PreferenceFragmentCompat style is broken after setting targetSdkVersion to 28.












0














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
Old styleNew Broken style
New broken style










share|improve this question



























    0














    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
    Old styleNew Broken style
    New broken style










    share|improve this question

























      0












      0








      0







      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
      Old styleNew Broken style
      New broken style










      share|improve this question













      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
      Old styleNew Broken style
      New broken style







      android






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 at 7:38









      yigitserin

      9113




      9113
























          2 Answers
          2






          active

          oldest

          votes


















          0














          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 and PreferenceThemeOverlay.v14.Material themes have been deprecated in favour of PreferenceThemeOverlay.




          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.






          share|improve this answer





















          • 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



















          0














          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






          share|improve this answer





















            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            0














            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 and PreferenceThemeOverlay.v14.Material themes have been deprecated in favour of PreferenceThemeOverlay.




            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.






            share|improve this answer





















            • 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
















            0














            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 and PreferenceThemeOverlay.v14.Material themes have been deprecated in favour of PreferenceThemeOverlay.




            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.






            share|improve this answer





















            • 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














            0












            0








            0






            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 and PreferenceThemeOverlay.v14.Material themes have been deprecated in favour of PreferenceThemeOverlay.




            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.






            share|improve this answer












            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 and PreferenceThemeOverlay.v14.Material themes have been deprecated in favour of PreferenceThemeOverlay.




            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            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


















            • 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













            0














            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






            share|improve this answer


























              0














              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






              share|improve this answer
























                0












                0








                0






                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






                share|improve this answer












                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







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 24 at 11:49









                prot0n

                1537




                1537






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Contact image not getting when fetch all contact list from iPhone by CNContact

                    count number of partitions of a set with n elements into k subsets

                    A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks