Status Update
Comments
so...@google.com <so...@google.com> #2
Thanks for your ticket.
-
colors (custom bg colors)" - you could use
backgroundColor
parameter to change it -
borders (no border) - yes, we've been considering the possibility to have optional or even customisable bottom indicator for TextField.
-
shape (already possible)
-
animation/position of label (disable animation, could be done by empty label and composition) - this might create unnecessary complexity for the TextField API. Alternatively, since the label parameter has become optional, you can leave it null and have your own label placed on top (depending on the animation of that label in your design).
-
leading/ending text (already possible, property name misleading (leadingIcon)) - these are named to be consistent with the Material Design terminology so should not be misleading (
https://material.io/components/text-fields ). I wouldn't expect developers to put text inside the 'leadingIcon' as its baseline won't be aligned with the input's baseline.
Please also keep in mind that you can use the BaseTextField or CoreTextField that provide basic edit text functionality to create any custom text field on top of them.
ap...@google.com <ap...@google.com> #3
Branch: androidx-master-dev
commit 87bdc09422bd32c063a93efc0078ba5b788497af
Author: Anastasia Soboleva <soboleva@google.com>
Date: Tue Sep 08 10:47:53 2020
Do not apply alpha to background color
Before this change: when developer passes some color to the background color parameter, we would apply 0.12 transparency alpha to it. This behaviour is not expected and made customisation harder
Test: TextFieldTest
Relnote: "Textfield's background color does not implicitly apply transparency alpha anymore. Instead, any color provided through the backgroundColor parameter will be applied directly."
Bug: 167951441
Change-Id: Iecee9f535b699acf684948fa99ec64217ea3f249
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/TextFieldTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextField.kt
sk...@gmail.com <sk...@gmail.com> #4
I'm ok with writing my own styled implementation, but currently using BaseTextField without published TextFieldScroller is really cumbersome. Could you please make that class public?
Also IconsWithTextFieldLayout could be somehow decomposed and published, since it takes care of a lot internals of text field.
so...@google.com <so...@google.com> #6
Thank you for you suggestion. We're looking towards making the scrolling behaviour out of the box in CoreTextField.
Meanwhile, you could use Modifier.horizontalScroll
to achieve the same behaviour because at the moment the TextFieldScroller does not add any "magic". Though it won't be the case in the future.
so...@google.com <so...@google.com> #7
Scrolling behaviour is already a part of the lower-level text fields.
We've also exposed the TextFieldColors object into material text fields so changing colors of different parts of the text field should be easier now.
For prefix/suffix support
va...@qvik.fi <va...@qvik.fi> #8
Hi,
Alternatively, since the label parameter has become optional, you can leave it null and have your own label placed on top (depending on the animation of that label in your design).
I would rather use the default label for accessibility reasons, instead of making my own. I cannot see a way to make
[Text]
[TextField]
to be announced like a TextField with a label.
Description
I'd like to create own branded TextField.
Properties I need to change:
Attaching a visual what would be nice be able to achieve.