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 {
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'

View file

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

View file

@ -39,10 +39,6 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
showTransparentTop = true
showTransparentNavigation = true
if (config.isUsingSystemTheme) {
setTheme(R.style.AppTheme_Material)
}
super.onCreate(savedInstanceState)
setContentView(R.layout.fragment_holder)
if (checkAppSideloading()) {
@ -95,6 +91,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE)
}
updateMenuItemColors(fragment_viewer_toolbar.menu, forceWhiteIcons = true)
fragment_viewer_toolbar.setOnMenuItemClickListener { menuItem ->
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) {

View file

@ -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 {

View file

@ -88,14 +88,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private var mIgnoredPaths = ArrayList<String>()
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() {

View file

@ -1,20 +1,11 @@
<resources>
<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="AppTheme" parent="AppTheme.Base" />
<style name="FullScreenTheme.Base" parent="AppTheme">
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
<style name="FullScreenTheme" parent="FullScreenTheme.Base"/>
<style name="FullScreenTheme" parent="FullScreenTheme.Base" />
</resources>