Search in sources :

Example 76 with TaskData

use of com.ichi2.async.TaskData in project Anki-Android by Ramblurr.

the class DeckTask method doInBackgroundConfSetSubdecks.

private TaskData doInBackgroundConfSetSubdecks(TaskData... params) {
    // Log.i(AnkiDroidApp.TAG, "doInBackgroundConfSetSubdecks");
    Object[] data = params[0].getObjArray();
    Collection col = (Collection) data[0];
    JSONObject deck = (JSONObject) data[1];
    JSONObject conf = (JSONObject) data[2];
    try {
        TreeMap<String, Long> children = col.getDecks().children(deck.getLong("id"));
        for (Map.Entry<String, Long> entry : children.entrySet()) {
            JSONObject child = col.getDecks().get(entry.getValue());
            if (child.getInt("dyn") == 1) {
                continue;
            }
            TaskData newParams = new TaskData(new Object[] { col, child, conf });
            boolean changed = doInBackgroundConfChange(newParams).getBoolean();
            if (!changed) {
                return new TaskData(false);
            }
        }
        return new TaskData(true);
    } catch (JSONException e) {
        return new TaskData(false);
    }
}
Also used : JSONObject(org.json.JSONObject) Collection(com.ichi2.libanki.Collection) JSONException(org.json.JSONException) JSONObject(org.json.JSONObject) HashMap(java.util.HashMap) Map(java.util.Map) TreeMap(java.util.TreeMap)

Example 77 with TaskData

use of com.ichi2.async.TaskData in project Anki-Android by Ramblurr.

the class DeckTask method doInBackgroundMarkCard.

private TaskData doInBackgroundMarkCard(TaskData... params) {
    Card card = params[0].getCard();
    Sched sched = params[0].getSched();
    try {
        AnkiDb ankiDB = sched.getCol().getDb();
        ankiDB.getDatabase().beginTransaction();
        try {
            if (card != null) {
                Note note = card.note();
                sched.getCol().markUndo(Collection.UNDO_MARK_NOTE, new Object[] { note.getId(), note.stringTags(), card.getId() });
                if (note.hasTag("marked")) {
                    note.delTag("marked");
                } else {
                    note.addTag("marked");
                }
                note.flush();
            }
            publishProgress(new TaskData(card));
            ankiDB.getDatabase().setTransactionSuccessful();
        } finally {
            ankiDB.getDatabase().endTransaction();
        }
    } catch (RuntimeException e) {
        Log.e(AnkiDroidApp.TAG, "doInBackgroundMarkCard - RuntimeException on marking card: " + e);
        AnkiDroidApp.saveExceptionReportFile(e, "doInBackgroundMarkCard");
        return new TaskData(false);
    }
    return new TaskData(true);
}
Also used : AnkiDb(com.ichi2.anki.AnkiDb) Sched(com.ichi2.libanki.Sched) Note(com.ichi2.libanki.Note) Card(com.ichi2.libanki.Card)

Example 78 with TaskData

use of com.ichi2.async.TaskData in project Anki-Android by Ramblurr.

the class DeckPicker method handleDbError.

