INNER CODE UNIT · Kotlin
onDrawerStateChanged
fumiama/copymanga · app/src/main/java/top/fumiama/copymanga/MainActivity.kt:141
override fun onDrawerStateChanged(newState: Int) {}
})
lifecycleScope.launch { goCheckUpdate(false) }
ime = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
var latestDestination: Int
navController!!.addOnDestinationChangedListener { controller, destination, _ ->
latestDestination = destination.id
Log.d("MyMain", "latestDestination: ${destination.label}")
if (isMenuWaiting) {
return@addOnDestinationChangedListener
}
if (latestDestination !in appBarConfiguration.topLevelDestinations) {
drawer_layout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED)
} else {
drawer_layout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED)
}