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 8c812791ad..008312b7c6 100644 --- a/app/src/main/java/com/nextcloud/ui/composeActivity/ComposeActivity.kt +++ b/app/src/main/java/com/nextcloud/ui/composeActivity/ComposeActivity.kt @@ -53,7 +53,6 @@ class ComposeActivity : DrawerActivity() { companion object { const val DESTINATION = "DESTINATION" const val TITLE = "TITLE" - const val MENU_ITEM = "MENU_ITEM" } override fun onCreate(savedInstanceState: Bundle?) { @@ -63,13 +62,10 @@ class ComposeActivity : DrawerActivity() { val destination = intent.getSerializableArgument(DESTINATION, ComposeDestination::class.java) val titleId = intent.getIntExtra(TITLE, R.string.empty) - val menuItemId = intent.getIntExtra(MENU_ITEM, R.id.nav_assistant) setupToolbar() updateActionBarTitleAndHomeButtonByString(getString(titleId)) - setupDrawer(menuItemId) - binding.composeView.setContent { MaterialTheme( colorScheme = viewThemeUtils.getColorScheme(this), @@ -80,11 +76,6 @@ class ComposeActivity : DrawerActivity() { } } - override fun onResume() { - super.onResume() - setDrawerMenuItemChecked(R.id.nav_assistant) - } - 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 3ba730fcea..5257411942 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 @@ -362,12 +362,14 @@ public abstract class DrawerActivity extends ToolbarActivity LinearLayout[] views = { ecosystemApps.findViewById(R.id.drawer_ecosystem_notes), ecosystemApps.findViewById(R.id.drawer_ecosystem_talk), - ecosystemApps.findViewById(R.id.drawer_ecosystem_more) + ecosystemApps.findViewById(R.id.drawer_ecosystem_more), + ecosystemApps.findViewById(R.id.drawer_ecosystem_assistant), }; views[0].setOnClickListener(v -> openAppOrStore("it.niedermann.owncloud.notes")); views[1].setOnClickListener(v -> openAppOrStore("com.nextcloud.talk2")); views[2].setOnClickListener(v -> openAppStore("Nextcloud", true)); + views[3].setOnClickListener(v -> startComposeActivity(ComposeDestination.AssistantScreen, R.string.assistant_screen_top_bar_title)); int iconColor; if (Hct.fromInt(primaryColor).getTone() < 80.0) { @@ -468,7 +470,6 @@ public abstract class DrawerActivity extends ToolbarActivity DrawerMenuUtil.filterSearchMenuItems(menu, user, getResources()); DrawerMenuUtil.filterTrashbinMenuItem(menu, capability); DrawerMenuUtil.filterActivityMenuItem(menu, capability); - DrawerMenuUtil.filterAssistantMenuItem(menu, capability); DrawerMenuUtil.filterGroupfoldersMenuItem(menu, capability); DrawerMenuUtil.setupHomeMenuItem(menu, getResources()); @@ -545,8 +546,6 @@ public abstract class DrawerActivity extends ToolbarActivity intent.setAction(FileDisplayActivity.LIST_GROUPFOLDERS); intent.putExtra(FileDisplayActivity.DRAWER_MENU_ID, menuItem.getItemId()); startActivity(intent); - } else if (itemId == R.id.nav_assistant) { - startComposeActivity(ComposeDestination.AssistantScreen, R.string.assistant_screen_top_bar_title, itemId); } else { if (menuItem.getItemId() >= MENU_ITEM_EXTERNAL_LINK && menuItem.getItemId() <= MENU_ITEM_EXTERNAL_LINK + 100) { @@ -558,11 +557,10 @@ public abstract class DrawerActivity extends ToolbarActivity } } - private void startComposeActivity(ComposeDestination destination, int titleId, int menuItemId) { + private void startComposeActivity(ComposeDestination destination, int titleId) { Intent composeActivity = new Intent(getApplicationContext(), ComposeActivity.class); composeActivity.putExtra(ComposeActivity.DESTINATION, destination); composeActivity.putExtra(ComposeActivity.TITLE, titleId); - composeActivity.putExtra(ComposeActivity.MENU_ITEM, menuItemId); startActivity(composeActivity); } diff --git a/app/src/main/java/com/owncloud/android/utils/DrawerMenuUtil.java b/app/src/main/java/com/owncloud/android/utils/DrawerMenuUtil.java index a09099800e..8ac2280a87 100644 --- a/app/src/main/java/com/owncloud/android/utils/DrawerMenuUtil.java +++ b/app/src/main/java/com/owncloud/android/utils/DrawerMenuUtil.java @@ -64,12 +64,6 @@ public final class DrawerMenuUtil { } } - public static void filterAssistantMenuItem(Menu menu, @Nullable OCCapability capability) { - if (capability != null && !capability.getAssistant().isTrue()) { - filterMenuItems(menu, R.id.nav_assistant); - } - } - public static void filterGroupfoldersMenuItem(Menu menu, @Nullable OCCapability capability) { if (capability != null && !capability.getGroupfolders().isTrue()) { filterMenuItems(menu, R.id.nav_groupfolders); diff --git a/app/src/main/res/layout/drawer_header.xml b/app/src/main/res/layout/drawer_header.xml index 8ec80c5da5..f4f07bf5c6 100644 --- a/app/src/main/res/layout/drawer_header.xml +++ b/app/src/main/res/layout/drawer_header.xml @@ -71,6 +71,37 @@ android:layout_marginBottom="@dimen/standard_half_margin" android:orientation="horizontal"> + + + + + + + + - - Biggest first Smallest first + Assistant + Assistant Task List are loading, please wait No task available. Select a task type to create a new task.