Code example for GestureDetectorCompat

0
 
    View aboveView;
    private void initView(Context context){
        scroller = new Scroller(context);
        scroller.extendDuration((int) (Math.abs(10) / (float) Math.max(1000, Math.abs(10)) * 1000));
        mGestureDetector = new GestureDetectorCompat(context, new MyGestureListener());
 
 
    } 
 
 
 
    public void close() { 
 
        Log.i("curr xx = ", "" + getScrollX());
        scroller.startScroll(getScrollX(), 0, -getScrollX(), 0);
        scrollTo(0, 0);
        isOpen = false;
        aboveView = findViewById(com.fisher3421.simpleslidingmenu.R.id.menuAboveLockView);
        aboveView.setClickable(false);
    }