dirkvranckaert / my-episodes-watch-manager

Automatically exported from code.google.com/p/my-episodes-watch-manager
1 stars 2 forks source link

PrefencesDialog, should be used instead of some custom component #44

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We should use the preferencesDialog instead of using a custom written 
component as we do now! Important for screen-resolution independent 
development

Original issue reported on code.google.com by dirkvran...@gmail.com on 16 May 2010 at 12:16

GoogleCodeExporter commented 8 years ago

Original comment by dirkvran...@gmail.com on 16 May 2010 at 1:02

GoogleCodeExporter commented 8 years ago
Doing well so far. The option to remember the password has already been changed 
to 
the new preferences.

For the two sorting options a different approach is required.
Reasons:
* The stings.xml file contains a list of values to be displayed per option
* Per option an Enum is available which contains the values to be stored in the 
preferences
=> So the value on the screen is not the value to store, so a convertion needs 
to be 
done.

This can be achieved by implementing custom ListPreference. Try overriding all 
possible methods and see (through the debugger) in which methods the debugger 
stops 
to set the default value (would sth like onGetDefaultValue or onSetInitialValue 
I 
guess) and to persist the selected value to the preferences (The persistString 
or 
persistInt method inherited from the Preference class).

Original comment by dirkvran...@gmail.com on 19 May 2010 at 11:33

GoogleCodeExporter commented 8 years ago
Examples of some custom Preference components:
http://android-journey.blogspot.com/2010/01/for-almost-any-application-we-need-
to.html
http://www.androidsnippets.org/snippets/34/

Original comment by dirkvran...@gmail.com on 19 May 2010 at 11:40

GoogleCodeExporter commented 8 years ago
Done, easy and simple implementation now :)

Original comment by dirkvran...@gmail.com on 22 May 2010 at 4:00