Status Update
Comments
ma...@google.com <ma...@google.com>
si...@google.com <si...@google.com> #2
Nona'san can you prioritize this ticket please? I believe we had some ideas about when and how to support this, but I do not know the priority for Anastasia.
no...@google.com <no...@google.com> #3
Uploaded a CL
This CL just passes down the maxLines parameter to the underlying TextDelegate class. This won't do anything if overflow happens. We need to decide which layer takes responsibility of overflow scrolling since either clipping or ellipsis doesn't work for TextField.
so...@google.com <so...@google.com> #4
Nona, Siyamed,
I think what we need for FilledTextField is a bit different - here is the ticket
no...@google.com <no...@google.com> #5
I pushed back the CL since it was not clear the expected behavior. We need to define the behavior first, or even we may drop maxLines from TextField.
si...@google.com <si...@google.com>
si...@google.com <si...@google.com> #6
si...@google.com <si...@google.com> #7
I checked the resources Anastasia pointed.
The following are use cases from the material perspective:
- single line Textfield (scrolls horizontally)
- multi-line and growing TextField (grows as text does not fit)
- multi-line fixed height TextField (scrolls)
I want to add the following to this list:
- multi-line growing TextField until a height is reached
I checked CSS a bunch, however the amount of attributes related to line clamp behavior is a lot. Some related attrbutes are
- whitespace
- line-clamp
- max-lines
As far I understood input(type=text) is single line, and textarea is multi line in html
- text-area has rows and cols attribute where rows match to height in terms of lines
One of concerns I have (applies to Text(maxLines) as well) is providing the maximum0 height in terms of line height can be done using a modifier
- option a: by converting max lines or lines to from sp to dp
- option b: by providing a modifier that does it for API user.
If we were to assume that sp will be converted to dp, we will need to make sure that the line height can be identified before the composition.
Some nites: From the perspective of TextField:
- single line is an important configuration since we also have to inform IME about this
- we can provide a "lines" attribute/modifier with the semantics of the visual height will be that many lines
- I am not sure if "lines=1" would be singleLine semantics
- we can provide a "maxLines" attribute/modifier with the semantics of the visual height will be at most that many lines
so...@google.com <so...@google.com> #8
comment copied from
FYI scrolling behaviour WIP CL
Please let me know if you're adding the scrolling behaviour, or whether I should continue working on my CL. As I don't want us to do the duplicate work :)
si...@google.com <si...@google.com>
ap...@google.com <ap...@google.com> #9
Branch: androidx-master-dev
commit d13d11623ff9d16ae7fdfb97acbe59e18a0f22df
Author: Siyamed Sinir <siyamed@google.com>
Date: Wed Oct 14 21:21:47 2020
Add maxLines to CoreTextField
Defines the CoreTextField height in terms of maximum visible
lines. Even if the final Composable height is constrained with
maxLines, it does not clip the result and lets the modifiers to
clip to the boundaries.
Test: added tests
Test: ./gradlew compose:foundation:foundation-text:test
Test: ./gradlew compose:foundation:foundation-text:connectedAndroidTest
Test: ./gradlew compose:foundation:foundation:test
Test: ./gradlew compose:foundation:foundation:connectedAndroidTest
Test: ./gradlew compose:material:material:test
Test: ./gradlew compose:material:material:connectedAndroidTest
RelNote: “Added maxLines to CoreTextField”
Bug: 143687793
Change-Id: Ibee58be1331d36bfce70a0b14e83ffb5c0cfa3a2
M compose/foundation/foundation-text/api/current.txt
M compose/foundation/foundation-text/api/public_plus_experimental_current.txt
M compose/foundation/foundation-text/api/restricted_current.txt
A compose/foundation/foundation-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/compose/foundation/text/demos/ComposeInputFieldMinMaxLines.kt
M compose/foundation/foundation-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/compose/foundation/text/demos/TextDemos.kt
A compose/foundation/foundation-text/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldMinMaxLineTest.kt
M compose/foundation/foundation-text/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation-text/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
Description