From 2c069837fe87ca63187b0f2e852ebc8a5174e6d9 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 25 Nov 2022 18:57:53 +0100 Subject: [PATCH] hide the open with button by default --- .../java/com/github/libretube/constants/PreferenceKeys.kt | 1 + .../com/github/libretube/ui/fragments/PlayerFragment.kt | 5 +++++ app/src/main/res/layout/fragment_player.xml | 1 + app/src/main/res/values/strings.xml | 2 ++ app/src/main/res/xml/player_settings.xml | 7 +++++++ 5 files changed, 16 insertions(+) diff --git a/app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt b/app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt index a7dc511db..49ade8d59 100644 --- a/app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt +++ b/app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt @@ -84,6 +84,7 @@ object PreferenceKeys { const val USE_HLS_OVER_DASH = "use_hls" const val QUEUE_AUTO_INSERT_RELATED = "queue_insert_related_videos" const val PLAYER_SWIPE_CONTROLS = "player_swipe_controls" + const val SHOW_OPEN_WITH = "show_open_with" /** * Background mode diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index d0c224963..dad093817 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -403,6 +403,11 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions { LinearLayoutManager.HORIZONTAL, false ) + + if (!PreferenceHelper.getBoolean(PreferenceKeys.SHOW_OPEN_WITH, false)) { + binding.relPlayerOpen.visibility = View.GONE + binding.optionsLL.weightSum = 4f + } } private fun setFullscreen() { diff --git a/app/src/main/res/layout/fragment_player.xml b/app/src/main/res/layout/fragment_player.xml index 3c2db25e5..dd944b6e9 100644 --- a/app/src/main/res/layout/fragment_player.xml +++ b/app/src/main/res/layout/fragment_player.xml @@ -140,6 +140,7 @@ app:cardCornerRadius="27dp"> Swipe controls Use swipe gesture to adjust the brightness and volume. Defaults + Open With + Show a button to open the video with a 3rd party app at the player. Download Service diff --git a/app/src/main/res/xml/player_settings.xml b/app/src/main/res/xml/player_settings.xml index 0d4b6c3c6..fa490ca54 100644 --- a/app/src/main/res/xml/player_settings.xml +++ b/app/src/main/res/xml/player_settings.xml @@ -134,6 +134,13 @@ app:key="pause_screen_off" app:title="@string/pauseOnScreenOff" /> + + \ No newline at end of file