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