mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 23:00:31 +05:30
28 lines
874 B
Kotlin
28 lines
874 B
Kotlin
package com.github.libretube
|
|
|
|
import android.annotation.SuppressLint
|
|
import android.content.Context
|
|
import android.util.AttributeSet
|
|
import android.view.MotionEvent
|
|
import com.google.android.exoplayer2.ui.PlayerView
|
|
import com.google.android.exoplayer2.ui.StyledPlayerControlView
|
|
import com.google.android.exoplayer2.ui.StyledPlayerView
|
|
|
|
internal class CustomExoPlayerView(
|
|
context: Context, attributeSet: AttributeSet? = null
|
|
) : StyledPlayerView(context, attributeSet) {
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
override fun onTouchEvent(event: MotionEvent): Boolean {
|
|
when (event.action) {
|
|
MotionEvent.ACTION_DOWN -> {
|
|
if (isControllerFullyVisible) {
|
|
hideController()
|
|
}else {
|
|
showController()
|
|
}
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
} |