android - CustomView scaleOnTouch animation stopped using it with Shared Element Transition -


i have customview, used in recyclerview scales when user touch next extension function:

fun view.scaleontouch(scalefactor : float = 0.8f) {     setontouchlistener {         view, motionevent ->         when (motionevent.action) {             motionevent.action_down -> {                 view.animate()                         .scalex(scalefactor)                         .scaley(scalefactor)                         .setinterpolator(overshootinterpolator())                         .start()             }             motionevent.action_up -> {                 view.animate()                         .scalex(1f)                         .scaley(1f)                         .setinterpolator(overshootinterpolator())                         .start()             }         }         view.ontouchevent(motionevent)     } } 

i animate transition of 1 activity other well. works fine, when new activity loaded, , go back, state of view pressed stays between scale animation. can see in image, view animation stopped before , after. there can put items in recyclerview.

this code launch new activity:

holder?.rlcontainer?.setonclicklistener { view ->                  val intent = intent(context, colordetailactivity::class.java)                 intent.putextra(colordetailactivity.maincolor, mcolor)                 intent.putextra(colordetailactivity.maincolor_viewtransition_name, context.getstring(mcolor.hexvalue))                  val options = activityoptionscompat.                         makescenetransitionanimation(                                 context activity,                                 view,                                 context.getstring(mcolor.hexvalue))                  context.startactivity(intent, options.tobundle())             } 

an image explains behavior, after clicking launch new activity, , go first activity (in 5 items)

animation stopped


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -