Padding and margin in DialogPreference

I implemented a Time Picker in the preference using the code found here where the class TimePreference extends the class DialogPreference but I found a lack of alignment with the other preference items because of a different setting of the margins and/or padding.

For example the following xml file:

which contains a CheckBoxPreference and a TimePreference and it has the following screenshot:

preferences_0

where the style for the TimePreference is different from that one for the CheckBoxPreference.

I solved the problem by replacing the constructor

con

Now the preference items have the same style:

dialogPreferenceStyle

One Reply to “Padding and margin in DialogPreference”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.