pavreh
January 31, 2025, 8:50pm
1
There is a new Card Browser in AnkiDroid 2.21alpha11where you can set more columns than two. It is great. It would be also great to have the old function where you can tap on the top line and select what there should be displayed. It takes two taps to change the displayed data in the old card browser.
2 Likes
David
February 2, 2025, 8:17am
2
Agreed, thanks!. For now you can have 3 columns so you don’t need to switch. Moved this one to GitHub
opened 08:16AM - 02 Feb 25 UTC
Good First Issue!
Card Browser
2.21
> There is a new Card Browser in AnkiDroid 2.21alpha11where you can set more col… umns than two. It is great. It would be also great to have the old function where you can tap on the top line and select what there should be displayed. It takes two taps to change the displayed data in the old card browser.
>
> <details> <summary>Screenshot</summary>
>
> 
> </details>
Source: https://forums.ankiweb.net/t/ankidroid-2-21alpha11-card-browser/55145
----
Cause & context
* https://github.com/ankidroid/Anki-Android/issues/17780
* https://github.com/ankidroid/Anki-Android/pull/17781
----
The `<Spinner>` which we removed in the above PR was space inefficient and will no longer be usable. Just add a click listener to the current TextView
I would recommend opening a simple dialog here which lists:
* the columns which are not in use
* previews of the data which will be displayed.
A 'single press' listener should be added, which opens a dialog which lists all available columns, excluding the ones which are already in use.
Here is what we do for the 'long press' listener. The single press listener should be on the TextViews inside this view (so each one refers to a different column) and a reasonable method should be added.
You can probably use this for a good design of the dialog entries [hide the buttons on the right]]: https://github.com/ankidroid/Anki-Android/blob/a863c1bee72077198a1b33764a445567c6684cdc/AnkiDroid/src/main/res/layout/browser_columns_selection_entry.xml
https://github.com/ankidroid/Anki-Android/blob/e1088cf305309793cf87e2b603ecfd860cdd8173/AnkiDroid/src/main/java/com/ichi2/anki/CardBrowser.kt#L421-L429
The list of unused & available columns is available from the `CardBrowserViewModel` already. The dialog should display the labels (and a preview of the data if it exists):
The dialog title should specify the column which is being changed, so a user is made aware of a misclick
https://github.com/ankidroid/Anki-Android/blob/3ea835e21d96b3ad7f681995b6cffc2e3f775b1c/AnkiDroid/src/main/java/com/ichi2/anki/browser/CardBrowserViewModel.kt#L948-L973
On selection, call the following method with the appropriate parameters:
https://github.com/ankidroid/Anki-Android/blob/3ea835e21d96b3ad7f681995b6cffc2e3f775b1c/AnkiDroid/src/main/java/com/ichi2/anki/browser/CardBrowserViewModel.kt#L565-L578
Add a `@NeedsTest("")` annotation on `updateActiveColumns`, noting that updating one column should not cause all columns to be reloaded. We do not handle this case yet, it probably doesn't matter from a performance perspective, but it would be nice to handle from a 'do the right thing' perspective
3 Likes