declare styleable如何减慢slidingdrawer的动画速度

declare styleable  时间:2022-02-27  阅读:()

如何减慢slidingdrawer的动画速度

我是这样做的,把代码贴出来看看对你有没有用! styleable.xml [mw_shl_code=html,true]<?xml version="1.0" encoding="utf-8"?> <resources > <declare-styleable name="SlidingDrawer"> <attr name="orientation"> <enum name="horizontal" value="0" /> <enum name="vertical" value="1" /> </attr> <attr name="bottomOffset" format="dimension|reference"/> <attr name=&Offset" format="dimension|reference"/> <attr name="allowSingleTap" format="boolean"/> <attr name="animateOnClick" format="boolean"/> <attr name="handle" format="reference"/> <attr name="content" format="reference"/> </declare-styleable> </resources> [/mw_shl_code] MySlidingDrawer.java [mw_shl_code=java,true] public MySlidingDrawer(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SlidingDrawer, 0, 0); int orientation = a.getInt(R.styleable.SlidingDrawer_orientation, ORIENTATION_VERTICAL); mVertical = orientation == ORIENTATION_VERTICAL; mBottomOffset = (int) a.getDimension(R.styleable.SlidingDrawer_bottomOffset, 0.0f); mTopOffset = (int) a.getDimension(R.styleableOffset, 0.0f); mAllowSingleTap = a.getBoolean(R.styleable.SlidingDrawer_allowSingleTap, true); mAnimateOnClick = a.getBoolean(R.styleable.SlidingDrawer_animateOnClick, true); int handleId = a.getResourceId(R.styleable.SlidingDrawer_handle, 0); if (handleId == 0) { throw new IllegalArgumentException("The handle attribute is required and must refer " + "to a valid child."); } int contentId = a.getResourceId(R.styleable.SlidingDrawer_content, 0); if (contentId == 0) { throw new IllegalArgumentException("The content attribute is required and must refer " + "to a valid child."); } if (handleId == contentId) { throw new IllegalArgumentException("The content and handle attributes must refer " + "to different children."); } mHandleId = handleId; mContentId = contentId; final float density = getResources().getDisplayMetrics().density; mTapThreshold = (int) (TAP_THRESHOLD * density + 0.5f); mMaximumTapVelocity = (int) (MAXIMUM_TAP_VELOCITY * density + 0.5f); mMaximumMinorVelocity = (int) (MAXIMUM_MINOR_VELOCITY * density + 0.5f); mMaximumMajorVelocity = (int) (MAXIMUM_MAJOR_VELOCITY * density + 0.5f); eleration = (int) (MAXIMUM_ACCELERATION * density + 0.5f); mVelocityUnits = (int) (VELOCITY_UNITS * density + 0.5f); a.recycle(); setAlwaysDrawnWithCacheEnabled(false); }[/mw_shl_code] 转载仅供参考,版权属于原作者。祝你愉快,满意请采纳哦

易探云韩国云服务器仅50元/月,510元/年起

韩国云服务器哪个好?韩国云服务器好用吗?韩国是距离我国很近的一个国家,很多站长用户在考虑国外云服务器时,也会将韩国云服务器列入其中。绝大部分用户都是接触的免备案香港和美国居多,在加上服务器确实不错,所以形成了习惯性依赖。但也有不少用户开始寻找其它的海外免备案云服务器,比如韩国云服务器。下面云服务器网(yuntue.com)就推荐最好用的韩国cn2云服务器,韩国CN2云服务器租用推荐。为什么推荐租用...

注册做什么96%可以干啥,常用的7个常用的国内国外域名注册服务商_云服务器可以干什么

日前,国内知名主机服务商阿里云与国外资深服务器面板Plesk强强联合,推出 阿里云域名注册与备案、服务器ECS购买与登录使用 前言云服务器(Elastic  只需要确定cpu内存与带宽基本上就可以了,对于新手用户来说,我们在购买阿里云服务申请服务器与域名许多云服务商的云服务器配置是弹性的 三周学会小程序第三讲:服务 不过这个国外服务器有点慢,可以考虑国内的ngrokcc。 ngrokcc...

spinservers:圣何塞10Gbps带宽服务器月付$109起,可升级1Gbps无限流量

spinservers是Majestic Hosting Solutions LLC旗下站点,主营国外服务器租用和Hybrid Dedicated等,数据中心在美国达拉斯和圣何塞机房。目前,商家针对圣何塞部分独立服务器进行促销优惠,使用优惠码后Dual Intel Xeon E5-2650L V3(24核48线程)+64GB内存服务器每月仅109美元起,提供10Gbps端口带宽,可以升级至1Gbp...

declare styleable为你推荐
excel通配符怎样删除excel中的通配符getsockoptsocket的send()方法的发送目的地址放在哪个参数里面?初始化磁盘台式机新添加的硬盘怎么初始化磁盘qq实名注册qq实名认证exe文件打不开.exe文件打不开为什么torrent文件怎么打开BT下载后的文件怎么打开系统登录界面192.168.0.1登录页面蓝牙开发android 蓝牙开发 ble 难吗团购网源码我想弄个自己的团购网站,请求帮助团购网源码想做一个团购网站,像糯米拉手一样的模板,哪里可以买的到?
河南虚拟主机 cn域名 site5 主机 sockscap 英文简历模板word 申请空间 台湾谷歌网址 网通ip 免空 腾讯云分析 双十一秒杀 域名接入 卡巴斯基破解版 如何注册阿里云邮箱 域名与空间 宏讯 789 英国伦敦 阿里云手机官网 更多