Animation (scrolling) one ViewGroup blocks unbound views from animation until finished

Hierarchy view:

[0/6] View (first view in layout)
...
[2/6] RecyclerView
... 
RecyclerView children views
...
[6/6] View (point of interest, on top)

      

Purpose:

I need to push (using an accelerating interpolator) the last view (which is a custom toolbar) in my hierarchy when it RecyclerView

scrolls high enough and pops it out when it RecyclerView

is low enough. An effect similar to the sliding heading title https://material.io/ .

Problem:

Toolbar animations - (view initially hidden):

title_bar.animate()
         .setInterpolator(FastOutSlowInInterpolator())
         .setDuration(500)
         .setStartDelay(0)
         .translationY(0f)
         .start()

      

and hide it:

title_bar.animate()
         .setInterpolator(FastOutSlowInInterpolator())
         .setDuration(500)
         .setStartDelay(0)
         .translationY(someValue)
         .start()

      

The problem is that the animation won't work until RecyclerView

it scrolls (key-up).

I suspect the animation is being queued in the FIFO and until it stops before scrolling. I don't understand why this might be the case, because the two views are completely independent and are RecyclerView

located below my toolbar.

Twist

This works great:

title_bar.animate()
         .setInterpolator(FastOutSlowInInterpolator())
         .setDuration(0) // <-- duration is zero
         .setStartDelay(0)
         .translationY(someValue)
         .start()

      

i.e. the animation starts immediately (is it possibly equivalent title_bar.translationY = someValue

?)

So what exactly is going on here?

+3
android kotlin android-animation


source to share


No one has answered this question yet

Check out similar questions:

504
Get root view from current activity
280
Show and hide view with up / down slide animations
26
Android Animation: Wait Until You're Done?
7
How to collapse AppBarLayout animation without clicking on WhatsApp Android-like content?
2
RecyclerView and view collapsed on click causes RecyclerView to "jump" to scroll
1
It is not possible to scroll the baby scroll view while the scroll mode is active.
1
Problems with TransitionManager beginDelayedTransition to view RecyclerView items
0
Android SwipeRefreshLayout stops instead of animating
0
Using TransitionManager with ChangeBounds when expanding item in RecyclerView makes strange visuals when combined with layout_height: match_constraint
0
MotionLayout OnSwipe transient glitch when first swipe in the opposite direction



All Articles
Loading...
X
Show
Funny
Dev
Pics