problem with Accompanist navigation animations. `e...
# compose
m
problem with Accompanist navigation animations.
expandIn
and
shrinkOut
always expand in/shrink to top left corner. setting `expandFrom`/`shrinkTowards` has no effect and default value for those two is
Alignment = Alignment.BottomEnd
.
c
Probably will need some code to really tell what's wrong here. I've used it briefly and didn't have any issues.
m
did you use expand and shrink animations?
d
Have you tried adding
fillMaxSize()
to
AnimatedNavHost
? See discussion here: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1628536044113100?thread_ts=1628522573.089500&cid=CJLTWPH7S
For the
Alignment.BottomEnd
, we'll need to support the content alignment on the
AnimatedHost
level to align the incoming/outgoing content to the bottom end when that content is smaller than parent.
m
@Doris Liu I have and than it launches from the center. center is the default when
AnimatedNavHost
has
modifier.fillMaxSize()
added to it
d
Yea, center is where the child would be placed by default in Box. To fully control where the child is when it's smaller than parent, we'll have to support
contentAlignment
. Out of curiosity, is there a specific effect you are trying to achieve? 🙂
Btw,
contentAlignment
is support in
AnimatedContent
, which is what
AnimatedNavHost
uses under the hood. If the visual effect you are going for can't be achieved w/ AnimatedContent, please let us know so we can add support for it.
m
I am a bit confused right now
I don’t need anything special I just used plain
expandIn
and
shrinkOut
as
enterTransition
and
exitTransition
and it’s not responding to
expandFrom
nor
shrinkTowards
contentAlignment
parameter. that’s it
what am confused about is: are you saying that
contentAlignment
will be fully supported soon or it is fully supported now?
d
expandFrom
and
shrinkTowards
refers to the clipped the content. It defines which part of the content to reveal first/last when clipped.
contentAlignment
defines the positioning of the clipped content in parent.
contentAlignment
is supported in the level below
AnimatedHost
(i.e. AnimatedContent), but not surfaced in AnimatedHost. That's why I was suggesting trying out
AnimatedContent
and see whether it does what you want. If not, we can add support in AnimatedContent and surface that through AnimatedHost.
m
I understand. I will try and report back
👍 1