[Android] Remove useless fragment force loading
Nicolas Pomepuy
git at videolan.org
Thu Sep 16 04:04:08 UTC 2021
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Sep 14 08:41:26 2021 +0200| [b4ed30ba228802507618436c2c5cdf0afa6571e4] | committer: Nicolas Pomepuy
Remove useless fragment force loading
> https://code.videolan.org/videolan/vlc-android/commit/b4ed30ba228802507618436c2c5cdf0afa6571e4
---
.../vlc-android/src/org/videolan/vlc/gui/ContentActivity.kt | 4 ----
.../src/org/videolan/vlc/gui/SecondaryActivity.kt | 12 ------------
.../src/org/videolan/vlc/gui/helpers/Navigator.kt | 5 -----
.../src/org/videolan/vlc/gui/video/VideoGridFragment.kt | 2 +-
4 files changed, 1 insertion(+), 22 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/ContentActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/ContentActivity.kt
index d76429c32..43f04341e 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/ContentActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/ContentActivity.kt
@@ -157,10 +157,6 @@ open class ContentActivity : AudioPlayerContainerActivity(), SearchView.OnQueryT
override fun onQueryTextSubmit(query: String) = false
- open fun forceLoadVideoFragment() {
- throw NotImplementedError("forceLoadVideoFragment not implemented")
- }
-
private fun openSearchActivity() {
startActivity(Intent(Intent.ACTION_SEARCH, null, this, SearchActivity::class.java)
.putExtra(SearchManager.QUERY, searchView.query.toString()))
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
index 199c21743..ac879f08b 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
@@ -115,18 +115,6 @@ class SecondaryActivity : ContentActivity(), IDialogManager {
override fun dialogCanceled(dialog: Dialog?) {}
- override fun forceLoadVideoFragment() {
- val fragmentId = intent.getStringExtra(KEY_FRAGMENT)
- fetchSecondaryFragment(fragmentId)
- if (fragment == null) {
- finish()
- return
- }
- supportFragmentManager.beginTransaction()
- .replace(R.id.fragment_placeholder, fragment!!)
- .commit()
- }
-
override fun onResume() {
if (!intent.getBooleanExtra(KEY_ANIMATED, false)) overridePendingTransition(0, 0)
super.onResume()
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
index 4fb28d507..d2c0f30b5 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
@@ -125,10 +125,6 @@ class Navigator : BottomNavigationView.OnNavigationItemSelectedListener, Lifecyc
showFragment(fragment, id, tag)
}
- override fun forceLoadVideoFragment() {
- showFragment(R.id.nav_video)
- }
-
private fun showFragment(fragment: Fragment, id: Int, tag: String = getTag(id)) {
val fm = activity.supportFragmentManager
if (currentFragment is BaseBrowserFragment) fm.popBackStackImmediate("root", FragmentManager.POP_BACK_STACK_INCLUSIVE)
@@ -317,5 +313,4 @@ interface INavigator {
fun currentIdIsExtension() : Boolean
fun displayExtensionItems(extensionId: Int, title: String, items: List<VLCExtensionItem>, showParams: Boolean, refresh: Boolean)
fun reloadPreferences()
- fun forceLoadVideoFragment()
}
\ No newline at end of file
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
index 66e5684d4..2710e597a 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
@@ -163,7 +163,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
R.id.ml_menu_display_list, R.id.ml_menu_display_grid -> {
val displayInCards = settings.getBoolean(KEY_VIDEOS_CARDS, true)
settings.putSingle(KEY_VIDEOS_CARDS, !displayInCards)
- (activity as ContentActivity).forceLoadVideoFragment()
+ updateViewMode()
}
R.id.video_min_group_length_disable -> {
settings.putSingle(KEY_GROUP_VIDEOS, GROUP_VIDEOS_NONE)
More information about the Android
mailing list