diff --git a/app/build.gradle b/app/build.gradle index 651c3380b..6b912188f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -78,7 +78,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:febce24496' + implementation 'com.github.SimpleMobileTools:Simple-Commons:7f819f8a75' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 41cd0fbae..9c0c20529 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -118,7 +118,8 @@ android:name=".activities.ViewPagerActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:exported="true" - android:parentActivityName=".activities.MediaActivity"> + android:parentActivityName=".activities.MediaActivity" + android:theme="@style/TranslucentTheme"> @@ -158,13 +159,15 @@ + android:exported="false" + android:theme="@style/TranslucentTheme" /> + android:parentActivityName=".activities.MediaActivity" + android:theme="@style/TranslucentTheme" /> if (mMedium == null || mUri == null) { return@setOnMenuItemClickListener true @@ -191,6 +188,12 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList } top_shadow.layoutParams.height = statusBarHeight + actionBarHeight + if (!portrait && navigationBarRight && navigationBarWidth > 0) { + fragment_viewer_toolbar.setPadding(0, 0, navigationBarWidth, 0) + } else { + fragment_viewer_toolbar.setPadding(0, 0, 0, 0) + } + checkNotchSupport() showSystemUI(true) val bundle = Bundle() @@ -279,6 +282,14 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) initBottomActionsLayout() + + top_shadow.layoutParams.height = statusBarHeight + actionBarHeight + (fragment_viewer_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight + if (!portrait && navigationBarRight && navigationBarWidth > 0) { + fragment_viewer_toolbar.setPadding(0, 0, navigationBarWidth, 0) + } else { + fragment_viewer_toolbar.setPadding(0, 0, 0, 0) + } } private fun sendViewPagerIntent(path: String) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index 6ac7e5994..62e218dee 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -59,7 +59,6 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen private var mIgnoreCloseDown = false public override fun onCreate(savedInstanceState: Bundle?) { - useDynamicTheme = false showTransparentTop = true showTransparentNavigation = true @@ -87,6 +86,12 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen } updateTextColors(video_player_holder) + + if (!portrait && navigationBarRight && navigationBarWidth > 0) { + video_toolbar.setPadding(0, 0, navigationBarWidth, 0) + } else { + video_toolbar.setPadding(0, 0, 0, 0) + } } override fun onPause() { @@ -118,6 +123,7 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE) } + updateMenuItemColors(video_toolbar.menu, forceWhiteIcons = true) video_toolbar.setOnMenuItemClickListener { menuItem -> when (menuItem.itemId) { R.id.menu_change_orientation -> changeOrientation() @@ -141,6 +147,8 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen video_surface_frame.controller.resetState() } + top_shadow.layoutParams.height = statusBarHeight + actionBarHeight + (video_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight if (!portrait && navigationBarRight && navigationBarWidth > 0) { video_toolbar.setPadding(0, 0, navigationBarWidth, 0) } else { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index e7423f9d3..baa597763 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -88,14 +88,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private var mIgnoredPaths = ArrayList() override fun onCreate(savedInstanceState: Bundle?) { - useDynamicTheme = false showTransparentTop = true showTransparentNavigation = true - if (config.isUsingSystemTheme) { - setTheme(R.style.AppTheme_Material) - } - super.onCreate(savedInstanceState) setContentView(R.layout.activity_medium) setupOptionsMenu() @@ -227,6 +222,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE) } + updateMenuItemColors(medium_viewer_toolbar.menu, forceWhiteIcons = true) medium_viewer_toolbar.setOnMenuItemClickListener { menuItem -> if (getCurrentMedium() == null) { return@setOnMenuItemClickListener true @@ -290,6 +286,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) initBottomActionsLayout() + (medium_viewer_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight } private fun initViewPager() { diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 1db84e47d..d6a419858 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,20 +1,11 @@ - + -