android - drag and drop animate shadow back to original position if not dropped to target -


i have made functionality of drag , drop using ondraglistener. working fine problem shadow made not go original image if view not dropped @ target. how animate going of shadow position original position.any

we have write our own logic move back, do.

add ondraglistener root view, in ondrag(view view, dragevent event) of dragged view wait action_drag_ended.

create image copy of shadow.

bitmap bitmap = bitmap.createbitmap(view.getwidth(), view.getheight(), config.argb_8888);         canvas canvas = new canvas(bitmap); shadowbuilder.ondrawshadow(canvas); 

create imageview bitmap , add root view of view hierarchy.

then create animator move original position , remove imageview.

objectanimator defaultchangein = objectanimator.ofpropertyvaluesholder((object)mimageview,                 pvhleft, pvhtop, pvhright, pvhbottom); 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -