Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/transparent vid controls #760

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/phone/src/main/java/dev/jdtech/jellyfin/PlayerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@ class PlayerActivity : BasePlayerActivity() {
timeBar.addListener(previewScrubListener!!)
}

if (appPreferences.clearPlayerOverlay) {
binding.run {
progressScrubberLayout.background = null
findViewById<View>(R.id.player_controls)?.setBackgroundColor(Color.TRANSPARENT)
}
}

viewModel.initializePlayer(args.items)
hideSystemUI()
}
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 @@ -192,4 +192,6 @@
<string name="unmark_as_played">Unmark as played</string>
<string name="add_to_favorites">Add to favorites</string>
<string name="remove_from_favorites">Remove from favorites</string>
<string name="clear_player_overlay_title">Transparent Player Overlay Background</string>
<string name="clear_player_overlay_desc">Use transparent background for video player controls, instead of dimming the video while these controls are visible.</string>
</resources>
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 @@ -74,6 +74,11 @@
app:key="pref_player_start_maximized"
app:summary="@string/player_start_maximized_summary"
app:title="@string/player_start_maximized" />
<SwitchPreferenceCompat
app:defaultValue="false"
app:key="pref_clear_player_overlay"
app:summary="@string/clear_player_overlay_desc"
app:title="@string/clear_player_overlay_title" />
</PreferenceCategory>

<PreferenceCategory app:title="@string/seeking">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ constructor(
false,
)

val clearPlayerOverlay get() = sharedPreferences.getBoolean(Constants.PREF_CLEAR_PLAYER_OVERLAY, false)

// Sorting
var sortBy: String
get() = sharedPreferences.getString(
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 @@ -45,6 +45,7 @@ object Constants {
const val PREF_SORT_BY = "pref_sort_by"
const val PREF_SORT_ORDER = "pref_sort_order"
const val PREF_DISPLAY_EXTRA_INFO = "pref_display_extra_info"
const val PREF_CLEAR_PLAYER_OVERLAY = "pref_clear_player_overlay"

// caching
const val DEFAULT_CACHE_SIZE = 20
Expand Down