mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
fix PiP
This commit is contained in:
parent
a705b29b95
commit
803e1546e1
@ -1222,9 +1222,8 @@ class PlayerFragment : Fragment() {
|
|||||||
val captionLanguage = subtitlesNamesList[index]
|
val captionLanguage = subtitlesNamesList[index]
|
||||||
val captionLanguageCode = subtitleCodesList[index]
|
val captionLanguageCode = subtitleCodesList[index]
|
||||||
|
|
||||||
// update the icon
|
// update the icon of the captions button
|
||||||
playerBinding.captions.setImageResource(R.drawable.ic_caption)
|
playerBinding.captions.setImageResource(R.drawable.ic_caption)
|
||||||
playerBinding.captions.setColorFilter(Color.WHITE)
|
|
||||||
|
|
||||||
// select the new caption preference
|
// select the new caption preference
|
||||||
trackSelector.buildUponParameters()
|
trackSelector.buildUponParameters()
|
||||||
@ -1236,7 +1235,6 @@ class PlayerFragment : Fragment() {
|
|||||||
} else {
|
} else {
|
||||||
// none selected
|
// none selected
|
||||||
playerBinding.captions.setImageResource(R.drawable.ic_caption_outlined)
|
playerBinding.captions.setImageResource(R.drawable.ic_caption_outlined)
|
||||||
playerBinding.captions.setColorFilter(Color.GRAY)
|
|
||||||
|
|
||||||
// disable captions
|
// disable captions
|
||||||
trackSelector.buildUponParameters()
|
trackSelector.buildUponParameters()
|
||||||
@ -1416,8 +1414,7 @@ class PlayerFragment : Fragment() {
|
|||||||
// hide the close image button
|
// hide the close image button
|
||||||
playerBinding.closeImageButton.visibility =
|
playerBinding.closeImageButton.visibility =
|
||||||
if (isLocked &&
|
if (isLocked &&
|
||||||
!Globals.isFullScreen &&
|
!(Globals.isFullScreen && !autoRotationEnabled)
|
||||||
autoRotationEnabled
|
|
||||||
) View.VISIBLE else View.GONE
|
) View.VISIBLE else View.GONE
|
||||||
|
|
||||||
// disable double tap to seek when the player is locked
|
// disable double tap to seek when the player is locked
|
||||||
@ -1569,10 +1566,22 @@ class PlayerFragment : Fragment() {
|
|||||||
// set portrait mode
|
// set portrait mode
|
||||||
unsetFullscreen()
|
unsetFullscreen()
|
||||||
|
|
||||||
|
with(binding.playerMotionLayout) {
|
||||||
|
getConstraintSet(R.id.start).constrainHeight(R.id.player, -1)
|
||||||
|
enableTransition(R.id.yt_transition, false)
|
||||||
|
}
|
||||||
|
binding.linLayout.visibility = View.GONE
|
||||||
|
|
||||||
Globals.isFullScreen = false
|
Globals.isFullScreen = false
|
||||||
} else {
|
} else {
|
||||||
// enable exoPlayer controls again
|
// enable exoPlayer controls again
|
||||||
exoPlayerView.useController = true
|
exoPlayerView.useController = true
|
||||||
|
|
||||||
|
with(binding.playerMotionLayout) {
|
||||||
|
getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
|
||||||
|
enableTransition(R.id.yt_transition, true)
|
||||||
|
}
|
||||||
|
binding.linLayout.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1581,7 +1590,7 @@ class PlayerFragment : Fragment() {
|
|||||||
binding.playerScrollView.getHitRect(bounds)
|
binding.playerScrollView.getHitRect(bounds)
|
||||||
|
|
||||||
if (SDK_INT >= Build.VERSION_CODES.O &&
|
if (SDK_INT >= Build.VERSION_CODES.O &&
|
||||||
exoPlayer.isPlaying && (binding.playerScrollView.getLocalVisibleRect(bounds) || Globals.isFullScreen)
|
(binding.playerScrollView.getLocalVisibleRect(bounds) || Globals.isFullScreen)
|
||||||
) {
|
) {
|
||||||
activity?.enterPictureInPictureMode(updatePipParams())
|
activity?.enterPictureInPictureMode(updatePipParams())
|
||||||
}
|
}
|
||||||
|
@ -32,15 +32,15 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/close_imageButton"
|
android:id="@+id/close_imageButton"
|
||||||
style="@style/PlayerControlTop"
|
style="@style/PlayerControlTop"
|
||||||
|
android:layout_marginEnd="-10dp"
|
||||||
android:src="@drawable/ic_close"
|
android:src="@drawable/ic_close"
|
||||||
app:tint="@android:color/white" />
|
app:tint="@android:color/white" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/lock_player"
|
android:id="@+id/lock_player"
|
||||||
style="@style/PlayerControlTop"
|
style="@style/PlayerControlTop"
|
||||||
android:layout_marginStart="-5dp"
|
android:scaleX=".8"
|
||||||
android:scaleX=".9"
|
android:scaleY=".8"
|
||||||
android:scaleY=".9"
|
|
||||||
android:src="@drawable/ic_unlocked" />
|
android:src="@drawable/ic_unlocked" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@ -99,7 +99,7 @@
|
|||||||
android:id="@+id/captions"
|
android:id="@+id/captions"
|
||||||
style="@style/PlayerControlTop"
|
style="@style/PlayerControlTop"
|
||||||
android:src="@drawable/ic_caption_outlined"
|
android:src="@drawable/ic_caption_outlined"
|
||||||
app:tint="@android:color/darker_gray" />
|
app:tint="@android:color/white" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/repeat_toggle"
|
android:id="@+id/repeat_toggle"
|
||||||
@ -121,16 +121,14 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:layout_marginTop="@dimen/exo_styled_bottom_bar_margin_top"
|
android:layout_marginTop="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="@dimen/exo_styled_bottom_bar_time_padding"
|
android:paddingStart="10dp"
|
||||||
android:paddingLeft="@dimen/exo_styled_bottom_bar_time_padding"
|
android:paddingEnd="15dp" >
|
||||||
android:paddingEnd="@dimen/exo_styled_bottom_bar_time_padding"
|
|
||||||
android:paddingRight="@dimen/exo_styled_bottom_bar_time_padding">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@id/exo_time"
|
android:id="@id/exo_time"
|
||||||
@ -187,7 +185,6 @@
|
|||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/fullscreen"
|
android:id="@+id/fullscreen"
|
||||||
style="@style/PlayerControlBottom"
|
style="@style/PlayerControlBottom"
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:src="@drawable/ic_fullscreen"
|
android:src="@drawable/ic_fullscreen"
|
||||||
app:tint="@android:color/white" />
|
app:tint="@android:color/white" />
|
||||||
|
|
||||||
@ -226,7 +223,7 @@
|
|||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="@dimen/exo_styled_controls_padding">
|
android:padding="20dp">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@id/exo_play_pause"
|
android:id="@id/exo_play_pause"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user