how to disable gallery view scrolling [closed]
hi i want to disable ga开发者_开发百科llery view scrolling when we select particular item in gallery view.\ how do i do that. kindly help me out.
Write your own gallery class that extends Gallery. Override the onFling method with something like this :
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY){
if (itemIsSelected)
return true;
else return super.onFling(e1, e2, velocityX, velocityY);
}
set the the itemIsSelected flag in your onItemClickListener.
Hope that helps.
精彩评论