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 25, 2024
1 parent 9120441 commit 41e7e13
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 @@ -434,7 +434,7 @@ class MainActivity : BaseActivity() {
trackDestination(destination)

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

previousDestinationId = destination.id
}
Expand Down Expand Up @@ -468,8 +468,8 @@ class MainActivity : BaseActivity() {
}
}

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 41e7e13

Please sign in to comment.