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: https://github.com/androidx/constraintlayout/issues/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
(cherry picked from commit 675ff0fe3756eb07baffba4bfc18b5bd2c289b01)
Merged-In: I4d54b795cc4e96f6c204f2f00aff7607572d9aa3
3 files changed