0

I have a specific goal regarding animation using Recyclerview, but I cant find an exact title to convey my concern, so I'm open to any correction if necessary. So first , I have a recyclerview that acts as a ViewPager thanks to David Medenjak's Recyclerview ViewPager

Now I have a requirement to animate the background color for each swipe transition, thanks to different links and resources, I stumbled upon TransitionDrawables, putting an array of different drawables and invoking a necessary transition functions to animate,

recyclerView.setBackground(arrayOfDrawables)
transitionArrayOfDrawables.startTransition(...); 

Now I want to take things deeper, I want to manually control the transition relative to the animation of the swipe of each item of the recyclerview, Im mentally blocked as I cant find the keyword to search for where should I start, "Interpolation", "Manually interpolating a views animation", things like that, but still no luck, the only thing that I have on my mind is "Get the recyclerview's visible item's interpolation/animation-value then supply it to the target view's animation manually", but I dont know where to start, I dont even know how to animate view's manually, I have experience with ObjectAnimators, simple translating, scaling, bouncing etc.. but controlling view's animation manually and relatively even by using knob/seek bar or such, its just out of my domain as of the moment.

Any help would be greatly appreciated.

[Edit] Apologies if my question's intent covers alot of demands :(

mr.boo
  • 73
  • 6

1 Answers1

0

If I am understanding correctly, this link may be of some use. It provides instruction for how to gradually transition between viewpager background colors in relation to the user swipe.

The example uses the ArgbEvaluator class which -according to the doc: "...perform[s] type interpolation between integer values that represent ARGB colors."

Jantzilla
  • 638
  • 1
  • 7
  • 19
  • thanks so much! I also stumbled with this S.O question which is closely related to the link you gave, https://stackoverflow.com/questions/2614545/animate-change-of-view-background-color-on-android/14467625#14467625, now Im having a lead towards animating colors, but I hope someone can also point me on how to manually animate a view/object relative to some external source :( – mr.boo May 28 '18 at 05:16
  • Oh and as well as get the Recyclerview's animating value/properties during dragging/swiping.. :( – mr.boo May 28 '18 at 05:20