This issue begins with a few simple and interesting animations that you will share.
:
The effect is good, and the implementation is not much difficulty, on the code
public int id[] = {r.drawable.fengjing_1, r.drawable.fengjing_2,r.drawable.fengjing_3, R.drawable.fengjing_4, R.drawable.fengjing_5, r.drawable.fengjing_6};p ublic String list[] = {"One", "two", "three", "four", "five", "Six"};p rivate ListView ML Istview;private ImageView mimageview;protected void OnCreate (Bundle savedinstancestate) {super.oncreate ( Savedinstancestate); Setcontentview (R.layout.activity_main); Initview ();} private void Initview () {Mlistview = (ListView) Findviewbyid (r.id.list); arrayadapter<string> adapter = new Arrayadapter<string> (Mainactivity.this, Android. R.layout.simple_list_item_1, list); Mlistview.setadapter (adapter); Mlistview.setonitemclicklistener (this); Mimageview = (ImageView) Findviewbyid (r.id.img); Mimageview.setonclicklistener (this);} @SuppressLint ("Newapi") private void animation (final int position) {Final View vis;final view invis;if ( Mlistview.getvisibility () = = view.visible) {vis = Mlistview;invis = Mimageview;} else {vis = Mimageview;invis = MListView; }objectanimaTor objectanimator = objectanimator.offloat (Vis, "RotationY", 0f, 90f); objectanimator.setduration; o Bjectanimator.start (); final Objectanimator ObjectAnimator2 = objectanimator.offloat (Invis, "RotationY", -90f, 0f); o Bjectanimator2.setduration (+); Objectanimator.addlistener (new Animatorlisteneradapter () {@Overridepublic void Onanimationend (Animator animation) {super.onanimationend (animation); Objectanimator2.start (); Vis.setvisibility ( View.gone); Mimageview.setimageresource (Id[position]); invis.setvisibility (view.visible);}}); @Overridepublic void Onitemclick (adapterview<?> arg0, View arg1, int arg2, long arg3) {animation (arg2);} @Overridepublic void OnClick (View arg0) {animation (0);}
The main use of property animation, about the property animation and so I have more experience when the details of the time to tell. This issue is purely a sharing effect, very water ah ...
Project Source
Android share a simple and fun animation effect