Search in sources :

Example 81 with ViewConfiguration

use of android.view.ViewConfiguration in project android_frameworks_base by AOSPA.

the class PanelView method loadDimens.

protected void loadDimens() {
    final Resources res = getContext().getResources();
    final ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mTouchSlop = configuration.getScaledTouchSlop();
    mHintDistance = res.getDimension(R.dimen.hint_move_distance);
    mUnlockFalsingThreshold = res.getDimensionPixelSize(R.dimen.unlock_falsing_threshold);
}
Also used : ViewConfiguration(android.view.ViewConfiguration) Resources(android.content.res.Resources)

Example 82 with ViewConfiguration

use of android.view.ViewConfiguration in project android_frameworks_base by AOSPA.

the class KeyguardAffordanceHelper method initDimens.

private void initDimens() {
    final ViewConfiguration configuration = ViewConfiguration.get(mContext);
    mTouchSlop = configuration.getScaledPagingTouchSlop();
    mMinFlingVelocity = configuration.getScaledMinimumFlingVelocity();
    mMinTranslationAmount = mContext.getResources().getDimensionPixelSize(R.dimen.keyguard_min_swipe_amount);
    mMinBackgroundRadius = mContext.getResources().getDimensionPixelSize(R.dimen.keyguard_affordance_min_background_radius);
    mTouchTargetSize = mContext.getResources().getDimensionPixelSize(R.dimen.keyguard_affordance_touch_target_size);
    mHintGrowAmount = mContext.getResources().getDimensionPixelSize(R.dimen.hint_grow_amount_sideways);
    mFlingAnimationUtils = new FlingAnimationUtils(mContext, 0.4f);
    mFalsingManager = FalsingManager.getInstance(mContext);
}
Also used : ViewConfiguration(android.view.ViewConfiguration) FlingAnimationUtils(com.android.systemui.statusbar.FlingAnimationUtils)

Example 83 with ViewConfiguration

use of android.view.ViewConfiguration in project android_frameworks_base by AOSPA.

the class HorizontalScrollView method initScrollView.

private void initScrollView() {
    mScroller = new OverScroller(getContext());
    setFocusable(true);
    setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
    setWillNotDraw(false);
    final ViewConfiguration configuration = ViewConfiguration.get(mContext);
    mTouchSlop = configuration.getScaledTouchSlop();
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    mOverscrollDistance = configuration.getScaledOverscrollDistance();
    mOverflingDistance = configuration.getScaledOverflingDistance();
    mScrollFactor = configuration.getScaledScrollFactor();
}
Also used : ViewConfiguration(android.view.ViewConfiguration)

Example 84 with ViewConfiguration

use of android.view.ViewConfiguration in project ABPlayer by winkstu.

the class PLA_AbsListView method initAbsListView.

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();
}
Also used : ViewConfiguration(android.view.ViewConfiguration)

Example 85 with ViewConfiguration

use of android.view.ViewConfiguration in project AisenWeiBo by wangdan.

the class ViewDragHelper method setSensitivity.

/**
     * 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));
}
Also used : ViewConfiguration(android.view.ViewConfiguration)

Aggregations

ViewConfiguration (android.view.ViewConfiguration)186 Scroller (android.widget.Scroller)41 Context (android.content.Context)28 TypedArray (android.content.res.TypedArray)23 EdgeEffectCompat (android.support.v4.widget.EdgeEffectCompat)16 Point (android.graphics.Point)12 View (android.view.View)12 OverScroller (android.widget.OverScroller)10 Field (java.lang.reflect.Field)9 Resources (android.content.res.Resources)8 Paint (android.graphics.Paint)7 RectF (android.graphics.RectF)7 DisplayMetrics (android.util.DisplayMetrics)7 Drawable (android.graphics.drawable.Drawable)6 GestureDetector (android.view.GestureDetector)6 PointF (android.graphics.PointF)5 ImageView (android.widget.ImageView)5 FlingAnimationUtils (com.android.systemui.statusbar.FlingAnimationUtils)5 SlidingTabLayout (com.google.samples.apps.iosched.ui.widget.SlidingTabLayout)4 TimeInterpolator (android.animation.TimeInterpolator)3