parent
5b5f48f9f3
commit
4bf541932a
2 changed files with 11 additions and 3 deletions
|
@ -103,7 +103,8 @@
|
|||
android:configChanges="orientation|screenSize" />
|
||||
<activity
|
||||
android:name=".ViewMediaActivity"
|
||||
android:theme="@style/TuskyBaseTheme" />
|
||||
android:theme="@style/TuskyBaseTheme"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden|screenLayout|smallestScreenSize" />
|
||||
<activity
|
||||
android:name=".components.account.AccountActivity"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden|screenLayout|smallestScreenSize" />
|
||||
|
|
|
@ -12,6 +12,7 @@ class ExposedPlayPauseVideoView @JvmOverloads constructor(
|
|||
VideoView(context, attrs, defStyleAttr) {
|
||||
|
||||
private var listener: PlayPauseListener? = null
|
||||
private var playing = false
|
||||
|
||||
fun setPlayPauseListener(listener: PlayPauseListener) {
|
||||
this.listener = listener
|
||||
|
@ -19,13 +20,19 @@ class ExposedPlayPauseVideoView @JvmOverloads constructor(
|
|||
|
||||
override fun start() {
|
||||
super.start()
|
||||
if (!playing) {
|
||||
playing = true
|
||||
listener?.onPlay()
|
||||
}
|
||||
}
|
||||
|
||||
override fun pause() {
|
||||
super.pause()
|
||||
if (playing) {
|
||||
playing = false
|
||||
listener?.onPause()
|
||||
}
|
||||
}
|
||||
|
||||
interface PlayPauseListener {
|
||||
fun onPlay()
|
||||
|
|
Loading…
Reference in a new issue