class BaseProfileFragment extends SecuredFragment implements View.OnTouchListener {

    @VisibleForTesting
    protected boolean onFlingProcessor(MotionEvent event, MotionEvent event2, float velocityY) {

        final int SWIPE_MIN_DISTANCE = 120;
        final int SWIPE_MAX_OFF_PATH = 300;
        final int SWIPE_THRESHOLD_VELOCITY = 200;
        try {
            if (Math.abs(event.getX() - event2.getX()) > SWIPE_MAX_OFF_PATH) {
                return true;
            }
            if (event.getY() - event2.getY() > SWIPE_MIN_DISTANCE && Math.abs(velocityY) > SWIPE_THRESHOLD_VELOCITY) {

                ((BaseProfileActivity) getActivity()).getProfileAppBarLayout().setExpanded(false, true);
            } else if (event2.getY() - event.getY() > SWIPE_MIN_DISTANCE && Math.abs(velocityY) > SWIPE_THRESHOLD_VELOCITY) {

                ((BaseProfileActivity) getActivity()).getProfileAppBarLayout().setExpanded(true, true);
            }
        } catch (Exception e) {
            // nothing
        }
        return false;
    }

}