Maxr1998 / ModernAndroidPreferences

Android Preferences defined through Kotlin DSL, shown in a RecyclerView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

multiChoice preference doesn't show summary

rosenpin opened this issue · comments

Hi Max what's up?
Long time

This library is pretty awesome, it looks fantastic and this is the least painful way I encountered to handle preferences in Android

I messed around a bit with it in a new app I'm working on and it seems like when providing summary to the multiChoice preference it isn't shown anywhere, not where the normal summaries are and not in the dialog

Code:

 multiChoice("special_buttons", specialButtons) {
            title = "Special buttons"
            summary = "WIP: Choose what the special button to show"
        }

Thanks!

Hey Tomer,
Long time no see!
Hope you're doing good, glad to see that Always On AMOLED is still getting updated.

So, onto your report: the choice preferences are currently set up to show the current selection if one was made, and only fall back to the standard summaries if you made no choice at all. This is less than ideal, and I should fix that.
I'll probably handle it like I do in the new EditText preference, and allow the use of a summary provider lambda, with a fallback to the current behavior.
And you're right, it also makes sense to show not only the preference title, but also the summary within dialogs (possibly configurable).

Thanks! :)

Awesome, sounds great

Though I should note that I didn't see the summary even before making a selection. Same if I clear the app data, it just stays empty

Though I should note that I didn't see the summary even before making a selection. Same if I clear the app data, it just stays empty

I have to investigate this then 🤔

Should be working actually, at least I couldn't reproduce the bug.
Regardless, I introduced the possibility to turn of auto-generated summaries in 7780c3d. You simply have to set autoGeneratedSummary to false on the preference.

Sorry for taking so long to work on it, university work kept me busy..
I'll draft a new release soon, then you can test it. Released as 2.1.0.