Example usage for android.support.v4.view ViewConfigurationCompat getScaledPagingTouchSlop

List of usage examples for android.support.v4.view ViewConfigurationCompat getScaledPagingTouchSlop

Introduction

In this page you can find the example usage for android.support.v4.view ViewConfigurationCompat getScaledPagingTouchSlop.

Prototype

public static int getScaledPagingTouchSlop(ViewConfiguration config) 

Source Link

Document

Call ViewConfiguration#getScaledPagingTouchSlop() .

Usage

From source file:com.duy.pascal.ui.view.BaseRecycleView.java

@Override
public void setScrollingTouchSlop(int slopConstant) {
    super.setScrollingTouchSlop(slopConstant);
    final ViewConfiguration vc = ViewConfiguration.get(getContext());
    switch (slopConstant) {
    case TOUCH_SLOP_DEFAULT:
        mTouchSlop = vc.getScaledTouchSlop();
        break;// w w w.j  a  va 2  s.c  o m
    case TOUCH_SLOP_PAGING:
        mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(vc);
        break;
    default:
        break;
    }
}

From source file:com.facebook.getrecommendations.AppCardPager.java

/**
 * Construct an AppCardPager with the given context and attributes
 *
 * @param context the application context
 * @param attrs   a set of initial attributes
 */// w w  w .  ja  v a 2  s.co m
public AppCardPager(Context context, AttributeSet attrs) {
    super(context, attrs);
    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration) / 2;
}

From source file:com.android.deskclock.VerticalViewPager.java

public VerticalViewPager(Context context, AttributeSet attrs) {
    super(context, attrs);
    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
    init();/*from ww  w.  j a v a  2 s.  com*/
}

From source file:com.vincestyling.traversaless_testcase.TopTabIndicator.java

public TopTabIndicator(Context context, AttributeSet attrs) {
    super(context, attrs);
    if (isInEditMode())
        return;/*from   w  ww  . ja va2  s.c  o  m*/

    mTextColor = getResources().getColor(R.color.frag_tab_item_text);
    mTextSize = getResources().getDimension(R.dimen.frag_tab_item_text);
    mUnderlineColor = getResources().getColor(R.color.frag_tab_item_underline);
    mUnderlineHeight = getResources().getDimensionPixelSize(R.dimen.frag_tab_item_underline);

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
}

From source file:com.jungle.toolbaractivity.layout.HorizontalSwipeBackLayout.java

private void initLayout(Context context) {
    Resources res = getResources();
    mShadowWidth = res.getDimensionPixelSize(R.dimen.activity_edge_shadow_width);
    mEdgeShadowDrawable = res.getDrawable(R.drawable.activity_left_edge_shadow);
    mTriggerSlideSlop = (int) (1.5f
            * ViewConfigurationCompat.getScaledPagingTouchSlop(ViewConfiguration.get(getContext())));
}

From source file:qv.viewpager.UnderlinePageIndicator.java

public UnderlinePageIndicator(Context context, AttributeSet attrs) {
    super(context, attrs);
    if (isInEditMode())
        return;/*ww w.j  a v a2 s . com*/

    setFades(false);
    setSelectedColor(0xFF33B5E5);
    /*setFadeDelay(300);
    setFadeLength(400);*/

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
}

From source file:com.dragon.lib.IndicatorView.java

public IndicatorView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    if (isInEditMode()) {
        return;/*from  ww w.jav a 2 s.c  om*/
    }

    autoStart();
    init(attrs, defStyle);
    final ViewConfiguration viewConfiguration = ViewConfiguration.get(getContext());
    mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(viewConfiguration);
}

From source file:com.android.yijiang.kzx.widget.betterpickers.widget.UnderlinePageIndicatorPicker.java

public UnderlinePageIndicatorPicker(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    mColorUnderline = getResources().getColor(R.color.dialog_text_color_holo_dark);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BetterPickersDialogFragment, defStyle, 0);
    mColorUnderline = a.getColor(R.styleable.BetterPickersDialogFragment_bpKeyboardIndicatorColor,
            mColorUnderline);/*from www.ja va 2 s  .  com*/

    rectPaint = new Paint();
    rectPaint.setAntiAlias(true);
    rectPaint.setStyle(Style.FILL);

    a.recycle();

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
}

From source file:lt.app.hmspicker.widget.UnderlinePageIndicatorPicker.java

public UnderlinePageIndicatorPicker(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    mColorUnderline = ContextCompat.getColor(context, R.color.dialog_text_color_holo_dark);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BetterPickersDialogFragment, defStyle, 0);
    mColorUnderline = a.getColor(R.styleable.BetterPickersDialogFragment_bpKeyboardIndicatorColor,
            mColorUnderline);/*  w  ww  . j a va 2 s .co  m*/

    rectPaint = new Paint();
    rectPaint.setAntiAlias(true);
    rectPaint.setStyle(Style.FILL);

    a.recycle();

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
}

From source file:kr.kdev.dg1s.biowiki.util.LinePageIndicator.java

public LinePageIndicator(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    if (isInEditMode())
        return;/*from   w  w  w. j a v a2  s  .c  om*/

    final Resources res = getResources();

    mCentered = true;
    mLineWidth = res.getDimension(R.dimen.page_indicator_line_width);
    mGapWidth = res.getDimension(R.dimen.page_indicator_gap_width);
    setStrokeWidth(res.getDimension(R.dimen.page_indicator_stroke_width));
    mPaintUnselected.setColor(res.getColor(R.color.page_indicator_unselected_color));
    mPaintSelected.setColor(res.getColor(R.color.page_indicator_selected_color));

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
}