Alex
06/21/2021, 8:48 AMAdam Powell
06/21/2021, 1:59 PMAlex
06/24/2021, 5:55 PMAdam Powell
06/24/2021, 6:55 PMAdam Powell
06/24/2021, 6:56 PMAdam Powell
06/24/2021, 6:57 PMLouis Pullen-Freilich [G]
06/24/2021, 7:03 PMAlex
06/25/2021, 8:47 AMLouis Pullen-Freilich [G]
06/25/2021, 1:56 PMthat this customization was possible via a style when using the xml based implementation of the OutlinedTextField and now it’s gone in the compose version.Parity between XML / Compose is a non-goal: we aim to implement the Material specification, and customization provided by the spec. Adding customization for things not in the spec makes it hard to reconcile our APIs with spec updates, and it makes it hard for us to define what our components actually support.
I completely understand your point about not wanting to bloat textfields, but completely reimplementing a TextField just to change the border size seems pretty strange to me?It’s not really about how large the change is - if there is a change from the component we have provided, it is natural to need to build your own. This very quickly devolves into a slippery slope of customization too - if you can change the border width in the public API, then maybe that will work for a while, but what if you then want to also change the border to be dashed, and add a separate internal divider between an icon and the text. At some point you will need to build your own, and if we don’t have the clear line of ‘we support the specification’, then it becomes very hard for developers to reason about what they can expect to do, and also very hard for us to manage feature requests and decide what is reasonable to add. The text field APIs are already some of if not the most complicated Material APIs due to their size, so ensuring they are easy to use and understand for the default cases is also important. On a side note we have received many requests to customize the internal padding, but I believe this is the first request for border width, so this would appear to be lower priority for most developers. Also as I mentioned previously, we would like for ‘reimplementing a text field’ to be a few lines of intermediary API (similar to other components like if you wanted to build your own Button or Tab), not the large amount of copy and pasting you would need currently. In that case, there really isn’t much cost to building your own version with a different border, most of the challenge here is because of how complicated text fields are, with all their different states and moving internal components.
Changing the outline shape was added recentlyThis is something explicitly mentioned in the spec - outlined text fields should use a shape from the theme by default, so naturally this should be customized locally too. Border width is fixed and not something that should be customized - it is intrinsic to the component itself.
Alex
07/05/2021, 5:30 PMlouiscad
07/05/2021, 5:33 PM