// private void resetDeckLanguages(String deckPath) {
// if (MetaDB.resetDeckLanguages(this, deckPath)) {
// Themes.showThemedToast(this, getResources().getString(R.string.contextmenu_deckpicker_reset_reset_message),
// true);
// }
// }
// 
// 
// public void openSharedDeckPicker() {
// // deckLoaded = false;
// startActivityForResult(new Intent(this, SharedDeckPicker.class), DOWNLOAD_SHARED_DECK);
// if (UIUtils.getApiLevel() > 4) {
// ActivityTransitionAnimation.slide(this, ActivityTransitionAnimation.RIGHT);
// }
// }
public void handleDbError() {
    AnkiDatabaseManager.closeDatabase(AnkiDroidApp.getCollectionPath());
    DeckTask.launchDeckTask(DeckTask.TASK_TYPE_RESTORE_IF_MISSING, new DeckTask.TaskListener() {

        @Override
        public void onPreExecute() {
            mProgressDialog = StyledProgressDialog.show(DeckPicker.this, "", getResources().getString(R.string.backup_restore_if_missing), true);
        }

        @Override
        public void onPostExecute(TaskData result) {
            if (mProgressDialog.isShowing()) {
                try {
                    mProgressDialog.dismiss();
                } catch (Exception e) {
                    Log.e(AnkiDroidApp.TAG, "onPostExecute - Dialog dismiss Exception = " + e.getMessage());
                }
            }
            showDialog(DIALOG_DB_ERROR);
        }

        @Override
        public void onProgressUpdate(TaskData... values) {
        }
    }, new DeckTask.TaskData(AnkiDroidApp.getCollectionPath()));
}
Also used : DeckTask(com.ichi2.async.DeckTask) JSONException(org.json.JSONException) NotFoundException(android.content.res.Resources.NotFoundException) SQLException(android.database.SQLException) TaskData(com.ichi2.async.DeckTask.TaskData) TaskData(com.ichi2.async.DeckTask.TaskData)

Example 79 with TaskData

use of com.ichi2.async.TaskData in project Anki-Android by Ramblurr.

the class DeckPicker method showStartupScreensAndDialogs.

private void showStartupScreensAndDialogs(SharedPreferences preferences, int skip) {
    if (skip < 1 && preferences.getLong("lastTimeOpened", 0) == 0) {
        Intent infoIntent = new Intent(this, Info.class);
        infoIntent.putExtra(Info.TYPE_EXTRA, Info.TYPE_WELCOME);
        startActivityForResult(infoIntent, SHOW_INFO_WELCOME);
        if (skip != 0 && AnkiDroidApp.SDK_VERSION > 4) {
            ActivityTransitionAnimation.slide(this, ActivityTransitionAnimation.LEFT);
        }
    } else if (skip < 2 && !preferences.getString("lastVersion", "").equals(AnkiDroidApp.getPkgVersionName())) {
        preferences.edit().putBoolean("showBroadcastMessageToday", true).commit();
        Intent infoIntent = new Intent(this, Info.class);
        infoIntent.putExtra(Info.TYPE_EXTRA, Info.TYPE_NEW_VERSION);
        startActivityForResult(infoIntent, SHOW_INFO_NEW_VERSION);
        if (skip != 0 && AnkiDroidApp.SDK_VERSION > 4) {
            ActivityTransitionAnimation.slide(this, ActivityTransitionAnimation.LEFT);
        }
    } else if (skip < 3 && upgradeNeeded()) {
        // Note that the "upgrade needed" refers to upgrading Anki 1.x decks, not to newer
        // versions of AnkiDroid.
        AnkiDroidApp.getSharedPrefs(AnkiDroidApp.getInstance().getBaseContext()).edit().putInt("lastUpgradeVersion", AnkiDroidApp.getPkgVersionCode()).commit();
        showUpgradeScreen(skip != 0, Info.UPGRADE_SCREEN_BASIC1);
    } else if (skip < 4 && hasErrorFiles()) {
        Intent i = new Intent(this, Feedback.class);
        startActivityForResult(i, REPORT_ERROR);
        if (skip != 0 && AnkiDroidApp.SDK_VERSION > 4) {
            ActivityTransitionAnimation.slide(this, ActivityTransitionAnimation.LEFT);
        }
    } else if (!AnkiDroidApp.isSdCardMounted()) {
        showDialog(DIALOG_SD_CARD_NOT_MOUNTED);
    } else if (!BackupManager.enoughDiscSpace(mPrefDeckPath)) {
        // && !preferences.getBoolean("dontShowLowMemory",
        // false)) {
        showDialog(DIALOG_NO_SPACE_LEFT);
    } else if (preferences.getBoolean("noSpaceLeft", false)) {
        showDialog(DIALOG_BACKUP_NO_SPACE_LEFT);
        preferences.edit().putBoolean("noSpaceLeft", false).commit();
    } else if (mImportPath != null && AnkiDroidApp.colIsOpen()) {
        showDialog(DIALOG_IMPORT);
    } else {
        // AnkiDroid is being updated and a collection already exists. We check if we are upgrading
        // to a version that contains additions to the database integrity check routine that we would
        // like to run on all collections. A missing version number is assumed to be a fresh
        // installation of AnkiDroid and we don't run the check.
        int current = AnkiDroidApp.getPkgVersionCode();
        int previous;
        if (!preferences.contains("lastUpgradeVersion")) {
            // Fresh install
            previous = current;
        } else {
            try {
                previous = preferences.getInt("lastUpgradeVersion", current);
            } catch (ClassCastException e) {
                // Previous versions stored this as a string.
                String s = preferences.getString("lastUpgradeVersion", "");
                // check.
                if (s.equals("2.0.2")) {
                    previous = 40;
                } else {
                    previous = 0;
                }
            }
        }
        preferences.edit().putInt("lastUpgradeVersion", current).commit();
        if (previous < AnkiDroidApp.CHECK_DB_AT_VERSION) {
            DeckTask.launchDeckTask(DeckTask.TASK_TYPE_OPEN_COLLECTION, new Listener() {

                @Override
                public void onPostExecute(DeckTask task, TaskData result) {
                    mOpenCollectionHandler.onPostExecute(result);
                    integrityCheck();
                }

                @Override
                public void onPreExecute(DeckTask task) {
                }

                @Override
                public void onProgressUpdate(DeckTask task, TaskData... values) {
                }
            }, new DeckTask.TaskData(AnkiDroidApp.getCollectionPath()));
        } else {
            loadCollection();
        }
    }
}
Also used : OnGlobalLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener) OnCancelListener(android.content.DialogInterface.OnCancelListener) SimpleOnGestureListener(android.view.GestureDetector.SimpleOnGestureListener) Listener(com.ichi2.async.DeckTask.Listener) OnClickListener(android.view.View.OnClickListener) Intent(android.content.Intent) ActivityInfo(android.content.pm.ActivityInfo) ContextMenuInfo(android.view.ContextMenu.ContextMenuInfo) DeckTask(com.ichi2.async.DeckTask) TaskData(com.ichi2.async.DeckTask.TaskData)

