[Android] Remove dead code

Nicolas Pomepuy git at videolan.org
Thu Apr 11 18:38:10 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Tue Apr  9 09:28:38 2019 +0200| [266899a92031410e1c227085d1c0e0eddb495ff7] | committer: Geoffrey Métais

Remove dead code

> https://code.videolan.org/videolan/vlc-android/commit/266899a92031410e1c227085d1c0e0eddb495ff7
---

 .../vlc/gui/tv/browser/AudioBrowserTvFragment.kt   | 28 +++++-----------------
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/AudioBrowserTvFragment.kt b/vlc-android/src/org/videolan/vlc/gui/tv/browser/AudioBrowserTvFragment.kt
index 15f70c780..397bb33c1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/AudioBrowserTvFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/AudioBrowserTvFragment.kt
@@ -46,6 +46,9 @@ import androidx.lifecycle.Observer
 import androidx.lifecycle.ViewModelProviders
 import androidx.recyclerview.widget.GridLayoutManager
 import androidx.recyclerview.widget.RecyclerView
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.ObsoleteCoroutinesApi
+import kotlinx.coroutines.Runnable
 import org.videolan.medialibrary.Medialibrary
 import org.videolan.medialibrary.media.Folder
 import org.videolan.medialibrary.media.MediaLibraryItem
@@ -61,6 +64,8 @@ import org.videolan.vlc.util.*
 import org.videolan.vlc.viewmodels.paged.*
 import java.util.*
 
+ at ExperimentalCoroutinesApi
+ at ObsoleteCoroutinesApi
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 class AudioBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEventsHandler, PopupMenu.OnMenuItemClickListener, SongHeaderAdapter.OnHeaderSelected, VerticalGridActivity.OnKeyPressedListener {
 
@@ -123,7 +128,6 @@ class AudioBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEventsHand
         }
 
 
-
         viewModel.pagedList.observe(this, Observer { items ->
             if (items != null) adapter.submitList(items)
 
@@ -144,13 +148,6 @@ class AudioBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEventsHand
             }
             headerAdapter.items = headerItems
             headerAdapter.notifyDataSetChanged()
-            list.setItemViewCacheSize(nbColumns * 10)
-            list.addOnScrollListener(object : RecyclerView.OnScrollListener() {
-                override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
-                    super.onScrollStateChanged(recyclerView, newState)
-                    if (BuildConfig.DEBUG) Log.d("SongBrowserFragment", "Pool: " + list.recycledViewPool.getRecycledViewCount(MediaLibraryItem.TYPE_MEDIA))
-                }
-            })
         })
 
     }
@@ -307,20 +304,17 @@ class AudioBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEventsHand
     }
 
     private fun expandExtendedFAB() {
-//        fabAnimationCancel()
         fabHeader.animate().translationY(-(resources.getDimension(R.dimen.kl_normal) + fabHeader.height))
         fabSort.animate().translationY(-2 * (resources.getDimension(R.dimen.kl_normal) + fabHeader.height))
     }
 
 
     private fun collapseExtendedFAB() {
-//        fabAnimationCancel()
         fabHeader.animate().translationY(0f)
         fabSort.animate().translationY(0f)
     }
 
     private fun hideFAB() {
-//        fabAnimationCancel()
         val marginBottom = (fabSettings.layoutParams as ConstraintLayout.LayoutParams).bottomMargin.toFloat()
         fabSettings.animate().translationY(fabSettings.height + marginBottom)
         fabHeader.animate().translationY(fabSettings.height + marginBottom)
@@ -331,7 +325,6 @@ class AudioBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEventsHand
     }
 
     private fun showFAB() {
-//        fabAnimationCancel()
         fabSettings.animate().translationY(0f).setListener(null)
         fabHeader.animate().translationY(0f)
         fabSort.animate().translationY(0f)
@@ -340,12 +333,6 @@ class AudioBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEventsHand
         fabSort.isFocusable = true
     }
 
-    private fun fabAnimationCancel() {
-        fabSettings.animate().cancel()
-        fabHeader.animate().cancel()
-        fabSort.animate().cancel()
-    }
-
 
     override fun onConfigurationChanged(newConfig: Configuration?) {
         super.onConfigurationChanged(newConfig)
@@ -357,7 +344,7 @@ class AudioBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEventsHand
 
     override fun onActivityCreated(savedInstanceState: Bundle?) {
         list.adapter = adapter
-        backgroundManager?.attachToView(view)
+        backgroundManager.attachToView(view)
         super.onActivityCreated(savedInstanceState)
     }
 
@@ -462,11 +449,8 @@ class AudioBrowserTvFragment : Fragment(), BrowserFragmentInterface, IEventsHand
         if (list.getChildAt(positionForSectionByName) == null) {
             adapter.focusNext = positionForSectionByName
             list.scrollToPosition(positionForSectionByName)
-            if (BuildConfig.DEBUG)
-                Log.d("SongBrowserFragment", "Setting focus next: $positionForSectionByName")
         } else {
             list.getChildAt(positionForSectionByName).requestFocus()
-            if (BuildConfig.DEBUG) Log.d("SongBrowserFragment", "Requesting focus")
         }
     }
 



More information about the Android mailing list