Skip to content

Commit

Permalink
Invert setDrawerLockMode() parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Jan 23, 2024
1 parent 8436edc commit 578429e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,13 @@ class MainActivity : BaseActivity() {
SentryDebug.addNavigationBreadcrumb(destination.displayName, arguments)
trackDestination(destination)

setDrawerLockMode(destination.id == R.id.threadListFragment)
setDrawerLockMode(isLocked = destination.id != R.id.threadListFragment)

previousDestinationId = destination.id
}

fun setDrawerLockMode(isUnlocked: Boolean) {
val drawerLockMode = if (isUnlocked) DrawerLayout.LOCK_MODE_UNLOCKED else DrawerLayout.LOCK_MODE_LOCKED_CLOSED
fun setDrawerLockMode(isLocked: Boolean) {
val drawerLockMode = if (isLocked) DrawerLayout.LOCK_MODE_LOCKED_CLOSED else DrawerLayout.LOCK_MODE_UNLOCKED
binding.drawerLayout.setDrawerLockMode(drawerLockMode)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class ThreadListMultiSelection {
}

private fun lockDrawerAndSwipe(isMultiSelectOn: Boolean) = with(threadListFragment) {
(requireActivity() as MainActivity).setDrawerLockMode(!isMultiSelectOn)
(requireActivity() as MainActivity).setDrawerLockMode(isLocked = isMultiSelectOn)
if (isMultiSelectOn) {
binding.threadsList.apply {
disableSwipeDirection(DirectionFlag.LEFT)
Expand Down

0 comments on commit 578429e

Please sign in to comment.