Maxr1998 / ModernAndroidPreferences

Android Preferences defined through Kotlin DSL, shown in a RecyclerView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting `collapseIcon = true` does not work

msfjarvis opened this issue · comments

The logic in this line is never false.

Setting a breakpoint confirms this. The expression evaluates to false in this case even though there is no iconRes or icon set.

Screenshot of the line of code linked above with a debugger expression evaluation for 'itemVisible || !preferenceParent.collapseIcon' which results in 'false'

Screenshot of the line of code linked above with a debugger expression evaluation for 'iconRes != DEFAULT_RES_ID || icon != null' which results in 'false'

Could you check if collapseIcon is actually true there? I just tested this locally, and it seemed to work.
Note that the collapseIcon attribute currently has to be set on every screen/subScreen and isn't inherited from the parent screen.

Note that the collapseIcon attribute currently has to be set on every screen/subScreen and isn't inherited from the parent screen.

Oh

That was it, thanks!

Alright, good to know it's not a bug.
But this shows me the current design is neither obvious nor that great. I'll look if I can tune this for a future release. I think when I finally introduce the storage abstraction, I could also include a few other behavior changes as part of a major release.