Search in sources :

Example 56 with ViewConfiguration

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

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 57 with ViewConfiguration

use of android.view.ViewConfiguration in project CompactCalendarView by SundeepK.

the class CompactCalendarController method initScreenDensityRelatedValues.

private void initScreenDensityRelatedValues(Context context) {
    if (context != null) {
        screenDensity = context.getResources().getDisplayMetrics().density;
        final ViewConfiguration configuration = ViewConfiguration.get(context);
        densityAdjustedSnapVelocity = (int) (screenDensity * SNAP_VELOCITY_DIP_PER_SECOND);
        maximumVelocity = configuration.getScaledMaximumFlingVelocity();
        final DisplayMetrics dm = context.getResources().getDisplayMetrics();
        multiDayIndicatorStrokeWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, dm);
    }
}
Also used : ViewConfiguration(android.view.ViewConfiguration) DisplayMetrics(android.util.DisplayMetrics)

Example 58 with ViewConfiguration

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

the class SwipeDismissLayout method init.

private void init(Context context) {
    ViewConfiguration vc = ViewConfiguration.get(context);
    mSlop = vc.getScaledTouchSlop();
    mMinFlingVelocity = vc.getScaledMinimumFlingVelocity();
    TypedArray a = context.getTheme().obtainStyledAttributes(com.android.internal.R.styleable.Theme);
    mIsWindowNativelyTranslucent = a.getBoolean(com.android.internal.R.styleable.Window_windowIsTranslucent, false);
    a.recycle();
}
Also used : ViewConfiguration(android.view.ViewConfiguration) TypedArray(android.content.res.TypedArray)

Example 59 with ViewConfiguration

use of android.view.ViewConfiguration in project UltimateAndroid by cymcsg.

the class FlipViewController method init.

private void init(Context context, int orientation) {
    ViewConfiguration configuration = ViewConfiguration.get(getContext());
    touchSlop = configuration.getScaledTouchSlop();
    this.flipOrientation = orientation;
    setupSurfaceView(context);
}
Also used : ViewConfiguration(android.view.ViewConfiguration)

Example 60 with ViewConfiguration

use of android.view.ViewConfiguration in project UltimateAndroid by cymcsg.

the class FlipView method init.

private void init() {
    final Context context = getContext();
    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mScroller = new Scroller(context, flipInterpolator);
    mTouchSlop = configuration.getScaledPagingTouchSlop();
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    mShadowPaint.setColor(Color.BLACK);
    mShadowPaint.setStyle(Style.FILL);
    mShadePaint.setColor(Color.BLACK);
    mShadePaint.setStyle(Style.FILL);
    mShinePaint.setColor(Color.WHITE);
    mShinePaint.setStyle(Style.FILL);
}
Also used : Context(android.content.Context) ViewConfiguration(android.view.ViewConfiguration) Scroller(android.widget.Scroller)

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