android - RecyclerView scrollToPositionWithOffset with animation -
im trying animate card view's position , resize fit screen @ same time. when user clicks button inside cardview, cardview should expand size of container, , scroll become visible @ same time
in custom animator class, im using following function:
@override protected void applytransformation(float interpolatedtimetransformation t) { int newheight = (int) (startheight + (targetheight - startheight) *interpolatedtime); view.getlayoutparams().height = newheight; ((linearlayoutmanager) mainpage.maingrouprecycler.getlayoutmanager()).scrolltopositionwithoffset(mainpage.maingrouprecycler.getchildadapterposition((cardview) view.getparent()), 0); view.requestlayout(); } in following case, recyclerview instantly shows cardview @ top of visible area without animating scrolling, animates resize. need scroll @ same time resize happening.
i tried calling scroll function:
mainpage.maingrouprecycler.scrolltoposition(mainpage.maingrouprecycler.getchildadapterposition((cardview) view.getparent())); but problem scrolling animate after resize complete.
i need resizing , scrolling happen simultaneously.
any appreciated
for 2 effects occur in tandem, must start animation of view, , call scrolltoposition @ same time.
also, remove call "scrolltoposition" within animation's applytransformation method. bad because it's telling layout manager needs scroll position on every iteration of animation, occur hundreds of times. need call scrolltoposition once.
also, instead of scrolltoposition, use smoothscrolltoposition nice smooth scroll effect.
Android - Recyclerview Scrolltopositionwithoffset With Animation - >>>>> Download Now
ReplyDelete>>>>> Download Full
Android - Recyclerview Scrolltopositionwithoffset With Animation - >>>>> Download LINK
>>>>> Download Now
Android - Recyclerview Scrolltopositionwithoffset With Animation - >>>>> Download Full
>>>>> Download LINK GT