Android Fixed paging

1

I have gridView that I'm populating through WebService . The problem starts when I want to trigger an event say that clico when sliding the screen left or right I know there is pageview , but I do not want to change the screen I just want the user to have a sense of change, ie the data after the gesture but do not page to a next screen.

Being clearer as a calendar where grid remains the same but changes only values. Thanks in advance.

    
asked by anonymous 30.06.2014 / 17:31

1 answer

0

This may work for you. You can use the onTouchEvent method in your activity as the example taken from developer android .

public class MainActivity extends Activity {

@Override
public boolean onTouchEvent(MotionEvent event){ 

int action = MotionEventCompat.getActionMasked(event);

switch(action) {
    case (MotionEvent.ACTION_DOWN) :
        Log.d(DEBUG_TAG,"Action was DOWN");
        return true;
    case (MotionEvent.ACTION_MOVE) :
        Log.d(DEBUG_TAG,"Action was MOVE");
        return true;
    case (MotionEvent.ACTION_UP) :
        Log.d(DEBUG_TAG,"Action was UP");
        return true;
    case (MotionEvent.ACTION_CANCEL) :
        Log.d(DEBUG_TAG,"Action was CANCEL");
        return true;
    case (MotionEvent.ACTION_OUTSIDE) :
        Log.d(DEBUG_TAG,"Movement occurred outside bounds " +
                "of current screen element");
        return true;      
    default : 
        return super.onTouchEvent(event);
}      

}

    
30.06.2014 / 18:06