i ma using gallery view images. have following onitemselected -
public void onitemselected( final adapterview<?> parent, final view view, final int index, final long id) { galleryadapter.selected = index ; animation growanimation = animationutils.loadanimation(this, r.anim.grow_shrink_image); view.startanimation(growanimation); ... }
it works fine, when item tapped moves center , animation runs. problem is, when scrolled left or right, item reached center gets automatically selected , animation starts. how can auto selection disabled?
i had same problem. have used setcallbackduringfling().
here g
object of galleryview
.
g.setcallbackduringfling(false); g.setonitemselectedlistener(new onitemselectedlistener() { @override public void onitemselected(adapterview<?> adapter, view view, int pos, long arg3) { // todo auto-generated method stub toast.maketext(myactivity.this,"selected", 1000).show(); // here u can apply animation selected image } @override public void onnothingselected(adapterview<?> adapter) { // todo auto-generated method stub } });
Comments
Post a Comment