diff options
author | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2023-06-09 06:34:09 +0000 |
---|---|---|
committer | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2023-06-09 06:34:09 +0000 |
commit | 74b9860784913c097ae59e58b0958da7744ebc2e (patch) | |
tree | 29f4f655f6ac71a0da40bc50d332db3c2c75f634 /app/src/main/res | |
parent | 045261f84c1ac5ba4c8ed0f3dabd4ea53a1155c9 (diff) |
1227: use navigation graph component, avoid view (fragments) duplications
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/activity_main.xml | 27 | ||||
-rw-r--r-- | app/src/main/res/navigation/nav_graph.xml | 91 |
2 files changed, 115 insertions, 3 deletions
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 2627a32..a5816f4 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,6 +1,27 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?><!-- + ~ Copyright (C) 2023 MURENA SAS + ~ Copyright (C) 2021 E FOUNDATION + ~ + ~ This program is free software: you can redistribute it and/or modify + ~ it under the terms of the GNU 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 General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License + ~ along with this program. If not, see <https://www.gnu.org/licenses/>. + --> <androidx.fragment.app.FragmentContainerView xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/container" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/nav_host_fragment" + android:name="androidx.navigation.fragment.NavHostFragment" android:layout_height="match_parent" android:layout_width="match_parent" - />
\ No newline at end of file + + app:defaultNavHost="true" + app:navGraph="@navigation/nav_graph" + /> diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml new file mode 100644 index 0000000..52a1677 --- /dev/null +++ b/app/src/main/res/navigation/nav_graph.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2023 MURENA SAS + ~ + ~ This program is free software: you can redistribute it and/or modify + ~ it under the terms of the GNU 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 General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License + ~ along with this program. If not, see <https://www.gnu.org/licenses/>. + --> +<navigation xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/nav_graph" + app:startDestination="@id/dashboardFragment" + > + + <fragment + android:id="@+id/dashboardFragment" + android:name="foundation.e.advancedprivacy.features.dashboard.DashboardFragment" + android:label="@string/app_name" + > + <action + android:id="@+id/goto_trackersFragment" + app:destination="@id/trackersFragment" + /> + <action + android:id="@+id/goto_fakeLocationFragment" + app:destination="@id/fakeLocationFragment" + /> + <action + android:id="@+id/goto_internetPrivacyFragment" + app:destination="@id/internetPrivacyFragment" + /> + <action + android:id="@+id/goto_appTrackersFragment" + app:destination="@id/appTrackersFragment" + /> + <action + android:id="@+id/goto_settingsPermissionsActivity" + app:destination="@id/settingsPermissionsActivity" + /> + <argument + android:name="highlightLeaks" + app:argType="integer" + android:defaultValue="-1" + /> + </fragment> + <fragment + android:id="@+id/trackersFragment" + android:name="foundation.e.advancedprivacy.features.trackers.TrackersFragment" + android:label="@string/trackers_title" + > + <action + android:id="@+id/goto_appTrackersFragment" + app:destination="@id/appTrackersFragment" + /> + </fragment> + <fragment + android:id="@+id/appTrackersFragment" + android:name="foundation.e.advancedprivacy.features.trackers.apptrackers.AppTrackersFragment" + android:label="AppTrackersFragment" + > + <argument + android:name="appUid" + app:argType="integer" + android:defaultValue="1000" + /> + </fragment> + <fragment + android:id="@+id/fakeLocationFragment" + android:name="foundation.e.advancedprivacy.features.location.FakeLocationFragment" + android:label="@string/location_title" + /> + <fragment + android:id="@+id/internetPrivacyFragment" + android:name="foundation.e.advancedprivacy.features.internetprivacy.InternetPrivacyFragment" + android:label="@string/ipscrambling_title" + /> + <activity + android:id="@+id/settingsPermissionsActivity" + android:label="@string/dashboard_apps_permissions_title" + app:action="android.intent.action.MANAGE_PERMISSIONS" + /> +</navigation> |