Add assistant to the navbar

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-02-26 16:18:30 +01:00 committed by Alper Öztürk
parent 0a39df3e1c
commit c577a0550f
5 changed files with 49 additions and 1 deletions

View File

@ -542,6 +542,9 @@ 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) {
// TODO ADD JETPACK Compose PAGE
Log_OC.w(TAG, "ADD JETPACK Compose PAGE");
} else {
if (menuItem.getItemId() >= MENU_ITEM_EXTERNAL_LINK &&
menuItem.getItemId() <= MENU_ITEM_EXTERNAL_LINK + 100) {

View File

@ -74,9 +74,14 @@ import com.nextcloud.client.network.ClientFactory;
import com.nextcloud.client.network.ConnectivityService;
import com.nextcloud.client.preferences.AppPreferences;
import com.nextcloud.client.utils.IntentUtil;
import com.nextcloud.common.NextcloudClient;
import com.nextcloud.java.util.Optional;
import com.nextcloud.model.WorkerState;
import com.nextcloud.model.WorkerStateLiveData;
import com.nextcloud.operations.assistant.AssistantRepository;
import com.nextcloud.operations.assistant.model.CreatedTask;
import com.nextcloud.operations.assistant.model.Ocs;
import com.nextcloud.operations.assistant.model.TaskTypes;
import com.nextcloud.utils.extensions.BundleExtensionsKt;
import com.nextcloud.utils.extensions.IntentExtensionsKt;
import com.nextcloud.utils.view.FastScrollUtils;
@ -150,7 +155,6 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Stack;
import javax.inject.Inject;

View File

@ -0,0 +1,32 @@
<!--
~ Nextcloud Android client application
~
~ @author Alper Ozturk
~ Copyright (C) 2024 Alper Ozturk
~ Copyright (C) 2024 Nextcloud GmbH
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="1dp"
android:height="1dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M9,4.5a0.75,0.75 0,0 1,0.721 0.544l0.813,2.846a3.75,3.75 0,0 0,2.576 2.576l2.846,0.813a0.75,0.75 0,0 1,0 1.442l-2.846,0.813a3.75,3.75 0,0 0,-2.576 2.576l-0.813,2.846a0.75,0.75 0,0 1,-1.442 0l-0.813,-2.846a3.75,3.75 0,0 0,-2.576 -2.576l-2.846,-0.813a0.75,0.75 0,0 1,0 -1.442l2.846,-0.813A3.75,3.75 0,0 0,7.466 7.89l0.813,-2.846A0.75,0.75 0,0 1,9 4.5ZM18,1.5a0.75,0.75 0,0 1,0.728 0.568l0.258,1.036c0.236,0.94 0.97,1.674 1.91,1.91l1.036,0.258a0.75,0.75 0,0 1,0 1.456l-1.036,0.258c-0.94,0.236 -1.674,0.97 -1.91,1.91l-0.258,1.036a0.75,0.75 0,0 1,-1.456 0l-0.258,-1.036a2.625,2.625 0,0 0,-1.91 -1.91l-1.036,-0.258a0.75,0.75 0,0 1,0 -1.456l1.036,-0.258a2.625,2.625 0,0 0,1.91 -1.91l0.258,-1.036A0.75,0.75 0,0 1,18 1.5ZM16.5,15a0.75,0.75 0,0 1,0.712 0.513l0.394,1.183c0.15,0.447 0.5,0.799 0.948,0.948l1.183,0.395a0.75,0.75 0,0 1,0 1.422l-1.183,0.395c-0.447,0.15 -0.799,0.5 -0.948,0.948l-0.395,1.183a0.75,0.75 0,0 1,-1.422 0l-0.395,-1.183a1.5,1.5 0,0 0,-0.948 -0.948l-1.183,-0.395a0.75,0.75 0,0 1,0 -1.422l1.183,-0.395c0.447,-0.15 0.799,-0.5 0.948,-0.948l0.395,-1.183A0.75,0.75 0,0 1,16.5 15Z"
android:strokeWidth="0"
android:fillColor="#FF000000"
android:fillType="evenOdd"/>
</vector>

View File

@ -25,11 +25,18 @@
<group
android:id="@+id/drawer_menu_standard"
android:checkableBehavior="single">
<item
android:id="@+id/nav_assistant"
android:icon="@drawable/ic_assistant"
android:orderInCategory="0"
android:title="@string/drawer_item_assistant" />
<item
android:id="@+id/nav_all_files"
android:icon="@drawable/all_files"
android:orderInCategory="0"
android:title="@string/drawer_item_all_files" />
<item
android:id="@+id/nav_personal_files"
android:icon="@drawable/ic_user"

View File

@ -18,6 +18,8 @@
<string name="menu_item_sort_by_size_biggest_first">Biggest first</string>
<string name="menu_item_sort_by_size_smallest_first">Smallest first</string>
<string name="drawer_item_assistant">Assistant</string>
<string name="drawer_item_all_files">All files</string>
<string name="drawer_item_personal_files">Personal files</string>
<string name="drawer_item_home">Home</string>