Open nickbutcher opened 7 years ago
👋 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 a Transition
for the Activity
that figures out what the text will look like in the destination Activity
(hence all the interface methods on Reflowable
) so it can animate betweenCollapsingTitleLayout
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 the Activity
is first laid out, with the CollapsingTitleLayout
in the "expanded" state.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.
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).
☠️
Support lib now offers:
CollapsingToolbarLayout
TextView
auto-sizing.Should remove the custom
CollapsingTitleLayout
class and migrate to standard components. Possibly also migrateReflowText
to simply workTextView
s rather than custom components.