mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 22:00:30 +05:30
Merge pull request #5905 from Bnyro/master
fix: don't show autoplay countdown controls in PiP mode
This commit is contained in:
commit
d2976cbbdc
@ -11,7 +11,9 @@ import androidx.core.view.isVisible
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.get
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.compat.PictureInPictureCompat
|
||||
import com.github.libretube.databinding.AutoplayCountdownBinding
|
||||
import com.github.libretube.helpers.ContextHelper
|
||||
import com.github.libretube.ui.activities.MainActivity
|
||||
import com.github.libretube.ui.models.PlayerViewModel
|
||||
|
||||
@ -60,6 +62,12 @@ class AutoplayCountdownView(
|
||||
return
|
||||
}
|
||||
|
||||
// don't show cancel and play next buttons in PiP mode
|
||||
val context = ContextHelper.unwrapActivity(context)
|
||||
val isInPipMode = PictureInPictureCompat.isInPictureInPictureMode(context)
|
||||
binding.cancel.isVisible = !isInPipMode
|
||||
binding.playNext.isVisible = !isInPipMode
|
||||
|
||||
// only show countdown when mini player not visible
|
||||
this.isVisible = playerViewModel.isMiniPlayerVisible.value == false
|
||||
binding.currentState.text = context.getString(
|
||||
|
Loading…
Reference in New Issue
Block a user