1
tj
2025-02-27 768f1d38c5357e214e6cff018e57ef7bcb64ee60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/mobile_navigation"
    app:startDestination="@+id/navigation_home">
 
    <!--    对应的多个片段-->
    <!--    tools:layout="@layout/fragment_home"表示设计视图中显示的应该是fragment_home.xml的内容,而不是当前布局的内容-->
    <fragment
        android:id="@+id/navigation_home"
        android:name="com.example.firstapp.ui.home.HomeFragment"
        android:label="@string/title_home"
        tools:layout="@layout/fragment_home" />
 
    <fragment
        android:id="@+id/navigation_dashboard"
        android:name="com.example.firstapp.ui.dashboard.DashboardFragment"
        android:label="@string/title_dashboard"
        tools:layout="@layout/fragment_dashboard" />
 
    <fragment
        android:id="@+id/navigation_notifications"
        android:name="com.example.firstapp.ui.notifications.NotificationsFragment"
        android:label="@string/title_notifications"
        tools:layout="@layout/fragment_notifications" >
        <action
            android:id="@+id/action_navigation_notifications_to_reminderSettingsFragment"
            app:destination="@id/reminderSettingsFragment"
            app:enterAnim="@anim/nav_default_enter_anim"
            app:exitAnim="@anim/nav_default_exit_anim"
            app:popEnterAnim="@anim/nav_default_pop_enter_anim"
            app:popExitAnim="@anim/nav_default_pop_exit_anim" />
 
        <!-- 新增的action,跳转到 ReminderSettingsFragmentOther -->
        <action
            android:id="@+id/action_settings_to_reminderSettingsFragmentOther"
            app:destination="@id/reminderSettingsFragmentOther"
            app:enterAnim="@anim/nav_default_enter_anim"
            app:exitAnim="@anim/nav_default_exit_anim"
            app:popEnterAnim="@anim/nav_default_pop_enter_anim"
            app:popExitAnim="@anim/nav_default_pop_exit_anim" />
 
    </fragment>
 
    <fragment
        android:id="@+id/reminderSettingsFragment"
        android:name="com.example.firstapp.ui.reminder.ReminderSettingsFragment"
        android:label="设置提醒"
        tools:layout="@layout/fragment_reminder_settings" />
 
 
 
    <fragment
        android:id="@+id/reminderSettingsFragmentOther"
        android:name="com.example.firstapp.ui.reminderOther.ReminderSettingsFragmentOther"
        android:label="设置其他提醒"
        tools:layout="@layout/fragment_reminder_settings_fragment_other" >
 
        <action
            android:id="@+id/action_reminderSettingsFragmentOther_to_reminderSettingsFragmentOtherAdd"
            app:destination="@id/reminderSettingsFragmentOtherAdd" />
    </fragment>
 
    <fragment
        android:id="@+id/reminderSettingsFragmentOtherAdd"
        android:name="com.example.firstapp.ui.reminderOther.ReminderSettingsFragmentOtherAdd"
        android:label="新增" />
 
</navigation>