adding some fullscreen related UI improvements

This commit is contained in:
tibbi 2022-07-30 23:33:21 +02:00
parent a8293f46c4
commit 25d0d133eb
6 changed files with 35 additions and 25 deletions

View file

@ -78,7 +78,7 @@ android {
} }
dependencies { 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 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24'

View file

@ -118,7 +118,8 @@
android:name=".activities.ViewPagerActivity" android:name=".activities.ViewPagerActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true" android:exported="true"
android:parentActivityName=".activities.MediaActivity"> android:parentActivityName=".activities.MediaActivity"
android:theme="@style/TranslucentTheme">
<intent-filter> <intent-filter>
<action android:name="com.android.camera.action.REVIEW" /> <action android:name="com.android.camera.action.REVIEW" />
@ -158,13 +159,15 @@
<activity <activity
android:name=".activities.PhotoVideoActivity" android:name=".activities.PhotoVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false" /> android:exported="false"
android:theme="@style/TranslucentTheme" />
<activity <activity
android:name=".activities.VideoPlayerActivity" android:name=".activities.VideoPlayerActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false" android:exported="false"
android:parentActivityName=".activities.MediaActivity" /> android:parentActivityName=".activities.MediaActivity"
android:theme="@style/TranslucentTheme" />
<activity <activity
android:name=".activities.PanoramaPhotoActivity" android:name=".activities.PanoramaPhotoActivity"

View file

@ -39,10 +39,6 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
showTransparentTop = true showTransparentTop = true
showTransparentNavigation = true showTransparentNavigation = true
if (config.isUsingSystemTheme) {
setTheme(R.style.AppTheme_Material)
}
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.fragment_holder) setContentView(R.layout.fragment_holder)
if (checkAppSideloading()) { if (checkAppSideloading()) {
@ -95,6 +91,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE) navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE)
} }
updateMenuItemColors(fragment_viewer_toolbar.menu, forceWhiteIcons = true)
fragment_viewer_toolbar.setOnMenuItemClickListener { menuItem -> fragment_viewer_toolbar.setOnMenuItemClickListener { menuItem ->
if (mMedium == null || mUri == null) { if (mMedium == null || mUri == null) {
return@setOnMenuItemClickListener true return@setOnMenuItemClickListener true
@ -191,6 +188,12 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
} }
top_shadow.layoutParams.height = statusBarHeight + actionBarHeight 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() checkNotchSupport()
showSystemUI(true) showSystemUI(true)
val bundle = Bundle() val bundle = Bundle()
@ -279,6 +282,14 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
override fun onConfigurationChanged(newConfig: Configuration) { override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig) super.onConfigurationChanged(newConfig)
initBottomActionsLayout() 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) { private fun sendViewPagerIntent(path: String) {

View file

@ -59,7 +59,6 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
private var mIgnoreCloseDown = false private var mIgnoreCloseDown = false
public override fun onCreate(savedInstanceState: Bundle?) { public override fun onCreate(savedInstanceState: Bundle?) {
useDynamicTheme = false
showTransparentTop = true showTransparentTop = true
showTransparentNavigation = true showTransparentNavigation = true
@ -87,6 +86,12 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
} }
updateTextColors(video_player_holder) 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() { override fun onPause() {
@ -118,6 +123,7 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE) navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE)
} }
updateMenuItemColors(video_toolbar.menu, forceWhiteIcons = true)
video_toolbar.setOnMenuItemClickListener { menuItem -> video_toolbar.setOnMenuItemClickListener { menuItem ->
when (menuItem.itemId) { when (menuItem.itemId) {
R.id.menu_change_orientation -> changeOrientation() R.id.menu_change_orientation -> changeOrientation()
@ -141,6 +147,8 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
video_surface_frame.controller.resetState() video_surface_frame.controller.resetState()
} }
top_shadow.layoutParams.height = statusBarHeight + actionBarHeight
(video_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight
if (!portrait && navigationBarRight && navigationBarWidth > 0) { if (!portrait && navigationBarRight && navigationBarWidth > 0) {
video_toolbar.setPadding(0, 0, navigationBarWidth, 0) video_toolbar.setPadding(0, 0, navigationBarWidth, 0)
} else { } else {

View file

@ -88,14 +88,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private var mIgnoredPaths = ArrayList<String>() private var mIgnoredPaths = ArrayList<String>()
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
useDynamicTheme = false
showTransparentTop = true showTransparentTop = true
showTransparentNavigation = true showTransparentNavigation = true
if (config.isUsingSystemTheme) {
setTheme(R.style.AppTheme_Material)
}
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_medium) setContentView(R.layout.activity_medium)
setupOptionsMenu() setupOptionsMenu()
@ -227,6 +222,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE) navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE)
} }
updateMenuItemColors(medium_viewer_toolbar.menu, forceWhiteIcons = true)
medium_viewer_toolbar.setOnMenuItemClickListener { menuItem -> medium_viewer_toolbar.setOnMenuItemClickListener { menuItem ->
if (getCurrentMedium() == null) { if (getCurrentMedium() == null) {
return@setOnMenuItemClickListener true return@setOnMenuItemClickListener true
@ -290,6 +286,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
override fun onConfigurationChanged(newConfig: Configuration) { override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig) super.onConfigurationChanged(newConfig)
initBottomActionsLayout() initBottomActionsLayout()
(medium_viewer_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight
} }
private fun initViewPager() { private fun initViewPager() {

View file

@ -1,20 +1,11 @@
<resources> <resources>
<style name="AppTheme" parent="AppTheme.Base"/> <style name="AppTheme" parent="AppTheme.Base" />
<style name="AppTheme.Material" parent="AppTheme">
<item name="colorPrimary">@color/you_primary_color</item>
<item name="colorPrimaryDark">@color/you_primary_dark_color</item>
<item name="colorAccent">@color/you_primary_color</item>
<item name="actionOverflowMenuStyle">@style/TopPopupMenuYou</item>
<item name="actionBarPopupTheme">@style/TopPopupMenuTextYou</item>
<item name="actionBarStyle">@style/AppTheme.ActionBar</item>
</style>
<style name="FullScreenTheme.Base" parent="AppTheme"> <style name="FullScreenTheme.Base" parent="AppTheme">
<item name="android:windowContentOverlay">@null</item> <item name="android:windowContentOverlay">@null</item>
<item name="android:windowTranslucentNavigation">true</item> <item name="android:windowTranslucentNavigation">true</item>
</style> </style>
<style name="FullScreenTheme" parent="FullScreenTheme.Base"/> <style name="FullScreenTheme" parent="FullScreenTheme.Base" />
</resources> </resources>