Search in sources :

Example 1 with TagsDialog

use of com.ichi2.anki.dialogs.TagsDialog in project AnkiChinaAndroid by ankichinateam.

the class AbstractFlashcardViewer method showTagsDialog.

protected void showTagsDialog() {
    ArrayList<String> tags = new ArrayList<>(getCol().getTags().all());
    ArrayList<String> selTags = new ArrayList<>(mCurrentCard.note().getTags());
    TagsDialog.TagsDialogListener tagsDialogListener = (selectedTags, option) -> {
        if (!mCurrentCard.note().getTags().equals(selectedTags)) {
            String tagString = TextUtils.join(" ", selectedTags);
            Note note = mCurrentCard.note();
            note.setTagsFromStr(tagString);
            note.flush();
            // Reload current card to reflect tag changes
            displayCardQuestion(true);
        }
    };
    TagsDialog dialog = TagsDialog.newInstance(TagsDialog.TYPE_ADD_TAG, selTags, tags);
    dialog.setTagsDialogListener(tagsDialogListener);
    showDialogFragment(dialog);
}
Also used : JavascriptInterface(android.webkit.JavascriptInterface) UI_PLAY_END(com.ichi2.bd.MainHandlerConstant.UI_PLAY_END) Version(com.github.zafarkhaja.semver.Version) Bundle(android.os.Bundle) TagsDialog(com.ichi2.anki.dialogs.TagsDialog) JsResult(android.webkit.JsResult) NonNull(androidx.annotation.NonNull) Uri(android.net.Uri) FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView) AbstractSched(com.ichi2.libanki.sched.AbstractSched) RangeSeekBar(com.jaygoo.widget.RangeSeekBar) RenderProcessGoneDetail(android.webkit.RenderProcessGoneDetail) HitTestResult(android.webkit.WebView.HitTestResult) ActionBar(androidx.appcompat.app.ActionBar) FileSaveListener(com.ichi2.bd.FileSaveListener) Decks(com.ichi2.libanki.Decks) Matcher(java.util.regex.Matcher) Handler(android.os.Handler) DeckConfig(com.ichi2.libanki.DeckConfig) Map(java.util.Map) JSONException(com.ichi2.utils.JSONException) THEME_NIGHT_BLACK(com.ichi2.themes.Themes.THEME_NIGHT_BLACK) OnRangeChangedListener(com.jaygoo.widget.OnRangeChangedListener) ContextCompat(androidx.core.content.ContextCompat) TargetApi(android.annotation.TargetApi) Log(android.util.Log) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) ConnectivityManager(android.net.ConnectivityManager) HtmlUtils(com.ichi2.utils.HtmlUtils) CoordinatorLayout(androidx.coordinatorlayout.widget.CoordinatorLayout) TtsMode(com.baidu.tts.client.TtsMode) IntentFilter(android.content.IntentFilter) CardMarker(com.ichi2.anki.reviewer.CardMarker) Set(java.util.Set) JSONObject(com.ichi2.utils.JSONObject) BE_VIP(com.ichi2.anki.DeckPicker.BE_VIP) IdRes(androidx.annotation.IdRes) StringRes(androidx.annotation.StringRes) Nullable(androidx.annotation.Nullable) Message(android.os.Message) Consts(com.ichi2.libanki.Consts) OKHttpUtil(com.ichi2.utils.OKHttpUtil) CompatHelper(com.ichi2.compat.CompatHelper) WebViewDebugging(com.ichi2.utils.WebViewDebugging) DiffEngine(com.ichi2.utils.DiffEngine) TypedAnswer(com.ichi2.anki.cardviewer.TypedAnswer) WebResourceResponse(android.webkit.WebResourceResponse) Dialog(android.app.Dialog) SystemClock(android.os.SystemClock) SdCardReceiver(com.ichi2.anki.receiver.SdCardReceiver) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) CardAppearance.calculateDynamicFontSize(com.ichi2.anki.cardviewer.CardAppearance.calculateDynamicFontSize) ViewAnimation(com.ichi2.anim.ViewAnimation) ArrayList(java.util.ArrayList) REFRESH_VOICE_INFO(com.ichi2.anki.DeckPicker.REFRESH_VOICE_INFO) WebResourceRequest(android.webkit.WebResourceRequest) Toast(android.widget.Toast) Menu(android.view.Menu) Connection(com.ichi2.async.Connection) Response(okhttp3.Response) Call(okhttp3.Call) CardAppearance(com.ichi2.anki.cardviewer.CardAppearance) WebChromeClient(android.webkit.WebChromeClient) LinkedHashSet(java.util.LinkedHashSet) PRINT(com.ichi2.bd.MainHandlerConstant.PRINT) CheckResult(androidx.annotation.CheckResult) MissingImageHandler(com.ichi2.anki.cardviewer.MissingImageHandler) FileOutputStream(java.io.FileOutputStream) TextUtils(android.text.TextUtils) IOException(java.io.IOException) SoundSide(com.ichi2.libanki.Sound.SoundSide) File(java.io.File) Gravity(android.view.Gravity) Lock(java.util.concurrent.locks.Lock) SharedPreferences(android.content.SharedPreferences) TypedValue(android.util.TypedValue) FileUtil(com.ichi2.utils.FileUtil) Configuration(android.content.res.Configuration) ActivityTransitionAnimation(com.ichi2.anim.ActivityTransitionAnimation) EditText(android.widget.EditText) SpeechSynthesizerListener(com.baidu.tts.client.SpeechSynthesizerListener) ImageButton(android.widget.ImageButton) REQUEST_CODE_SPEAK_SETTING(com.ichi2.anki.SpeakSettingActivity.REQUEST_CODE_SPEAK_SETTING) LinearLayout(android.widget.LinearLayout) URLDecoder(java.net.URLDecoder) HtmlColors(com.ichi2.themes.HtmlColors) GestureDetectorCompat(androidx.core.view.GestureDetectorCompat) WindowManager(android.view.WindowManager) NonBlockSyntherizer(com.ichi2.bd.NonBlockSyntherizer) FormBody(okhttp3.FormBody) ByteArrayInputStream(java.io.ByteArrayInputStream) ViewerCommand(com.ichi2.anki.cardviewer.ViewerCommand) Gson(com.google.gson.Gson) Locale(java.util.Locale) WebViewClient(android.webkit.WebViewClient) View(android.view.View) Button(android.widget.Button) TaskData(com.ichi2.async.TaskData) WebView(android.webkit.WebView) InitConfig(com.ichi2.bd.InitConfig) Auth(com.ichi2.bd.Auth) SimpleOnGestureListener(android.view.GestureDetector.SimpleOnGestureListener) SynthesizerTool(com.baidu.tts.client.SynthesizerTool) BroadcastReceiver(android.content.BroadcastReceiver) ViewGroup(android.view.ViewGroup) Timber(timber.log.Timber) IOfflineResourceConst(com.ichi2.bd.IOfflineResourceConst) MySyntherizer(com.ichi2.bd.MySyntherizer) List(java.util.List) TextView(android.widget.TextView) ActivityNotFoundException(android.content.ActivityNotFoundException) SpeechSynthesizer(com.baidu.tts.client.SpeechSynthesizer) KEY_SELECT_ONLINE_SPEAK_ENGINE(com.ichi2.libanki.Consts.KEY_SELECT_ONLINE_SPEAK_ENGINE) Toolbar(androidx.appcompat.widget.Toolbar) RelativeLayout(android.widget.RelativeLayout) THEME_NIGHT_DARK(com.ichi2.themes.Themes.THEME_NIGHT_DARK) OfflineResource(com.ichi2.bd.OfflineResource) AudioView(com.ichi2.anki.multimediacard.AudioView) Pattern(java.util.regex.Pattern) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) Window(android.view.Window) EditorInfo(android.view.inputmethod.EditorInfo) Snackbar(com.google.android.material.snackbar.Snackbar) UnsupportedEncodingException(java.io.UnsupportedEncodingException) KEY_SHOW_TTS_ICON(com.ichi2.libanki.Consts.KEY_SHOW_TTS_ICON) Note(com.ichi2.libanki.Note) Context(android.content.Context) TaskListener(com.ichi2.async.TaskListener) UI_CHANGE_SYNTHES_TEXT_SELECTION(com.ichi2.bd.MainHandlerConstant.UI_CHANGE_SYNTHES_TEXT_SELECTION) KeyEvent(android.view.KeyEvent) Pair(android.util.Pair) Intent(android.content.Intent) ReviewerCustomFonts(com.ichi2.anki.reviewer.ReviewerCustomFonts) HashMap(java.util.HashMap) REFRESH_LOGIN_STATE_AND_TURN_TO_VIP_HTML(com.ichi2.anki.DeckPicker.REFRESH_LOGIN_STATE_AND_TURN_TO_VIP_HTML) Collection(com.ichi2.libanki.Collection) TypedArray(android.content.res.TypedArray) MenuItem(android.view.MenuItem) InputMethodManager(android.view.inputmethod.InputMethodManager) RequestBody(okhttp3.RequestBody) TASK_TYPE(com.ichi2.async.CollectionTask.TASK_TYPE) HashSet(java.util.HashSet) ConnectivityManagerCompat(androidx.core.net.ConnectivityManagerCompat) SuppressLint(android.annotation.SuppressLint) JSONArray(com.ichi2.utils.JSONArray) MotionEvent(android.view.MotionEvent) Build(android.os.Build) WeakReference(java.lang.ref.WeakReference) LinkedList(java.util.LinkedList) Sound(com.ichi2.libanki.Sound) Utils(com.ichi2.libanki.Utils) LoggerProxy(com.baidu.tts.chainofresponsibility.logger.LoggerProxy) Consumer(com.ichi2.utils.FunctionalInterfaces.Consumer) Function(com.ichi2.utils.FunctionalInterfaces.Function) UI_CHANGE_INPUT_TEXT_SELECTION(com.ichi2.bd.MainHandlerConstant.UI_CHANGE_INPUT_TEXT_SELECTION) FlagDef(com.ichi2.anki.reviewer.CardMarker.FlagDef) LayoutInflater(android.view.LayoutInflater) ReviewerUi(com.ichi2.anki.reviewer.ReviewerUi) CollectionTask(com.ichi2.async.CollectionTask) Chronometer(android.widget.Chronometer) Themes(com.ichi2.themes.Themes) Template(com.ichi2.libanki.template.Template) Color(android.graphics.Color) WebResourceError(android.webkit.WebResourceError) UI_PLAY_START(com.ichi2.bd.MainHandlerConstant.UI_PLAY_START) AdaptionUtil(com.ichi2.utils.AdaptionUtil) Card(com.ichi2.libanki.Card) Activity(android.app.Activity) VisibleForTesting(androidx.annotation.VisibleForTesting) CustomStyleDialog(com.ichi2.ui.CustomStyleDialog) Resources(android.content.res.Resources) OnClickListener(android.view.View.OnClickListener) Note(com.ichi2.libanki.Note) ArrayList(java.util.ArrayList) TagsDialog(com.ichi2.anki.dialogs.TagsDialog)

