PreferenceFragmentCompat style is broken after setting targetSdkVersion to 28.
Hey there my PreferenceFragmentCompat looked fine before I upgraded to sdk version 28. However after upgrading, its style is broken and I can't seem to fix it. Why is the reason and how can I fix it?
This is my app style:
<style name="MyMaterialTheme0" parent="MyMaterialTheme0.Base"/>
<style name="MyMaterialTheme0.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary0</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark0</item>
<item name="colorAccent">@color/colorAccent0</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style>
Old style
New Broken style
android
add a comment |
Hey there my PreferenceFragmentCompat looked fine before I upgraded to sdk version 28. However after upgrading, its style is broken and I can't seem to fix it. Why is the reason and how can I fix it?
This is my app style:
<style name="MyMaterialTheme0" parent="MyMaterialTheme0.Base"/>
<style name="MyMaterialTheme0.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary0</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark0</item>
<item name="colorAccent">@color/colorAccent0</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style>
Old style
New Broken style
android
add a comment |
Hey there my PreferenceFragmentCompat looked fine before I upgraded to sdk version 28. However after upgrading, its style is broken and I can't seem to fix it. Why is the reason and how can I fix it?
This is my app style:
<style name="MyMaterialTheme0" parent="MyMaterialTheme0.Base"/>
<style name="MyMaterialTheme0.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary0</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark0</item>
<item name="colorAccent">@color/colorAccent0</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style>
Old style
New Broken style
android
Hey there my PreferenceFragmentCompat looked fine before I upgraded to sdk version 28. However after upgrading, its style is broken and I can't seem to fix it. Why is the reason and how can I fix it?
This is my app style:
<style name="MyMaterialTheme0" parent="MyMaterialTheme0.Base"/>
<style name="MyMaterialTheme0.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary0</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark0</item>
<item name="colorAccent">@color/colorAccent0</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style>
Old style
New Broken style
android
android
asked Nov 23 at 7:38
yigitserin
9113
9113
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Per the Preference rc01 release notes:
PreferenceThemeOverlay
has been updated to the latest material theme. If no custom theme is provided,PreferenceThemeOverlay
is used as the default theme.
PreferenceThemeOverlay.v14
andPreferenceThemeOverlay.v14.Material
themes have been deprecated in favour ofPreferenceThemeOverlay
.
Therefore you can simply remove your preferenceTheme
attribute entirely to get the default, correct theming if you're not customizing the preferences theme at all.
Removing <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> did not solve this issue.
– yigitserin
Nov 23 at 8:14
Are you changing the default text style or anything else in your theme?
– ianhanniballake
Nov 23 at 8:16
No, my style file is as listed above.
– yigitserin
Nov 23 at 8:24
Also I am using implementation 'com.android.support:preference-v7:28.0.0'
– yigitserin
Nov 23 at 8:34
add a comment |
Here are the diff changes between the PreferenceThemeOverlay.v14.Material and PreferenceThemeOverlay. Pay attention to new allowDividerAbove, allowDividerBelow and iconSpaceReserved attributes.
I've had to modify my style to match before update like:
<style name="AppSettingsTheme" parent="PreferenceThemeOverlay">
<item name="preferenceCategoryStyle">@style/AppSettings.Category.Material</item>
<item name="preferenceFragmentCompatStyle">@style/AppSettings.Fragment.Material</item>
<item name="preferenceStyle">@style/AppSettings.Preference.Material</item>
</style>
<style name="AppSettings.Category.Material" parent="Preference.Category.Material">
<item name="allowDividerAbove">false</item>
<item name="allowDividerBelow">false</item>
<item name="iconSpaceReserved">false</item>
</style>
<style name="AppSettings.Fragment.Material" parent="PreferenceFragment.Material">
<item name="allowDividerAfterLastItem">true</item>
</style>
<style name="AppSettings.Preference.Material" parent="Preference.Material">
<item name="allowDividerAbove">true</item>
<item name="allowDividerBelow">true</item>
<item name="iconSpaceReserved">false</item>
</style>
and update your preferenceTheme to @style/AppSettingsTheme value instead of @style/PreferenceThemeOverlay.v14.Material
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53442445%2fpreferencefragmentcompat-style-is-broken-after-setting-targetsdkversion-to-28%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Per the Preference rc01 release notes:
PreferenceThemeOverlay
has been updated to the latest material theme. If no custom theme is provided,PreferenceThemeOverlay
is used as the default theme.
PreferenceThemeOverlay.v14
andPreferenceThemeOverlay.v14.Material
themes have been deprecated in favour ofPreferenceThemeOverlay
.
Therefore you can simply remove your preferenceTheme
attribute entirely to get the default, correct theming if you're not customizing the preferences theme at all.
Removing <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> did not solve this issue.
– yigitserin
Nov 23 at 8:14
Are you changing the default text style or anything else in your theme?
– ianhanniballake
Nov 23 at 8:16
No, my style file is as listed above.
– yigitserin
Nov 23 at 8:24
Also I am using implementation 'com.android.support:preference-v7:28.0.0'
– yigitserin
Nov 23 at 8:34
add a comment |
Per the Preference rc01 release notes:
PreferenceThemeOverlay
has been updated to the latest material theme. If no custom theme is provided,PreferenceThemeOverlay
is used as the default theme.
PreferenceThemeOverlay.v14
andPreferenceThemeOverlay.v14.Material
themes have been deprecated in favour ofPreferenceThemeOverlay
.
Therefore you can simply remove your preferenceTheme
attribute entirely to get the default, correct theming if you're not customizing the preferences theme at all.
Removing <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> did not solve this issue.
– yigitserin
Nov 23 at 8:14
Are you changing the default text style or anything else in your theme?
– ianhanniballake
Nov 23 at 8:16
No, my style file is as listed above.
– yigitserin
Nov 23 at 8:24
Also I am using implementation 'com.android.support:preference-v7:28.0.0'
– yigitserin
Nov 23 at 8:34
add a comment |
Per the Preference rc01 release notes:
PreferenceThemeOverlay
has been updated to the latest material theme. If no custom theme is provided,PreferenceThemeOverlay
is used as the default theme.
PreferenceThemeOverlay.v14
andPreferenceThemeOverlay.v14.Material
themes have been deprecated in favour ofPreferenceThemeOverlay
.
Therefore you can simply remove your preferenceTheme
attribute entirely to get the default, correct theming if you're not customizing the preferences theme at all.
Per the Preference rc01 release notes:
PreferenceThemeOverlay
has been updated to the latest material theme. If no custom theme is provided,PreferenceThemeOverlay
is used as the default theme.
PreferenceThemeOverlay.v14
andPreferenceThemeOverlay.v14.Material
themes have been deprecated in favour ofPreferenceThemeOverlay
.
Therefore you can simply remove your preferenceTheme
attribute entirely to get the default, correct theming if you're not customizing the preferences theme at all.
answered Nov 23 at 8:11
ianhanniballake
102k14214226
102k14214226
Removing <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> did not solve this issue.
– yigitserin
Nov 23 at 8:14
Are you changing the default text style or anything else in your theme?
– ianhanniballake
Nov 23 at 8:16
No, my style file is as listed above.
– yigitserin
Nov 23 at 8:24
Also I am using implementation 'com.android.support:preference-v7:28.0.0'
– yigitserin
Nov 23 at 8:34
add a comment |
Removing <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> did not solve this issue.
– yigitserin
Nov 23 at 8:14
Are you changing the default text style or anything else in your theme?
– ianhanniballake
Nov 23 at 8:16
No, my style file is as listed above.
– yigitserin
Nov 23 at 8:24
Also I am using implementation 'com.android.support:preference-v7:28.0.0'
– yigitserin
Nov 23 at 8:34
Removing <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> did not solve this issue.
– yigitserin
Nov 23 at 8:14
Removing <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> did not solve this issue.
– yigitserin
Nov 23 at 8:14
Are you changing the default text style or anything else in your theme?
– ianhanniballake
Nov 23 at 8:16
Are you changing the default text style or anything else in your theme?
– ianhanniballake
Nov 23 at 8:16
No, my style file is as listed above.
– yigitserin
Nov 23 at 8:24
No, my style file is as listed above.
– yigitserin
Nov 23 at 8:24
Also I am using implementation 'com.android.support:preference-v7:28.0.0'
– yigitserin
Nov 23 at 8:34
Also I am using implementation 'com.android.support:preference-v7:28.0.0'
– yigitserin
Nov 23 at 8:34
add a comment |
Here are the diff changes between the PreferenceThemeOverlay.v14.Material and PreferenceThemeOverlay. Pay attention to new allowDividerAbove, allowDividerBelow and iconSpaceReserved attributes.
I've had to modify my style to match before update like:
<style name="AppSettingsTheme" parent="PreferenceThemeOverlay">
<item name="preferenceCategoryStyle">@style/AppSettings.Category.Material</item>
<item name="preferenceFragmentCompatStyle">@style/AppSettings.Fragment.Material</item>
<item name="preferenceStyle">@style/AppSettings.Preference.Material</item>
</style>
<style name="AppSettings.Category.Material" parent="Preference.Category.Material">
<item name="allowDividerAbove">false</item>
<item name="allowDividerBelow">false</item>
<item name="iconSpaceReserved">false</item>
</style>
<style name="AppSettings.Fragment.Material" parent="PreferenceFragment.Material">
<item name="allowDividerAfterLastItem">true</item>
</style>
<style name="AppSettings.Preference.Material" parent="Preference.Material">
<item name="allowDividerAbove">true</item>
<item name="allowDividerBelow">true</item>
<item name="iconSpaceReserved">false</item>
</style>
and update your preferenceTheme to @style/AppSettingsTheme value instead of @style/PreferenceThemeOverlay.v14.Material
add a comment |
Here are the diff changes between the PreferenceThemeOverlay.v14.Material and PreferenceThemeOverlay. Pay attention to new allowDividerAbove, allowDividerBelow and iconSpaceReserved attributes.
I've had to modify my style to match before update like:
<style name="AppSettingsTheme" parent="PreferenceThemeOverlay">
<item name="preferenceCategoryStyle">@style/AppSettings.Category.Material</item>
<item name="preferenceFragmentCompatStyle">@style/AppSettings.Fragment.Material</item>
<item name="preferenceStyle">@style/AppSettings.Preference.Material</item>
</style>
<style name="AppSettings.Category.Material" parent="Preference.Category.Material">
<item name="allowDividerAbove">false</item>
<item name="allowDividerBelow">false</item>
<item name="iconSpaceReserved">false</item>
</style>
<style name="AppSettings.Fragment.Material" parent="PreferenceFragment.Material">
<item name="allowDividerAfterLastItem">true</item>
</style>
<style name="AppSettings.Preference.Material" parent="Preference.Material">
<item name="allowDividerAbove">true</item>
<item name="allowDividerBelow">true</item>
<item name="iconSpaceReserved">false</item>
</style>
and update your preferenceTheme to @style/AppSettingsTheme value instead of @style/PreferenceThemeOverlay.v14.Material
add a comment |
Here are the diff changes between the PreferenceThemeOverlay.v14.Material and PreferenceThemeOverlay. Pay attention to new allowDividerAbove, allowDividerBelow and iconSpaceReserved attributes.
I've had to modify my style to match before update like:
<style name="AppSettingsTheme" parent="PreferenceThemeOverlay">
<item name="preferenceCategoryStyle">@style/AppSettings.Category.Material</item>
<item name="preferenceFragmentCompatStyle">@style/AppSettings.Fragment.Material</item>
<item name="preferenceStyle">@style/AppSettings.Preference.Material</item>
</style>
<style name="AppSettings.Category.Material" parent="Preference.Category.Material">
<item name="allowDividerAbove">false</item>
<item name="allowDividerBelow">false</item>
<item name="iconSpaceReserved">false</item>
</style>
<style name="AppSettings.Fragment.Material" parent="PreferenceFragment.Material">
<item name="allowDividerAfterLastItem">true</item>
</style>
<style name="AppSettings.Preference.Material" parent="Preference.Material">
<item name="allowDividerAbove">true</item>
<item name="allowDividerBelow">true</item>
<item name="iconSpaceReserved">false</item>
</style>
and update your preferenceTheme to @style/AppSettingsTheme value instead of @style/PreferenceThemeOverlay.v14.Material
Here are the diff changes between the PreferenceThemeOverlay.v14.Material and PreferenceThemeOverlay. Pay attention to new allowDividerAbove, allowDividerBelow and iconSpaceReserved attributes.
I've had to modify my style to match before update like:
<style name="AppSettingsTheme" parent="PreferenceThemeOverlay">
<item name="preferenceCategoryStyle">@style/AppSettings.Category.Material</item>
<item name="preferenceFragmentCompatStyle">@style/AppSettings.Fragment.Material</item>
<item name="preferenceStyle">@style/AppSettings.Preference.Material</item>
</style>
<style name="AppSettings.Category.Material" parent="Preference.Category.Material">
<item name="allowDividerAbove">false</item>
<item name="allowDividerBelow">false</item>
<item name="iconSpaceReserved">false</item>
</style>
<style name="AppSettings.Fragment.Material" parent="PreferenceFragment.Material">
<item name="allowDividerAfterLastItem">true</item>
</style>
<style name="AppSettings.Preference.Material" parent="Preference.Material">
<item name="allowDividerAbove">true</item>
<item name="allowDividerBelow">true</item>
<item name="iconSpaceReserved">false</item>
</style>
and update your preferenceTheme to @style/AppSettingsTheme value instead of @style/PreferenceThemeOverlay.v14.Material
answered Dec 24 at 11:49
prot0n
1537
1537
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53442445%2fpreferencefragmentcompat-style-is-broken-after-setting-targetsdkversion-to-28%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown