osmeditor4android
osmeditor4android copied to clipboard
Add reset to default button for each preference individually
Each time we want to reset an individual preference to its default, for example:
We must first look it up in Help to find what the default value is:
Max line width Maximum width lines will increase to when zooming in. Default: 16 pixels.
It would be great if each preference had its own Reset to Default button too.
This would seem to be an awful lot of work for something that would essentially never be used. Note that in the odd case you want to use the original value, they are all documented here http://vespucci.io/help/en/Advanced%20preferences/#max-line-width
I guess we've all grown to expect them everywhere setting might be, example:

https://developer.android.com/reference/androidx/preference/Preference doesn't retain the default value and doesn't provide a method to access it.
It is possible to reset all preferences at once by clearing all current values and then forcing a reread of the XML file, see https://developer.android.com/reference/androidx/preference/PreferenceManager#setDefaultValues(android.content.Context,int,boolean)
Potentially something could be hacked by sub-classing all the Preference classes we use and overriding https://developer.android.com/reference/androidx/preference/Preference#onGetDefaultValue(android.content.res.TypedArray,int) however this would only work for new installs (and as already pointed out an insane amount of work relative to the value add this feature would provide).