Skip to content

Commit

Permalink
center text when it's overflowing
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastGimbus committed Sep 19, 2023
1 parent 26d2eba commit dde290c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.glance.appwidget.*
import androidx.glance.layout.*
import androidx.glance.text.FontWeight
import androidx.glance.text.Text
import androidx.glance.text.TextAlign
import androidx.glance.text.TextDefaults
import androidx.glance.unit.ColorProvider
import es.antonborri.home_widget.HomeWidgetPlugin
Expand Down Expand Up @@ -50,7 +51,8 @@ class BatteryWidget : GlanceAppWidget() {
val barBackground = ColorProvider(R.color.battery_widget_bar_background)
val textStyle = TextDefaults.defaultTextStyle.copy(
color = ColorProvider(R.color.battery_widget_text_color),
fontWeight = FontWeight.Medium, fontSize = 16.sp
fontWeight = FontWeight.Medium, fontSize = 16.sp,
textAlign = TextAlign.Center,
)

@Composable
Expand Down

0 comments on commit dde290c

Please sign in to comment.