File tree 1 file changed +20
-0
lines changed
app/src/main/java/com/infomaniak/mail/ui
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -433,11 +433,31 @@ class MainActivity : BaseActivity() {
433
433
SentryDebug .addNavigationBreadcrumb(destination.displayName, arguments)
434
434
trackDestination(destination)
435
435
436
+ updateColorsWhenDestinationChanged()
436
437
setDrawerLockMode(isLocked = destination.id != R .id.threadListFragment)
437
438
438
439
previousDestinationId = destination.id
439
440
}
440
441
442
+ private fun updateColorsWhenDestinationChanged () {
443
+ when (previousDestinationId) {
444
+ R .id.threadActionsBottomSheetDialog,
445
+ R .id.messageActionsBottomSheetDialog,
446
+ R .id.replyBottomSheetDialog,
447
+ R .id.detailedContactBottomSheetDialog -> {
448
+ val fragment = currentFragment
449
+ if (fragment is TwoPaneFragment ) {
450
+ val navigationBarColor = if (fragment.isThreadOpen() && ! canDisplayBothPanes()) {
451
+ R .color.elevatedBackground
452
+ } else {
453
+ R .color.backgroundColor
454
+ }
455
+ window.updateNavigationBarColor(getColor(navigationBarColor))
456
+ }
457
+ }
458
+ }
459
+ }
460
+
441
461
fun setDrawerLockMode (isLocked : Boolean ) {
442
462
val drawerLockMode = if (isLocked) DrawerLayout .LOCK_MODE_LOCKED_CLOSED else DrawerLayout .LOCK_MODE_UNLOCKED
443
463
binding.drawerLayout.setDrawerLockMode(drawerLockMode)
You can’t perform that action at this time.
0 commit comments