-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix QS header constraints so status icons are now ellipsized where there
is lack of space. Previously: There was a chain [date]-[space]-[status icons]-[battery]. That's why we should add bias and space to make it working. But there're several problems with this: 1) app:layout_width="WRAP_CONTENT" + app:layout_constrainedWidth=”true" != app:layout_width="0dp" + app:layout_constraintWidth_default="wrap". The first one gets view expanded like it's MATCH_PARENT. 2) I've found out that wrapping views in constraint layout 2.0.0 may not always work as expected with app:layout_constrainedWidth=”true" (the view get's stretched as it's match_parent). layout_constraintWidth_max="wrap" should've help with this, but motion layout can't parse this attribute in constraint set. That's why my solution is to reimplement the layout a little bit This behavior is reported here: androidx/constraintlayout#713 Now: [date] and [battery] are constrained to the sides and [status icons] occupy the whole space between them. [date] is always WRAP_CONTENT because there's always some space and we want to show it. [battery] and [status icons] are wrap content with constraints restrictions to make them fill all the space left Test: manual: phone + tablet Fixes: 260364389 Change-Id: I4d54b795cc4e96f6c204f2f00aff7607572d9aa3
- Loading branch information
Anton Potapov
committed
Jan 10, 2023
1 parent
8165fae
commit 675ff0f
Showing
3 changed files
with
12 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters