feat(TV UI): Player's Top controls redesign (#1203)

This commit is contained in:
KingLucius 2024-07-19 20:35:29 +03:00 committed by GitHub
parent 073af50f5f
commit bb8144a52e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 467 additions and 109 deletions

View file

@ -912,7 +912,11 @@ class CS3IPlayer : IPlayer {
} }
CSPlayerEvent.SeekForward -> seekTime(seekActionTime, source) CSPlayerEvent.SeekForward -> seekTime(seekActionTime, source)
CSPlayerEvent.SeekBack -> seekTime(-seekActionTime, source) CSPlayerEvent.SeekBack -> seekTime(-seekActionTime, source)
CSPlayerEvent.Restart -> seekTo(0, source)
CSPlayerEvent.NextEpisode -> event( CSPlayerEvent.NextEpisode -> event(
EpisodeSeekEvent( EpisodeSeekEvent(
offset = 1, offset = 1,

View file

@ -14,7 +14,13 @@ import android.os.Bundle
import android.provider.Settings import android.provider.Settings
import android.text.Editable import android.text.Editable
import android.text.format.DateUtils import android.text.format.DateUtils
import android.view.* import android.view.KeyEvent
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.Surface
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES import android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
import android.view.animation.AlphaAnimation import android.view.animation.AlphaAnimation
import android.view.animation.Animation import android.view.animation.Animation
@ -58,7 +64,11 @@ import com.lagradost.cloudstream3.utils.UIHelper.showSystemUI
import com.lagradost.cloudstream3.utils.UIHelper.toPx import com.lagradost.cloudstream3.utils.UIHelper.toPx
import com.lagradost.cloudstream3.utils.UserPreferenceDelegate import com.lagradost.cloudstream3.utils.UserPreferenceDelegate
import com.lagradost.cloudstream3.utils.Vector2 import com.lagradost.cloudstream3.utils.Vector2
import kotlin.math.* import kotlin.math.abs
import kotlin.math.ceil
import kotlin.math.max
import kotlin.math.min
import kotlin.math.round
const val MINIMUM_SEEK_TIME = 7000L // when swipe seeking const val MINIMUM_SEEK_TIME = 7000L // when swipe seeking
const val MINIMUM_VERTICAL_SWIPE = 2.0f // in percentage const val MINIMUM_VERTICAL_SWIPE = 2.0f // in percentage
@ -77,7 +87,8 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
protected open var isFullScreenPlayer = true protected open var isFullScreenPlayer = true
protected var playerBinding: PlayerCustomLayoutBinding? = null protected var playerBinding: PlayerCustomLayoutBinding? = null
private var durationMode : Boolean by UserPreferenceDelegate("duration_mode", false) private var durationMode: Boolean by UserPreferenceDelegate("duration_mode", false)
// state of player UI // state of player UI
protected var isShowing = false protected var isShowing = false
protected var isLocked = false protected var isLocked = false
@ -243,7 +254,6 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
val playerSourceMove = if (isShowing) 0f else -50.toPx.toFloat() val playerSourceMove = if (isShowing) 0f else -50.toPx.toFloat()
playerBinding?.apply { playerBinding?.apply {
playerOpenSource.let { playerOpenSource.let {
ObjectAnimator.ofFloat(it, "translationY", playerSourceMove).apply { ObjectAnimator.ofFloat(it, "translationY", playerSourceMove).apply {
@ -284,7 +294,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
player.getCurrentPreferredSubtitle() == null player.getCurrentPreferredSubtitle() == null
} }
private fun restoreOrientationWithSensor(activity: Activity){ private fun restoreOrientationWithSensor(activity: Activity) {
val currentOrientation = activity.resources.configuration.orientation val currentOrientation = activity.resources.configuration.orientation
var orientation = 0 var orientation = 0
when (currentOrientation) { when (currentOrientation) {
@ -300,7 +310,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
activity.requestedOrientation = orientation activity.requestedOrientation = orientation
} }
private fun toggleOrientationWithSensor(activity: Activity){ private fun toggleOrientationWithSensor(activity: Activity) {
val currentOrientation = activity.resources.configuration.orientation val currentOrientation = activity.resources.configuration.orientation
var orientation = 0 var orientation = 0
when (currentOrientation) { when (currentOrientation) {
@ -345,12 +355,11 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
private fun updateOrientation(ignoreDynamicOrientation: Boolean = false) { private fun updateOrientation(ignoreDynamicOrientation: Boolean = false) {
activity?.apply { activity?.apply {
if(lockRotation) { if (lockRotation) {
if(isLocked) { if (isLocked) {
lockOrientation(this) lockOrientation(this)
} } else {
else { if (ignoreDynamicOrientation) {
if(ignoreDynamicOrientation){
// restore when lock is disabled // restore when lock is disabled
restoreOrientationWithSensor(this) restoreOrientationWithSensor(this)
} else { } else {
@ -958,7 +967,10 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
} }
else -> { else -> {
player.handleEvent(CSPlayerEvent.PlayPauseToggle, PlayerEventSource.UI) player.handleEvent(
CSPlayerEvent.PlayPauseToggle,
PlayerEventSource.UI
)
} }
} }
} else if (doubleTapEnabled && isFullScreenPlayer) { } else if (doubleTapEnabled && isFullScreenPlayer) {
@ -1234,6 +1246,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
// if nothing has loaded these buttons should not be visible // if nothing has loaded these buttons should not be visible
playerBinding?.apply { playerBinding?.apply {
playerSkipEpisode.isVisible = false playerSkipEpisode.isVisible = false
playerGoForward.isVisible = false
playerTracksBtt.isVisible = false playerTracksBtt.isVisible = false
playerSkipOp.isVisible = false playerSkipOp.isVisible = false
shadowOverlay.isVisible = false shadowOverlay.isVisible = false
@ -1307,6 +1320,10 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
player.handleEvent(CSPlayerEvent.SeekBack) player.handleEvent(CSPlayerEvent.SeekBack)
} }
PlayerEventType.Restart -> {
player.handleEvent(CSPlayerEvent.Restart)
}
PlayerEventType.ToggleMute -> { PlayerEventType.ToggleMute -> {
player.handleEvent(CSPlayerEvent.ToggleMute) player.handleEvent(CSPlayerEvent.ToggleMute)
} }
@ -1428,6 +1445,25 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
} }
playerBinding?.apply { playerBinding?.apply {
if (isLayout(TV or EMULATOR)) {
mapOf(
playerGoBack to playerGoBackText,
playerRestart to playerRestartText,
playerGoForward to playerGoForwardText
).forEach { (button, text) ->
button.setOnFocusChangeListener { _, hasFocus ->
if (!hasFocus) {
text.isSelected = false
text.isVisible = false
return@setOnFocusChangeListener
}
text.isSelected = true
text.isVisible = true
}
}
}
playerPausePlay.setOnClickListener { playerPausePlay.setOnClickListener {
autoHide() autoHide()
player.handleEvent(CSPlayerEvent.PlayPauseToggle) player.handleEvent(CSPlayerEvent.PlayPauseToggle)
@ -1471,6 +1507,16 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
player.handleEvent(CSPlayerEvent.NextEpisode) player.handleEvent(CSPlayerEvent.NextEpisode)
} }
playerGoForward.setOnClickListener {
autoHide()
player.handleEvent(CSPlayerEvent.NextEpisode)
}
playerRestart.setOnClickListener {
autoHide()
player.handleEvent(CSPlayerEvent.Restart)
}
playerLock.setOnClickListener { playerLock.setOnClickListener {
autoHide() autoHide()
toggleLock() toggleLock()
@ -1564,7 +1610,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
private fun setRemainingTimeCounter(showRemaining: Boolean) { private fun setRemainingTimeCounter(showRemaining: Boolean) {
durationMode = showRemaining durationMode = showRemaining
playerBinding?.exoDuration?.isInvisible= showRemaining playerBinding?.exoDuration?.isInvisible = showRemaining
playerBinding?.timeLeft?.isVisible = showRemaining playerBinding?.timeLeft?.isVisible = showRemaining
} }

View file

@ -44,6 +44,7 @@ import com.lagradost.cloudstream3.ui.player.source_priority.QualityDataHelper
import com.lagradost.cloudstream3.ui.player.source_priority.QualityProfileDialog import com.lagradost.cloudstream3.ui.player.source_priority.QualityProfileDialog
import com.lagradost.cloudstream3.ui.result.* import com.lagradost.cloudstream3.ui.result.*
import com.lagradost.cloudstream3.ui.settings.Globals.EMULATOR import com.lagradost.cloudstream3.ui.settings.Globals.EMULATOR
import com.lagradost.cloudstream3.ui.settings.Globals.PHONE
import com.lagradost.cloudstream3.ui.settings.Globals.TV import com.lagradost.cloudstream3.ui.settings.Globals.TV
import com.lagradost.cloudstream3.ui.settings.Globals.isLayout import com.lagradost.cloudstream3.ui.settings.Globals.isLayout
import com.lagradost.cloudstream3.ui.subtitles.SUBTITLE_AUTO_SELECT_KEY import com.lagradost.cloudstream3.ui.subtitles.SUBTITLE_AUTO_SELECT_KEY
@ -1097,9 +1098,16 @@ class GeneratorPlayer : FullScreenPlayer() {
} }
playerBinding?.playerSkipOp?.isVisible = isOpVisible playerBinding?.playerSkipOp?.isVisible = isOpVisible
when {
isLayout(PHONE) ->
playerBinding?.playerSkipEpisode?.isVisible = playerBinding?.playerSkipEpisode?.isVisible =
!isOpVisible && viewModel.hasNextEpisode() == true !isOpVisible && viewModel.hasNextEpisode() == true
else ->
playerBinding?.playerGoForward?.isVisible = viewModel.hasNextEpisode() == true
}
if (percentage >= PRELOAD_NEXT_EPISODE_PERCENTAGE) { if (percentage >= PRELOAD_NEXT_EPISODE_PERCENTAGE) {
viewModel.preLoadNextLinks() viewModel.preLoadNextLinks()
} }
@ -1254,7 +1262,7 @@ class GeneratorPlayer : FullScreenPlayer() {
fun setPlayerDimen(widthHeight: Pair<Int, Int>?) { fun setPlayerDimen(widthHeight: Pair<Int, Int>?) {
val extra = if (widthHeight != null) { val extra = if (widthHeight != null) {
val (width, height) = widthHeight val (width, height) = widthHeight
"${width}x${height}" "- ${width}x${height}"
} else { } else {
"" ""
} }
@ -1265,7 +1273,7 @@ class GeneratorPlayer : FullScreenPlayer() {
0 -> "" 0 -> ""
1 -> extra 1 -> extra
2 -> source 2 -> source
3 -> "$source - $extra" 3 -> "$source $extra"
else -> "" else -> ""
} }
playerBinding?.playerVideoTitleRez?.apply { playerBinding?.playerVideoTitleRez?.apply {
@ -1290,7 +1298,8 @@ class GeneratorPlayer : FullScreenPlayer() {
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View? { ): View? {
// this is used instead of layout-television to follow the settings and some TV devices are not classified as TV for some reason // this is used instead of layout-television to follow the settings and some TV devices are not classified as TV for some reason
layout = if (isLayout(TV or EMULATOR)) R.layout.fragment_player_tv else R.layout.fragment_player layout =
if (isLayout(TV or EMULATOR)) R.layout.fragment_player_tv else R.layout.fragment_player
viewModel = ViewModelProvider(this)[PlayerGeneratorViewModel::class.java] viewModel = ViewModelProvider(this)[PlayerGeneratorViewModel::class.java]
sync = ViewModelProvider(this)[SyncViewModel::class.java] sync = ViewModelProvider(this)[SyncViewModel::class.java]

View file

@ -26,6 +26,7 @@ enum class PlayerEventType(val value: Int) {
Resize(13), Resize(13),
SearchSubtitlesOnline(14), SearchSubtitlesOnline(14),
SkipOp(15), SkipOp(15),
Restart(16),
} }
enum class CSPlayerEvent(val value: Int) { enum class CSPlayerEvent(val value: Int) {
@ -39,6 +40,7 @@ enum class CSPlayerEvent(val value: Int) {
PrevEpisode(6), PrevEpisode(6),
PlayPauseToggle(7), PlayPauseToggle(7),
ToggleMute(8), ToggleMute(8),
Restart(9),
} }
enum class CSPlayerLoading { enum class CSPlayerLoading {

View file

@ -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="M160,800v-320h160v320L160,800ZM400,800v-640h160v640L400,800ZM640,800v-440h160v440L640,800Z"
android:fillColor="#5f6368"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,5V2.21c0,-0.45 -0.54,-0.67 -0.85,-0.35l-3.8,3.79c-0.2,0.2 -0.2,0.51 0,0.71l3.79,3.79c0.32,0.31 0.86,0.09 0.86,-0.36V7c3.73,0 6.68,3.42 5.86,7.29 -0.47,2.27 -2.31,4.1 -4.57,4.57 -3.57,0.75 -6.75,-1.7 -7.23,-5.01 -0.07,-0.48 -0.49,-0.85 -0.98,-0.85 -0.6,0 -1.08,0.53 -1,1.13 0.62,4.39 4.8,7.64 9.53,6.72 3.12,-0.61 5.63,-3.12 6.24,-6.24C20.84,9.48 16.94,5 12,5z"
android:fillColor="#e8eaed"/>
</vector>

View file

@ -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="M440,838q-121,-15 -200.5,-105.5T160,520q0,-66 26,-126.5T260,288l57,57q-38,34 -57.5,79T240,520q0,88 56,155.5T440,758v80ZM520,838v-80q87,-16 143.5,-83T720,520q0,-100 -70,-170t-170,-70h-3l44,44 -56,56 -140,-140 140,-140 56,56 -44,44h3q134,0 227,93t93,227q0,121 -79.5,211.5T520,838Z"
android:fillColor="#e8eaed"/>
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2.775,21.225 L15.844,12 2.775,2.775ZM18.15,2.775v18.45h3.075V2.775Z"
android:strokeWidth="1.5375"
android:fillColor="#e8eaed"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7.58,16.89l5.77,-4.07c0.56,-0.4 0.56,-1.24 0,-1.63L7.58,7.11C6.91,6.65 6,7.12 6,7.93v8.14c0,0.81 0.91,1.28 1.58,0.82zM16,7v10c0,0.55 0.45,1 1,1s1,-0.45 1,-1V7c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1z"
android:fillColor="#e8eaed"/>
</vector>

View file

@ -68,7 +68,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp" android:layout_margin="5dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"
tools:visibility="visible">
<ImageView <ImageView
android:layout_width="30dp" android:layout_width="30dp"
@ -82,12 +84,11 @@
android:id="@+id/player_loading_go_back" android:id="@+id/player_loading_go_back"
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="70dp" android:layout_height="70dp"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/video_tap_button_always_white" android:background="@drawable/video_tap_button_always_white"
android:clickable="true" android:clickable="false"
android:focusable="true" android:focusable="false"
android:focusableInTouchMode="true" android:focusableInTouchMode="false"
android:nextFocusRight="@id/overlay_loading_skip_button" android:nextFocusRight="@id/overlay_loading_skip_button"
android:nextFocusDown="@id/overlay_loading_skip_button" /> android:nextFocusDown="@id/overlay_loading_skip_button" />
</FrameLayout> </FrameLayout>

View file

@ -172,27 +172,108 @@
android:id="@+id/player_go_back_holder" android:id="@+id/player_go_back_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp" android:layout_margin="20dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<ImageView <LinearLayout
android:layout_width="30dp" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_marginEnd="10dp"
android:contentDescription="@string/go_back_img_des" android:id="@+id/player_go_back_root"
android:src="@drawable/ic_baseline_arrow_back_24" android:orientation="vertical">
app:tint="@android:color/white" />
<ImageView <ImageView
android:id="@+id/player_go_back" android:id="@+id/player_go_back"
android:layout_width="70dp" android:layout_width="30dp"
android:layout_height="70dp" android:layout_height="30dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_baseline_arrow_back_24"
app:tint="@android:color/white"
android:background="@drawable/video_tap_button_always_white" android:background="@drawable/video_tap_button_always_white"
android:clickable="true" android:clickable="true"
android:contentDescription="@string/go_back_img_des" android:contentDescription="@string/go_back_img_des"
android:focusable="true" /> android:focusable="true"
android:nextFocusRight="@id/player_restart"
android:nextFocusLeft="@id/player_go_back"
android:nextFocusDown="@id/player_pause_play"
android:nextFocusUp="@id/player_go_back"
android:tag="@string/tv_no_focus_tag" />
<TextView
android:id="@+id/player_go_back_text"
style="@style/ResultMarqueeButtonText"
android:text="@string/go_back_img_des"
android:visibility="gone"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginEnd="10dp"
android:id="@+id/player_restart_root"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:id="@+id/player_restart"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_replay_24"
app:tint="@android:color/white"
android:background="@drawable/video_tap_button_always_white"
android:clickable="true"
android:contentDescription="@string/restart"
android:focusable="true"
android:nextFocusRight="@id/player_go_forward"
android:nextFocusLeft="@id/player_go_back"
android:nextFocusDown="@id/player_pause_play"
android:nextFocusUp="@id/player_restart"
android:tag="@string/tv_no_focus_tag" />
<TextView
android:id="@+id/player_restart_text"
style="@style/ResultMarqueeButtonText"
android:text="@string/restart" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="80dp"
android:layout_marginEnd="10dp"
android:id="@+id/player_go_forward_root"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:id="@+id/player_go_forward"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_skip_next_rounded_24"
app:tint="@android:color/white"
android:background="@drawable/video_tap_button_always_white"
android:clickable="true"
android:nextFocusRight="@id/player_go_forward"
android:nextFocusLeft="@id/player_restart"
android:nextFocusDown="@id/player_pause_play"
android:nextFocusUp="@id/player_go_forward"
android:contentDescription="@string/next_episode"
android:focusable="true"
android:tag="@string/tv_no_focus_tag" />
<TextView
android:id="@+id/player_go_forward_text"
style="@style/ResultMarqueeButtonText"
android:text="@string/next_episode" />
</LinearLayout>
</FrameLayout> </FrameLayout>
@ -626,7 +707,7 @@
android:nextFocusLeft="@id/player_sources_btt" android:nextFocusLeft="@id/player_sources_btt"
android:nextFocusRight="@id/player_skip_op" android:nextFocusRight="@id/player_skip_op"
android:text="@string/tracks" android:text="@string/tracks"
app:icon="@drawable/ic_baseline_playlist_play_24" /> app:icon="@drawable/ic_baseline_equalizer_24" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/player_skip_op" android:id="@+id/player_skip_op"
@ -641,10 +722,10 @@
android:id="@+id/player_skip_episode" android:id="@+id/player_skip_episode"
style="@style/VideoButton" style="@style/VideoButton"
android:nextFocusLeft="@id/player_skip_op" android:nextFocusLeft="@id/player_skip_op"
android:nextFocusRight="@id/player_lock" android:nextFocusRight="@id/player_lock"
android:text="@string/next_episode" android:text="@string/next_episode"
app:icon="@drawable/ic_baseline_skip_next_24" /> app:icon="@drawable/ic_baseline_skip_next_24" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</HorizontalScrollView> </HorizontalScrollView>

View file

@ -231,7 +231,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="80dp" android:layout_marginStart="32dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginEnd="32dp" android:layout_marginEnd="32dp"
android:orientation="vertical"> android:orientation="vertical">
@ -240,6 +240,7 @@
android:id="@+id/player_video_title" android:id="@+id/player_video_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAlignment="viewEnd"
android:gravity="end" android:gravity="end"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" android:textSize="16sp"
@ -250,6 +251,7 @@
android:id="@+id/player_video_title_rez" android:id="@+id/player_video_title_rez"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAlignment="viewEnd"
android:gravity="end" android:gravity="end"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" android:textSize="16sp"
@ -285,28 +287,116 @@
android:id="@+id/player_go_back_holder" android:id="@+id/player_go_back_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp" android:layout_marginStart="17dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="17dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<ImageView <LinearLayout
android:layout_width="30dp" android:layout_width="60dp"
android:layout_height="30dp" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_marginEnd="10dp"
android:contentDescription="@string/go_back_img_des" android:id="@+id/player_go_back_root"
android:src="@drawable/ic_baseline_arrow_back_24" android:orientation="vertical">
app:tint="@android:color/white" />
<ImageView <ImageView
android:id="@+id/player_go_back" android:id="@+id/player_go_back"
android:layout_width="70dp" android:layout_width="30dp"
android:layout_height="70dp" android:layout_height="30dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_baseline_arrow_back_24"
app:tint="@android:color/white"
android:background="@drawable/video_tap_button_always_white" android:background="@drawable/video_tap_button_always_white"
android:clickable="true" android:clickable="true"
android:contentDescription="@string/go_back_img_des" android:contentDescription="@string/go_back_img_des"
android:focusable="true" android:focusable="true"
android:nextFocusRight="@id/player_restart"
android:nextFocusLeft="@id/player_go_back"
android:nextFocusDown="@id/player_pause_play"
android:nextFocusUp="@id/player_go_back"
android:tag="@string/tv_no_focus_tag" /> android:tag="@string/tv_no_focus_tag" />
<TextView
android:id="@+id/player_go_back_text"
android:layout_marginTop="5dp"
style="@style/ResultMarqueeButtonText"
android:text="@string/go_back_img_des"
android:visibility="invisible"
tools:visibility="visible"/>
</LinearLayout>
<LinearLayout
android:layout_width="60dp"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:layout_marginEnd="10dp"
android:id="@+id/player_restart_root"
android:orientation="vertical">
<ImageView
android:id="@+id/player_restart"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_replay_24"
app:tint="@android:color/white"
android:background="@drawable/video_tap_button_always_white"
android:clickable="true"
android:contentDescription="@string/restart"
android:focusable="true"
android:nextFocusRight="@id/player_go_forward"
android:nextFocusLeft="@id/player_go_back"
android:nextFocusDown="@id/player_pause_play"
android:nextFocusUp="@id/player_restart"
android:tag="@string/tv_no_focus_tag" />
<TextView
android:id="@+id/player_restart_text"
android:layout_marginTop="5dp"
style="@style/ResultMarqueeButtonText"
android:text="@string/restart"
android:visibility="invisible"
tools:visibility="visible"/>
</LinearLayout>
<LinearLayout
android:layout_width="60dp"
android:layout_height="wrap_content"
android:layout_marginStart="100dp"
android:layout_marginEnd="10dp"
android:id="@+id/player_go_forward_root"
android:orientation="vertical">
<ImageView
android:id="@+id/player_go_forward"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_skip_next_rounded_24"
app:tint="@android:color/white"
android:background="@drawable/video_tap_button_always_white"
android:clickable="true"
android:nextFocusRight="@id/player_go_forward"
android:nextFocusLeft="@id/player_restart"
android:nextFocusDown="@id/player_pause_play"
android:nextFocusUp="@id/player_go_forward"
android:contentDescription="@string/next_episode"
android:focusable="true"
android:tag="@string/tv_no_focus_tag" />
<TextView
android:id="@+id/player_go_forward_text"
android:layout_marginTop="5dp"
style="@style/ResultMarqueeButtonText"
android:text="@string/next_episode"
android:visibility="invisible"
tools:visibility="visible"/>
</LinearLayout>
</FrameLayout> </FrameLayout>
</FrameLayout> </FrameLayout>
@ -509,6 +599,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layoutDirection="ltr" android:layoutDirection="ltr"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/player_pause_play" android:id="@+id/player_pause_play"
@ -520,14 +611,14 @@
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:nextFocusUp="@id/skip_chapter_button" android:nextFocusUp="@id/skip_chapter_button"
android:nextFocusDown="@id/player_skip_op" android:nextFocusDown="@id/player_lock_holder"
android:src="@drawable/netflix_pause" android:src="@drawable/netflix_pause"
android:tag="@string/tv_no_focus_tag" android:tag="@string/tv_no_focus_tag"
app:tint="@color/player_button_tv"
tools:ignore="ContentDescription"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent"
app:tint="@color/player_button_tv"
tools:ignore="ContentDescription" />
<TextView <TextView
android:id="@id/exo_position" android:id="@id/exo_position"
@ -618,10 +709,10 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="normal" android:textStyle="normal"
android:visibility="gone"
app:layout_constraintBaseline_toBaselineOf="@id/exo_position" app:layout_constraintBaseline_toBaselineOf="@id/exo_position"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
tools:text="-23:20" tools:text="-23:20" />
android:visibility="gone"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@ -672,12 +763,13 @@
android:id="@+id/player_skip_episode" android:id="@+id/player_skip_episode"
style="@style/VideoButtonTV" style="@style/VideoButtonTV"
android:nextFocusLeft="@id/player_skip_op" android:nextFocusLeft="@id/player_skip_op"
android:nextFocusRight="@id/player_resize_btt" android:nextFocusRight="@id/player_resize_btt"
android:nextFocusUp="@id/player_pause_play" android:nextFocusUp="@id/player_pause_play"
android:nextFocusDown="@id/player_resize_btt" android:nextFocusDown="@id/player_resize_btt"
android:text="@string/next_episode" android:text="@string/next_episode"
app:icon="@drawable/ic_baseline_skip_next_24" /> app:icon="@drawable/ic_baseline_skip_next_24"
android:visibility="gone"
tools:visibility="visible"/>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/player_resize_btt" android:id="@+id/player_resize_btt"
@ -732,7 +824,7 @@
android:nextFocusRight="@id/player_skip_op" android:nextFocusRight="@id/player_skip_op"
android:nextFocusUp="@id/player_pause_play" android:nextFocusUp="@id/player_pause_play"
android:text="@string/tracks" android:text="@string/tracks"
app:icon="@drawable/ic_baseline_playlist_play_24" /> app:icon="@drawable/ic_baseline_equalizer_24" />
</LinearLayout> </LinearLayout>
</HorizontalScrollView> </HorizontalScrollView>
</LinearLayout> </LinearLayout>

View file

@ -30,28 +30,27 @@
<ImageView <ImageView
android:id="@+id/subtitle_offset_subtract_more" android:id="@+id/subtitle_offset_subtract_more"
android:layout_width="wrap_content" android:layout_width="24dp"
android:layout_height="match_parent" android:layout_height="24dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true" android:focusable="true"
android:nextFocusRight="@id/subtitle_offset_subtract" android:nextFocusRight="@id/subtitle_offset_subtract"
android:padding="10dp"
android:src="@drawable/ic_baseline_keyboard_arrow_left_24" android:src="@drawable/ic_baseline_keyboard_arrow_left_24"
app:tint="?attr/white" app:tint="?attr/white"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageView <ImageView
android:id="@+id/subtitle_offset_subtract" android:id="@+id/subtitle_offset_subtract"
android:layout_width="wrap_content" android:layout_width="24dp"
android:layout_height="match_parent" android:layout_height="24dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_marginEnd="10dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true" android:focusable="true"
android:nextFocusLeft="@id/subtitle_offset_subtract_more" android:nextFocusLeft="@id/subtitle_offset_subtract_more"
android:padding="10dp"
android:src="@drawable/baseline_remove_24" android:src="@drawable/baseline_remove_24"
app:tint="?attr/white" app:tint="?attr/white"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
@ -67,29 +66,29 @@
<ImageView <ImageView
android:id="@+id/subtitle_offset_add" android:id="@+id/subtitle_offset_add"
android:layout_width="wrap_content" android:layout_width="24dp"
android:layout_height="match_parent" android:layout_height="24dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_marginStart="10dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true" android:focusable="true"
android:nextFocusRight="@id/subtitle_offset_add_more" android:nextFocusRight="@id/subtitle_offset_add_more"
android:padding="10dp"
android:src="@drawable/ic_baseline_add_24" android:src="@drawable/ic_baseline_add_24"
app:tint="?attr/white" app:tint="?attr/white"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageView <ImageView
android:id="@+id/subtitle_offset_add_more" android:id="@+id/subtitle_offset_add_more"
android:layout_width="wrap_content" android:layout_width="24dp"
android:layout_height="match_parent" android:layout_height="24dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:focusable="true" android:focusable="true"
android:nextFocusLeft="@id/subtitle_offset_add" android:nextFocusLeft="@id/subtitle_offset_add"
android:nextFocusDown="@id/apply_btt" android:nextFocusDown="@id/apply_btt"
android:padding="10dp"
android:src="@drawable/ic_baseline_keyboard_arrow_right_24" android:src="@drawable/ic_baseline_keyboard_arrow_right_24"
app:tint="?attr/white" app:tint="?attr/white"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />

View file

@ -137,33 +137,110 @@
<FrameLayout <FrameLayout
android:id="@+id/player_go_back_holder" android:id="@+id/player_go_back_holder"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="0dp" android:layout_height="wrap_content"
android:layout_margin="5dp" android:layout_margin="20dp"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<ImageView <LinearLayout
android:layout_width="30dp" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_marginEnd="10dp"
android:contentDescription="@string/go_back_img_des" android:id="@+id/player_go_back_root"
android:src="@drawable/ic_baseline_arrow_back_24" android:orientation="vertical">
app:tint="@android:color/white" />
<ImageView <ImageView
android:id="@+id/player_go_back" android:id="@+id/player_go_back"
android:layout_width="70dp" android:layout_width="30dp"
android:layout_height="70dp" android:layout_height="30dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_baseline_arrow_back_24"
app:tint="@android:color/white"
android:background="@drawable/video_tap_button_always_white" android:background="@drawable/video_tap_button_always_white"
android:clickable="true" android:clickable="true"
android:contentDescription="@string/go_back_img_des" android:contentDescription="@string/go_back_img_des"
android:focusable="true" /> android:focusable="true"
android:nextFocusRight="@id/player_restart"
android:nextFocusLeft="@id/player_go_back"
android:nextFocusDown="@id/player_pause_play"
android:nextFocusUp="@id/player_go_back"
android:tag="@string/tv_no_focus_tag" />
<TextView
android:id="@+id/player_go_back_text"
style="@style/ResultMarqueeButtonText"
android:text="@string/go_back_img_des"
android:visibility="gone"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginEnd="10dp"
android:id="@+id/player_restart_root"
android:orientation="vertical">
<ImageView
android:id="@+id/player_restart"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_replay_24"
app:tint="@android:color/white"
android:background="@drawable/video_tap_button_always_white"
android:clickable="true"
android:contentDescription="@string/restart"
android:focusable="true"
android:nextFocusRight="@id/player_go_forward"
android:nextFocusLeft="@id/player_go_back"
android:nextFocusDown="@id/player_pause_play"
android:nextFocusUp="@id/player_restart"
android:tag="@string/tv_no_focus_tag" />
<TextView
android:id="@+id/player_restart_text"
style="@style/ResultMarqueeButtonText"
android:text="@string/restart"
android:visibility="gone"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="80dp"
android:layout_marginEnd="10dp"
android:id="@+id/player_go_forward_root"
android:orientation="vertical">
<ImageView
android:id="@+id/player_go_forward"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_skip_next_rounded_24"
app:tint="@android:color/white"
android:background="@drawable/video_tap_button_always_white"
android:clickable="true"
android:nextFocusRight="@id/player_go_forward"
android:nextFocusLeft="@id/player_restart"
android:nextFocusDown="@id/player_pause_play"
android:nextFocusUp="@id/player_go_forward"
android:contentDescription="@string/next_episode"
android:focusable="true"
android:tag="@string/tv_no_focus_tag" />
<TextView
android:id="@+id/player_go_forward_text"
style="@style/ResultMarqueeButtonText"
android:text="@string/next_episode"
android:visibility="gone"/>
</LinearLayout>
</FrameLayout> </FrameLayout>
</FrameLayout> </FrameLayout>

View file

@ -96,6 +96,7 @@
<string name="home_next_random_img_des">Next Random</string> <string name="home_next_random_img_des">Next Random</string>
<string name="episode_play_img_des" translatable="false">@string/play_episode</string> <string name="episode_play_img_des" translatable="false">@string/play_episode</string>
<string name="go_back_img_des">Go back</string> <string name="go_back_img_des">Go back</string>
<string name="play_from_beginning_img_des">Play from the Beginning</string>
<string name="change_providers_img_des" translatable="false">@string/home_change_provider_img_des</string> <string name="change_providers_img_des" translatable="false">@string/home_change_provider_img_des</string>
<string name="home_change_provider_img_des">Change Provider</string> <string name="home_change_provider_img_des">Change Provider</string>
<string name="preview_background_img_des">Preview Background</string> <string name="preview_background_img_des">Preview Background</string>