This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
[Toolbar] How to implement toggle button backed by sharedPrefs? #13710
Labels
needs:triage
Issue needs triage
I originally filed #265 to ask a specific question wrt our implementation: this bug is to explain the problem we were trying to generally solve to see if the framework should change to account for it.
We want to have a Toolbar.ActionToggleButton backed by shared preferences, i.e.:
However, there are two problems in the current implementation: we can't set the state without changing the listener #267 and we're not sure the best way to keep references to the button views #268. As such, we do something funky:
(I actually realize this may be broken because the listener holds a strong reference to the toolbar). This only currently works because the call order is correct #265 for
setSelected
. What is the recommended way to implement such a button, that is backed by SharedPreferences?┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: