diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 31a23202a..2a92a42c0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -80,7 +80,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_medium) - setTranslucentNavigation() mMediaFiles = MediaActivity.mMedia.clone() as ArrayList handlePermission(PERMISSION_WRITE_STORAGE) { @@ -95,6 +94,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View storeStateVariables() } + @TargetApi(Build.VERSION_CODES.LOLLIPOP) override fun onResume() { super.onResume() if (!hasPermission(PERMISSION_WRITE_STORAGE)) { @@ -102,6 +102,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return } + if (config.bottomActions) { + if (isLollipopPlus()) { + window.navigationBarColor = Color.TRANSPARENT + } + } else { + setTranslucentNavigation() + } + if (mStoredReplaceZoomableImages != config.replaceZoomableImages) { mPrevHashcode = 0 refreshViewPager() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 84baf6b4c..6dcf9a864 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -51,6 +51,7 @@ class PhotoFragment : ViewPagerFragment() { private var storedShowExtendedDetails = false private var storedHideExtendedDetails = false + private var storedBottomActions = false private var storedExtendedDetails = 0 lateinit var view: ViewGroup @@ -116,7 +117,8 @@ class PhotoFragment : ViewPagerFragment() { isFullscreen = activity!!.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_FULLSCREEN == View.SYSTEM_UI_FLAG_FULLSCREEN loadImage() - checkExtendedDetails() + initExtendedDetails() + initBottomActions() wasInit = true return view @@ -130,7 +132,11 @@ class PhotoFragment : ViewPagerFragment() { override fun onResume() { super.onResume() if (wasInit && (context!!.config.showExtendedDetails != storedShowExtendedDetails || context!!.config.extendedDetails != storedExtendedDetails)) { - checkExtendedDetails() + initExtendedDetails() + } + + if (wasInit && (context!!.config.bottomActions != storedBottomActions)) { + initBottomActions() } val allowPhotoGestures = context!!.config.allowPhotoGestures @@ -162,6 +168,7 @@ class PhotoFragment : ViewPagerFragment() { storedShowExtendedDetails = showExtendedDetails storedHideExtendedDetails = hideExtendedDetails storedExtendedDetails = extendedDetails + storedBottomActions = bottomActions } } @@ -376,7 +383,7 @@ class PhotoFragment : ViewPagerFragment() { loadBitmap(degrees) } - private fun checkExtendedDetails() { + private fun initExtendedDetails() { if (context!!.config.showExtendedDetails) { view.photo_details.apply { beInvisible() // make it invisible so we can measure it, but not show yet @@ -397,6 +404,14 @@ class PhotoFragment : ViewPagerFragment() { } } + private fun initBottomActions() { + if (context!!.config.bottomActions) { + view.bottom_actions.beVisible() + } else { + view.bottom_actions.beGone() + } + } + override fun onDestroyView() { super.onDestroyView() if (activity?.isActivityDestroyed() == false) { @@ -408,7 +423,8 @@ class PhotoFragment : ViewPagerFragment() { override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) loadImage() - checkExtendedDetails() + initExtendedDetails() + initBottomActions() } private fun photoClicked() { @@ -426,6 +442,10 @@ class PhotoFragment : ViewPagerFragment() { } } } + + if (storedBottomActions) { + view.bottom_actions.animate().alpha(if (isFullscreen) 0f else 1f).start() + } } private fun getExtendedDetailsY(height: Int): Float { diff --git a/app/src/main/res/drawable/gradient_background_lighter.xml b/app/src/main/res/drawable/gradient_background_lighter.xml new file mode 100644 index 000000000..ba3477dc5 --- /dev/null +++ b/app/src/main/res/drawable/gradient_background_lighter.xml @@ -0,0 +1,7 @@ + + + + diff --git a/app/src/main/res/layout/pager_photo_item.xml b/app/src/main/res/layout/pager_photo_item.xml index deb877e71..85765aa38 100644 --- a/app/src/main/res/layout/pager_photo_item.xml +++ b/app/src/main/res/layout/pager_photo_item.xml @@ -68,4 +68,14 @@ android:layout_alignParentEnd="true" android:layout_alignParentRight="true"/> + + + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 0a0cdcd24..3771a2dbc 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -10,4 +10,5 @@ 60dp 30dp 72dp + 110dp