public ViewConfigurationAssert hasScaledEdgeSlop(int slop) { isNotNull(); int actualSlop = actual.getScaledEdgeSlop(); assertThat(actualSlop) // .overridingErrorMessage("Expected scaled edge slop <%s> but was <%s>", slop, actualSlop) // .isEqualTo(slop); return this; }
@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()); }
public TwoFingerGestureDetector(Context context) { super(context); ViewConfiguration config = ViewConfiguration.get(context); mEdgeSlop = config.getScaledEdgeSlop(); }
public void init(Application application) { switcherHelper = new ActivitySwitcherHelper(this, application); ViewConfiguration conf = ViewConfiguration.get(application); touchSlop = conf.getScaledEdgeSlop(); }
assertEquals(12, viewConfiguration.getScaledEdgeSlop()); assertEquals(16, viewConfiguration.getScaledTouchSlop()); assertEquals(32, viewConfiguration.getScaledPagingTouchSlop());
public TwoFingerGestureDetector(Context context) { super(context); ViewConfiguration config = ViewConfiguration.get(context); mEdgeSlop = config.getScaledEdgeSlop(); }
public MaterialBackgroundDetector(Context context, View view, Callback callback, int color) { mView = view; mCallback = callback; setColor(color); ViewConfiguration configuration = ViewConfiguration.get(context); mMinPadding = configuration.getScaledEdgeSlop(); }
public ViewConfigurationAssert hasScaledEdgeSlop(int slop) { isNotNull(); int actualSlop = actual.getScaledEdgeSlop(); assertThat(actualSlop) // .overridingErrorMessage("Expected scaled edge slop <%s> but was <%s>", slop, actualSlop) // .isEqualTo(slop); return this; }
public TouchImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); this.edgeSlop = ViewConfiguration.get(context).getScaledEdgeSlop(); setDisplayType(DisplayType.FIT_TO_SCREEN); setQuickScaleEnabled(true); }
mEdgeSlop = config.getScaledEdgeSlop();
slop = config.getScaledEdgeSlop();
public SuperSlidingPaneLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); final float density = context.getResources().getDisplayMetrics().density; mOverhangSize = (int) (DEFAULT_OVERHANG_SIZE * density + 0.5f); final ViewConfiguration viewConfig = ViewConfiguration.get(context); mEdgeSlop = viewConfig.getScaledEdgeSlop(); setWillNotDraw(false); final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SuperSlidingPaneLayout); mMode = Mode.getFromInt(a.getInt(R.styleable.SuperSlidingPaneLayout_mode,0)); mIsCompatSliding = a.getBoolean(R.styleable.SuperSlidingPaneLayout_compat_sliding,false); a.recycle(); ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate()); ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); mDragHelper = ViewDragHelper.create(this, 0.5f, new DragHelperCallback()); mDragHelper.setMinVelocity(MIN_FLING_VELOCITY * density); }
public SuitLines(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); initOptionalState(context, attrs); basePadding = Util.dip2px(basePadding); maxVelocity = ViewConfiguration.get(context).getScaledMaximumFlingVelocity(); clickSlop = ViewConfiguration.get(context).getScaledEdgeSlop(); scroller = new Scroller(context); edgeEffectLeft = new EdgeEffect(context); edgeEffectRight = new EdgeEffect(context); setEdgeEffectColor(edgeEffectColor); basePaint.setColor(defaultLineColor[0]); basePaint.setStyle(Paint.Style.STROKE); basePaint.setStrokeWidth(4); coverLinePaint.setStyle(Paint.Style.STROKE); coverLinePaint.setStrokeWidth(Util.dip2px(5)); setLineStyle(SOLID); xyPaint.setTextSize(Util.size2sp(defaultXySize, getContext())); xyPaint.setColor(defaultXyColor); hintPaint.setTextSize(Util.size2sp(12, getContext())); hintPaint.setColor(hintColor); hintPaint.setStyle(Paint.Style.STROKE); hintPaint.setStrokeWidth(2); hintPaint.setTextAlign(Paint.Align.CENTER); }
slop = config.getScaledEdgeSlop();