Commit d227870
[CollapsingToolbarLayout] Fix jumping when multiline title changes while collapsed
When a multiline title changes length (e.g. multi-line to single-line) while collapsed, the layout height decreases. If the previous scroll offset is deeper than the new valid range, the AppBarLayout can jump or get stuck in an invalid state.
This fix forces the AppBarLayout to `PENDING_ACTION_COLLAPSED` if the CollapsingToolbarLayout height changes while fully collapsed. This ensures it snaps correctly to the new collapsed offset.
PiperOrigin-RevId: 8611335261 parent 85c910f commit d227870
1 file changed
Lines changed: 21 additions & 7 deletions
Lines changed: 21 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
| 548 | + | |
555 | 549 | | |
556 | 550 | | |
557 | 551 | | |
558 | 552 | | |
559 | 553 | | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
560 | 564 | | |
561 | 565 | | |
562 | 566 | | |
| |||
771 | 775 | | |
772 | 776 | | |
773 | 777 | | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
774 | 788 | | |
775 | 789 | | |
776 | 790 | | |
| |||
0 commit comments