toggle fullscreen at clicking outside videos too
This commit is contained in:
parent
d914f0bb53
commit
cb9353c31a
1 changed files with 8 additions and 5 deletions
|
@ -84,11 +84,8 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
|
||||||
mSurfaceView = mView.video_surface
|
mSurfaceView = mView.video_surface
|
||||||
mSurfaceHolder = mSurfaceView!!.holder
|
mSurfaceHolder = mSurfaceView!!.holder
|
||||||
mSurfaceHolder!!.addCallback(this)
|
mSurfaceHolder!!.addCallback(this)
|
||||||
mSurfaceView!!.setOnClickListener({
|
mSurfaceView!!.setOnClickListener({ toggleFullscreen() })
|
||||||
mIsFullscreen = !mIsFullscreen
|
mView.video_holder.setOnClickListener { toggleFullscreen() }
|
||||||
checkFullscreen()
|
|
||||||
listener?.fragmentClicked()
|
|
||||||
})
|
|
||||||
|
|
||||||
initTimeHolder()
|
initTimeHolder()
|
||||||
}
|
}
|
||||||
|
@ -111,6 +108,12 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
|
||||||
initTimeHolder()
|
initTimeHolder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun toggleFullscreen() {
|
||||||
|
mIsFullscreen = !mIsFullscreen
|
||||||
|
checkFullscreen()
|
||||||
|
listener?.fragmentClicked()
|
||||||
|
}
|
||||||
|
|
||||||
private fun initTimeHolder() {
|
private fun initTimeHolder() {
|
||||||
mTimeHolder = mView.video_time_holder
|
mTimeHolder = mView.video_time_holder
|
||||||
val res = resources
|
val res = resources
|
||||||
|
|
Loading…
Reference in a new issue