2022-06-03 00:40:16 +05:30
|
|
|
package com.github.libretube.util
|
2021-12-12 20:31:44 +05:30
|
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
|
import android.content.Context
|
|
|
|
import android.util.AttributeSet
|
|
|
|
import android.view.MotionEvent
|
2021-12-14 02:58:17 +05:30
|
|
|
import com.google.android.exoplayer2.ui.StyledPlayerView
|
2021-12-12 20:31:44 +05:30
|
|
|
|
|
|
|
internal class CustomExoPlayerView(
|
2022-05-20 03:52:10 +05:30
|
|
|
context: Context,
|
|
|
|
attributeSet: AttributeSet? = null
|
2021-12-14 02:58:17 +05:30
|
|
|
) : StyledPlayerView(context, attributeSet) {
|
2021-12-12 20:31:44 +05:30
|
|
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
|
override fun onTouchEvent(event: MotionEvent): Boolean {
|
|
|
|
when (event.action) {
|
|
|
|
MotionEvent.ACTION_DOWN -> {
|
2021-12-14 21:45:53 +05:30
|
|
|
if (isControllerFullyVisible) {
|
|
|
|
hideController()
|
2022-05-20 03:52:10 +05:30
|
|
|
} else {
|
2021-12-14 21:45:53 +05:30
|
|
|
showController()
|
|
|
|
}
|
2021-12-12 20:31:44 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
2022-05-20 03:52:10 +05:30
|
|
|
}
|