mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 15:30:31 +05:30
scale controls on fullscreen
This commit is contained in:
parent
64f9f58583
commit
17cf24a5aa
@ -268,6 +268,7 @@ class PlayerFragment : Fragment() {
|
||||
// FullScreen button trigger
|
||||
playerBinding.fullscreen.setOnClickListener {
|
||||
exoPlayerView.hideController()
|
||||
var scaleFactor: Float? = null
|
||||
if (!isFullScreen) {
|
||||
// go to fullscreen mode
|
||||
with(binding.playerMotionLayout) {
|
||||
@ -280,6 +281,8 @@ class PlayerFragment : Fragment() {
|
||||
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen_exit)
|
||||
playerBinding.exoTitle.visibility = View.VISIBLE
|
||||
|
||||
scaleFactor = 1.3F
|
||||
|
||||
val mainActivity = activity as MainActivity
|
||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
||||
} else {
|
||||
@ -294,10 +297,20 @@ class PlayerFragment : Fragment() {
|
||||
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen)
|
||||
playerBinding.exoTitle.visibility = View.INVISIBLE
|
||||
|
||||
scaleFactor = 1F
|
||||
|
||||
val mainActivity = activity as MainActivity
|
||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
||||
}
|
||||
isFullScreen = !isFullScreen
|
||||
|
||||
// scale the exo player center controls
|
||||
playerBinding.exoFfwdWithAmount.scaleX = scaleFactor
|
||||
playerBinding.exoFfwdWithAmount.scaleY = scaleFactor
|
||||
playerBinding.exoRewWithAmount.scaleX = scaleFactor
|
||||
playerBinding.exoRewWithAmount.scaleY = scaleFactor
|
||||
playerBinding.exoPlayPause.scaleX = scaleFactor
|
||||
playerBinding.exoPlayPause.scaleY = scaleFactor
|
||||
}
|
||||
|
||||
// switching between original aspect ratio (black bars) and zoomed to fill device screen
|
||||
|
Loading…
x
Reference in New Issue
Block a user