onClickListener
ビューページャーでビュー(おそらくボタン)に設定adapter
し、アダプタでクリックを処理する必要があります。
編集
あなたはその種の機能のためにViewFlipperを使うほうがいいかもしれません。
private static final int SWIPE_MIN_DISTANCE = 120;
private static final int SWIPE_MAX_OFF_PATH = 250;
private static final int SWIPE_THRESHOLD_VELOCITY = 200;
class MyGestureDetector extends SimpleOnGestureListener {
@Override
public boolean onSingleTapConfirmed(MotionEvent arg0) {
//Single Tap
return false;
};
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
try {
if (Math.abs(e1.getY() - e2.getY()) > REL_SWIPE_MAX_OFF_PATH)
return false;
if (e1.getX() - e2.getX() > REL_SWIPE_MIN_DISTANCE
&& Math.abs(velocityX) > REL_SWIPE_THRESHOLD_VELOCITY) {
ViewFlipper vf = (ViewFlipper) findViewById(R.id.flipper);
vf.setInAnimation(pushRightIn);
vf.setOutAnimation(pushLeftOut);
// right to left swipe
}
else if (e2.getX() - e1.getX() > REL_SWIPE_MIN_DISTANCE
&& Math.abs(velocityX) > REL_SWIPE_THRESHOLD_VELOCITY) {
ViewFlipper vf = (ViewFlipper) findViewById(R.id.flipper);
vf.setInAnimation(pushLeftIn);
vf.setOutAnimation(pushRightOut);
// left to right swipe
}
} catch (Exception e) {
}
return false;
}
}