Search in sources :

Example 11 with ViewConfiguration

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

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

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

the class StackView method initStackView.

private void initStackView() {
    configureViewAnimator(NUM_ACTIVE_VIEWS, 1);
    setStaticTransformationsEnabled(true);
    final ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mTouchSlop = configuration.getScaledTouchSlop();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    mActivePointerId = INVALID_POINTER;
    mHighlight = new ImageView(getContext());
    mHighlight.setLayoutParams(new LayoutParams(mHighlight));
    addViewInLayout(mHighlight, -1, new LayoutParams(mHighlight));
    mClickFeedback = new ImageView(getContext());
    mClickFeedback.setLayoutParams(new LayoutParams(mClickFeedback));
    addViewInLayout(mClickFeedback, -1, new LayoutParams(mClickFeedback));
    mClickFeedback.setVisibility(INVISIBLE);
    mStackSlider = new StackSlider();
    if (sHolographicHelper == null) {
        sHolographicHelper = new HolographicHelper(mContext);
    }
    setClipChildren(false);
    setClipToPadding(false);
    // This sets the form of the StackView, which is currently to have the perspective-shifted
    // views above the active view, and have items slide down when sliding out. The opposite is
    // available by using ITEMS_SLIDE_UP.
    mStackMode = ITEMS_SLIDE_DOWN;
    // This is a flag to indicate the the stack is loading for the first time
    mWhichChild = -1;
    // Adjust the frame padding based on the density, since the highlight changes based
    // on the density
    final float density = mContext.getResources().getDisplayMetrics().density;
    mFramePadding = (int) Math.ceil(density * FRAME_PADDING);
}
Also used : ViewConfiguration(android.view.ViewConfiguration)

Example 13 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 14 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 15 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)

Aggregations

ViewConfiguration (android.view.ViewConfiguration)234 Scroller (android.widget.Scroller)53 Context (android.content.Context)36 TypedArray (android.content.res.TypedArray)29 Field (java.lang.reflect.Field)20 EdgeEffectCompat (android.support.v4.widget.EdgeEffectCompat)18 View (android.view.View)15 Point (android.graphics.Point)14 OverScroller (android.widget.OverScroller)12 Drawable (android.graphics.drawable.Drawable)10 Paint (android.graphics.Paint)8 DisplayMetrics (android.util.DisplayMetrics)8 Resources (android.content.res.Resources)7 RectF (android.graphics.RectF)7 GestureDetector (android.view.GestureDetector)7 ImageView (android.widget.ImageView)6 PointF (android.graphics.PointF)5 FlingAnimationUtils (com.android.systemui.statusbar.FlingAnimationUtils)5 Rect (android.graphics.Rect)4 SlidingTabLayout (com.google.samples.apps.iosched.ui.widget.SlidingTabLayout)4