android - Flip effect in an image gallery -
i'm trying make image gallery includes effect when click image turns around , show different one. in case when click on image1 turns , show image11 when click on image2 turns , show image12 , on. have done gallery have no idea how implement effect. appreciate help.
public class carrusel extends activity implements onclicklistener { imageview lastclicked = null; int padding = 10; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.start); linearlayout l; l = (linearlayout) findviewbyid(r.id.carrusel); int[] images = new int[] { r.drawable.image1, r.drawable.image2, r.drawable.image3,r.drawable.image4,r.drawable.image5, r.drawable.image6,r.drawable.image7,r.drawable.image8, r.drawable.image9,r.drawable.image10,r.drawable.image11, r.drawable.image12, r.drawable.image13,r.drawable.image14, r.drawable.image15,r.drawable.image16,r.drawable.image17, r.drawable.image18,r.drawable.image19,r.drawable.image20 }; (int = 0; <10; i++) { imageview iv = new imageview(this); iv.setimageresource(images[i]); iv.setpadding(padding, padding, padding, padding); iv.setonclicklistener(this); l.addview(iv); } } @override public void onclick(view v) { if (v instanceof imageview) { if (lastclicked != null) { lastclicked.setpadding(padding, padding, padding, padding); lastclicked.invalidate(); } v.setpadding(0, 0, 0, 0); v.invalidate(); lastclicked = (imageview) v; } } }
please visit website https://code.google.com/p/android-3d-flip-view-transition/ hope you
Comments
Post a Comment