fix widget color bar: use left-border trick to match content height
This commit is contained in:
parent
2dddb6799a
commit
cf82b4b586
1 changed files with 32 additions and 29 deletions
|
|
@ -217,19 +217,20 @@ class AgendaWidget : GlanceAppWidget() {
|
||||||
|
|
||||||
Spacer(GlanceModifier.width(8.dp))
|
Spacer(GlanceModifier.width(8.dp))
|
||||||
|
|
||||||
// color indicator
|
// color bar as left border - stretches with content automatically
|
||||||
val barHeight = if (event.location != null || !event.allDay) 32.dp else 18.dp
|
|
||||||
Box(
|
Box(
|
||||||
modifier = GlanceModifier
|
modifier = GlanceModifier
|
||||||
.size(width = 3.dp, height = barHeight)
|
.defaultWeight()
|
||||||
.cornerRadius(2.dp)
|
.background(GlanceTheme.colors.primary)
|
||||||
.background(GlanceTheme.colors.primary),
|
.cornerRadius(4.dp),
|
||||||
) {}
|
) {
|
||||||
|
Column(
|
||||||
Spacer(GlanceModifier.width(8.dp))
|
modifier = GlanceModifier
|
||||||
|
.fillMaxWidth()
|
||||||
// event details
|
.padding(start = 3.dp)
|
||||||
Column(modifier = GlanceModifier.defaultWeight()) {
|
.background(GlanceTheme.colors.widgetBackground),
|
||||||
|
) {
|
||||||
|
Column(modifier = GlanceModifier.padding(start = 8.dp, top = 2.dp, bottom = 2.dp)) {
|
||||||
Text(
|
Text(
|
||||||
text = event.title,
|
text = event.title,
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
|
|
@ -252,6 +253,8 @@ class AgendaWidget : GlanceAppWidget() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val timeFormatter = DateTimeFormatter.ofPattern("HH:mm")
|
private val timeFormatter = DateTimeFormatter.ofPattern("HH:mm")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue