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的这个方法。

ViewConfiguration 和 ViewConfigurationCompat的更多相关文章

  1. ViewConfiguration.getScaledTouchSlop () 用法

    getScaledTouchSlop是一个距离,表示滑动的时候,手的移动要大于这个距离才开始移动控件.如果小于这个距离就不触发移动控件,如viewpager就是用这个距离来判断用户是否翻页 ViewC ...

  2. android ViewConfiguration

    ViewConfiguration 1.有时候要获取一些android UI的中一些默认参数的来进行操作设置,就要用到ViewConfiguration 官方飞解释是:ViewConfiguratio ...

  3. ViewConfiguration滑动参数设置类

    /** * 包含了方法和标准的常量用来设置UI的超时.大小和距离 */ public class ViewConfiguration { // 设定水平滚动条的宽度和垂直滚动条的高度,单位是像素px ...

  4. Android开发 ViewConfiguration 用法

    ViewConfiguration 实例获取 ViewConfiguration viewConfiguration = ViewConfiguration.get(Context); 常用对象方法 ...

  5. W/System.err: at android.view.ViewConfiguration.get(ViewConfiguration.java:369)

    *11-09 11:48:38.558 13887-13900/? W/System.err: at android.view.WindowManagerGlobal.getWindowManager ...

  6. 修复垂直滑动RecyclerView嵌套水平滑动RecyclerView水平滑动不灵敏问题

    在 Android 应用中,大部分情况下都会使用一个垂直滚动的 View 来显示内容(比如 ListView.RecyclerView 等).但是有时候你还希望垂直滚动的View 里面的内容可以水平滚 ...

  7. 关于禁止ViewPager预加载问题【转】

    转自:http://blog.csdn.net/qq_21898059/article/details/51453938#comments 我最近上班又遇到一个小难题了,就是如题所述:ViewPage ...

  8. android自己定义ViewPager之——3D效果应用

    今天在github里看到一个3D效果的ViewPager,感觉做出来的ViewPager滑动的时候效果十分的炫,就check out下来研究了一下怎样实现的.以及怎样使用.将整个ViewPager稍加 ...

  9. Android Canvas不能换行,或者不识别\n,\r\n的解决方案

    在使用Canvas绘制文本的时候,如果要绘制的字符串含有\r\n,\n换行的时候,会识别不出来,当成空格绘制出来. 解决方案: 1.使用StaticLayout来实现,具体代码如下: TextPain ...

随机推荐

  1. 0053 用注解方式配置Spring MVC

    按照0052中的办法,如果一个站点设计有1000个请求,那就得写1000个controller,还得配置1000个<bean id="helloController" cla ...

  2. Powershell分支条件

    Where-Object 进行条件判断很方便,如果在判断后执行很多代码可以使用IF-ELSEIF-ELSE语句.语句模板: If(条件满足){如果条件满足就执行代码}Else{如果条件不满足}条件判断 ...

  3. 使用struts的时候form用struts的,不用html本身的

    同样的struts-config.xml, web.xml的配置,使用2个版本的form,只有struts的form才能成功运行 使用html版本的form导致post的路径不对,报404 HTML版 ...

  4. VS2015许可证过期

    VS2015过期激活方法

  5. java模拟从http上下载文件

    1.依赖 Apache httpclient 包. 2.代码 HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = ...

  6. jQuery中jsonp的跨域处理,no access-control-allow-origin,unexpected token

    引言 ajax跨域就无法成功获取数据了,需要通过jsonp来处理 报错如下 1.改为jsonp var targeturl = ajaxurl+"?g=Api&m="+m+ ...

  7. Maven 安装教程

    Linux系统: 1.准本工作 Maven下载地址:http://mirror.bit.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven- ...

  8. 【Mac + Python + Selenium】之PyCharm配置Selenium自动化

    一.安装PyCharm 1.下载地址: Pycharm编辑器官网下载地址 2.安装完成之后打开,一路下去点击,直到填写注册码,参考: <[转载][Pycharm编辑器破解步骤]之idea和Pyc ...

  9. YAML 语法小结

    专门用来写配置文件的语言,非常简洁和强大,远比 JSON 格式方便. 使用缩进表示层级关系 缩进时不允许使用Tab键,只允许使用空格. 缩进的空格数目不重要,只要相同层级的元素左侧对齐即可 # 表示注 ...

  10. 数据库I/O:CMP、Hibernate

    ★什么是“Persistence” 用过VMWare的朋友大概都知道当一个guest OS正在运行的时候点击“Suspend”将虚拟OS挂起,它会把整个虚拟内存的内容保存到磁盘上,譬如你为虚拟OS分配 ...