Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
d4b4ebc
feat: Add TextClock to player custom layout for video playback time d…
JelleSThijs Jun 22, 2026
9827d15
feat: Add vector clock icon for UI enhancements
JelleSThijs Jun 22, 2026
eb5b591
feat: Add tv layout clock settings title, description and key to stri…
JelleSThijs Jun 22, 2026
3a52d90
feat: Add tv layout clock settings option in player settings
JelleSThijs Jun 22, 2026
b8fc780
feat: Animate video clock position in fullscreen player
JelleSThijs Jun 22, 2026
ed0cdbc
feat: Set tv layout clock visibility based on settings
JelleSThijs Jun 22, 2026
1e84bc1
feat: Add player video clock to player_custom_layout.xml to adhere to…
JelleSThijs Jun 22, 2026
be2bc46
refactor: transfer tv_layout_clock_key
JelleSThijs Jun 22, 2026
1233949
refactor: update tv_layout_clock settings title and description for c…
JelleSThijs Jun 22, 2026
febf325
refactor: simplify playerVideoClock access and visibility handling
JelleSThijs Jun 22, 2026
c6723ae
feat: hide tv_layout_clock setting on PHONE and EMULATOR
JelleSThijs Jun 22, 2026
c9b7c06
refactor: Specify that the real time clock is shown in the video player
JelleSThijs Jun 22, 2026
693db01
feat: Add real-time clock to home layouts
JelleSThijs Jun 23, 2026
33a63ed
refactor: remove unused TextClock import from FullScreenPlayer.kt
JelleSThijs Jun 23, 2026
488bf37
fix: ensure playerVideoClock is hidden in non-TV layouts
JelleSThijs Jun 23, 2026
3db6887
feat: set visibility and scroll effect for TV home page real time clock
JelleSThijs Jun 23, 2026
0af8077
refactor: relocate tv_layout_clock setting from player settings to UI…
JelleSThijs Jun 23, 2026
42d18fd
refactor: move and update tv_layout_clock strings to reflect its use …
JelleSThijs Jun 23, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,23 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(
homeViewModel.queryTextSubmit("")
}

// Load value for toggling Tv layout real time clock. Hide by default at startup
// set visibility first, to apply a scroll effect later
context?.let {
if (isLayout(TV)) {
val settingsManager = PreferenceManager.getDefaultSharedPreferences(it)
val toggleClock =
settingsManager.getBoolean(
getString(R.string.tv_layout_clock_key),
false
)
binding.homeClock.isVisible = toggleClock
} else {
binding.homeClock.isVisible = false
}
}


