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();
}
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);
}
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();
}
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;
}
use of android.view.ViewConfiguration in project android_frameworks_base by DirtyUnicorns.
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);
}
Aggregations