// Path: app/src/main/java/io/github/marktony/espresso/interfaze/OnFastScrollStateChangeListener.java
// public interface OnFastScrollStateChangeListener {
// 
//     /**
//      * Called when fast scrolling begins
//      */
//     void onFastScrollStart();
// 
//     /**
//      * Called when fast scrolling ends
//      */
//     void onFastScrollStop();
// 
// 
// }
// 
// Path: app/src/main/java/io/github/marktony/espresso/util/DensityUtil.java
// public class DensityUtil {
// 
//     public static int getScreenHeight(Context context) {
//         DisplayMetrics displayMetrics = new DisplayMetrics();
//         ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
//         return displayMetrics.heightPixels;
//     }
// 
//     public static int getScreenWidth(Context context) {
//         DisplayMetrics displayMetrics = new DisplayMetrics();
//         ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
//         return displayMetrics.widthPixels;
//     }
// 
//     public static int getScreenHeightWithDecorations(Context context) {
//         int heightPixes;
//         WindowManager windowManager = ((Activity) context).getWindowManager();
//         Display display = windowManager.getDefaultDisplay();
//         Point realSize = new Point();
//         try {
//             Display.class.getMethod("getRealSize", Point.class).invoke(display, realSize);
//         } catch (NoSuchMethodException e) {
//             e.printStackTrace();
//         } catch (IllegalAccessException e) {
//             e.printStackTrace();
//         } catch (InvocationTargetException e) {
//             e.printStackTrace();
//         }
//         heightPixes = realSize.y;
//         return heightPixes;
//     }
// 
//     public static int dip2px(Context context, float dpVale) {
//         final float scale = context.getResources().getDisplayMetrics().density;
//         return (int) (dpVale * scale + 0.5f);
//     }
// 
//     public static int getStatusBarHeight(Context context) {
//         Resources resources = context.getResources();
//         int resourcesId = resources.getIdentifier("status_bar_height", "dimen", "android");
//         int height = resources.getDimensionPixelSize(resourcesId);
//         return height;
//     }
// 
//     /**
//      * Converts sp to px
//      *
//      * @param context Context
//      * @param sp  the value in sp
//      * @return int
//      */
//     public static int dip2sp(Context context, float sp) {
//         return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, context.getResources().getDisplayMetrics());
//     }
// 
//     public static int px2dip(Context context, float pxValue) {
//         final float scale = context.getResources().getDisplayMetrics().density;
//         return (int) (pxValue / scale + 0.5f);
//     }
// 
// }


import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.support.annotation.ColorInt;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.animation.FastOutLinearInInterpolator;
import android.support.v4.view.animation.LinearOutSlowInInterpolator;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import io.github.marktony.espresso.R;
import io.github.marktony.espresso.interfaze.OnFastScrollStateChangeListener;
import io.github.marktony.espresso.util.DensityUtil;
        mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
            @Override
            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                super.onScrolled(recyclerView, dx, dy);
                show();
            }
        });

        if (mAutoHideEnabled) {
            postAutoHideDelayed();
        }
    }

    public int getThumbHeight() {
        return mThumbHeight;
    }

    public int getWidth() {
        return mWidth;
    }

    public boolean isDragging() {
        return mIsDragging;
    }

    /**
     * Handles the touch event and determines whether to show the fast scroller (or updates it if
     * it is already showing).
     */
    public void handleTouchEvent(MotionEvent ev, int downX, int downY, int lastY,
// Path: app/src/main/java/io/github/marktony/espresso/interfaze/OnFastScrollStateChangeListener.java
// public interface OnFastScrollStateChangeListener {
// 
//     /**
//      * Called when fast scrolling begins
//      */
//     void onFastScrollStart();
// 
//     /**
//      * Called when fast scrolling ends
//      */
//     void onFastScrollStop();
// 
// 
// }
// 
// Path: app/src/main/java/io/github/marktony/espresso/util/DensityUtil.java
// public class DensityUtil {
// 
//     public static int getScreenHeight(Context context) {
//         DisplayMetrics displayMetrics = new DisplayMetrics();
//         ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
//         return displayMetrics.heightPixels;
//     }
// 
//     public static int getScreenWidth(Context context) {
//         DisplayMetrics displayMetrics = new DisplayMetrics();
//         ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
//         return displayMetrics.widthPixels;
//     }
// 
//     public static int getScreenHeightWithDecorations(Context context) {
//         int heightPixes;
//         WindowManager windowManager = ((Activity) context).getWindowManager();
//         Display display = windowManager.getDefaultDisplay();
//         Point realSize = new Point();
//         try {
//             Display.class.getMethod("getRealSize", Point.class).invoke(display, realSize);
//         } catch (NoSuchMethodException e) {
//             e.printStackTrace();
//         } catch (IllegalAccessException e) {
//             e.printStackTrace();
//         } catch (InvocationTargetException e) {
//             e.printStackTrace();
//         }
//         heightPixes = realSize.y;
//         return heightPixes;
//     }
// 
//     public static int dip2px(Context context, float dpVale) {
//         final float scale = context.getResources().getDisplayMetrics().density;
//         return (int) (dpVale * scale + 0.5f);
//     }
// 
//     public static int getStatusBarHeight(Context context) {
//         Resources resources = context.getResources();
//         int resourcesId = resources.getIdentifier("status_bar_height", "dimen", "android");
//         int height = resources.getDimensionPixelSize(resourcesId);
//         return height;
//     }
// 
//     /**
//      * Converts sp to px
//      *
//      * @param context Context
//      * @param sp  the value in sp
//      * @return int
//      */
//     public static int dip2sp(Context context, float sp) {
//         return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, context.getResources().getDisplayMetrics());
//     }
// 
//     public static int px2dip(Context context, float pxValue) {
//         final float scale = context.getResources().getDisplayMetrics().density;
//         return (int) (pxValue / scale + 0.5f);
//     }
// 
// }


// Path: app/src/main/java/io/github/marktony/espresso/component/FastScroller.java
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.support.annotation.ColorInt;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.animation.FastOutLinearInInterpolator;
import android.support.v4.view.animation.LinearOutSlowInInterpolator;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import io.github.marktony.espresso.R;
import io.github.marktony.espresso.interfaze.OnFastScrollStateChangeListener;
import io.github.marktony.espresso.util.DensityUtil;

        mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
            @Override
            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                super.onScrolled(recyclerView, dx, dy);
                show();
            }
        });

        if (mAutoHideEnabled) {
            postAutoHideDelayed();
        }
    }

    public int getThumbHeight() {
        return mThumbHeight;
    }

    public int getWidth() {
        return mWidth;
    }

    public boolean isDragging() {
        return mIsDragging;
    }

    /**
     * Handles the touch event and determines whether to show the fast scroller (or updates it if
     * it is already showing).
     */
    public void handleTouchEvent(MotionEvent ev, int downX, int downY, int lastY,
                                 OnFastScrollStateChangeListener stateChangeListener) {