mirror of
https://github.com/nextcloud/android.git
synced 2024-12-21 08:24:08 +03:00
Merge pull request #14196 from nextcloud/feature/add-bottom-bar-to-assistant-screen
Feature - Add Bottom Nav Bar To The Assistant Screen
This commit is contained in:
commit
cd6ec5ff7c
3 changed files with 20 additions and 6 deletions
|
@ -84,6 +84,9 @@ class ComposeActivity : DrawerActivity() {
|
|||
}
|
||||
|
||||
if (destination == ComposeDestination.AssistantScreen) {
|
||||
val assistantMenuItem = binding.bottomNavigation.menu.findItem(R.id.nav_assistant)
|
||||
assistantMenuItem.setChecked(true)
|
||||
|
||||
nextcloudClient?.let { client ->
|
||||
AssistantScreen(
|
||||
viewModel = AssistantViewModel(
|
||||
|
|
|
@ -262,9 +262,10 @@ 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) {
|
||||
} else if (menuItemId == R.id.nav_assistant && !(this instanceof ComposeActivity)) {
|
||||
startComposeActivity(ComposeDestination.AssistantScreen, R.string.assistant_screen_top_bar_title);
|
||||
} else if (menuItemId == R.id.nav_gallery) {
|
||||
startPhotoSearch(menuItem.getItemId());
|
||||
|
@ -949,7 +950,7 @@ public abstract class DrawerActivity extends ToolbarActivity
|
|||
if (bottomNavigationView != null) {
|
||||
MenuItem menuItem = bottomNavigationView.getMenu().findItem(menuItemId);
|
||||
|
||||
// Don't highlight assistant bottom navigation item because Assistant screen doesn't have bottom navigation bar
|
||||
// Don't highlight assistant bottom navigation item because Assistant screen doesn't have same bottom navigation bar
|
||||
if (menuItem != null && !menuItem.isChecked() && menuItem.getItemId() != R.id.nav_assistant) {
|
||||
menuItem.setChecked(true);
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
~ SPDX-FileCopyrightText: 2024 Nextcloud GmbH
|
||||
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
||||
-->
|
||||
<androidx.drawerlayout.widget.DrawerLayout
|
||||
android:id="@+id/drawer_layout"
|
||||
<androidx.drawerlayout.widget.DrawerLayout android:id="@+id/drawer_layout"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
android:focusable="true"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -24,7 +24,17 @@
|
|||
<androidx.compose.ui.platform.ComposeView
|
||||
android:id="@+id/compose_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/bottom_navigation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
app:labelVisibilityMode="labeled"
|
||||
app:menu="@menu/bottom_navigation_menu"
|
||||
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
Loading…
Reference in a new issue