[Android] Remove dead code

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


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Mon Apr  8 13:21:08 2019 +0200| [23c59915ec6fcfa900cea86cd610c0d605dd8eb0] | committer: Geoffrey Métais

Remove dead code

> https://code.videolan.org/videolan/vlc-android/commit/23c59915ec6fcfa900cea86cd610c0d605dd8eb0
---

 .../vlc/gui/tv/browser/AudioBrowserTvFragment.kt   |   2 +-
 .../vlc/gui/tv/browser/MediaLibBrowserFragment.kt  | 100 ---------------------
 .../vlc/gui/tv/browser/VerticalGridActivity.java   |   2 -
 3 files changed, 1 insertion(+), 103 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 870b6d65f..15f70c780 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
@@ -1,6 +1,6 @@
 /*
  * ************************************************************************
- *  SongsBrowserFragment.java
+ *  AudioBrowserTvFragment.kt
  * *************************************************************************
  *  Copyright © 2016 VLC authors and VideoLAN
  *  Author: Geoffrey Métais
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/MediaLibBrowserFragment.kt b/vlc-android/src/org/videolan/vlc/gui/tv/browser/MediaLibBrowserFragment.kt
deleted file mode 100644
index b6d80f0ad..000000000
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/MediaLibBrowserFragment.kt
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * *************************************************************************
- *  MediaLibBrowserFragment.java
- * **************************************************************************
- *  Copyright © 2015 VLC authors and VideoLAN
- *  Author: Geoffrey Métais
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *  ***************************************************************************
- */
-
-package org.videolan.vlc.gui.tv.browser
-
-import android.annotation.TargetApi
-import android.content.SharedPreferences
-import android.os.Build
-import android.os.Bundle
-import android.os.Parcelable
-import android.widget.ImageView
-import androidx.annotation.RequiresApi
-import androidx.core.content.ContextCompat
-import androidx.leanback.app.BackgroundManager
-import androidx.leanback.widget.*
-import org.videolan.medialibrary.media.MediaLibraryItem
-import org.videolan.vlc.R
-import org.videolan.vlc.gui.tv.TvUtil
-import org.videolan.vlc.interfaces.Sortable
-import org.videolan.vlc.util.AUDIO_ITEM
-import org.videolan.vlc.util.Settings
-import org.videolan.vlc.viewmodels.BaseModel
-
- at TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
-abstract class MediaLibBrowserFragment<T : BaseModel<out MediaLibraryItem>> : GridFragment(), OnItemViewSelectedListener, OnItemViewClickedListener, Sortable {
-    private var mBackgroundManager: BackgroundManager? = null
-    private var mSelectedItem: Any? = null
-    lateinit var model: T
-    protected var currentItem: MediaLibraryItem? = null
-    protected val preferences: SharedPreferences by lazy { Settings.getInstance(requireContext()) }
-
-    override fun onCreate(savedInstanceState: Bundle?) {
-        super.onCreate(savedInstanceState)
-        currentItem = if (savedInstanceState != null) savedInstanceState.getParcelable<Parcelable>(AUDIO_ITEM) as? MediaLibraryItem
-        else requireActivity().intent.getParcelableExtra<Parcelable>(AUDIO_ITEM) as? MediaLibraryItem
-        mBackgroundManager = BackgroundManager.getInstance(requireActivity())
-        setOnSearchClickedListener { sort(requireActivity().findViewById(R.id.title_orb)) }
-    }
-
-    override fun onActivityCreated(savedInstanceState: Bundle?) {
-        super.onActivityCreated(savedInstanceState)
-        setOnItemViewSelectedListener(this)
-        onItemViewClickedListener = this
-        mBackgroundManager?.attachToView(view)
-        searchAffordanceColor = ContextCompat.getColor(requireContext(), R.color.orange500)
-        requireActivity().findViewById<ImageView>(R.id.icon).setImageResource(R.drawable.ic_menu_sort)
-    }
-
-    override fun onStart() {
-        super.onStart()
-        TvUtil.updateBackground(mBackgroundManager, mSelectedItem)
-    }
-
-    override fun refresh() {
-        model.refresh()
-    }
-
-    protected fun update(list: List<MediaLibraryItem>) {
-        mAdapter.setItems(list, TvUtil.diffCallback)
-    }
-
-    private var currentArt : String? = null
-    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
-    override fun onItemSelected(itemViewHolder: Presenter.ViewHolder?, item: Any?,
-                                rowViewHolder: RowPresenter.ViewHolder?, row: Row?) {
-        mSelectedItem = item
-        (item as? MediaLibraryItem)?.run {
-            if (currentArt == artworkMrl) return at run
-            currentArt = artworkMrl
-            TvUtil.updateBackground(mBackgroundManager, this)
-        }
-    }
-
-    override fun onItemClicked(itemViewHolder: Presenter.ViewHolder?, item: Any?,
-                               rowViewHolder: RowPresenter.ViewHolder?, row: Row?) {
-        TvUtil.openMedia(mContext, item, model)
-    }
-
-    override fun getVM(): BaseModel<out MediaLibraryItem> = this.model
-}
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
index d4a0ea9fe..bfc6fa862 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
@@ -43,8 +43,6 @@ import androidx.fragment.app.Fragment;
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 public class VerticalGridActivity extends BaseTvActivity implements BrowserActivityInterface {
 
-    private static final String TAG = "VLC/VerticalGridActivity";
-    private static final int GRID_LIMIT = 24;
     BrowserFragmentInterface mFragment;
     ProgressBar mContentLoadingProgressBar;
     TextView mEmptyView;



More information about the Android mailing list