Skip to content

Commit

Permalink
figured out how to lay it out without spreadAround :D
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastGimbus committed Sep 20, 2023
1 parent e714dfe commit 720de6c
Showing 1 changed file with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,26 @@ class BatteryWidget : GlanceAppWidget() {
horizontalAlignment = Alignment.Horizontal.Start,
verticalAlignment = Alignment.Vertical.CenterVertically
) {
Image(
ImageProvider(R.drawable.left_earbud),
"Left earbud",
modifier = GlanceModifier.defaultWeight()
)
Box(modifier = GlanceModifier.padding(R.dimen.batteryWidgetPadding)) {
Image(
ImageProvider(R.drawable.left_earbud),
"Left earbud",
modifier = GlanceModifier.defaultWeight().size(30.dp),
colorFilter = ColorFilter.tint(GlanceTheme.colors.primary),
)
}
Text(label, style = textStyle)
Spacer(modifier = GlanceModifier.defaultWeight())
Text(
if (level >= 0) "$level%" else "-",
style = textStyle,
modifier = GlanceModifier.defaultWeight()
)
Box(
modifier = GlanceModifier.padding(R.dimen.batteryWidgetPadding),
contentAlignment = Alignment.Center
) {
Text(
if (level >= 0) "$level%" else "-",
style = textStyle,
modifier = GlanceModifier.defaultWeight().width(64.dp)
)
}
}
}
}
Expand Down

0 comments on commit 720de6c

Please sign in to comment.