Commit 73cb1b6
[TextField] Fix hint is not displayed when expanding space is limited
In CollapsingTextHelper we are checking both the expanded bound and the collapsed bound to be larger than 0 to decide if we are going to draw the collapsing text. However this can result in a situation that when there's no space to display expanded hint, the collapsed hint won't be drawn either, even if the hint is not expandable at all.
This CL fixes the issue in a more generic way - whenever draw() is called, we check if the current bound (should be calculated whenever the collapsing fraction is changed) is larger than 0 to decide if we need to draw the collapsing text.
This CL also adds the logic to ensure the cutout bound will never be larger than the collapsed bound.
Resolves #2573
PiperOrigin-RevId: 4495976581 parent 673cefc commit 73cb1b6
File tree
2 files changed
+7
-14
lines changed- lib/java/com/google/android/material
- internal
- textfield
2 files changed
+7
-14
lines changedLines changed: 4 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
246 | 245 | | |
247 | 246 | | |
248 | 247 | | |
249 | | - | |
250 | 248 | | |
251 | 249 | | |
252 | 250 | | |
| |||
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
261 | | - | |
262 | 259 | | |
263 | 260 | | |
264 | 261 | | |
| |||
268 | 265 | | |
269 | 266 | | |
270 | 267 | | |
271 | | - | |
| 268 | + | |
272 | 269 | | |
273 | | - | |
| 270 | + | |
| 271 | + | |
274 | 272 | | |
275 | 273 | | |
276 | 274 | | |
| |||
350 | 348 | | |
351 | 349 | | |
352 | 350 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | 351 | | |
362 | 352 | | |
363 | 353 | | |
| |||
839 | 829 | | |
840 | 830 | | |
841 | 831 | | |
842 | | - | |
| 832 | + | |
843 | 833 | | |
844 | 834 | | |
845 | 835 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3954 | 3954 | | |
3955 | 3955 | | |
3956 | 3956 | | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
3957 | 3960 | | |
3958 | 3961 | | |
3959 | 3962 | | |
| |||
0 commit comments