Nat Strangerweather
10/30/2023, 5:25 PM@Composable
private fun MyWidget() {
val picker =
MaterialTimePicker.Builder()
.setTimeFormat(TimeFormat.CLOCK_12H)
.setHour(12)
.setMinute(10)
.setTitleText("Select Appointment time")
.build()
val packageName = LocalContext.current.packageName
Column(modifier = GlanceModifier.fillMaxSize()) {
Text("Isn't that cool?")
AndroidRemoteViews(RemoteViews(packageName, picker))
}
}
Summers Pittman
10/30/2023, 9:23 PMMaterialTimePicker
is a DialogFragment
and not a RemoteView
. I wouldn't expect it to usable in a widget; is there a non-Glance time picker widget you are referencing?Nat Strangerweather
10/30/2023, 9:31 PMSummers Pittman
10/30/2023, 9:33 PMandroid.widget.TimePicker
. It isn't a Glance component so you will need to make a layout for it and use Glance interoperability.Nat Strangerweather
10/30/2023, 9:34 PMSummers Pittman
10/30/2023, 9:34 PM