use of com.ichi2.async.CollectionTask.TASK_TYPE.CHECK_CARD_SELECTION in project AnkiChinaAndroid by ankichinateam.
the class CardBrowser method updateMultiselectMenu.
private void updateMultiselectMenu() {
Timber.d("updateMultiselectMenu()");
if (mActionBarMenu == null || mActionBarMenu.findItem(R.id.action_suspend_card) == null) {
return;
}
if (!mCheckedCards.isEmpty()) {
CollectionTask.cancelAllTasks(CHECK_CARD_SELECTION);
CollectionTask.launchCollectionTask(CHECK_CARD_SELECTION, mCheckSelectedCardsHandler, new TaskData(new Object[] { mCheckedCards, getCards() }));
}
mActionBarMenu.findItem(R.id.action_select_all).setVisible(!hasSelectedAllCards());
// Note: Theoretically should not happen, as this should kick us back to the menu
mActionBarMenu.findItem(R.id.action_select_none).setVisible(hasSelectedCards());
mActionBarMenu.findItem(R.id.action_edit_note).setVisible(canPerformMultiSelectEditNote());
}
use of com.ichi2.async.CollectionTask.TASK_TYPE.CHECK_CARD_SELECTION in project AnkiChinaAndroid by ankichinateam.
the class SelfStudyActivity method updateMultiselectMenu.
private void updateMultiselectMenu() {
Timber.d("updateMultiselectMenu()");
if (mActionBarMenu == null || mActionBarMenu.findItem(R.id.action_suspend_card) == null) {
return;
}
if (getSelectedCardIds().length != 0) {
CollectionTask.cancelAllTasks(CHECK_CARD_SELECTION);
CollectionTask.launchCollectionTask(CHECK_CARD_SELECTION, mCheckSelectedCardsHandler, new TaskData(new Object[] { getSelectedCards(), getCards() }));
}
}
Aggregations