List of usage examples for android.view ViewConfiguration getScaledMaximumFlingVelocity
public int getScaledMaximumFlingVelocity()
From source file:com.qurater.pivotal.ui.TwoWayView.java
public TwoWayView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mNeedSync = false;//from ww w.j a va 2 s . c o m mVelocityTracker = null; mLayoutMode = LAYOUT_NORMAL; mTouchMode = TOUCH_MODE_REST; mLastTouchMode = TOUCH_MODE_UNKNOWN; mIsAttached = false; mContextMenuInfo = null; mOnScrollListener = null; mLastScrollState = OnScrollListener.SCROLL_STATE_IDLE; final ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); mMaximumVelocity = vc.getScaledMaximumFlingVelocity(); mFlingVelocity = vc.getScaledMinimumFlingVelocity(); mOverscrollDistance = getScaledOverscrollDistance(vc); mOverScroll = 0; mScroller = new Scroller(context); mIsVertical = true; mItemsCanFocus = false; mTempRect = new Rect(); mArrowScrollFocusResult = new ArrowScrollFocusResult(); mSelectorPosition = INVALID_POSITION; mSelectorRect = new Rect(); mSelectedStart = 0; mResurrectToPosition = INVALID_POSITION; mSelectedStart = 0; mNextSelectedPosition = INVALID_POSITION; mNextSelectedRowId = INVALID_ROW_ID; mSelectedPosition = INVALID_POSITION; mSelectedRowId = INVALID_ROW_ID; mOldSelectedPosition = INVALID_POSITION; mOldSelectedRowId = INVALID_ROW_ID; mChoiceMode = ChoiceMode.NONE; mCheckedItemCount = 0; mCheckedIdStates = null; mCheckStates = null; mRecycler = new RecycleBin(); mDataSetObserver = null; mAreAllItemsSelectable = true; mStartEdge = null; mEndEdge = null; setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setWillNotDraw(false); setClipToPadding(false); ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TwoWayView, defStyle, 0); mDrawSelectorOnTop = a.getBoolean(R.styleable.TwoWayView_android_drawSelectorOnTop, false); Drawable d = a.getDrawable(R.styleable.TwoWayView_android_listSelector); if (d != null) { setSelector(d); } int orientation = a.getInt(R.styleable.TwoWayView_android_orientation, -1); if (orientation >= 0) { setOrientation(Orientation.values()[orientation]); } int choiceMode = a.getInt(R.styleable.TwoWayView_android_choiceMode, -1); if (choiceMode >= 0) { setChoiceMode(ChoiceMode.values()[choiceMode]); } a.recycle(); }
From source file:com.runmit.sweedee.view.DirectListView.java
public DirectListView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mNeedSync = false;//w ww . j ava 2 s . c o m mVelocityTracker = null; mLayoutMode = LAYOUT_NORMAL; mTouchMode = TOUCH_MODE_REST; mLastTouchMode = TOUCH_MODE_UNKNOWN; mIsAttached = false; mContextMenuInfo = null; mOnScrollListener = null; mLastScrollState = OnScrollListener.SCROLL_STATE_IDLE; final ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); mMaximumVelocity = vc.getScaledMaximumFlingVelocity(); mFlingVelocity = vc.getScaledMinimumFlingVelocity(); mOverscrollDistance = getScaledOverscrollDistance(vc); mOverScroll = 0; mScroller = new Scroller(context); mIsVertical = true; mItemsCanFocus = false; mTempRect = new Rect(); mArrowScrollFocusResult = new ArrowScrollFocusResult(); mSelectorPosition = INVALID_POSITION; mSelectorRect = new Rect(); mSelectedStart = 0; mResurrectToPosition = INVALID_POSITION; mSelectedStart = 0; mNextSelectedPosition = INVALID_POSITION; mNextSelectedRowId = INVALID_ROW_ID; mSelectedPosition = INVALID_POSITION; mSelectedRowId = INVALID_ROW_ID; mOldSelectedPosition = INVALID_POSITION; mOldSelectedRowId = INVALID_ROW_ID; mChoiceMode = ChoiceMode.NONE; mCheckedItemCount = 0; mCheckedIdStates = null; mCheckStates = null; mRecycler = new RecycleBin(); mDataSetObserver = null; mAreAllItemsSelectable = true; mStartEdge = null; mEndEdge = null; setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setWillNotDraw(false); setClipToPadding(false); ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DirectListView, defStyle, 0); mDrawSelectorOnTop = a.getBoolean(R.styleable.DirectListView_android_drawSelectorOnTop, false); Drawable d = a.getDrawable(R.styleable.DirectListView_android_listSelector); if (d != null) { setSelector(d); } int orientation = a.getInt(R.styleable.DirectListView_android_orientation, -1); if (orientation >= 0) { setOrientation(Orientation.values()[orientation]); } int choiceMode = a.getInt(R.styleable.DirectListView_android_choiceMode, -1); if (choiceMode >= 0) { setChoiceMode(ChoiceMode.values()[choiceMode]); } a.recycle(); updateScrollbarsDirection(); }
From source file:com.mist.sciryl.app.views.TwoWayView.java
public TwoWayView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mNeedSync = false;/*from w w w .j a va 2 s. co m*/ mVelocityTracker = null; mLayoutMode = LAYOUT_NORMAL; mTouchMode = TOUCH_MODE_REST; mLastTouchMode = TOUCH_MODE_UNKNOWN; mIsAttached = false; mContextMenuInfo = null; mOnScrollListener = null; mLastScrollState = OnScrollListener.SCROLL_STATE_IDLE; final ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); mMaximumVelocity = vc.getScaledMaximumFlingVelocity(); mFlingVelocity = vc.getScaledMinimumFlingVelocity(); mOverscrollDistance = getScaledOverscrollDistance(vc); mOverScroll = 0; mScroller = new Scroller(context); mIsVertical = true; mItemsCanFocus = false; mTempRect = new Rect(); mArrowScrollFocusResult = new ArrowScrollFocusResult(); mSelectorPosition = INVALID_POSITION; mSelectorRect = new Rect(); mSelectedStart = 0; mResurrectToPosition = INVALID_POSITION; mSelectedStart = 0; mNextSelectedPosition = INVALID_POSITION; mNextSelectedRowId = INVALID_ROW_ID; mSelectedPosition = INVALID_POSITION; mSelectedRowId = INVALID_ROW_ID; mOldSelectedPosition = INVALID_POSITION; mOldSelectedRowId = INVALID_ROW_ID; mChoiceMode = ChoiceMode.NONE; mCheckedItemCount = 0; mCheckedIdStates = null; mCheckStates = null; mRecycler = new RecycleBin(); mDataSetObserver = null; mAreAllItemsSelectable = true; mStartEdge = null; mEndEdge = null; setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setWillNotDraw(false); setClipToPadding(false); ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TwoWayView, defStyle, 0); mDrawSelectorOnTop = a.getBoolean(R.styleable.TwoWayView_android_drawSelectorOnTop, false); Drawable d = a.getDrawable(R.styleable.TwoWayView_android_listSelector); if (d != null) { setSelector(d); } int orientation = a.getInt(R.styleable.TwoWayView_android_orientation, -1); if (orientation >= 0) { setOrientation(Orientation.values()[orientation]); } int choiceMode = a.getInt(R.styleable.TwoWayView_android_choiceMode, -1); if (choiceMode >= 0) { setChoiceMode(ChoiceMode.values()[choiceMode]); } a.recycle(); updateScrollbarsDirection(); }
From source file:com.propkaro.util.TwoWayView.java
public TwoWayView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mNeedSync = false;/* ww w . ja v a 2 s . c o m*/ mVelocityTracker = null; mLayoutMode = LAYOUT_NORMAL; mTouchMode = TOUCH_MODE_REST; mLastTouchMode = TOUCH_MODE_UNKNOWN; mIsAttached = false; mContextMenuInfo = null; mOnScrollListener = null; mLastScrollState = OnScrollListener.SCROLL_STATE_IDLE; final ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); mMaximumVelocity = vc.getScaledMaximumFlingVelocity(); mFlingVelocity = vc.getScaledMinimumFlingVelocity(); mOverscrollDistance = getScaledOverscrollDistance(vc); mOverScroll = 0; mScroller = new Scroller(context); mIsVertical = true; mItemsCanFocus = false; mTempRect = new Rect(); mArrowScrollFocusResult = new ArrowScrollFocusResult(); mSelectorPosition = INVALID_POSITION; mSelectorRect = new Rect(); mSelectedStart = 0; mResurrectToPosition = INVALID_POSITION; mSelectedStart = 0; mNextSelectedPosition = INVALID_POSITION; mNextSelectedRowId = INVALID_ROW_ID; mSelectedPosition = INVALID_POSITION; mSelectedRowId = INVALID_ROW_ID; mOldSelectedPosition = INVALID_POSITION; mOldSelectedRowId = INVALID_ROW_ID; mChoiceMode = ChoiceMode.NONE; mCheckedItemCount = 0; mCheckedIdStates = null; mCheckStates = null; mRecycler = new RecycleBin(); mDataSetObserver = null; mAreAllItemsSelectable = true; mStartEdge = null; mEndEdge = null; setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setWillNotDraw(false); setClipToPadding(false); ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TwoWayView, defStyle, 0); // initializeScrollbars(a); mDrawSelectorOnTop = a.getBoolean(R.styleable.TwoWayView_android_drawSelectorOnTop, false); Drawable d = a.getDrawable(R.styleable.TwoWayView_android_listSelector); if (d != null) { setSelector(d); } int orientation = a.getInt(R.styleable.TwoWayView_android_orientation, -1); if (orientation >= 0) { setOrientation(Orientation.values()[orientation]); } int choiceMode = a.getInt(R.styleable.TwoWayView_android_choiceMode, -1); if (choiceMode >= 0) { setChoiceMode(ChoiceMode.values()[choiceMode]); } a.recycle(); updateScrollbarsDirection(); }
From source file:com.aliasapps.seq.scroller.TwoWayView.java
public TwoWayView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mNeedSync = false;/*from w w w . ja va 2s.c om*/ mVelocityTracker = null; mLayoutMode = LAYOUT_NORMAL; mTouchMode = TOUCH_MODE_REST; mLastTouchMode = TOUCH_MODE_UNKNOWN; mIsAttached = false; mContextMenuInfo = null; mOnScrollListener = null; mLastScrollState = OnScrollListener.SCROLL_STATE_IDLE; final ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); mMaximumVelocity = vc.getScaledMaximumFlingVelocity(); mFlingVelocity = vc.getScaledMinimumFlingVelocity(); mOverscrollDistance = getScaledOverscrollDistance(vc); mOverScroll = 0; mScroller = new Scroller(context); mIsVertical = true; mItemsCanFocus = false; mTempRect = new Rect(); mArrowScrollFocusResult = new ArrowScrollFocusResult(); mSelectorPosition = INVALID_POSITION; mSelectorRect = new Rect(); mSelectedStart = 0; mResurrectToPosition = INVALID_POSITION; mSelectedStart = 0; mNextSelectedPosition = INVALID_POSITION; mNextSelectedRowId = INVALID_ROW_ID; mSelectedPosition = INVALID_POSITION; mSelectedRowId = INVALID_ROW_ID; mOldSelectedPosition = INVALID_POSITION; mOldSelectedRowId = INVALID_ROW_ID; mChoiceMode = ChoiceMode.NONE; mCheckedItemCount = 0; mCheckedIdStates = null; mCheckStates = null; mRecycler = new RecycleBin(); mDataSetObserver = null; mAreAllItemsSelectable = true; mStartEdge = null; mEndEdge = null; setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setWillNotDraw(false); setClipToPadding(false); ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TwoWayView, defStyle, 0); initializeScrollbars(a); mDrawSelectorOnTop = a.getBoolean(R.styleable.TwoWayView_android_drawSelectorOnTop, false); Drawable d = a.getDrawable(R.styleable.TwoWayView_android_listSelector); if (d != null) { setSelector(d); } int orientation = a.getInt(R.styleable.TwoWayView_android_orientation, -1); if (orientation >= 0) { setOrientation(Orientation.values()[orientation]); } int choiceMode = a.getInt(R.styleable.TwoWayView_android_choiceMode, -1); if (choiceMode >= 0) { setChoiceMode(ChoiceMode.values()[choiceMode]); } a.recycle(); updateScrollbarsDirection(); }
From source file:com.cmg.android.cmgpdf.view.TwoWayView.java
public TwoWayView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mNeedSync = false;/*from w ww. j ava2s .com*/ mVelocityTracker = null; mLayoutMode = LAYOUT_NORMAL; mTouchMode = TOUCH_MODE_REST; mLastTouchMode = TOUCH_MODE_UNKNOWN; mIsAttached = false; mContextMenuInfo = null; mOnScrollListener = null; mLastScrollState = OnScrollListener.SCROLL_STATE_IDLE; final ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); mMaximumVelocity = vc.getScaledMaximumFlingVelocity(); mFlingVelocity = vc.getScaledMinimumFlingVelocity(); mOverscrollDistance = getScaledOverscrollDistance(vc); mOverScroll = 0; mScroller = new Scroller(context); mIsVertical = true; mItemsCanFocus = false; mTempRect = new Rect(); mArrowScrollFocusResult = new ArrowScrollFocusResult(); mSelectorPosition = INVALID_POSITION; mSelectorRect = new Rect(); mSelectedStart = 0; mResurrectToPosition = INVALID_POSITION; mSelectedStart = 0; mNextSelectedPosition = INVALID_POSITION; mNextSelectedRowId = INVALID_ROW_ID; mSelectedPosition = INVALID_POSITION; mSelectedRowId = INVALID_ROW_ID; mOldSelectedPosition = INVALID_POSITION; mOldSelectedRowId = INVALID_ROW_ID; mChoiceMode = ChoiceMode.NONE; mCheckedItemCount = 0; mCheckedIdStates = null; mCheckStates = null; mRecycler = new RecycleBin(); mDataSetObserver = null; mAreAllItemsSelectable = true; mStartEdge = null; mEndEdge = null; setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setWillNotDraw(false); setClipToPadding(false); ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TwoWayView, defStyle, 0); //initializeScrollbars(a); mDrawSelectorOnTop = a.getBoolean(R.styleable.TwoWayView_android_drawSelectorOnTop, false); Drawable d = a.getDrawable(R.styleable.TwoWayView_android_listSelector); if (d != null) { setSelector(d); } int orientation = a.getInt(R.styleable.TwoWayView_android_orientation, -1); if (orientation >= 0) { setOrientation(Orientation.values()[orientation]); } int choiceMode = a.getInt(R.styleable.TwoWayView_android_choiceMode, -1); if (choiceMode >= 0) { setChoiceMode(ChoiceMode.values()[choiceMode]); } a.recycle(); updateScrollbarsDirection(); }
From source file:com.artifex.mupdf.view.ThumbnailViews.java
public ThumbnailViews(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mNeedSync = false;// w w w . j av a 2s .c o m mVelocityTracker = null; mLayoutMode = LAYOUT_NORMAL; mTouchMode = TOUCH_MODE_REST; mLastTouchMode = TOUCH_MODE_UNKNOWN; mIsAttached = false; mContextMenuInfo = null; mOnScrollListener = null; mLastScrollState = OnScrollListener.SCROLL_STATE_IDLE; final ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); mMaximumVelocity = vc.getScaledMaximumFlingVelocity(); mFlingVelocity = vc.getScaledMinimumFlingVelocity(); mOverscrollDistance = getScaledOverscrollDistance(vc); mOverScroll = 0; mScroller = new Scroller(context); mIsVertical = true; mItemsCanFocus = false; mTempRect = new Rect(); mArrowScrollFocusResult = new ArrowScrollFocusResult(); mSelectorPosition = INVALID_POSITION; mSelectorRect = new Rect(); mSelectedStart = 0; mResurrectToPosition = INVALID_POSITION; mSelectedStart = 0; mNextSelectedPosition = INVALID_POSITION; mNextSelectedRowId = INVALID_ROW_ID; mSelectedPosition = INVALID_POSITION; mSelectedRowId = INVALID_ROW_ID; mOldSelectedPosition = INVALID_POSITION; mOldSelectedRowId = INVALID_ROW_ID; mChoiceMode = ChoiceMode.NONE; mCheckedItemCount = 0; mCheckedIdStates = null; mCheckStates = null; mRecycler = new RecycleBin(); mDataSetObserver = null; mAreAllItemsSelectable = true; mStartEdge = null; mEndEdge = null; setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setWillNotDraw(false); setClipToPadding(false); ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TwoWayView, defStyle, 0); initializeScrollbars(a); mDrawSelectorOnTop = a.getBoolean(R.styleable.TwoWayView_android_drawSelectorOnTop, false); Drawable d = a.getDrawable(R.styleable.TwoWayView_android_listSelector); if (d != null) { setSelector(d); } int orientation = a.getInt(R.styleable.TwoWayView_android_orientation, -1); if (orientation >= 0) { setOrientation(Orientation.values()[orientation]); } int choiceMode = a.getInt(R.styleable.TwoWayView_android_choiceMode, -1); if (choiceMode >= 0) { setChoiceMode(ChoiceMode.values()[choiceMode]); } a.recycle(); updateScrollbarsDirection(); }
From source file:com.ruyigu.freeart.ui.widget.HorizontalListView.java
public HorizontalListView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mNeedSync = false;/*from w w w . j a va 2 s .c om*/ mVelocityTracker = null; mLayoutMode = LAYOUT_NORMAL; mTouchMode = TOUCH_MODE_REST; mLastTouchMode = TOUCH_MODE_UNKNOWN; mIsAttached = false; mContextMenuInfo = null; mOnScrollListener = null; mLastScrollState = OnScrollListener.SCROLL_STATE_IDLE; final ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); mMaximumVelocity = vc.getScaledMaximumFlingVelocity(); mFlingVelocity = vc.getScaledMinimumFlingVelocity(); mOverscrollDistance = getScaledOverscrollDistance(vc); mOverScroll = 0; mScroller = new Scroller(context); mIsVertical = true; mItemsCanFocus = false; mTempRect = new Rect(); mArrowScrollFocusResult = new ArrowScrollFocusResult(); mSelectorPosition = INVALID_POSITION; mSelectorRect = new Rect(); mSelectedStart = 0; mResurrectToPosition = INVALID_POSITION; mSelectedStart = 0; mNextSelectedPosition = INVALID_POSITION; mNextSelectedRowId = INVALID_ROW_ID; mSelectedPosition = INVALID_POSITION; mSelectedRowId = INVALID_ROW_ID; mOldSelectedPosition = INVALID_POSITION; mOldSelectedRowId = INVALID_ROW_ID; mChoiceMode = ChoiceMode.NONE; mCheckedItemCount = 0; mCheckedIdStates = null; mCheckStates = null; mRecycler = new RecycleBin(); mDataSetObserver = null; mAreAllItemsSelectable = true; mStartEdge = null; mEndEdge = null; setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setWillNotDraw(false); setClipToPadding(false); ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.HorizontalListView, defStyle, 0); // initializeScrollbars(a); mDrawSelectorOnTop = a.getBoolean(R.styleable.HorizontalListView_android_drawSelectorOnTop, false); Drawable d = a.getDrawable(R.styleable.HorizontalListView_android_listSelector); if (d != null) { setSelector(d); } int orientation = a.getInt(R.styleable.HorizontalListView_android_orientation, -1); if (orientation >= 0) { setOrientation(Orientation.values()[orientation]); } int choiceMode = a.getInt(R.styleable.HorizontalListView_android_choiceMode, -1); if (choiceMode >= 0) { setChoiceMode(ChoiceMode.values()[choiceMode]); } a.recycle(); updateScrollbarsDirection(); }
From source file:com.kinth.mmspeed.ui.TwoWayView.java
public TwoWayView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mNeedSync = false;//from w w w.jav a2 s . c om mVelocityTracker = null; mLayoutMode = LAYOUT_NORMAL; mTouchMode = TOUCH_MODE_REST; mLastTouchMode = TOUCH_MODE_UNKNOWN; mIsAttached = false; mContextMenuInfo = null; mOnScrollListener = null; mLastScrollState = OnScrollListener.SCROLL_STATE_IDLE; final ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); mMaximumVelocity = vc.getScaledMaximumFlingVelocity(); mFlingVelocity = vc.getScaledMinimumFlingVelocity(); mOverscrollDistance = getScaledOverscrollDistance(vc); mOverScroll = 0; mScroller = new Scroller(context); mIsVertical = true; mItemsCanFocus = false; mTempRect = new Rect(); mArrowScrollFocusResult = new ArrowScrollFocusResult(); mSelectorPosition = INVALID_POSITION; mSelectorRect = new Rect(); mSelectedStart = 0; mResurrectToPosition = INVALID_POSITION; mSelectedStart = 0; mNextSelectedPosition = INVALID_POSITION; mNextSelectedRowId = INVALID_ROW_ID; mSelectedPosition = INVALID_POSITION; mSelectedRowId = INVALID_ROW_ID; mOldSelectedPosition = INVALID_POSITION; mOldSelectedRowId = INVALID_ROW_ID; mChoiceMode = ChoiceMode.NONE; mCheckedItemCount = 0; mCheckedIdStates = null; mCheckStates = null; mRecycler = new RecycleBin(); mDataSetObserver = null; mAreAllItemsSelectable = true; mStartEdge = null; mEndEdge = null; setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setWillNotDraw(false); setClipToPadding(false); ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TwoWayView, defStyle, 0); // initializeScrollbars(a); mDrawSelectorOnTop = a.getBoolean(R.styleable.TwoWayView_android_drawSelectorOnTop, false); Drawable d = a.getDrawable(R.styleable.TwoWayView_android_listSelector); if (d != null) { setSelector(d); } int orientation = a.getInt(R.styleable.TwoWayView_android_orientation, -1); if (orientation >= 0) { setOrientation(Orientation.values()[orientation]); } int choiceMode = a.getInt(R.styleable.TwoWayView_android_choiceMode, -1); if (choiceMode >= 0) { setChoiceMode(ChoiceMode.values()[choiceMode]); } a.recycle(); updateScrollbarsDirection(); }
From source file:com.vreal.libs.TwoWayView.java
public TwoWayView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); // c=context; mNeedSync = false;//ww w. j a v a2 s . c o m mVelocityTracker = null; mLayoutMode = LAYOUT_NORMAL; mTouchMode = TOUCH_MODE_REST; mLastTouchMode = TOUCH_MODE_UNKNOWN; mIsAttached = false; mContextMenuInfo = null; mOnScrollListener = null; mLastScrollState = OnScrollListener.SCROLL_STATE_IDLE; final ViewConfiguration vc = ViewConfiguration.get(context); mTouchSlop = vc.getScaledTouchSlop(); mMaximumVelocity = vc.getScaledMaximumFlingVelocity(); mFlingVelocity = vc.getScaledMinimumFlingVelocity(); mOverscrollDistance = getScaledOverscrollDistance(vc); mOverScroll = 0; mScroller = new Scroller(context); mIsVertical = true; mItemsCanFocus = false; mTempRect = new Rect(); mArrowScrollFocusResult = new ArrowScrollFocusResult(); mSelectorPosition = INVALID_POSITION; mSelectorRect = new Rect(); mSelectedStart = 0; mResurrectToPosition = INVALID_POSITION; mSelectedStart = 0; mNextSelectedPosition = INVALID_POSITION; mNextSelectedRowId = INVALID_ROW_ID; mSelectedPosition = INVALID_POSITION; mSelectedRowId = INVALID_ROW_ID; mOldSelectedPosition = INVALID_POSITION; mOldSelectedRowId = INVALID_ROW_ID; mChoiceMode = ChoiceMode.NONE; mCheckedItemCount = 0; mCheckedIdStates = null; mCheckStates = null; mRecycler = new RecycleBin(); mDataSetObserver = null; mAreAllItemsSelectable = true; mStartEdge = null; mEndEdge = null; setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); setWillNotDraw(false); setClipToPadding(false); ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TwoWayView, defStyle, 0); // initializeScrollbars(a,context); mDrawSelectorOnTop = a.getBoolean(R.styleable.TwoWayView_android_drawSelectorOnTop, false); Drawable d = a.getDrawable(R.styleable.TwoWayView_android_listSelector); if (d != null) { setSelector(d); } int orientation = a.getInt(R.styleable.TwoWayView_android_orientation, -1); if (orientation >= 0) { setOrientation(Orientation.values()[orientation]); } int choiceMode = a.getInt(R.styleable.TwoWayView_android_choiceMode, -1); if (choiceMode >= 0) { setChoiceMode(ChoiceMode.values()[choiceMode]); } a.recycle(); updateScrollbarsDirection(); }