Search in sources :

Example 71 with ViewConfiguration

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

the class ScrollView 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 72 with ViewConfiguration

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

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

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

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

use of android.view.ViewConfiguration in project Etar-Calendar by Etar-Group.

the class SimpleDayPickerFragment method onAttach.

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    mContext = activity;
    String tz = Time.getCurrentTimezone();
    ViewConfiguration viewConfig = ViewConfiguration.get(activity);
    mMinimumFlingVelocity = viewConfig.getScaledMinimumFlingVelocity();
    // Ensure we're in the correct time zone
    mSelectedDay.switchTimezone(tz);
    mSelectedDay.normalize(true);
    mFirstDayOfMonth.timezone = tz;
    mFirstDayOfMonth.normalize(true);
    mFirstVisibleDay.timezone = tz;
    mFirstVisibleDay.normalize(true);
    mTempTime.timezone = tz;
    Resources res = activity.getResources();
    String theme = Utils.getTheme(getActivity());
    if (theme.equals("dark")) {
        mSaturdayColor = res.getColor(R.color.month_saturday_dark);
        mSundayColor = res.getColor(R.color.month_sunday_dark);
        mDayNameColor = res.getColor(R.color.month_day_names_color_dark);
    } else {
        mSaturdayColor = res.getColor(R.color.month_saturday);
        mSundayColor = res.getColor(R.color.month_sunday);
        mDayNameColor = res.getColor(R.color.month_day_names_color);
    }
    // Adjust sizes for screen density
    if (mScale == 0) {
        mScale = activity.getResources().getDisplayMetrics().density;
        if (mScale != 1) {
            WEEK_MIN_VISIBLE_HEIGHT *= mScale;
            BOTTOM_BUFFER *= mScale;
            LIST_TOP_OFFSET *= mScale;
        }
    }
    setUpAdapter();
    setListAdapter(mAdapter);
}
Also used : ViewConfiguration(android.view.ViewConfiguration) Resources(android.content.res.Resources)

Example 75 with ViewConfiguration

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

the class 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);
    boolean scrollingCacheEnabled = (mScrollingCacheProperty < 2);
    setScrollingCacheEnabled(scrollingCacheEnabled);
    final ViewConfiguration configuration = ViewConfiguration.get(mContext);
    mTouchSlop = configuration.getScaledTouchSlop();
    mScrollFactor = configuration.getScaledScrollFactor();
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    mDecacheThreshold = mMaximumVelocity / 2;
    mOverscrollDistance = configuration.getScaledOverscrollDistance();
    mOverflingDistance = configuration.getScaledOverflingDistance();
    mDensityScale = getContext().getResources().getDisplayMetrics().density;
}
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