Skip to content
Commit 675ff0fe authored by Anton Potapov's avatar Anton Potapov
Browse files

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
parent 8165fae2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment