Skip to content

Commit

Permalink
Add an option to start player maximized
Browse files Browse the repository at this point in the history
  • Loading branch information
Natanel-Shitrit committed Jan 26, 2024
1 parent c7849a7 commit 3ab8676
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ class PlayerGestureHelper(
activity.window.attributes.screenBrightness = appPreferences.playerBrightness
}

updateZoomMode(appPreferences.playerStartMaximized)

@Suppress("ClickableViewAccessibility")
playerView.setOnTouchListener { _, event ->
if (playerView.useController) {
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
<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_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_1">IMDB Rating</string>
<string name="sort_by_options_2">Parental Rating</string>
Expand Down
5 changes: 5 additions & 0 deletions core/src/main/res/xml/fragment_settings_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
app:dependency="pref_player_gestures_vb"
app:key="pref_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 app:title="@string/seeking">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ constructor(
val playerBrightnessRemember get() =
sharedPreferences.getBoolean(Constants.PREF_PLAYER_BRIGHTNESS_REMEMBER, false)

val playerStartMaximized get() =
sharedPreferences.getBoolean(Constants.PREF_PLAYER_START_MAXIMIZED, false)

var playerBrightness: Float
get() = sharedPreferences.getFloat(
Constants.PREF_PLAYER_BRIGHTNESS,
Expand Down
1 change: 1 addition & 0 deletions preferences/src/main/java/dev/jdtech/jellyfin/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ object Constants {
const val PREF_PLAYER_GESTURES_ZOOM = "pref_player_gestures_zoom"
const val PREF_PLAYER_GESTURES_SEEK = "pref_player_gestures_seek"
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_SEEK_BACK_INC = "pref_player_seek_back_inc"
const val PREF_PLAYER_SEEK_FORWARD_INC = "pref_player_seek_forward_inc"
Expand Down

0 comments on commit 3ab8676

Please sign in to comment.