dimsuz
08/30/2022, 3:36 PMText
composables in the Box
, with the former having + 1.sp
, but it doesn't align as perfectly as in the screenshot.Alejandro Rios
08/30/2022, 3:40 PMAlejandro Rios
08/30/2022, 3:41 PMdimsuz
08/30/2022, 3:42 PMSiyamed
08/30/2022, 7:38 PMSiyamed
08/30/2022, 7:40 PMSiyamed
08/30/2022, 7:40 PMSiyamed
08/30/2022, 7:41 PMColton Idle
08/30/2022, 7:56 PMHalil Ozercan
08/31/2022, 12:55 PM@Composable Text
nor experimental drawText
will give you the result that you are expecting.
The upcoming stroke feature may be of help but I'm not sure. Compose DrawStyle
can either be Fill or Stroke. This design seems to use white color for stroke, and a dark blue for fill. AFAIK Android platform doesn't support defining different colors for fill and stroke at the same time. You can probably draw stroke'd text on top of fill'ed text with the upcoming API.
@Composable
fun FillAndStrokeText(text: String) {
Box {
Text(text, style = TextStyle(color = Color.Blue))
Text(text, style = TextStyle(color = Color.White, drawStyle = Stroke(4f)))
}
}
Colton Idle
08/31/2022, 3:20 PMHalil Ozercan
09/01/2022, 8:55 AMHalil Ozercan
10/10/2022, 12:09 AMDrawStyle
in TextStyle
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]ain/java/androidx/compose/foundation/demos/text/StrokeDemo.kt