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. Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir

          今天升级Xcode 7.0 bata发现网络访问失败.输出错误信息 The resource could not be loaded because the App Transport S ...

  2. Extjs的完成按钮和位置

    this.toolbar.add('->') ---重点是这个箭头,他是控制位置的 this.CompleteDataAction = new Ext.Action({ text : '完成', ...

  3. mybatis传多个参数实例

    最近在做一个统计功能,有一个功能点:根据id更新某字段的值.那么就需要有两个参数,我的做法: dao层: int updateTaskCount(int taskCount,int id); 对应的m ...

  4. 基于Redis实现延迟队列

    背景 在后端服务中,经常有这样一种场景,写数据库操作在异步队列中执行,且这个异步队列是多进程运行的,这时如果对同一资源进行写库操作,很有可能产生数据被覆盖等问题,于是就需要业务层在更新数据库之前进行加 ...

  5. Azkaban安装配置

    描述: azkaban主要用于离线计算任务的调度 说明: 此处Azkaban选择版本为:3.52.0,部署方式为Cluster模式,即支持多Executor计算节点,目前默认安装方式选择在同一台机器上 ...

  6. ES查看配置和查看全部配置

    http://10.0.0.17:9200/blog/_settings   GET 获取单个index(库的配置) http://10.0.0.17:9200/_settings/_all   GE ...

  7. 查看与修改网关,DNS

    网关是网络中的路由器,作为访问其他网络的接入点. 修改ip地址 即时生效: ifconfig eth0 192.168.0.20 netmask 255.255.255.0 启动生效: 修改/etc/ ...

  8. 第二百四十一节,Bootstrap进度条媒体对象和 Well 组件

    第二百四十一节,Bootstrap进度条媒体对象和 Well 组件 学习要点: 1.Well 组件 2.进度条组件 3.媒体对象组件 本节课我们主要学习一下 Bootstrap 的三个组件功能:Wel ...

  9. BootStrap带样式打印

    在新窗口打印时bootstrap表格的样式出不来,因为打印时没有加载CSS样式. 我在jquery.PrintArea.js的基础上改造了下打印的方法: (function ($) { var pri ...

  10. websphere web.xml

    解决WAS更新web.xml文件不生效的问题(web_merged.xml是罪魁祸首)   问题原因分析 近日碰到更新web.xml文件到WAS服务器(WebSphere Application Se ...