ViewConfiguration 和 ViewConfigurationCompat

Contains methods to standard constants used in the UI for timeouts, sizes, and distances.

 

一。几个常用的方法

返回初始化滑动的最大速度值和最小速度值,以像素/秒为单位

getScaledMinimumFlingVelocity()

  • Minimum velocity to initiate a fling, as measured in pixels per second.

  •  mMinimumFlingVelocity = (int) (density * 50 + 0.5f);

 

getScaledMaximumFlingVelocity()

  • Maximum velocity to initiate a fling, as measured in pixels per second.

  • mMaximumFlingVelocity = (int) (density * 4000 0.5f);

 

getScaledTouchSlop ()

  •  Distance in pixels a touch can wander before we think the user is scrolling  。

  •   mTouchSlop = (int) (density * 16 + 0.5f);

 

 getScaledPagingTouchSlop ()

  • Distance in pixels a touch can wander before we think the user is scrolling a full page

  • mPagingTouchSlop = (int) (density * 32 + 0.5f);

 

 

在ViewConfigurationCompat 也有  getScaledPagingTouchSlop () 。所以要调用ViewConfigurationCompat的这个方法。

 

posted @ 2014-05-21 18:35  等风来。。  Views(879)  Comments(0Edit  收藏  举报
------------------------------------------------------------------------------------------------------------ --------------- 欢迎联系 x.guan.ling@gmail.com--------------- ------------------------------------------------------------------------------------------------------------