There are a lot of questions around how to customize a ListPreference with images on each row and so on.
What i m interested is, however, the button that opens up the list dialog.
For example, for the sync frequency :
Is there a way to replace the generic listpref button with an image button ?
Thanks in advance!
You can simply use the android:icon attribute to add an image to your ListPreference entry.
Documentation
Related
I am remaking our custom preferences screen into PreferencesScreen.
We currently have several settings, for example checkboxes, with a questionmark icon next to it that users can click to get information about the setting.
The built-in preferences have "setIcon" which works, but it does not seem possible to make them clickable.
Is the only solution to make totally custom layouts for my preference, or is there some other way to have a clickable image or icon next to my preference rows?
I want to use FloatingActionButton for "like" action, but there should be two states for this, liked and unliked. So ToggleButton is suitable for this, but is there anything that combines the feature of these two kinds of button?
You can use the checkbox with checked and unchecked images. so that you can able to manage it for like and like within same button action. this link will help you to get the checkbox selector which use icons for different state.
Basically this depend on your scenario,for eg if want to show like dislike only then use toggle button only and if want to perform some action then use floating action button with all the action..
Like for particular page change background black white,increase text size etc..All depends on scenario..And always try to choose best not to fail at any stage...For anything pls ask
I need to add a spinner in my PreferenceCategory with a text on its right is there a way to do that? plus when I create a checkboxpreference the text is on the left how can I make the text appear on the right?
thanks.
If you want to use these built in controls you have to use them the way they are designed. Its also good because it fits the android design that users expect.
If you need to do something different, just make your own preference screen. Its just a list view with click handlers, not too hard to make on your own. Then you get the styling you want.
I would like to customize the appearance of the dialog that appears when I click on the spinner in spinnermode=dialog.
I want to use a dialog fragment but I find no documentation.
Is it possible?
No. The appearance is fixed to give it the feel of the operating system. You would have to create your own spinner to do this which isn't easy but also not too difficult if the lists in your spinner won't get so large that it takes up all the phone's memory. Just make a control that can scroll vertically.
I have no idea how to achieve this, and don't know if it's achievable or not.
I have a sharedPreference value I set via my android app like this
menu button -> settings -> listPreference (a 1 digit value is set this way, among 3 values!!!)
I would however like to be able to set this value without entering the settings menu first, because it is changed often. Im thinking a button should take me directly to the listPreference dialog box like this!
Button -> listPreference
Is is possible to omit the settings menu like this?
Thanks
I asked somthing similar some time back. There is no quick solution but I have a coded up custom solution in the answer to this question