Hi everyone, does anybody knew how to set gravity ...
# compose
c
Hi everyone, does anybody knew how to set gravity or align text to
end
? basically, cursor starts from the right using
BaseTextField
j
cc @Siyamed
❤️ 1
s
it is TextAlign
1
why do you want cursor to start from right?
😅 1
is it because of the language? do you want to move the cursor to end?
1
👆 1
c
Hey @jim Thanks for tagging the right person! Hey @Siyamed, Yes! basically I want to start from the right to left, not specifically because of the language but it's the requirement. Like how I did on xml, I just set
textAlignment
to
viewEnd
@Siyamed, I believe
TextAlign
is only applicable on
Text
but not on
BaseTextField
s
Got it. Can you please create a ticket about it? I would appreciate if you can describe the use case as well (in the ticket)
1
c
I already had created it yesterday! Here is the link https://issuetracker.google.com/170785134. Let me know if its all the use cases you need. Thank you! 🙏 🙇
Hey @Siyamed I got it! I just want to put it out here for anyone who will encounter next! Thank you
Copy code
Column(with(ColumnScope) {
    Modifier.weight(1f)
}
) {
    BaseTextField(
        textStyle = TextStyle(textAlign = TextAlign.End),
        textColor = textColor,
        cursorColor = textColor,
        value = textState,
        onValueChange = {
            textState = it
        },
        modifier = Modifier.background(textField)
            .height(100.dp)
            .fillMaxWidth()
            .wrapContentSize(Alignment.BottomEnd)
    )
}
🙏 1