Skip to content

Commit aa6ec4a

Browse files
MorenoTropicaldavid-allison
authored andcommitted
improve study shortcut
1 parent 7dadf6c commit aa6ec4a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/NavigationDrawerActivity.kt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,17 +453,23 @@ abstract class NavigationDrawerActivity :
453453
return
454454
}
455455
// Review Cards Shortcut
456-
val intentReviewCards = Reviewer.getIntent(context)
457-
intentReviewCards.action = Intent.ACTION_VIEW
458-
intentReviewCards.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK
459-
intentReviewCards.putExtra(EXTRA_STARTED_WITH_SHORTCUT, true)
456+
val intentReviewCards =
457+
Reviewer.getIntent(context).apply {
458+
action = Intent.ACTION_VIEW
459+
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
460+
putExtra(EXTRA_STARTED_WITH_SHORTCUT, true)
461+
}
462+
val deckPickerIntent =
463+
Intent(context, IntentHandler::class.java).apply {
464+
action = Intent.ACTION_VIEW
465+
}
460466
val reviewCardsShortcut =
461467
ShortcutInfoCompat
462468
.Builder(context, "reviewCardsShortcutId")
463469
.setShortLabel(context.getString(R.string.studyoptions_start))
464470
.setLongLabel(context.getString(R.string.studyoptions_start))
465471
.setIcon(IconCompat.createWithResource(context, R.drawable.review_shortcut))
466-
.setIntent(intentReviewCards)
472+
.setIntents(arrayOf(deckPickerIntent, intentReviewCards))
467473
.build()
468474

469475
// Add Shortcut

0 commit comments

Comments
 (0)