File tree Expand file tree Collapse file tree
anki-common/src/main/kotlin/com/ichi2/anki/common/destinations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import android.app.Activity
66import android.content.Intent
77import androidx.activity.result.ActivityResultLauncher
88import androidx.annotation.CheckResult
9+ import androidx.core.app.TaskStackBuilder
910import androidx.fragment.app.Fragment
1011
1112// TODO: Move this into anki-common:android after libanki becomes a java-library
@@ -57,6 +58,13 @@ fun ActivityResultLauncher<Intent>.navigate(destination: Destination) {
5758 launch(navigatorInstance.toIntent(destination))
5859}
5960
61+ /* *
62+ * Adds the Intent for [destination] to this [TaskStackBuilder]'s stack.
63+ *
64+ * @see TaskStackBuilder.addNextIntent
65+ */
66+ fun TaskStackBuilder.addNextIntent (destination : Destination ): TaskStackBuilder = addNextIntent(navigatorInstance.toIntent(destination))
67+
6068/* *
6169 * Opt-in marker for callers that are not launching navigation immediately, but
6270 * handing an [Intent] to the framework to launch later ([android.app.PendingIntent] etc...).
You can’t perform that action at this time.
0 commit comments