mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-07 10:00:31 +05:30
.
This commit is contained in:
parent
6d50edb6a5
commit
63c97508de
@ -1,34 +0,0 @@
|
|||||||
package com.github.libretube.util
|
|
||||||
|
|
||||||
import android.util.Log
|
|
||||||
import android.view.ScaleGestureDetector
|
|
||||||
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout
|
|
||||||
import com.google.android.exoplayer2.ui.StyledPlayerView
|
|
||||||
|
|
||||||
class CustomOnScaleGestureListener(
|
|
||||||
private val player: StyledPlayerView
|
|
||||||
) : ScaleGestureDetector.SimpleOnScaleGestureListener() {
|
|
||||||
private var scaleFactor = 0f
|
|
||||||
|
|
||||||
override fun onScale(
|
|
||||||
detector: ScaleGestureDetector
|
|
||||||
): Boolean {
|
|
||||||
scaleFactor = detector.scaleFactor
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onScaleBegin(
|
|
||||||
detector: ScaleGestureDetector
|
|
||||||
): Boolean {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onScaleEnd(detector: ScaleGestureDetector) {
|
|
||||||
Log.e("scale", "scale")
|
|
||||||
if (scaleFactor > 1) {
|
|
||||||
player.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM
|
|
||||||
} else {
|
|
||||||
player.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user