diff --git a/app/src/main/java/com/nextcloud/ui/composeActivity/ComposeActivity.kt b/app/src/main/java/com/nextcloud/ui/composeActivity/ComposeActivity.kt index 68870d1c70..0ccd6fb787 100644 --- a/app/src/main/java/com/nextcloud/ui/composeActivity/ComposeActivity.kt +++ b/app/src/main/java/com/nextcloud/ui/composeActivity/ComposeActivity.kt @@ -10,7 +10,6 @@ package com.nextcloud.ui.composeActivity import android.content.Context import android.os.Bundle import android.view.MenuItem -import androidx.activity.OnBackPressedCallback import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -56,8 +55,6 @@ class ComposeActivity : DrawerActivity() { openDrawer() } - handleOnBackPressed() - binding.composeView.setContent { MaterialTheme( colorScheme = viewThemeUtils.getColorScheme(this), @@ -68,20 +65,6 @@ class ComposeActivity : DrawerActivity() { } } - // FIXME: show previous screen - private val onBackPressedCallback = object : OnBackPressedCallback(true) { - override fun handleOnBackPressed() { - finish() - } - } - - private fun handleOnBackPressed() { - onBackPressedDispatcher.addCallback( - this, - onBackPressedCallback - ) - } - override fun onOptionsItemSelected(item: MenuItem): Boolean { return when (item.itemId) { android.R.id.home -> { diff --git a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java index 3f2a5ff72d..217c9edffb 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java @@ -262,6 +262,7 @@ public abstract class DrawerActivity extends ToolbarActivity if (this instanceof FileDisplayActivity fda) { fda.browseToRoot(); } + EventBus.getDefault().post(new ChangeMenuEvent()); } else if (menuItemId == R.id.nav_favorites) { handleSearchEvents(new SearchEvent("", SearchRemoteOperation.SearchType.FAVORITE_SEARCH), menuItemId); } else if (menuItemId == R.id.nav_assistant && !(this instanceof ComposeActivity)) {