homeMasterRecycler.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
if (isLayout(PHONE)) {
Expand Down Expand Up @@ -712,6 +729,17 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(
view.getLocationInWindow(rect)
scrollParent.isVisible = true
scrollParent.translationY = rect[1].toFloat() - 60.toPx

// Move the TV layout real time clock out of the way too
// We check if we have the correct layout and if the clock is enabled
if(isLayout(TV) && binding.homeClock.isVisible) {
val scrollParent = binding.homeClock

val rect = IntArray(2)
view.getLocationInWindow(rect)
scrollParent.isVisible = true
scrollParent.translationY = rect[1].toFloat() - 60.toPx
}
}
}
super.onScrolled(recyclerView, dx, dy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ open class FullScreenPlayer : AbstractPlayerFragment<FragmentPlayerBinding>(
}

val titleMove = if (isShowing) 0f else -50.toPx.toFloat()
playerBinding?.playerVideoClock.let {
ObjectAnimator.ofFloat(it, "translationY", titleMove).apply {
duration = 200
start()
}
}
playerBinding?.playerVideoTitleHolder?.let {
ObjectAnimator.ofFloat(it, "translationY", titleMove).apply {
duration = 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,14 @@ class GeneratorPlayer : FullScreenPlayer() {
fromTagToEnglishLanguageName(it)?.lowercase() ?: return@mapNotNull null
} ?: listOf()
}

// Set up TV clock visibility
if (isLayout(TV)) {
val showTvClock = settingsManager.getBoolean(ctx.getString(R.string.tv_layout_clock_key), false)
playerBinding?.playerVideoClock?.isVisible = showTvClock
} else {
playerBinding?.playerVideoClock?.isVisible = false
}
}

unwrapBundle(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ class SettingsUI : BasePreferenceFragmentCompat() {
return@setOnPreferenceClickListener true
}

getPref(R.string.tv_layout_clock_key)?.hideOn(PHONE or EMULATOR)

getPref(R.string.confirm_exit_key)?.setOnPreferenceClickListener {
val prefNames = resources.getStringArray(R.array.confirm_exit)
val prefValues = resources.getIntArray(R.array.confirm_exit_values)
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_baseline_clock_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="m612,668 l56,-56 -148,-148v-184h-80v216l172,172ZM480,880q-83,0 -156,-31.5T197,763q-54,-54 -85.5,-127T80,480q0,-83 31.5,-156T197,197q54,-54 127,-85.5T480,80q83,0 156,31.5T763,197q54,54 85.5,127T880,480q0,83 -31.5,156T763,763q-54,54 -127,85.5T480,880ZM480,480ZM480,800q133,0 226.5,-93.5T800,480q0,-133 -93.5,-226.5T480,160q-133,0 -226.5,93.5T160,480q0,133 93.5,226.5T480,800Z"
android:fillColor="#e3e3e3"/>
</vector>
6 changes: 6 additions & 0 deletions app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@
tools:listitem="@layout/homepage_parent"
tools:visibility="gone" />

<TextClock
android:id="@+id/home_clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />

<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/home_api_fab"
style="@style/ExtendedFloatingActionButton"
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/res/layout/fragment_home_tv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
</LinearLayout>
</LinearLayout>
</com.facebook.shimmer.ShimmerFrameLayout>

</FrameLayout>

<LinearLayout
Expand Down Expand Up @@ -163,6 +164,23 @@
tools:listitem="@layout/homepage_parent_tv"
tools:visibility="gone" />

<TextClock
android:id="@+id/home_clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="600dp"
android:textAlignment="viewEnd"
android:textColor="@color/white"
android:textSize="20sp"
android:visibility="visible"
android:format12Hour="hh:mm a"
android:format24Hour="HH:mm"
android:fontFamily="@font/google_sans"
android:textStyle="bold"
android:gravity="end"
android:layout_gravity="center_horizontal"
android:layout_margin="17dp" />

<LinearLayout
android:id="@+id/home_api_holder"
android:layout_width="wrap_content"
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/layout/player_custom_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@
tools:visibility="visible"
android:layout_gravity="center"/>
</LinearLayout>

<TextClock
android:id="@+id/player_video_clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:gravity="end"
android:visibility="gone"
android:textStyle="bold" />
</LinearLayout>

<!-- Removed as it has no use anymore-->
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/res/layout/player_custom_layout_tv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,22 @@
android:layout_marginEnd="32dp"
android:orientation="vertical">

<TextClock
android:id="@+id/player_video_clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:gravity="end"
android:maxWidth="600dp"
android:textAlignment="viewEnd"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="visible"
android:format12Hour="hh:mm a"
android:format24Hour="HH:mm"
android:fontFamily="@font/google_sans"
android:textStyle="bold" />

<LinearLayout
android:id="@+id/player_video_title_holder"
android:layout_width="wrap_content"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/donottranslate-strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<string name="opensubtitles_key">opensubtitles_key</string>
<string name="subdl_key">subdl_key</string>
<string name="animeskip_key">animeskip_key</string>
<string name="tv_layout_clock_key">tv_layout_clock_key</string>

<string name="pref_category_security_key">pref_category_security_key</string>
<string name="pref_category_gestures_key">pref_category_gestures_key</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@
<string name="pref_category_looks">Looks</string>
<string name="pref_category_ui_features">Features</string>
<string name="category_general">General</string>
<string name="tv_layout_clock_settings">Show real time clock</string>
<string name="tv_layout_clock_settings_des">Show a real time clock at the top of the screen. Applies to the homepage and player</string>
<string name="random_button_settings">Random Button</string>
<string name="random_button_settings_desc">Show random button on Homepage and Library</string>
<string name="provider_lang_settings">Extension languages</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/settings_ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@
android:icon="@drawable/metadata_overlay_icon"
android:key="@string/show_player_metadata_key"
android:title="@string/show_player_metadata_overlay" />
<SwitchPreference
android:icon="@drawable/ic_baseline_clock_24"
android:summary="@string/tv_layout_clock_settings_des"
android:title="@string/tv_layout_clock_settings"
android:defaultValue="false"
android:key="@string/tv_layout_clock_key" />
<SwitchPreference
android:icon="@drawable/ic_baseline_play_arrow_24"
android:summary="@string/random_button_settings_desc"
Expand Down