Example 80 with TaskData

use of com.ichi2.async.TaskData in project AnkiChinaAndroid by ankichinateam.

the class SelfStudyActivity method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // (when another operation will be performed on the model, it will undo the latest operation)
    if (mUndoSnackbar != null && mUndoSnackbar.isShown()) {
        mUndoSnackbar.dismiss();
    }
    switch(item.getItemId()) {
        case android.R.id.home:
            endMultiSelectMode();
            return true;
        case R.id.screen:
            showScreenDialog();
            return true;
        case R.id.action_edit:
            mCardsAdapter.setMultiCheckable(!mCardsAdapter.isMultiCheckableMode());
            return true;
        case R.id.action_add_note_from_card_browser:
            {
                Intent intent = new Intent(SelfStudyActivity.this, NoteEditor.class);
                intent.putExtra(NoteEditor.EXTRA_CALLER, NoteEditor.CALLER_CARDBROWSER_ADD);
                startActivityForResultWithAnimation(intent, ADD_NOTE, ActivityTransitionAnimation.LEFT);
                return true;
            }
        case R.id.action_save_search:
            {
                String searchTerms = mSearchView.getQuery().toString();
                showDialogFragment(CardBrowserMySearchesDialog.newInstance(null, mMySearchesDialogListener, searchTerms, CardBrowserMySearchesDialog.CARD_BROWSER_MY_SEARCHES_TYPE_SAVE));
                return true;
            }
        case R.id.action_list_my_searches:
            {
                JSONObject savedFiltersObj = getCol().getConf().optJSONObject("savedFilters");
                HashMap<String, String> savedFilters = new HashMap<>();
                if (savedFiltersObj != null) {
                    Iterator<String> it = savedFiltersObj.keys();
                    while (it.hasNext()) {
                        String searchName = it.next();
                        savedFilters.put(searchName, savedFiltersObj.optString(searchName));
                    }
                }
                showDialogFragment(CardBrowserMySearchesDialog.newInstance(savedFilters, mMySearchesDialogListener, "", CardBrowserMySearchesDialog.CARD_BROWSER_MY_SEARCHES_TYPE_LIST));
                return true;
            }
        case R.id.action_sort_by_size:
            showDialogFragment(CardBrowserOrderDialog.newInstance(mOrder, mOrderAsc, mOrderDialogListener));
            return true;
        case R.id.action_show_marked:
            mSearchTerms = "tag:marked";
            mSearchView.setQuery("", false);
            mSearchView.setQueryHint(getResources().getString(R.string.card_browser_show_marked));
            searchCards();
            return true;
        case R.id.action_show_suspended:
            mSearchTerms = "is:suspended";
            mSearchView.setQuery("", false);
            mSearchView.setQueryHint(getResources().getString(R.string.card_browser_show_suspended));
            searchCards();
            return true;
        case R.id.action_flag_zero:
            flagTask(0);
            return true;
        case R.id.action_flag_one:
            flagTask(1);
            return true;
        case R.id.action_flag_two:
            flagTask(2);
            return true;
        case R.id.action_flag_three:
            flagTask(3);
            return true;
        case R.id.action_flag_four:
            flagTask(4);
            return true;
        case R.id.action_delete_card:
            if (inMultiSelectMode()) {
                CollectionTask.launchCollectionTask(DISMISS_MULTI, mDeleteNoteHandler, new TaskData(new Object[] { getSelectedCardIds(), Collection.DismissType.DELETE_NOTE_MULTI }));
                mCardsAdapter.getSelectedItemIds().clear();
            }
            return true;
        case R.id.action_mark_card:
            CollectionTask.launchCollectionTask(DISMISS_MULTI, markCardHandler(), new TaskData(new Object[] { getSelectedCardIds(), Collection.DismissType.MARK_NOTE_MULTI }));
            return true;
        case R.id.action_suspend_card:
            CollectionTask.launchCollectionTask(DISMISS_MULTI, suspendCardHandler(), new TaskData(new Object[] { getSelectedCardIds(), Collection.DismissType.SUSPEND_CARD_MULTI }));
            toggleMultiSelectMode(false);
            return true;
        case R.id.action_change_deck:
            {
                AlertDialog.Builder builderSingle = new AlertDialog.Builder(this);
                builderSingle.setTitle(getString(R.string.move_all_to_deck));
                // WARNING: changeDeck depends on this index, so any changes should be reflected there.
                final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, R.layout.dropdown_deck_item);
                for (Deck deck : getValidDecksForChangeDeck()) {
                    try {
                        arrayAdapter.add(deck.getString("name"));
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
                builderSingle.setNegativeButton(getString(R.string.cancel), (dialog, which) -> dialog.dismiss());
                builderSingle.setAdapter(arrayAdapter, (dialog, which) -> changeDeck(which));
                builderSingle.show();
                return true;
            }
        case R.id.action_undo:
            if (getCol().undoAvailable()) {
                CollectionTask.launchCollectionTask(UNDO, mUndoHandler);
            }
            return true;
        case R.id.action_preview:
            {
                mStartStudyButton.performClick();
                return true;
            }
        case R.id.action_reset_cards_progress:
            {
                Timber.i("NoteEditor:: Reset progress button pressed");
                // Show confirmation dialog before resetting card progress
                ConfirmationDialog dialog = new ConfirmationDialog();
                String title = getString(R.string.reset_card_dialog_title);
                String message = getString(R.string.reset_card_dialog_message);
                dialog.setArgs(title, message);
                Runnable confirm = () -> {
                    Timber.i("CardBrowser:: ResetProgress button pressed");
                    CollectionTask.launchCollectionTask(DISMISS_MULTI, resetProgressCardHandler(), new TaskData(new Object[] { getSelectedCardIds(), Collection.DismissType.RESET_CARDS }));
                };
                dialog.setConfirm(confirm);
                showDialogFragment(dialog);
                return true;
            }
        case R.id.action_reschedule_cards:
            {
                Timber.i("CardBrowser:: Reschedule button pressed");
                long[] selectedCardIds = getSelectedCardIds();
                FunctionalInterfaces.Consumer<Integer> consumer = newDays -> CollectionTask.launchCollectionTask(DISMISS_MULTI, rescheduleCardHandler(), new TaskData(new Object[] { selectedCardIds, Collection.DismissType.RESCHEDULE_CARDS, newDays }));
                RescheduleDialog rescheduleDialog;
                if (selectedCardIds.length == 1) {
                    long cardId = selectedCardIds[0];
                    Card selected = getCol().getCard(cardId);
                    rescheduleDialog = RescheduleDialog.rescheduleSingleCard(getResources(), selected, consumer);
                } else {
                    rescheduleDialog = RescheduleDialog.rescheduleMultipleCards(getResources(), consumer, selectedCardIds.length);
                }
                showDialogFragment(rescheduleDialog);
                return true;
            }
        case R.id.action_reposition_cards:
            {
                Timber.i("CardBrowser:: Reposition button pressed");
                // Only new cards may be repositioned
                long[] cardIds = getSelectedCardIds();
                for (int i = 0; i < cardIds.length; i++) {
                    if (getCol().getCard(cardIds[i]).getQueue() != Consts.CARD_TYPE_NEW) {
                        SimpleMessageDialog dialog = SimpleMessageDialog.newInstance(getString(R.string.vague_error), getString(R.string.reposition_card_not_new_error), false);
                        showDialogFragment(dialog);
                        return false;
                    }
                }
                IntegerDialog repositionDialog = new IntegerDialog();
                repositionDialog.setArgs(getString(R.string.reposition_card_dialog_title), getString(R.string.reposition_card_dialog_message), 5);
                repositionDialog.setCallbackRunnable(days -> CollectionTask.launchCollectionTask(DISMISS_MULTI, repositionCardHandler(), new TaskData(new Object[] { cardIds, Collection.DismissType.REPOSITION_CARDS, days })));
                showDialogFragment(repositionDialog);
                return true;
            }
        case R.id.action_edit_note:
            {
                openNoteEditorForCurrentlySelectedNote();
            }
        default:
            return super.onOptionsItemSelected(item);
    }
}
Also used : AlertDialog(android.app.AlertDialog) Arrays(java.util.Arrays) Bundle(android.os.Bundle) TagsDialog(com.ichi2.anki.dialogs.TagsDialog) Deck(com.ichi2.libanki.Deck) NonNull(androidx.annotation.NonNull) ImageView(android.widget.ImageView) RangeSeekBar(com.jaygoo.widget.RangeSeekBar) ActionBar(androidx.appcompat.app.ActionBar) Decks(com.ichi2.libanki.Decks) Handler(android.os.Handler) Map(java.util.Map) JSONException(com.ichi2.utils.JSONException) OnRangeChangedListener(com.jaygoo.widget.OnRangeChangedListener) ContextCompat(androidx.core.content.ContextCompat) DUE(com.ichi2.anki.CardBrowser.Column.DUE) Upgrade(com.ichi2.upgrade.Upgrade) CREATED(com.ichi2.anki.CardBrowser.Column.CREATED) IntentFilter(android.content.IntentFilter) Set(java.util.Set) JSONObject(com.ichi2.utils.JSONObject) SearchView(androidx.appcompat.widget.SearchView) INTERVAL(com.ichi2.anki.CardBrowser.Column.INTERVAL) Nullable(androidx.annotation.Nullable) CHANGED(com.ichi2.anki.CardBrowser.Column.CHANGED) Consts(com.ichi2.libanki.Consts) CardCache(com.ichi2.anki.CardBrowser.CardCache) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) DECK(com.ichi2.anki.CardBrowser.Column.DECK) CARD(com.ichi2.anki.CardBrowser.Column.CARD) WarpLinearLayout(com.ichi2.ui.WarpLinearLayout) UPDATE_NOTE(com.ichi2.async.CollectionTask.TASK_TYPE.UPDATE_NOTE) NOTE_TYPE(com.ichi2.anki.CardBrowser.Column.NOTE_TYPE) TAGS(com.ichi2.anki.CardBrowser.Column.TAGS) SystemClock(android.os.SystemClock) RescheduleDialog(com.ichi2.anki.dialogs.RescheduleDialog) SdCardReceiver(com.ichi2.anki.receiver.SdCardReceiver) DISMISS_MULTI(com.ichi2.async.CollectionTask.TASK_TYPE.DISMISS_MULTI) Column(com.ichi2.anki.CardBrowser.Column) ArrayList(java.util.ArrayList) LAPSES(com.ichi2.anki.CardBrowser.Column.LAPSES) RENDER_BROWSER_QA(com.ichi2.async.CollectionTask.TASK_TYPE.RENDER_BROWSER_QA) SFLD(com.ichi2.anki.CardBrowser.Column.SFLD) Toast(android.widget.Toast) Menu(android.view.Menu) SimpleMessageDialog(com.ichi2.anki.dialogs.SimpleMessageDialog) REVIEWS(com.ichi2.anki.CardBrowser.Column.REVIEWS) IntegerDialog(com.ichi2.anki.dialogs.IntegerDialog) EASE(com.ichi2.anki.CardBrowser.Column.EASE) CheckResult(androidx.annotation.CheckResult) TextUtils(android.text.TextUtils) Gravity(android.view.Gravity) ArrayAdapter(android.widget.ArrayAdapter) SharedPreferences(android.content.SharedPreferences) TypedValue(android.util.TypedValue) ActivityTransitionAnimation(com.ichi2.anim.ActivityTransitionAnimation) CardBrowserOrderDialog(com.ichi2.anki.dialogs.CardBrowserOrderDialog) CardBrowser.sCardBrowserCard(com.ichi2.anki.CardBrowser.sCardBrowserCard) LinearLayout(android.widget.LinearLayout) WindowManager(android.view.WindowManager) UNDO(com.ichi2.async.CollectionTask.TASK_TYPE.UNDO) ConfirmationDialog(com.ichi2.anki.dialogs.ConfirmationDialog) Permissions(com.ichi2.utils.Permissions) FunctionalInterfaces(com.ichi2.utils.FunctionalInterfaces) CheckBox(android.widget.CheckBox) Locale(java.util.Locale) View(android.view.View) Button(android.widget.Button) TaskData(com.ichi2.async.TaskData) AdapterView(android.widget.AdapterView) RecyclerView(androidx.recyclerview.widget.RecyclerView) CardBrowserMySearchesDialog(com.ichi2.anki.dialogs.CardBrowserMySearchesDialog) TabLayout(com.google.android.material.tabs.TabLayout) SEARCH_CARDS(com.ichi2.async.CollectionTask.TASK_TYPE.SEARCH_CARDS) ANSWER(com.ichi2.anki.CardBrowser.Column.ANSWER) BroadcastReceiver(android.content.BroadcastReceiver) ViewGroup(android.view.ViewGroup) Timber(timber.log.Timber) AlertDialog(android.app.AlertDialog) Objects(java.util.Objects) List(java.util.List) TextView(android.widget.TextView) OnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener) SimpleAdapter(android.widget.SimpleAdapter) OrderListAdapter(com.ichi2.anki.widgets.OrderListAdapter) RelativeLayout(android.widget.RelativeLayout) Toolbar(androidx.appcompat.widget.Toolbar) TaskListenerWithContext(com.ichi2.async.TaskListenerWithContext) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) Snackbar(com.google.android.material.snackbar.Snackbar) Context(android.content.Context) EDITED(com.ichi2.anki.CardBrowser.Column.EDITED) Intent(android.content.Intent) HashMap(java.util.HashMap) CHECK_CARD_SELECTION(com.ichi2.async.CollectionTask.TASK_TYPE.CHECK_CARD_SELECTION) Collection(com.ichi2.libanki.Collection) TypedArray(android.content.res.TypedArray) MenuItem(android.view.MenuItem) InputMethodManager(android.view.inputmethod.InputMethodManager) HashSet(java.util.HashSet) CardsListAdapter(com.ichi2.anki.widgets.CardsListAdapter) DeckDropDownAdapter(com.ichi2.anki.widgets.DeckDropDownAdapter) WidgetStatus(com.ichi2.widget.WidgetStatus) QUESTION(com.ichi2.anki.CardBrowser.Column.QUESTION) Utils(com.ichi2.libanki.Utils) ListPopupWindow(androidx.appcompat.widget.ListPopupWindow) Iterator(java.util.Iterator) Stats(com.ichi2.libanki.stats.Stats) PopupWindow(android.widget.PopupWindow) CollectionTask(com.ichi2.async.CollectionTask) Spinner(android.widget.Spinner) KeyBoardListenerLayout(com.ichi2.ui.KeyBoardListenerLayout) Card(com.ichi2.libanki.Card) Collections(java.util.Collections) VisibleForTesting(androidx.annotation.VisibleForTesting) CustomStyleDialog(com.ichi2.ui.CustomStyleDialog) SimpleMessageDialog(com.ichi2.anki.dialogs.SimpleMessageDialog) HashMap(java.util.HashMap) Deck(com.ichi2.libanki.Deck) JSONException(com.ichi2.utils.JSONException) Intent(android.content.Intent) TaskData(com.ichi2.async.TaskData) ConfirmationDialog(com.ichi2.anki.dialogs.ConfirmationDialog) CardBrowser.sCardBrowserCard(com.ichi2.anki.CardBrowser.sCardBrowserCard) Card(com.ichi2.libanki.Card) JSONObject(com.ichi2.utils.JSONObject) RescheduleDialog(com.ichi2.anki.dialogs.RescheduleDialog) IntegerDialog(com.ichi2.anki.dialogs.IntegerDialog) Iterator(java.util.Iterator) JSONObject(com.ichi2.utils.JSONObject) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

Collection (com.ichi2.libanki.Collection)67 TaskData (com.ichi2.async.TaskData)46 JSONObject (com.ichi2.utils.JSONObject)35 Card (com.ichi2.libanki.Card)16 JSONException (com.ichi2.utils.JSONException)15 ArrayList (java.util.ArrayList)14 JSONObject (org.json.JSONObject)13 Resources (android.content.res.Resources)12 HashMap (java.util.HashMap)12 SharedPreferences (android.content.SharedPreferences)11 Deck (com.ichi2.libanki.Deck)11 Intent (android.content.Intent)10 View (android.view.View)9 TextView (android.widget.TextView)9 ConfirmationDialog (com.ichi2.anki.dialogs.ConfirmationDialog)9 TaskListener (com.ichi2.async.TaskListener)9 Map (java.util.Map)9 VisibleForTesting (androidx.annotation.VisibleForTesting)8 CollectionTask (com.ichi2.async.CollectionTask)8 IOException (java.io.IOException)8