4

Is there a library or a pre-written class somewhere that represents a Time picker preference for AndroidX's new Preference API?

Something like this: TimePicker in PreferenceScreen but for AndroidX?

ThexXTURBOXx
  • 381
  • 1
  • 3
  • 16
  • Did you figure this out. Having the same issue, the current TimePicker keeps failing on some devices. – Samuel Owino Dec 09 '20 at 05:49
  • 1
    @samuelowino Yes, someone deleted my answer (which is the correct answer). My code can be found here: https://github.com/ThexXTURBOXx/studip-app-uni-passau/tree/master/app/src/main/java/studip_uni_passau/femtopedia/de/unipassaustudip/preference/time – ThexXTURBOXx Dec 09 '20 at 15:08
  • Thanks @ThexXTURBOXx let me check it out. I thought we'd get an Androidx equivalent for time picker – Samuel Owino Dec 09 '20 at 15:10
  • Generally what was your solve. – Samuel Owino Dec 09 '20 at 15:13
  • @ThexXTURBOXx How do I use the timepicker in that link? It tries to import `studip_uni_passau.femtopedia.de.unipassaustudip.R` - what should I do? – TDG Feb 03 '23 at 09:46
  • 1
    @TDG The `R` file is a file that is generated based on your `xml` files in the `res` folder. You have to define these values yourself or more or less copy the ones I refer to in my archived project. However, I found this: https://developer.android.com/reference/kotlin/androidx/leanback/widget/picker/TimePicker So, maybe my workaround is not needed anymore? (Haven't tried this out myself yet) – ThexXTURBOXx Feb 04 '23 at 10:06
  • I'm also having problems with the TimePicker behavior depending the Android version. The problem with the one in the leanback package is that there's no `OnTimeChanged` interface – Chisko Apr 26 '23 at 23:00

0 Answers0