From 54203212078fd725120c71b51a51b9c084dc3eb4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 4 Jul 2018 19:54:51 +0200 Subject: [PATCH] show the bottom gradient at video fragment only if bottom actions are disabled --- .../gallery/fragments/VideoFragment.kt | 10 ++++++---- app/src/main/res/layout/pager_video_item.xml | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 0f5ee02f6..322346b97 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -177,8 +177,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S override fun onResume() { super.onResume() activity!!.updateTextColors(mView!!.video_holder) - val allowVideoGestures = context!!.config.allowVideoGestures - val allowInstantChange = context!!.config.allowInstantChange + val config = context!!.config + val allowVideoGestures = config.allowVideoGestures + val allowInstantChange = config.allowInstantChange mView!!.apply { video_volume_controller.beVisibleIf(allowVideoGestures) video_brightness_controller.beVisibleIf(allowVideoGestures) @@ -187,14 +188,15 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S instant_next_item.beVisibleIf(allowInstantChange) } - if (context!!.config.showExtendedDetails != mStoredShowExtendedDetails || context!!.config.extendedDetails != mStoredExtendedDetails) { + if (config.showExtendedDetails != mStoredShowExtendedDetails || config.extendedDetails != mStoredExtendedDetails) { checkExtendedDetails() } - if (context!!.config.bottomActions != mStoredBottomActions) { + if (config.bottomActions != mStoredBottomActions) { initTimeHolder() } + mView!!.video_time_holder.setBackgroundResource(if (config.bottomActions) 0 else R.drawable.gradient_background) storeStateVariables() } diff --git a/app/src/main/res/layout/pager_video_item.xml b/app/src/main/res/layout/pager_video_item.xml index 03014aa82..3845d13e4 100644 --- a/app/src/main/res/layout/pager_video_item.xml +++ b/app/src/main/res/layout/pager_video_item.xml @@ -80,8 +80,7 @@ android:id="@+id/video_time_holder" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:background="@drawable/gradient_background"> + android:layout_alignParentBottom="true">