plaid
plaid copied to clipboard
Migrate to support lib components
Support lib now offers:
- Fling velocity in
CollapsingToolbarLayout
-
TextView
auto-sizing.
Should remove the custom CollapsingTitleLayout
class and migrate to standard components. Possibly also migrate ReflowText
to simply work TextView
s rather than custom components.
👋 I'll do the non-reflow text part of this 😬
oh it might be linked 🙈 ~~still would like to try.~~
@nickbutcher Would this ticket require replacing the ElasticDragDismissFrameLayout
with a (custom) CoordinatorLayout
?
CollapsingToolbarLayout
is designed to work as a direct child of AppBarLayout
which, in my understanding, works with the behaviours in a CoordinatorLayout
.
This is too heavy for me 😓😞
I think I understand the different parts a little better:
-
ReflowText
is aTransition
for theActivity
that figures out what the text will look like in the destinationActivity
(hence all the interface methods onReflowable
) so it can animate between - the
CollapsingTitleLayout
doesn't have anything to do with the reflow animation itself - it just exposes information about the text's start state (== the reflow animation's end state) when theActivity
is first laid out, with theCollapsingTitleLayout
in the "expanded" state.
fiddling with ElasticDragDismissLayout
I started by replacing the superclass of ElasticDragDismissFrameLayout
with CoordinatorLayout
and while this worked, the way I did it would have messed up the scrolling behaviours of its children: overriding *NestedScroll*
events of the ElastricDragDismissCoordinatorLayout
so that we could dispatch the drag callbacks must also take into consideration any children that have layout behaviours which want to know about nested scrolls.
adding a redundant layout
Then I tried instead with adding a plain CoordinatorLayout
as the first/only child of the ElasticDragDismissFrameLayout
in activity_designer_news_story.xml
which is the only place where the CollapsingTitleLayout
is used.
This also has no negative effects on the drag-dismiss functionality, but it's not possible to replace the CollapsingTitleLayout
with a CollapsingToolbarLayout
without a lot of stuff - we need a wrapper around the toolbar layout that implements ReflowText.Reflowable
so that ReflowText.setupReflow(reflowable)
still works or extending CollapsingToolbarLayout
.
I think that's the way to go but it's too much for a small pay-off IMO - it's unclear also what the differences between the project's CollapsingTextHelper
and the one from the support library, else I think that could make a good first PR (not using a custom one).
☠️