8

I have a Wear app that needs to show preferences, to that effect, I'm currently using a PreferenceFragment, and this works normally.

Now in the interest of using the Architecture components, I'm migrating my app to use FragmentActivity instead of Activity and the appcompat Fragments instead of the SDK ones. And therefore I have to use PreferenceFragmentCompat instead of PreferenceFragment.

When I do that I have non Android Wear styling, as seen on the screenshot.

Before / After

As you can see, on the right image,

  • There is no title
  • The SwitchPreference doesn't work as expected (no widget + ellipsis)
  • There are separators where there shouldn't be any
  • There's not enough padding top and bottom so the first and last items are cropped
  • The margin between the widget and the text is too big

Is this even doable, or am I wasting my time?

BoD
  • 10,838
  • 6
  • 63
  • 59
  • 1
    Related issue: https://issuetracker.google.com/issues/73183201 – BoD Feb 11 '18 at 20:42
  • Did you manage to fix this? I'm using support Fragments so I need to use `PreferenceFragmentCompat`. Dialog preferences also don't work because they require an AppCompat theme. So what are we supposed to do? Use the deprecated `android.app.Fragment`? – Thomas Vos Jul 31 '18 at 18:40
  • No, so far, I couldn't find a solution. – BoD Aug 01 '18 at 08:10
  • 1
    Google recently released the emulator for Android 11 and the Preferences still look bad. Our only hope is that it's fixed in Android 12. – Kris B May 26 '21 at 23:23

0 Answers0