Example 2 with TagsDialog

use of com.ichi2.anki.dialogs.TagsDialog in project AnkiChinaAndroid by ankichinateam.

the class NoteEditor method showTagsDialog.

private void showTagsDialog() {
    if (mSelectedTags == null) {
        mSelectedTags = new ArrayList<>(0);
    }
    ArrayList<String> tags = new ArrayList<>(getCol().getTags().all());
    ArrayList<String> selTags = new ArrayList<>(mSelectedTags);
    TagsDialog.TagsDialogListener tagsDialogListener = (selectedTags, option) -> {
        if (!mSelectedTags.equals(selectedTags)) {
            mTagsEdited = true;
        }
        mSelectedTags = selectedTags;
        updateTags();
    };
    TagsDialog dialog = TagsDialog.newInstance(TagsDialog.TYPE_ADD_TAG, selTags, tags);
    dialog.setTagsDialogListener(tagsDialogListener);
    showDialogFragment(dialog);
}
Also used : Arrays(java.util.Arrays) Bundle(android.os.Bundle) TagsDialog(com.ichi2.anki.dialogs.TagsDialog) Deck(com.ichi2.libanki.Deck) NonNull(androidx.annotation.NonNull) Uri(android.net.Uri) Drawable(android.graphics.drawable.Drawable) AudioRecordingField(com.ichi2.anki.multimediacard.fields.AudioRecordingField) Map(java.util.Map) ClipboardManager(android.content.ClipboardManager) ContextCompat(androidx.core.content.ContextCompat) TargetApi(android.annotation.TargetApi) FieldChangeType(com.ichi2.anki.noteeditor.FieldState.FieldChangeType) IntentFilter(android.content.IntentFilter) IField(com.ichi2.anki.multimediacard.fields.IField) Set(java.util.Set) JSONObject(com.ichi2.utils.JSONObject) PopupMenuWithIcons(com.ichi2.anki.widgets.PopupMenuWithIcons) StringRes(androidx.annotation.StringRes) Nullable(androidx.annotation.Nullable) Consts(com.ichi2.libanki.Consts) CompatHelper(com.ichi2.compat.CompatHelper) DiscardChangesDialog(com.ichi2.anki.dialogs.DiscardChangesDialog) Models(com.ichi2.libanki.Models) TextWatcher(android.text.TextWatcher) DialogFragment(androidx.fragment.app.DialogFragment) ClozeUtils(com.ichi2.libanki.Note.ClozeUtils) KeyUtils(com.ichi2.utils.KeyUtils) Direction(com.ichi2.anim.ActivityTransitionAnimation.Direction) IMultimediaEditableNote(com.ichi2.anki.multimediacard.IMultimediaEditableNote) SdCardReceiver(com.ichi2.anki.receiver.SdCardReceiver) Editable(android.text.Editable) ImageField(com.ichi2.anki.multimediacard.fields.ImageField) ArrayList(java.util.ArrayList) NOT_FOUND_NOTE_TYPE(com.ichi2.libanki.Models.NOT_FOUND_NOTE_TYPE) MenuInflater(android.view.MenuInflater) Menu(android.view.Menu) IntegerDialog(com.ichi2.anki.dialogs.IntegerDialog) CheckResult(androidx.annotation.CheckResult) ContentResolverUtil(com.ichi2.utils.ContentResolverUtil) TextUtils(android.text.TextUtils) IOException(java.io.IOException) Toolbar(com.ichi2.anki.noteeditor.Toolbar) CustomToolbarButton(com.ichi2.anki.noteeditor.CustomToolbarButton) File(java.io.File) TextViewUtil(com.ichi2.utils.TextViewUtil) ArrayAdapter(android.widget.ArrayAdapter) SharedPreferences(android.content.SharedPreferences) FileUtil(com.ichi2.utils.FileUtil) ActivityTransitionAnimation(com.ichi2.anim.ActivityTransitionAnimation) EditText(android.widget.EditText) RequiresApi(androidx.annotation.RequiresApi) ImageButton(android.widget.ImageButton) ActionMode(android.view.ActionMode) LinearLayout(android.widget.LinearLayout) MultimediaEditFieldActivity(com.ichi2.anki.multimediacard.activity.MultimediaEditFieldActivity) WindowManager(android.view.WindowManager) ConfirmationDialog(com.ichi2.anki.dialogs.ConfirmationDialog) Locale(java.util.Locale) EFieldType(com.ichi2.anki.multimediacard.fields.EFieldType) View(android.view.View) TaskData(com.ichi2.async.TaskData) AdapterView(android.widget.AdapterView) MultimediaEditableNote(com.ichi2.anki.multimediacard.impl.MultimediaEditableNote) LocaleSelectionDialog(com.ichi2.anki.dialogs.LocaleSelectionDialog) EXTRA_PROCESS_TEXT(com.ichi2.compat.Compat.EXTRA_PROCESS_TEXT) BroadcastReceiver(android.content.BroadcastReceiver) FieldState(com.ichi2.anki.noteeditor.FieldState) Timber(timber.log.Timber) TextField(com.ichi2.anki.multimediacard.fields.TextField) List(java.util.List) TextView(android.widget.TextView) OnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener) TaskListenerWithContext(com.ichi2.async.TaskListenerWithContext) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) Typeface(android.graphics.Typeface) Note(com.ichi2.libanki.Note) Context(android.content.Context) KeyEvent(android.view.KeyEvent) AudioClipField(com.ichi2.anki.multimediacard.fields.AudioClipField) Pair(android.util.Pair) NamedJSONComparator(com.ichi2.utils.NamedJSONComparator) Intent(android.content.Intent) HashMap(java.util.HashMap) Collection(com.ichi2.libanki.Collection) StyledProgressDialog(com.ichi2.themes.StyledProgressDialog) MenuItem(android.view.MenuItem) InputMethodManager(android.view.inputmethod.InputMethodManager) MapUtil(com.ichi2.utils.MapUtil) HashSet(java.util.HashSet) SuppressLint(android.annotation.SuppressLint) JSONArray(com.ichi2.utils.JSONArray) WidgetStatus(com.ichi2.widget.WidgetStatus) Model(com.ichi2.libanki.Model) Build(android.os.Build) LinkedList(java.util.LinkedList) DeckComparator(com.ichi2.utils.DeckComparator) Utils(com.ichi2.libanki.Utils) ConfirmModSchemaException(com.ichi2.anki.exception.ConfirmModSchemaException) NoteService(com.ichi2.anki.servicelayer.NoteService) Consumer(com.ichi2.utils.FunctionalInterfaces.Consumer) CollectionTask(com.ichi2.async.CollectionTask) Themes(com.ichi2.themes.Themes) Spinner(android.widget.Spinner) PopupMenu(androidx.appcompat.widget.PopupMenu) ACTION_PROCESS_TEXT(com.ichi2.compat.Compat.ACTION_PROCESS_TEXT) ADD_NOTE(com.ichi2.async.CollectionTask.TASK_TYPE.ADD_NOTE) AdaptionUtil(com.ichi2.utils.AdaptionUtil) Card(com.ichi2.libanki.Card) VisibleForTesting(androidx.annotation.VisibleForTesting) Collections(java.util.Collections) NoteFieldDecorator(com.ichi2.utils.NoteFieldDecorator) Resources(android.content.res.Resources) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) TagsDialog(com.ichi2.anki.dialogs.TagsDialog)

Example 3 with TagsDialog

use of com.ichi2.anki.dialogs.TagsDialog in project AnkiChinaAndroid by ankichinateam.

the class CardBrowser method showTagsDialog.

private void showTagsDialog() {
    TagsDialog dialog = TagsDialog.newInstance(TagsDialog.TYPE_FILTER_BY_TAG, new ArrayList<String>(), new ArrayList<>(getCol().getTags().all()));
    dialog.setTagsDialogListener(this::filterByTag);
    showDialogFragment(dialog);
}
Also used : TagsDialog(com.ichi2.anki.dialogs.TagsDialog)

Example 4 with TagsDialog

use of com.ichi2.anki.dialogs.TagsDialog in project Anki-Android by ankidroid.

the class CardBrowser method showEditTagsDialog.

private void showEditTagsDialog() {
    if (getSelectedCardIds().isEmpty()) {
        Timber.d("showEditTagsDialog: called with empty selection");
    }
    final ArrayList<String> allTags = new ArrayList<>(getCol().getTags().all());
    List<Note> selectedNotes = getSelectedCardIds().stream().map(cardId -> getCol().getCard(cardId).note()).distinct().collect(Collectors.toList());
    final ArrayList<String> checkedTags = selectedNotes.stream().flatMap(note -> note.getTags().stream()).collect(Collectors.toCollection(ArrayList::new));
    if (selectedNotes.size() == 1) {
        Timber.d("showEditTagsDialog: edit tags for one note");
        mTagsDialogListenerAction = TagsDialogListenerAction.EDIT_TAGS;
        TagsDialog dialog = mTagsDialogFactory.newTagsDialog().withArguments(TagsDialog.DialogType.EDIT_TAGS, checkedTags, allTags);
        showDialogFragment(dialog);
        return;
    }
    final ArrayList<String> uncheckedTags = selectedNotes.stream().flatMap(note -> {
        final List<String> noteTags = note.getTags();
        return allTags.stream().filter(t -> !noteTags.contains(t));
    }).collect(Collectors.toCollection(ArrayList::new));
    Timber.d("showEditTagsDialog: edit tags for multiple note");
    mTagsDialogListenerAction = TagsDialogListenerAction.EDIT_TAGS;
    TagsDialog dialog = mTagsDialogFactory.newTagsDialog().withArguments(TagsDialog.DialogType.EDIT_TAGS, checkedTags, uncheckedTags, allTags);
    showDialogFragment(dialog);
}
Also used : TemplateRenderOutput(com.ichi2.libanki.TemplateManager.TemplateRenderContext.TemplateRenderOutput) Arrays(java.util.Arrays) Bundle(android.os.Bundle) SortOrder(com.ichi2.libanki.SortOrder) Deck(com.ichi2.libanki.Deck) NonNull(androidx.annotation.NonNull) Decks(com.ichi2.libanki.Decks) Map(java.util.Map) JSONException(com.ichi2.utils.JSONException) Upgrade(com.ichi2.upgrade.Upgrade) IntentFilter(android.content.IntentFilter) Set(java.util.Set) SearchView(androidx.appcompat.widget.SearchView) JSONObject(com.ichi2.utils.JSONObject) LanguageUtil.getLocaleCompat(com.ichi2.utils.LanguageUtil.getLocaleCompat) Unit(kotlin.Unit) Nullable(androidx.annotation.Nullable) TagsDialogListener(com.ichi2.anki.dialogs.tags.TagsDialogListener) Consts(com.ichi2.libanki.Consts) ActivityResultContracts(androidx.activity.result.contract.ActivityResultContracts) CompatHelper(com.ichi2.compat.CompatHelper) TagsDialogFactory(com.ichi2.anki.dialogs.tags.TagsDialogFactory) RustCleanup(net.ankiweb.rsdroid.RustCleanup) HandlerUtils(com.ichi2.utils.HandlerUtils) TagsDialog(com.ichi2.anki.dialogs.tags.TagsDialog) Direction(com.ichi2.anim.ActivityTransitionAnimation.Direction) SystemClock(android.os.SystemClock) RescheduleDialog(com.ichi2.anki.dialogs.RescheduleDialog) SdCardReceiver(com.ichi2.anki.receiver.SdCardReceiver) Column(com.ichi2.anki.CardBrowser.Column) ArrayList(java.util.ArrayList) Menu(android.view.Menu) SimpleMessageDialog(com.ichi2.anki.dialogs.SimpleMessageDialog) LinkedHashSet(java.util.LinkedHashSet) IntegerDialog(com.ichi2.anki.dialogs.IntegerDialog) CheckResult(androidx.annotation.CheckResult) TextUtils(android.text.TextUtils) CardBrowserSearchView(com.ichi2.ui.CardBrowserSearchView) ArrayAdapter(android.widget.ArrayAdapter) SharedPreferences(android.content.SharedPreferences) TypedValue(android.util.TypedValue) SECONDS_PER_DAY(com.ichi2.libanki.stats.Stats.SECONDS_PER_DAY) LanguageUtil(com.ichi2.utils.LanguageUtil) SchedulerService(com.ichi2.anki.servicelayer.SchedulerService) CardBrowserOrderDialog(com.ichi2.anki.dialogs.CardBrowserOrderDialog) TaskManager(com.ichi2.async.TaskManager) WindowManager(android.view.WindowManager) Compat(com.ichi2.compat.Compat) 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) AdapterView(android.widget.AdapterView) CardBrowserMySearchesDialog(com.ichi2.anki.dialogs.CardBrowserMySearchesDialog) HashUtil(com.ichi2.utils.HashUtil) BroadcastReceiver(android.content.BroadcastReceiver) Collectors(java.util.stream.Collectors) ViewGroup(android.view.ViewGroup) Timber(timber.log.Timber) AlertDialog(android.app.AlertDialog) UndoService(com.ichi2.anki.servicelayer.UndoService) List(java.util.List) TextView(android.widget.TextView) OnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener) BaseAdapter(android.widget.BaseAdapter) TaskListenerWithContext(com.ichi2.async.TaskListenerWithContext) ListView(android.widget.ListView) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) Snackbar(com.google.android.material.snackbar.Snackbar) SearchCardsResult(com.ichi2.anki.servicelayer.SearchService.SearchCardsResult) Typeface(android.graphics.Typeface) Note(com.ichi2.libanki.Note) Context(android.content.Context) NextCard(com.ichi2.anki.servicelayer.SchedulerService.NextCard) KeyEvent(android.view.KeyEvent) Pair(android.util.Pair) Intent(android.content.Intent) HashMap(java.util.HashMap) Collection(com.ichi2.libanki.Collection) MenuItem(android.view.MenuItem) HashSet(java.util.HashSet) DeckDropDownAdapter(com.ichi2.anki.widgets.DeckDropDownAdapter) WidgetStatus(com.ichi2.widget.WidgetStatus) Utils(com.ichi2.libanki.Utils) NoteService(com.ichi2.anki.servicelayer.NoteService) Computation(com.ichi2.utils.Computation) Iterator(java.util.Iterator) ActivityResultLauncher(androidx.activity.result.ActivityResultLauncher) LayoutInflater(android.view.LayoutInflater) AbsListView(android.widget.AbsListView) CollectionTask(com.ichi2.async.CollectionTask) Themes(com.ichi2.themes.Themes) Spinner(android.widget.Spinner) Consumer(java.util.function.Consumer) TagsUtil(com.ichi2.utils.TagsUtil) Card(com.ichi2.libanki.Card) VisibleForTesting(androidx.annotation.VisibleForTesting) Collections(java.util.Collections) DeckSelectionDialog(com.ichi2.anki.dialogs.DeckSelectionDialog) Note(com.ichi2.libanki.Note) ArrayList(java.util.ArrayList) TagsDialog(com.ichi2.anki.dialogs.tags.TagsDialog) ArrayList(java.util.ArrayList) List(java.util.List)

Example 5 with TagsDialog

use of com.ichi2.anki.dialogs.TagsDialog in project Anki-Android by ankidroid.

the class CardBrowser method showFilterByTagsDialog.

private void showFilterByTagsDialog() {
    mTagsDialogListenerAction = TagsDialogListenerAction.FILTER;
    TagsDialog dialog = mTagsDialogFactory.newTagsDialog().withArguments(TagsDialog.DialogType.FILTER_BY_TAG, new ArrayList<>(0), new ArrayList<>(getCol().getTags().all()));
    showDialogFragment(dialog);
}
Also used : TagsDialog(com.ichi2.anki.dialogs.tags.TagsDialog)

Aggregations

ArrayList (java.util.ArrayList)6 Intent (android.content.Intent)4 View (android.view.View)4 TextView (android.widget.TextView)4 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)4 TagsDialog (com.ichi2.anki.dialogs.TagsDialog)4 BroadcastReceiver (android.content.BroadcastReceiver)3 Context (android.content.Context)3 IntentFilter (android.content.IntentFilter)3 SharedPreferences (android.content.SharedPreferences)3 Bundle (android.os.Bundle)3 TextUtils (android.text.TextUtils)3 Pair (android.util.Pair)3 KeyEvent (android.view.KeyEvent)3 Menu (android.view.Menu)3 MenuItem (android.view.MenuItem)3 WindowManager (android.view.WindowManager)3 CheckResult (androidx.annotation.CheckResult)3 NonNull (androidx.annotation.NonNull)3 Nullable (androidx.annotation.Nullable)3