public MyScrollview(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); }
public ForwardingListener(View src) { mSrc = src; mScaledTouchSlop = ViewConfiguration.get(src.getContext()).getScaledTouchSlop(); mTapTimeout = ViewConfiguration.getTapTimeout(); // Use a medium-press timeout. Halfway between tap and long-press. mLongPressTimeout = (mTapTimeout + ViewConfiguration.getLongPressTimeout()) / 2; }
public CupcakeDetector(Context context) { final ViewConfiguration configuration = ViewConfiguration.get(context); mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); mTouchSlop = configuration.getScaledTouchSlop(); }
private void initAbsListView() { // Setting focusable in touch mode will set the focusable property to true setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setScrollingCacheEnabled(true); final ViewConfiguration configuration = ViewConfiguration.get(getContext()); mTouchSlop = configuration.getScaledTouchSlop(); mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); }
@Test public void methodsShouldReturnScaledAndroidConstantsDependingOnPixelDensity() { context.getResources().getDisplayMetrics().density = 1.5f; ViewConfiguration viewConfiguration = ViewConfiguration.get(context); assertEquals(15, viewConfiguration.getScaledScrollBarSize()); assertEquals(18, viewConfiguration.getScaledFadingEdgeLength()); assertEquals(18, viewConfiguration.getScaledEdgeSlop()); assertEquals(24, viewConfiguration.getScaledTouchSlop()); assertEquals(48, viewConfiguration.getScaledPagingTouchSlop()); assertEquals(150, viewConfiguration.getScaledDoubleTapSlop()); assertEquals(24, viewConfiguration.getScaledWindowTouchSlop()); assertEquals(75, viewConfiguration.getScaledMinimumFlingVelocity()); assertEquals(6000, viewConfiguration.getScaledMaximumFlingVelocity()); }
/** * initialize method, called inside the Chart.init() method. * * @param context */ @SuppressWarnings("deprecation") public static void init(Context context) { if (context == null) { // noinspection deprecation mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity(); // noinspection deprecation mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity(); Log.e("MPChartLib-Utils" , "Utils.init(...) PROVIDED CONTEXT OBJECT IS NULL"); } else { ViewConfiguration viewConfiguration = ViewConfiguration.get(context); mMinimumFlingVelocity = viewConfiguration.getScaledMinimumFlingVelocity(); mMaximumFlingVelocity = viewConfiguration.getScaledMaximumFlingVelocity(); Resources res = context.getResources(); mMetrics = res.getDisplayMetrics(); } }
protected void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){ mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mDrawRect = new RectF(); mTempRect = new RectF(); mTrackPath = new Path(); mFlingVelocity = ViewConfiguration.get(context).getScaledMinimumFlingVelocity(); applyStyle(context, attrs, defStyleAttr, defStyleRes); if(!isInEditMode()) mStyleId = ThemeManager.getStyleId(context, attrs, defStyleAttr, defStyleRes); }
/** * 设备是否有实体菜单 * * @param context * @return */ public static boolean hasHardwareMenuKey(Context context) { boolean flag = false; if (PRE_HC) flag = true; else if (GTE_ICS) { flag = ViewConfiguration.get(context).hasPermanentMenuKey(); } else flag = false; return flag; }
public MyScrollview(Context context, AttributeSet attrs) { super(context, attrs); mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); }
@Test public void testHasPermanentMenuKey() throws Exception { ViewConfiguration viewConfiguration = ViewConfiguration.get(context); assertThat(viewConfiguration.hasPermanentMenuKey()).isFalse(); ShadowViewConfiguration shadowViewConfiguration = shadowOf(viewConfiguration); shadowViewConfiguration.setHasPermanentMenuKey(true); assertThat(viewConfiguration.hasPermanentMenuKey()).isTrue(); } }
public VerticalSeekbar(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mScaledTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); }
public MyScrollview(Context context) { super(context); mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); }
public SildingFinishLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); mScroller = new Scroller(context); }
/** * Sets the sensitivity of the dragger. * * @param context The application context. * @param sensitivity value between 0 and 1, the final value for touchSlop = * ViewConfiguration.getScaledTouchSlop * (1 / s); */ public void setSensitivity(Context context, float sensitivity) { float s = Math.max(0f, Math.min(1.0f, sensitivity)); ViewConfiguration viewConfiguration = ViewConfiguration.get(context); mTouchSlop = (int) (viewConfiguration.getScaledTouchSlop() * (1 / s)); }
public CustomSwipeRefreshLayout(Context context, AttributeSet attrs) { super(context, attrs); touchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); load_view = LayoutInflater.from(context).inflate(R.layout.recycler_load_more_layout, null, false); }
void init(View delegateView, Rect delegateBounds) { mDelegateView = delegateView; mSlop = ViewConfiguration.get(delegateView.getContext()).getScaledTouchSlop(); mDelegateBounds.set(delegateBounds); mDelegateSlopBounds.set(delegateBounds); mDelegateSlopBounds.inset(-mSlop, -mSlop); }
public StickyGridHeadersGridView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); super.setOnScrollListener(this); setVerticalFadingEdgeEnabled(false); if (!mNumColumnsSet) { mNumColumns = AUTO_FIT; } ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); }
private void init(Context context) { mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); mRadius = UIUtil.dip2px(context, 3); mCircleSpacing = UIUtil.dip2px(context, 8); mStrokeWidth = UIUtil.dip2px(context, 1); }
private void initView() { setOnScrollListener(mOnScrollListener); mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); initShadow(true); }
private void init(Context context) { mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); mMinRadius = UIUtil.dip2px(context, 3); mMaxRadius = UIUtil.dip2px(context, 5); mCircleSpacing = UIUtil.dip2px(context, 8); mNavigatorHelper.setNavigatorScrollListener(this); mNavigatorHelper.setSkimOver(true); }