mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
fix #886, fade away both play/pause button after a few secs
This commit is contained in:
parent
613bbdd214
commit
7b2af9faeb
3 changed files with 14 additions and 8 deletions
|
@ -47,7 +47,7 @@ ext {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:4.5.10'
|
implementation 'com.simplemobiletools:commons:4.5.11'
|
||||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
|
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
|
||||||
implementation 'com.android.support:multidex:1.0.3'
|
implementation 'com.android.support:multidex:1.0.3'
|
||||||
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
||||||
|
|
|
@ -76,9 +76,10 @@ fun SimpleActivity.launchAbout() {
|
||||||
FAQItem(R.string.faq_12_title, R.string.faq_12_text),
|
FAQItem(R.string.faq_12_title, R.string.faq_12_text),
|
||||||
FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons))
|
FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons))
|
||||||
|
|
||||||
startAboutActivity(R.string.app_name, LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_MULTISELECT or LICENSE_RTL
|
val licenses = LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_MULTISELECT or LICENSE_RTL or LICENSE_SUBSAMPLING or LICENSE_PATTERN or
|
||||||
or LICENSE_SUBSAMPLING or LICENSE_PATTERN or LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or LICENSE_PHOTOVIEW or LICENSE_EXOPLAYER or
|
LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or LICENSE_PHOTOVIEW or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS
|
||||||
LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS, BuildConfig.VERSION_NAME, faqItems)
|
|
||||||
|
startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun AppCompatActivity.showSystemUI(toggleActionBarVisibility: Boolean) {
|
fun AppCompatActivity.showSystemUI(toggleActionBarVisibility: Boolean) {
|
||||||
|
|
|
@ -89,7 +89,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
}
|
}
|
||||||
|
|
||||||
mIsFullscreen = activity!!.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_FULLSCREEN == View.SYSTEM_UI_FLAG_FULLSCREEN
|
mIsFullscreen = activity!!.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_FULLSCREEN == View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
mView!!.video_play_outline.alpha = if (mIsFullscreen) 0f else PLAY_PAUSE_VISIBLE_ALPHA
|
|
||||||
|
|
||||||
setupPlayer()
|
setupPlayer()
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
|
@ -411,9 +410,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
mExoPlayer?.playWhenReady = true
|
mExoPlayer?.playWhenReady = true
|
||||||
mView!!.video_play_outline.setImageResource(R.drawable.ic_pause)
|
mView!!.video_play_outline.setImageResource(R.drawable.ic_pause)
|
||||||
activity!!.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
activity!!.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||||
mHidePauseHandler.postDelayed({
|
schedulePlayPauseFadeOut()
|
||||||
mView!!.video_play_outline.animate().alpha(0f).start()
|
|
||||||
}, HIDE_PAUSE_DELAY)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun pauseVideo() {
|
private fun pauseVideo() {
|
||||||
|
@ -429,6 +426,14 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
mView?.video_play_outline?.setImageResource(R.drawable.ic_play)
|
mView?.video_play_outline?.setImageResource(R.drawable.ic_play)
|
||||||
mView?.video_play_outline?.alpha = PLAY_PAUSE_VISIBLE_ALPHA
|
mView?.video_play_outline?.alpha = PLAY_PAUSE_VISIBLE_ALPHA
|
||||||
activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||||
|
schedulePlayPauseFadeOut()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun schedulePlayPauseFadeOut() {
|
||||||
|
mHidePauseHandler.removeCallbacksAndMessages(null)
|
||||||
|
mHidePauseHandler.postDelayed({
|
||||||
|
mView!!.video_play_outline.animate().alpha(0f).start()
|
||||||
|
}, HIDE_PAUSE_DELAY)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun videoEnded() = mExoPlayer?.currentPosition ?: 0 >= mExoPlayer?.duration ?: 0
|
private fun videoEnded() = mExoPlayer?.currentPosition ?: 0 >= mExoPlayer?.duration ?: 0
|
||||||
|
|
Loading…
Reference in a new issue