feat: start player maximized pref (#637)

This commit is contained in:
Natanel Shitrit 2024-01-28 15:01:29 +02:00 committed by GitHub
parent 07c58accf0
commit 61ec1edb35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 0 deletions

View file

@ -418,6 +418,8 @@ class PlayerGestureHelper(
activity.window.attributes.screenBrightness = appPreferences.playerBrightness activity.window.attributes.screenBrightness = appPreferences.playerBrightness
} }
updateZoomMode(appPreferences.playerStartMaximized)
@Suppress("ClickableViewAccessibility") @Suppress("ClickableViewAccessibility")
playerView.setOnTouchListener { _, event -> playerView.setOnTouchListener { _, event ->
if (playerView.useController) { if (playerView.useController) {

View file

@ -107,6 +107,8 @@
<string name="player_gestures_zoom_summary">Pinch to fill the screen with the video</string> <string name="player_gestures_zoom_summary">Pinch to fill the screen with the video</string>
<string name="player_gestures_seek_summary">Swipe horizontally to seek forwards or backwards</string> <string name="player_gestures_seek_summary">Swipe horizontally to seek forwards or backwards</string>
<string name="player_brightness_remember">Remember brightness level</string> <string name="player_brightness_remember">Remember brightness level</string>
<string name="player_start_maximized">Start maximized</string>
<string name="player_start_maximized_summary">Open video in maximized mode by default</string>
<string name="sort_by_options_0">Title</string> <string name="sort_by_options_0">Title</string>
<string name="sort_by_options_1">IMDB Rating</string> <string name="sort_by_options_1">IMDB Rating</string>
<string name="sort_by_options_2">Parental Rating</string> <string name="sort_by_options_2">Parental Rating</string>

View file

@ -63,6 +63,11 @@
app:dependency="pref_player_gestures_vb" app:dependency="pref_player_gestures_vb"
app:key="pref_player_brightness_remember" app:key="pref_player_brightness_remember"
app:title="@string/player_brightness_remember" /> app:title="@string/player_brightness_remember" />
<SwitchPreferenceCompat
app:dependency="pref_player_gestures_zoom"
app:key="pref_player_start_maximized"
app:summary="@string/player_start_maximized_summary"
app:title="@string/player_start_maximized" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory app:title="@string/seeking"> <PreferenceCategory app:title="@string/seeking">

View file

@ -51,6 +51,9 @@ constructor(
val playerBrightnessRemember get() = val playerBrightnessRemember get() =
sharedPreferences.getBoolean(Constants.PREF_PLAYER_BRIGHTNESS_REMEMBER, false) sharedPreferences.getBoolean(Constants.PREF_PLAYER_BRIGHTNESS_REMEMBER, false)
val playerStartMaximized get() =
sharedPreferences.getBoolean(Constants.PREF_PLAYER_START_MAXIMIZED, false)
var playerBrightness: Float var playerBrightness: Float
get() = sharedPreferences.getFloat( get() = sharedPreferences.getFloat(
Constants.PREF_PLAYER_BRIGHTNESS, Constants.PREF_PLAYER_BRIGHTNESS,

View file

@ -17,6 +17,7 @@ object Constants {
const val PREF_PLAYER_GESTURES_ZOOM = "pref_player_gestures_zoom" const val PREF_PLAYER_GESTURES_ZOOM = "pref_player_gestures_zoom"
const val PREF_PLAYER_GESTURES_SEEK = "pref_player_gestures_seek" const val PREF_PLAYER_GESTURES_SEEK = "pref_player_gestures_seek"
const val PREF_PLAYER_BRIGHTNESS_REMEMBER = "pref_player_brightness_remember" const val PREF_PLAYER_BRIGHTNESS_REMEMBER = "pref_player_brightness_remember"
const val PREF_PLAYER_START_MAXIMIZED = "pref_player_start_maximized"
const val PREF_PLAYER_BRIGHTNESS = "pref_player_brightness" const val PREF_PLAYER_BRIGHTNESS = "pref_player_brightness"
const val PREF_PLAYER_SEEK_BACK_INC = "pref_player_seek_back_inc" const val PREF_PLAYER_SEEK_BACK_INC = "pref_player_seek_back_inc"
const val PREF_PLAYER_SEEK_FORWARD_INC = "pref_player_seek_forward_inc" const val PREF_PLAYER_SEEK_FORWARD_INC = "pref_player_seek_forward_inc"