https://developer.android.com/develop/u ... app-widget
Код: Выделить всё
implementation ("androidx.glance:glance:1.0.0")
implementation ("androidx.glance:glance-appwidget:1.0.0")
Проверил именно то, что указано в документации выше.
Ожидается
Результат
Код: Выделить всё
@Composable
private fun MyContent() {
Column(
modifier = GlanceModifier.fillMaxSize(),
verticalAlignment = Alignment.Top,
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(text = "hello", modifier = GlanceModifier.padding(12.dp))
Row(horizontalAlignment = Alignment.CenterHorizontally) {
Button(
text = "A",
onClick = actionStartActivity()
)
Button(
text = "B",
onClick = actionStartActivity()
)
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/782 ... hole-widge
Мобильная версия