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
Post a Comment