diff --git a/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt index ecea86cc6..3c9dd2ae6 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/AppearanceSettings.kt @@ -63,10 +63,7 @@ class AppearanceSettings : BasePreferenceFragment() { val navBarOptions = findPreference(PreferenceKeys.NAVBAR_ITEMS) navBarOptions?.setOnPreferenceClickListener { - NavBarOptionsDialog().show( - childFragmentManager, - null - ) + NavBarOptionsDialog().show(childFragmentManager, null) true } diff --git a/app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt index a32df4b8d..b8aae847a 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt @@ -52,8 +52,6 @@ class InstanceSettings : BasePreferenceFragment() { true } - // hide auth instance if option deselected - authInstance.isVisible = authInstanceToggle.isChecked authInstance.setOnPreferenceChangeListener { _, newValue -> // save new auth url RetrofitInstance.authUrl = newValue.toString() @@ -63,7 +61,6 @@ class InstanceSettings : BasePreferenceFragment() { } authInstanceToggle.setOnPreferenceChangeListener { _, newValue -> - authInstance.isVisible = newValue == true // either use new auth url or the normal api url if auth instance disabled RetrofitInstance.authUrl = if (newValue == false) { RetrofitInstance.url diff --git a/app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt index 3e23d33a4..88e4b6843 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/NotificationSettings.kt @@ -8,7 +8,6 @@ import com.github.libretube.R import com.github.libretube.constants.PreferenceKeys import com.github.libretube.helpers.NotificationHelper import com.github.libretube.ui.base.BasePreferenceFragment -import com.github.libretube.ui.views.TimePickerPreference class NotificationSettings : BasePreferenceFragment() { override val titleResourceId: Int = R.string.notifications @@ -21,43 +20,20 @@ class NotificationSettings : BasePreferenceFragment() { val checkingFrequency = findPreference(PreferenceKeys.CHECKING_FREQUENCY) val requiredNetwork = findPreference(PreferenceKeys.REQUIRED_NETWORK) - notificationsEnabled?.setOnPreferenceChangeListener { _, newValue -> - checkingFrequency?.isEnabled = newValue as Boolean - requiredNetwork?.isEnabled = newValue + notificationsEnabled?.setOnPreferenceChangeListener { _, _ -> updateNotificationPrefs() true } - checkingFrequency?.isEnabled = notificationsEnabled!!.isChecked checkingFrequency?.setOnPreferenceChangeListener { _, _ -> updateNotificationPrefs() true } - requiredNetwork?.isEnabled = notificationsEnabled.isChecked requiredNetwork?.setOnPreferenceChangeListener { _, _ -> updateNotificationPrefs() true } - - val notificationTime = findPreference( - PreferenceKeys.NOTIFICATION_TIME_ENABLED - ) - val notificationStartTime = findPreference( - PreferenceKeys.NOTIFICATION_START_TIME - ) - val notificationEndTime = findPreference( - PreferenceKeys.NOTIFICATION_END_TIME - ) - listOf(notificationStartTime, notificationEndTime).forEach { - it?.isEnabled = notificationTime?.isChecked == true - } - notificationTime?.setOnPreferenceChangeListener { _, newValue -> - listOf(notificationStartTime, notificationEndTime).forEach { - it?.isEnabled = newValue as Boolean - } - true - } } private fun updateNotificationPrefs() { diff --git a/app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt index a40168fed..0f0f27e23 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/PlayerSettings.kt @@ -12,9 +12,7 @@ import com.github.libretube.R import com.github.libretube.compat.PictureInPictureCompat import com.github.libretube.constants.PreferenceKeys import com.github.libretube.helpers.LocaleHelper -import com.github.libretube.helpers.PreferenceHelper import com.github.libretube.ui.base.BasePreferenceFragment -import com.github.libretube.ui.views.SliderPreference class PlayerSettings : BasePreferenceFragment() { override val titleResourceId: Int = R.string.player @@ -22,33 +20,10 @@ class PlayerSettings : BasePreferenceFragment() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.player_settings, rootKey) - val playerOrientation = - findPreference(PreferenceKeys.FULLSCREEN_ORIENTATION) - val autoRotateToFullscreen = - findPreference(PreferenceKeys.AUTO_FULLSCREEN) - - // only show the player orientation option if auto fullscreen is disabled - playerOrientation?.isEnabled = autoRotateToFullscreen?.isChecked != true - - autoRotateToFullscreen?.setOnPreferenceChangeListener { _, newValue -> - playerOrientation?.isEnabled = newValue != true - true - } - val defaultSubtitle = findPreference(PreferenceKeys.DEFAULT_SUBTITLE) defaultSubtitle?.let { setupSubtitlePref(it) } - val systemCaptionStyle = - findPreference(PreferenceKeys.SYSTEM_CAPTION_STYLE) val captionSettings = findPreference(PreferenceKeys.CAPTION_SETTINGS) - - captionSettings?.isVisible = - PreferenceHelper.getBoolean(PreferenceKeys.SYSTEM_CAPTION_STYLE, true) - systemCaptionStyle?.setOnPreferenceChangeListener { _, newValue -> - captionSettings?.isVisible = newValue as Boolean - true - } - captionSettings?.setOnPreferenceClickListener { try { val captionSettingsIntent = Intent(Settings.ACTION_CAPTIONING_SETTINGS) @@ -70,26 +45,6 @@ class PlayerSettings : BasePreferenceFragment() { val isPipEnabled = pictureInPicture.isVisible && pictureInPicture.isChecked pauseOnQuit?.isVisible = !isPipEnabled alternativePipControls?.isVisible = isPipEnabled - - pictureInPicture.setOnPreferenceChangeListener { _, newValue -> - val isChecked = newValue as Boolean - pauseOnQuit?.isVisible = !isChecked - alternativePipControls?.isVisible = isChecked - true - } - - val customBackgroundSpeed = findPreference( - PreferenceKeys.CUSTOM_PLAYBACK_SPEED - ) - val backgroundSpeed = findPreference( - PreferenceKeys.BACKGROUND_PLAYBACK_SPEED - ) - backgroundSpeed?.isEnabled = customBackgroundSpeed?.isChecked == true - - customBackgroundSpeed?.setOnPreferenceChangeListener { _, newValue -> - backgroundSpeed?.isEnabled = newValue as Boolean - true - } } private fun setupSubtitlePref(preference: ListPreference) { diff --git a/app/src/main/res/xml/history_settings.xml b/app/src/main/res/xml/history_settings.xml index 8f41f7d1e..3c1c83358 100644 --- a/app/src/main/res/xml/history_settings.xml +++ b/app/src/main/res/xml/history_settings.xml @@ -1,6 +1,6 @@ + xmlns:app="http://schemas.android.com/apk/res-auto"> @@ -9,19 +9,19 @@ android:icon="@drawable/ic_history_filled" android:summary="@string/search_history_summary" app:key="search_history_toggle" - app:title="@string/search_history" /> + app:title="@string/search_history"/> + app:title="@string/unlimited_search_history"/> + app:title="@string/clear_history"/> @@ -32,7 +32,7 @@ android:icon="@drawable/ic_time_outlined" android:summary="@string/watch_history_summary" app:key="watch_history_toggle" - app:title="@string/watch_history" /> + app:title="@string/watch_history"/> + app:useSimpleSummaryProvider="true"/> + app:title="@string/clear_history"/> @@ -59,12 +60,12 @@ android:icon="@drawable/ic_play_filled" app:key="watch_positions" app:summary="@string/watch_positions_summary" - app:title="@string/watch_positions" /> + app:title="@string/watch_positions"/> + app:title="@string/reset_watch_positions"/> @@ -73,7 +74,7 @@ + app:key="clear_bookmarks"/> diff --git a/app/src/main/res/xml/instance_settings.xml b/app/src/main/res/xml/instance_settings.xml index 89dbc5b63..4daf55687 100644 --- a/app/src/main/res/xml/instance_settings.xml +++ b/app/src/main/res/xml/instance_settings.xml @@ -32,6 +32,7 @@ + xmlns:app="http://schemas.android.com/apk/res-auto"> @@ -9,14 +9,15 @@ android:summary="@string/notify_new_streams_summary" app:defaultValue="true" app:key="notification_toggle" - app:title="@string/notify_new_streams" /> + app:title="@string/notify_new_streams"/> + app:summary="@string/show_stream_thumbnails_summary"/> + app:useSimpleSummaryProvider="true"/> + app:useSimpleSummaryProvider="true"/> @@ -43,15 +46,17 @@ + app:title="@string/notification_time"/> + android:dependency="notification_time" + app:title="@string/start_time"/> + android:dependency="notification_time" + app:title="@string/end_time"/> diff --git a/app/src/main/res/xml/player_settings.xml b/app/src/main/res/xml/player_settings.xml index 17b947382..11f346060 100644 --- a/app/src/main/res/xml/player_settings.xml +++ b/app/src/main/res/xml/player_settings.xml @@ -1,6 +1,6 @@ + xmlns:app="http://schemas.android.com/apk/res-auto"> @@ -9,60 +9,63 @@ android:icon="@drawable/ic_swipe_gesture" android:summary="@string/swipe_controls_summary" app:key="player_swipe_controls" - app:title="@string/swipe_controls" /> + app:title="@string/swipe_controls"/> + app:title="@string/fullscreen_gestures"/> + app:title="@string/pinch_control"/> + app:title="@string/skip_buttons"/> + app:title="@string/double_tap_seek"/> + app:title="@string/picture_in_picture"/> + app:title="@string/alternative_pip_controls"/> + android:dependency="picture_in_picture" + app:title="@string/pause_on_quit"/> + android:disableDependentsState="true" + app:title="@string/autoRotatePlayer"/> + app:useSimpleSummaryProvider="true"/> @@ -84,7 +88,7 @@ app:stepSize="5.0" app:title="@string/seek_increment" app:valueFrom="5.0" - app:valueTo="60.0" /> + app:valueTo="60.0"/> + app:title="@string/buffering_goal"/> + app:valueTo="30"/> @@ -112,12 +116,13 @@ android:icon="@drawable/ic_caption" app:defaultValue="true" app:key="system_caption_style" - app:title="@string/system_caption_style" /> + app:title="@string/system_caption_style"/> + android:dependency="system_caption_style" + app:title="@string/caption_settings"/> @@ -127,7 +132,7 @@ android:defaultValue="true" android:icon="@drawable/ic_list" android:title="@string/queue_insert_related_videos" - app:key="queue_insert_related_videos" /> + app:key="queue_insert_related_videos"/> @@ -141,13 +146,13 @@ app:stepSize="0.1" app:title="@string/playback_speed" app:valueFrom="0.2" - app:valueTo="4.0" /> + app:valueTo="4.0"/> + app:title="@string/default_subtitle_language"/> + app:useSimpleSummaryProvider="true"/> + app:title="@string/player_autoplay"/> + app:title="@string/autoplay_countdown"/> + app:key="auto_fullscreen_shorts"/> @@ -187,7 +192,7 @@ android:summary="@string/custom_playback_speed_summary" app:defaultValue="false" app:key="custom_playback_speed" - app:title="@string/custom_playback_speed" /> + app:title="@string/custom_playback_speed"/> + app:valueTo="4.0"/> @@ -207,7 +213,7 @@ android:summary="@string/pauseOnScreenOff_summary" app:defaultValue="false" app:key="pause_screen_off" - app:title="@string/pauseOnScreenOff" /> + app:title="@string/pauseOnScreenOff"/> diff --git a/app/src/main/res/xml/sponsorblock_settings.xml b/app/src/main/res/xml/sponsorblock_settings.xml index 79fb1ae7a..d1f7b0a30 100644 --- a/app/src/main/res/xml/sponsorblock_settings.xml +++ b/app/src/main/res/xml/sponsorblock_settings.xml @@ -12,6 +12,7 @@ @@ -19,12 +20,14 @@