main_navigation.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version="1.0" encoding="utf-8"?><!--
  2. ~ Copyright 2018, The Android Open Source Project
  3. ~
  4. ~ Licensed under the Apache License, Version 2.0 (the "License");
  5. ~ you may not use this file except in compliance with the License.
  6. ~ You may obtain a copy of the License at
  7. ~
  8. ~ http://www.apache.org/licenses/LICENSE-2.0
  9. ~
  10. ~ Unless required by applicable law or agreed to in writing, software
  11. ~ distributed under the License is distributed on an "AS IS" BASIS,
  12. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. ~ See the License for the specific language governing permissions and
  14. ~ limitations under the License.
  15. -->
  16. <navigation xmlns:android="http://schemas.android.com/apk/res/android"
  17. xmlns:app="http://schemas.android.com/apk/res-auto"
  18. xmlns:tools="http://schemas.android.com/tools"
  19. app:startDestination="@id/title_destination">
  20. <fragment
  21. android:id="@+id/title_destination"
  22. android:name="com.example.android.guesstheword.screens.title.TitleFragment"
  23. android:label="title_fragment"
  24. tools:layout="@layout/title_fragment">
  25. <action
  26. android:id="@+id/action_title_to_game"
  27. app:destination="@id/game_destination"
  28. app:enterAnim="@anim/slide_in_right"
  29. app:exitAnim="@anim/slide_out_left"
  30. app:launchSingleTop="true"
  31. app:popEnterAnim="@anim/slide_in_right"
  32. app:popExitAnim="@anim/slide_out_left" />
  33. </fragment>
  34. <fragment
  35. android:id="@+id/game_destination"
  36. android:name="com.example.android.guesstheword.screens.game.GameFragment"
  37. android:label="game_fragment"
  38. tools:layout="@layout/game_fragment">
  39. <action
  40. android:id="@+id/action_game_to_score"
  41. app:destination="@id/score_destination"
  42. app:enterAnim="@anim/slide_in_right"
  43. app:exitAnim="@anim/slide_out_left"
  44. app:launchSingleTop="true"
  45. app:popEnterAnim="@anim/slide_in_right"
  46. app:popExitAnim="@anim/slide_out_left"
  47. app:popUpTo="@+id/title_destination" />
  48. </fragment>
  49. <fragment
  50. android:id="@+id/score_destination"
  51. android:name="com.example.android.guesstheword.screens.score.ScoreFragment"
  52. android:label="score_fragment"
  53. tools:layout="@layout/score_fragment">
  54. <action
  55. android:id="@+id/action_restart"
  56. app:destination="@+id/game_destination"
  57. app:enterAnim="@anim/slide_in_right"
  58. app:exitAnim="@anim/slide_out_left"
  59. app:popEnterAnim="@anim/slide_in_right"
  60. app:popExitAnim="@anim/slide_out_left"
  61. app:popUpTo="@+id/title_destination" />
  62. <argument
  63. android:name="score"
  64. android:defaultValue="0"
  65. app:argType="integer" />
  66. </fragment>
  67. </navigation>