Skip to content

Commit

Permalink
Add a method to hide UI immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
AbandonedCart committed Oct 12, 2024
1 parent 58b0f60 commit 75f7474
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,13 @@ public void switchChannel(UUID id, boolean hideGuide) {
}
}

public void hideImmediately() {
if (mIsVisible) {
hide();
leanbackOverlayFragment.hideOverlay();
}
}

private void startFadeTimer() {
mFadeEnabled = true;
mHandler.removeCallbacks(mHideTask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ import org.jellyfin.androidtv.ui.playback.segments.SegmentMode

class SelectSkipAction(
context: Context,
customPlaybackTransportControlGlue: CustomPlaybackTransportControlGlue,
val customPlaybackTransportControlGlue: CustomPlaybackTransportControlGlue,
userPreferences: UserPreferences
) : CustomAction(context, customPlaybackTransportControlGlue) {
private val preferences = userPreferences
private val customPlaybackTransportControlGlue1 = customPlaybackTransportControlGlue

private val SegmentMode.icon: Int
get() = when (this) {
Expand Down Expand Up @@ -53,7 +52,7 @@ class SelectSkipAction(
preferences[UserPreferences.skipMode] = SegmentMode.entries[item.itemId]

initializeWithIcon(preferences[UserPreferences.skipMode].icon)
customPlaybackTransportControlGlue1.notifyActionChanged(this@SelectSkipAction)
customPlaybackTransportControlGlue.notifyActionChanged(this@SelectSkipAction)
true
}
}.show()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class SegmentSkipFragment : Fragment() {
next()
} else {
seek(segment.endTime.millis)
fragment.hideImmediately()
}
}
}
Expand All @@ -75,7 +76,9 @@ class SegmentSkipFragment : Fragment() {

preferences[UserPreferences.skipMode].let { setting ->
when {
isSkipSegment && setting == SegmentMode.AUTO_SKIP -> doSkip()
isSkipSegment && setting == SegmentMode.AUTO_SKIP -> {
doSkip()
}
isSkipSegment && setting == SegmentMode.SHOW_SKIP_BUTTON -> {
if (!button.isVisible) {
button.text = when (currentSegment.type) {
Expand Down

0 comments on commit 75f7474

Please sign in to comment.