]> git.ktnx.net Git - mobile-ledger.git/commitdiff
new transaction: fix saving progress in/out navigation
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 16 Aug 2020 12:50:14 +0000 (15:50 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 16 Aug 2020 12:50:14 +0000 (15:50 +0300)
somewhat broken after following the recommendations about thefragment container.

the navigation was saved so after saving 'Back' returned to the 'saving progress' fragment instead of closing the activity

app/src/main/res/navigation/new_transaction_navigation.xml

index b68760c24e9f372924aa99007b419e2bf8c07f28..6f1fe29c3b7e015393c76440238e493c0dee39ba 100644 (file)
             android:id="@+id/action_newTransactionFragment_to_newTransactionSavingFragment"
             app:destination="@id/newTransactionSavingFragment"
             app:enterAnim="@anim/slide_in_up"
-            app:exitAnim="@anim/slide_out_up" />
+            app:exitAnim="@anim/slide_out_up"
+            app:launchSingleTop="true"
+            app:popUpTo="@id/new_transaction_navigation"
+            app:popUpToInclusive="true"
+            />
         <argument
             android:name="error"
             app:argType="string"
             app:destination="@id/newTransactionFragment"
             app:enterAnim="@anim/slide_in_up"
             app:exitAnim="@anim/slide_out_up"
+            app:launchSingleTop="true"
             app:popExitAnim="@anim/slide_out_down"
+            app:popUpTo="@id/new_transaction_navigation"
+            app:popUpToInclusive="true"
             />
         <action
             android:id="@+id/action_newTransactionSavingFragment_Failure"
             app:destination="@id/newTransactionFragment"
             app:enterAnim="@anim/slide_in_down"
             app:exitAnim="@anim/slide_out_down"
+            app:launchSingleTop="true"
             app:popExitAnim="@anim/slide_out_up"
+            app:popUpTo="@id/new_transaction_navigation"
+            app:popUpToInclusive="true"
             />
     </fragment>
 </navigation>
\ No newline at end of file