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);
}
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);
}
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();
}
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();
}
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));
}
Aggregations