I have encountered a weird "bug" with the PreferenceActivity class whereby
the title of the Preferences displayed uneven font size when switching
between Portrait and Landscape mode on an Android emulator and on real
physical mobile devices.
My PreferenceActivity class has this declaration:
public class PreferencesActivity extends PreferenceActivity implements
OnSharedPreferenceChangeListener {
// codes here.
}
My style for the PreferenceActivity is as follow:
<style name="Preference.Material.Dark.Theme" parent="android:Theme.Material"
>
<item name="name="android:colorAccent">@color/white</item>
<item name="android:windowTitleStyle">
@style/Preference.Window.Title.Style</item>
</style>
<style name="Preference.Window.Title.Style" parent="">
<item name="android:textSize">20sp</item>
</style>
In Portrait mode, the text size is displayed correctly (i.e. as 20sp) as
shown in the following screenshot:
<https://lh3.googleusercontent.com/-CNCqyQjLnIc/VnL7C782xbI/AAAAAAAAAIg/kR5W48g-tXE/s1600/preference_header_portrait.png>
However, in Landscape mode, the font is displayed much smaller as shown
below:
<https://lh3.googleusercontent.com/-EVkPc9B6NrA/VnL7aZdDPhI/AAAAAAAAAIo/k1ThhRFu0j8/s1600/preference_header_landscape.png>
Is the Material base theme overriding my theme in Landscape mode by any
chance? And why?
Does anyone have a method of styling the size of the displayed title of the
Preferences so it looks the same in both Portrait and Landscape mode?
I'm at my wits end and I don't know what's going on, or how to fix this. If
it's a bug with the Material theme/style, I'll log it in the Android's
Issue Tracker. If not, I'm stuck.
Ideas are welcomed.
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/500baffc-9b7f-49d0-877a-90a43b5e8b99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.