Search in sources :

Example 1 with SimpleFoldShading

use of com.alexvasilkov.foldablelayout.shading.SimpleFoldShading in project FoldableLayout by alexvasilkov.

the class FoldableListLayout method init.

private void init(Context context) {
    gestureDetector = new GestureDetector(context, new SimpleOnGestureListener() {

        @Override
        public boolean onDown(MotionEvent event) {
            return FoldableListLayout.this.onDown();
        }

        @Override
        public boolean onScroll(MotionEvent e1, MotionEvent e2, float distX, float distY) {
            return FoldableListLayout.this.onScroll(e1, e2);
        }

        @Override
        public boolean onFling(MotionEvent e1, MotionEvent e2, float velX, float velY) {
            return FoldableListLayout.this.onFling(velY);
        }
    });
    gestureDetector.setIsLongpressEnabled(false);
    animator = ObjectAnimator.ofFloat(this, "foldRotation", 0f);
    minDistanceBeforeScroll = ViewConfiguration.get(context).getScaledTouchSlop();
    flingAnimation = new FlingAnimation();
    foldShading = new SimpleFoldShading();
    setChildrenDrawingOrderEnabled(true);
}
Also used : SimpleOnGestureListener(android.view.GestureDetector.SimpleOnGestureListener) SimpleFoldShading(com.alexvasilkov.foldablelayout.shading.SimpleFoldShading) GestureDetector(android.view.GestureDetector) MotionEvent(android.view.MotionEvent)

Aggregations

GestureDetector (android.view.GestureDetector)1 SimpleOnGestureListener (android.view.GestureDetector.SimpleOnGestureListener)1 MotionEvent (android.view.MotionEvent)1 SimpleFoldShading (com.alexvasilkov.foldablelayout.shading.SimpleFoldShading)1