Can you set transition animations on `WorkflowLayo...
# squarelibraries
v
Can you set transition animations on
WorkflowLayout
or do you combine layout runners when you need to do transitions between them?
r
We’ve intentionally left custom transitions as an exercise to the reader. E.g., note that
BackStackContainer
is non-final, with an open
performTransition
. And see the
PanelContainer
sample for customized dialog behavior. https://github.com/square/workflow/blob/master/kotlin/samples/containers/android/src/main/java/com/squareup/sample/container/panel/PanelContainer.kt`
The theory is that we’re unlikely to create a config mechanism that’s any easier than just rolling your own, and very likely to make it too restrictive.
Very eager to get feedback on whether the hooks we’ve left for subclassing are flexible enough. E.g., I suspect we need to make some of the fields in
BackStackContainer
protected
instead of
private
.
Might be working on an app-specific custom container with a bit of configurability this week. If so, I’ll try to at least distill a new sample out of it.
v
Interesting. My first instinct was to just compose a new stateful layout runner with child layout runners and figure out transitions there, but i'll check out
BackStackContainer
. Though I have no requirement for back navigation so I haven't really modeled the renderings as a backstack.
r
Nor should you just for animation
I like that idea about a stateful layout runner.
Very clean.
s
@Ray Ryan I was able to create a
FadeBackStackContainer
by subclassing
BackStackContainer
. Well almost, I had to make a new
BackStackContainer
that made the
update
method
protected
instead of
private
because of the
ViewBinding companion object
which needed access to the method.
r
Thanks for trying! I’ll put up a PR to open that method, meant to do so a few weeks ago.