This article describes the Android implementation of Flip flip animation effect of the method to share for everyone to learn from.
The specific implementation code is as follows:
LinearLayout LOCATIONLL = (linearlayout) Findviewbyid (R.ID.LOCATIONLL);
LinearLayout Basell = (linearlayout) Findviewbyid (R.id.basell);
private void Flipit () {interpolator accelerator = new Accelerateinterpolator ();
Interpolator Decelerator = new Decelerateinterpolator ();
Final LinearLayout visiblelist,invisiblelist;
Final Objectanimator Vistoinvis, Invistovis;
if (locationll.getvisibility () = = View.gone) {visiblelist = Basell;
Invisiblelist = LOCATIONLL;
Vistoinvis = Objectanimator.offloat (visiblelist, "RotationY", 0f, 90f);
Invistovis = Objectanimator.offloat (invisiblelist, "RotationY", -90f, 0f);
else {invisiblelist = Basell;
Visiblelist = LOCATIONLL;
Vistoinvis = Objectanimator.offloat (visiblelist, "RotationY", 0f, -90f);
Invistovis = Objectanimator.offloat (invisiblelist, "RotationY", 90f, 0f);
} vistoinvis.setduration (300);
Invistovis.setduration (300);
Vistoinvis.setinterpolator (accelerator); Invistovis.setinterpolator (Decelerator);
Vistoinvis.addlistener (New Animatorlisteneradapter () {@Override public void Onanimationend (animator Anim) {
Visiblelist.setvisibility (View.gone);
Invistovis.start ();
Invisiblelist.setvisibility (view.visible);
}
});
Vistoinvis.start ();
}
I hope the examples described in this article will help you with Android programming.