mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-06 01:20:29 +05:30
fix the double tap overlay margin
This commit is contained in:
parent
f45e1aad24
commit
03a6e190a1
@ -600,7 +600,6 @@ class PlayerFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
mainActivity.requestedOrientation = orientation
|
mainActivity.requestedOrientation = orientation
|
||||||
}
|
}
|
||||||
binding.player.setDoubleTapOverlayLayoutParams(90)
|
|
||||||
|
|
||||||
Globals.IS_FULL_SCREEN = true
|
Globals.IS_FULL_SCREEN = true
|
||||||
}
|
}
|
||||||
|
@ -54,26 +54,6 @@ internal class CustomExoPlayerView(
|
|||||||
setOnClickListener(doubleTouchListener)
|
setOnClickListener(doubleTouchListener)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hideController() {
|
|
||||||
super.hideController()
|
|
||||||
setDoubleTapOverlayLayoutParams(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun showController() {
|
|
||||||
setDoubleTapOverlayLayoutParams(90)
|
|
||||||
super.showController()
|
|
||||||
}
|
|
||||||
|
|
||||||
// set the top and bottom margin of the double tap overlay
|
|
||||||
fun setDoubleTapOverlayLayoutParams(margin: Int) {
|
|
||||||
val dpMargin = resources?.displayMetrics?.density!!.toInt() * margin
|
|
||||||
val doubleTapOverlay = binding.root.findViewById<DoubleTapOverlay>(R.id.doubleTapOverlay)
|
|
||||||
val params = doubleTapOverlay.layoutParams as MarginLayoutParams
|
|
||||||
params.topMargin = dpMargin
|
|
||||||
params.bottomMargin = dpMargin
|
|
||||||
doubleTapOverlay.layoutParams = params
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||||
// save the x position of the touch event
|
// save the x position of the touch event
|
||||||
xPos = event.x
|
xPos = event.x
|
||||||
|
@ -377,7 +377,9 @@
|
|||||||
<com.github.libretube.views.DoubleTapOverlay
|
<com.github.libretube.views.DoubleTapOverlay
|
||||||
android:id="@+id/doubleTapOverlay"
|
android:id="@+id/doubleTapOverlay"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</com.github.libretube.views.CustomExoPlayerView>
|
</com.github.libretube.views.CustomExoPlayerView>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user