Fix navigation drawer predictive back

This commit is contained in:
tarsin committed 2023-06-17 23:26:22 +08:00
1 parent 2b520be693
commit 0d3c942984
2 files changed
-11

No files matched your search

-1
View File
@@ -185,7 +185,6 @@ dependencies {
implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10")
implementation("androidx.coordinatorlayout:coordinatorlayout:1.2.0")
implementation("androidx.drawerlayout:drawerlayout:1.2.0")
implementation("androidx.fragment:fragment-ktx:1.7.0-alpha01")
// https://developer.android.com/jetpack/androidx/releases/lifecycle
implementation("androidx.lifecycle:lifecycle-process:2.6.1")
@@ -102,16 +102,6 @@ class MainActivity : EhActivity() {
}
}
@Suppress("OVERRIDE_DEPRECATION")
override fun onBackPressed() {
val isDrawerOpen = binding.drawView.isDrawerOpen(GravityCompat.START) or binding.drawView.isDrawerOpen(GravityCompat.END)
if (isDrawerOpen) {
binding.drawView.closeDrawers()
} else {
super.onBackPressed()
}
}
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
lifecycleScope.launchUI {