mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +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
|
// FullScreen button trigger
|
||||||
playerBinding.fullscreen.setOnClickListener {
|
playerBinding.fullscreen.setOnClickListener {
|
||||||
exoPlayerView.hideController()
|
exoPlayerView.hideController()
|
||||||
|
var scaleFactor: Float? = null
|
||||||
if (!isFullScreen) {
|
if (!isFullScreen) {
|
||||||
// go to fullscreen mode
|
// go to fullscreen mode
|
||||||
with(binding.playerMotionLayout) {
|
with(binding.playerMotionLayout) {
|
||||||
@ -280,6 +281,8 @@ class PlayerFragment : Fragment() {
|
|||||||
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen_exit)
|
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen_exit)
|
||||||
playerBinding.exoTitle.visibility = View.VISIBLE
|
playerBinding.exoTitle.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
scaleFactor = 1.3F
|
||||||
|
|
||||||
val mainActivity = activity as MainActivity
|
val mainActivity = activity as MainActivity
|
||||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
||||||
} else {
|
} else {
|
||||||
@ -294,10 +297,20 @@ class PlayerFragment : Fragment() {
|
|||||||
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen)
|
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen)
|
||||||
playerBinding.exoTitle.visibility = View.INVISIBLE
|
playerBinding.exoTitle.visibility = View.INVISIBLE
|
||||||
|
|
||||||
|
scaleFactor = 1F
|
||||||
|
|
||||||
val mainActivity = activity as MainActivity
|
val mainActivity = activity as MainActivity
|
||||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
||||||
}
|
}
|
||||||
isFullScreen = !isFullScreen
|
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
|
// switching between original aspect ratio (black bars) and zoomed to fill device screen
|
||||||
|
Loading…
x
Reference in New Issue
Block a user