Skip to content

Commit 4221915

Browse files
committed
Remove text measure logic
1 parent dc088ae commit 4221915

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

feature/camera/src/main/java/com/android/developers/androidify/camera/CameraZoomToolbar.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ internal fun ZoomToolbar(
7878
}
7979
}
8080
}
81-
val textMeasurer = rememberTextMeasurer()
8281

8382
ButtonGroup(
8483
overflowIndicator = {},
@@ -95,9 +94,7 @@ internal fun ZoomToolbar(
9594
colors = ToggleButtonDefaults.toggleButtonColors(),
9695
modifier = Modifier,
9796
) {
98-
val textLayoutResult = textMeasurer.measure("M.MX", LocalTextStyle.current)
99-
val width = with(LocalDensity.current) { textLayoutResult.size.width.toDp() }
100-
Text(options[0], Modifier.widthIn(min = width), textAlign = TextAlign.Center)
97+
Text(options[0], Modifier, textAlign = TextAlign.Center)
10198
}
10299
},
103100
menuContent = {},
@@ -111,9 +108,7 @@ internal fun ZoomToolbar(
111108
colors = ToggleButtonDefaults.toggleButtonColors(),
112109
modifier = Modifier,
113110
) {
114-
val textLayoutResult = textMeasurer.measure("M.MX", LocalTextStyle.current)
115-
val width = with(LocalDensity.current) { textLayoutResult.size.width.toDp() }
116-
Text(options[1], Modifier.widthIn(min = width), textAlign = TextAlign.Center)
111+
Text(options[1], Modifier, textAlign = TextAlign.Center)
117112
}
118113
},
119114
menuContent = {},

0 commit comments

Comments
 (0)