i want rotate view
90 degree , update content , again rotate 90 degree, , far tried below code.
objectanimator anim1 = (objectanimator) animatorinflater.loadanimator(getactivity().getapplicationcontext(), r.animator.flip_animator); anim1.settarget(v); anim1.setduration(1000); anim1.start(); imageview box = (imageview) v.findviewbyid(r.id.box); bitmap bg = boxutils.getboxbg(boxsize, boxmargin, color.red); box.setimagebitmap(bg); anim1.settarget(v); anim1.setduration(1000); anim1.start();
xml:
<objectanimator xmlns:android="http://schemas.android.com/apk/res/android" android:valuefrom="0" android:valueto="90" android:propertyname="rotationy" > </objectanimator>
however working changing color before rotates next 90 degree, had written updation code before next rotation code. ?
the problem object rotates asynchronously code. have designed code sits there while cube first rotation, changes color. happens code starts animation, keeps running cube rotates, why changes color early.
the following method of animating view add end action, changing color rotating last 90:
view v; v.animate() .rotationy(90) .setduration(1000) .withendaction(new runnable() { @override public void run() { imageview box = (imageview) v.findviewbyid(r.id.box); bitmap bg = boxutils.getboxbg(boxsize, boxmargin, color.red); box.setimagebitmap(bg); v.animate().rotationy(90).setduration(1000).start(); } }).start();
Comments
Post a Comment