getting the Material Design TimePicker - android?
Asked Answered
T

2

1

if i use TimePicker/TimePickerDialog in my app i'm getting timePickerMode="spinner" styled widget though what i'm looking for is timePickerMode="clock". this is the style I've done

<style name="timePicker_dialog parent="android:Theme.Material.Light">
<item name="timePickerMode">clock</item>
</style>

and I've set this res as the style in the TimePicker via it's TimePickerDialog(), butt i'm still getting the spinner. is it device dependent? my phone is running v4.4.4? if not, what am i missing here. thanks!

Tuberose answered 5/11, 2015 at 19:33 Comment(1)
github.com/wdullaer/MaterialDateTimePicker try itPegu
R
2

As of late 2020, MaterialTimePicker is in the beta version of the Material package.
Therefore you can add the following to your app Gradle:

dependencies { ...
     implementation 'com.google.android.material:material:1.3.0-beta01'
}

And then use MaterialTimePicker like so:

      MaterialTimePicker materialTimePicker = new MaterialTimePicker.Builder()
          .setTimeFormat(clockFormat)
          .setHour(hour)
          .setMinute(minute)
          .build();

      materialTimePicker.show(requireFragmentManager(), "fragment_tag");
Ramer answered 27/12, 2020 at 13:41 Comment(0)
T
0

Try add dependencies compile 'com.android.support:appcompat-v7:23.1.0' i think use appcompat's theme under 5.0 parent="Theme.AppCompat.Light"

Train answered 6/11, 2015 at 10:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.