Skip to content

Commit 25d0d13

Browse files
committed
adding some fullscreen related UI improvements
1 parent a8293f4 commit 25d0d13

File tree

6 files changed

+35
-25
lines changed

6 files changed

+35
-25
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ android {
7878
}
7979

8080
dependencies {
81-
implementation 'com.github.SimpleMobileTools:Simple-Commons:febce24496'
81+
implementation 'com.github.SimpleMobileTools:Simple-Commons:7f819f8a75'
8282
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
8383
implementation 'it.sephiroth.android.exif:library:1.0.1'
8484
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24'

app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@
118118
android:name=".activities.ViewPagerActivity"
119119
android:configChanges="orientation|keyboardHidden|screenSize"
120120
android:exported="true"
121-
android:parentActivityName=".activities.MediaActivity">
121+
android:parentActivityName=".activities.MediaActivity"
122+
android:theme="@style/TranslucentTheme">
122123

123124
<intent-filter>
124125
<action android:name="com.android.camera.action.REVIEW" />
@@ -158,13 +159,15 @@
158159
<activity
159160
android:name=".activities.PhotoVideoActivity"
160161
android:configChanges="orientation|keyboardHidden|screenSize"
161-
android:exported="false" />
162+
android:exported="false"
163+
android:theme="@style/TranslucentTheme" />
162164

163165
<activity
164166
android:name=".activities.VideoPlayerActivity"
165167
android:configChanges="orientation|keyboardHidden|screenSize"
166168
android:exported="false"
167-
android:parentActivityName=".activities.MediaActivity" />
169+
android:parentActivityName=".activities.MediaActivity"
170+
android:theme="@style/TranslucentTheme" />
168171

169172
<activity
170173
android:name=".activities.PanoramaPhotoActivity"

app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
3939
showTransparentTop = true
4040
showTransparentNavigation = true
4141

42-
if (config.isUsingSystemTheme) {
43-
setTheme(R.style.AppTheme_Material)
44-
}
45-
4642
super.onCreate(savedInstanceState)
4743
setContentView(R.layout.fragment_holder)
4844
if (checkAppSideloading()) {
@@ -95,6 +91,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
9591
navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE)
9692
}
9793

94+
updateMenuItemColors(fragment_viewer_toolbar.menu, forceWhiteIcons = true)
9895
fragment_viewer_toolbar.setOnMenuItemClickListener { menuItem ->
9996
if (mMedium == null || mUri == null) {
10097
return@setOnMenuItemClickListener true
@@ -191,6 +188,12 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
191188
}
192189

193190
top_shadow.layoutParams.height = statusBarHeight + actionBarHeight
191+
if (!portrait && navigationBarRight && navigationBarWidth > 0) {
192+
fragment_viewer_toolbar.setPadding(0, 0, navigationBarWidth, 0)
193+
} else {
194+
fragment_viewer_toolbar.setPadding(0, 0, 0, 0)
195+
}
196+
194197
checkNotchSupport()
195198
showSystemUI(true)
196199
val bundle = Bundle()
@@ -279,6 +282,14 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
279282
override fun onConfigurationChanged(newConfig: Configuration) {
280283
super.onConfigurationChanged(newConfig)
281284
initBottomActionsLayout()
285+
286+
top_shadow.layoutParams.height = statusBarHeight + actionBarHeight
287+
(fragment_viewer_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight
288+
if (!portrait && navigationBarRight && navigationBarWidth > 0) {
289+
fragment_viewer_toolbar.setPadding(0, 0, navigationBarWidth, 0)
290+
} else {
291+
fragment_viewer_toolbar.setPadding(0, 0, 0, 0)
292+
}
282293
}
283294

284295
private fun sendViewPagerIntent(path: String) {

app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
5959
private var mIgnoreCloseDown = false
6060

6161
public override fun onCreate(savedInstanceState: Bundle?) {
62-
useDynamicTheme = false
6362
showTransparentTop = true
6463
showTransparentNavigation = true
6564

@@ -87,6 +86,12 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
8786
}
8887

8988
updateTextColors(video_player_holder)
89+
90+
if (!portrait && navigationBarRight && navigationBarWidth > 0) {
91+
video_toolbar.setPadding(0, 0, navigationBarWidth, 0)
92+
} else {
93+
video_toolbar.setPadding(0, 0, 0, 0)
94+
}
9095
}
9196

9297
override fun onPause() {
@@ -118,6 +123,7 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
118123
navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE)
119124
}
120125

126+
updateMenuItemColors(video_toolbar.menu, forceWhiteIcons = true)
121127
video_toolbar.setOnMenuItemClickListener { menuItem ->
122128
when (menuItem.itemId) {
123129
R.id.menu_change_orientation -> changeOrientation()
@@ -141,6 +147,8 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
141147
video_surface_frame.controller.resetState()
142148
}
143149

150+
top_shadow.layoutParams.height = statusBarHeight + actionBarHeight
151+
(video_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight
144152
if (!portrait && navigationBarRight && navigationBarWidth > 0) {
145153
video_toolbar.setPadding(0, 0, navigationBarWidth, 0)
146154
} else {

app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
8888
private var mIgnoredPaths = ArrayList<String>()
8989

9090
override fun onCreate(savedInstanceState: Bundle?) {
91-
useDynamicTheme = false
9291
showTransparentTop = true
9392
showTransparentNavigation = true
9493

95-
if (config.isUsingSystemTheme) {
96-
setTheme(R.style.AppTheme_Material)
97-
}
98-
9994
super.onCreate(savedInstanceState)
10095
setContentView(R.layout.activity_medium)
10196
setupOptionsMenu()
@@ -227,6 +222,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
227222
navigationIcon = resources.getColoredDrawableWithColor(R.drawable.ic_arrow_left_vector, Color.WHITE)
228223
}
229224

225+
updateMenuItemColors(medium_viewer_toolbar.menu, forceWhiteIcons = true)
230226
medium_viewer_toolbar.setOnMenuItemClickListener { menuItem ->
231227
if (getCurrentMedium() == null) {
232228
return@setOnMenuItemClickListener true
@@ -290,6 +286,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
290286
override fun onConfigurationChanged(newConfig: Configuration) {
291287
super.onConfigurationChanged(newConfig)
292288
initBottomActionsLayout()
289+
(medium_viewer_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight
293290
}
294291

295292
private fun initViewPager() {

app/src/main/res/values/styles.xml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
<resources>
22

3-
<style name="AppTheme" parent="AppTheme.Base"/>
4-
5-
<style name="AppTheme.Material" parent="AppTheme">
6-
<item name="colorPrimary">@color/you_primary_color</item>
7-
<item name="colorPrimaryDark">@color/you_primary_dark_color</item>
8-
<item name="colorAccent">@color/you_primary_color</item>
9-
<item name="actionOverflowMenuStyle">@style/TopPopupMenuYou</item>
10-
<item name="actionBarPopupTheme">@style/TopPopupMenuTextYou</item>
11-
<item name="actionBarStyle">@style/AppTheme.ActionBar</item>
12-
</style>
3+
<style name="AppTheme" parent="AppTheme.Base" />
134

145
<style name="FullScreenTheme.Base" parent="AppTheme">
156
<item name="android:windowContentOverlay">@null</item>
167
<item name="android:windowTranslucentNavigation">true</item>
178
</style>
189

19-
<style name="FullScreenTheme" parent="FullScreenTheme.Base"/>
10+
<style name="FullScreenTheme" parent="FullScreenTheme.Base" />
2011
</resources>

0 commit comments

Comments
 (0)