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] 转载仅供参考,版权属于原作者。祝你愉快,满意请采纳哦

justhost:“第4次VPS测评”,8.3元/月,200M带宽,不限流量,KVM虚拟,4个俄罗斯机房应有适合你的

justhost.ru官方来消息说已经对网络进行了比较全面的优化,针对中国电信、联通、移动来说,4个机房总有一个适合中国用户,让站长进行一下测试,这不就有了这篇有关justhost的VPS的第四次测评。本帖主要关注的是网络,对于其他的参数一概不管! 官方网站:https://justhost.ru 最低配VPS:8.3元/月,KVM,512M内存,5G硬盘,200M带宽,不限流量 购买链接:...

月神科技:香港CN2/洛杉矶CN2/华中电信高防vps,月付20元起

月神科技怎么样?月神科技是由江西月神科技有限公司运营的一家自营云产品的IDC服务商,提供香港安畅、香港沙田、美国CERA、华中电信等机房资源,月神科技有自己的用户群和拥有创宇认证,并且也有电商企业将业务架设在月神科技的平台上。目前,香港CN2云服务器、洛杉矶CN2云主机、华中电信高防vps,月付20元起。点击进入:月神科技官方网站地址月神科技vps优惠信息:香港安畅CN2-GIA低至20元核心:2...

digital-vm:VPS低至$4/月,服务器$80/月,10Gbps超大带宽,不限流量,机房可选:日本新加坡美国英国西班牙荷兰挪威丹麦

digital-vm,这家注册在罗马尼亚的公司在国内应该有不少人比较熟悉了,主要提供VPS业务,最高10Gbps带宽,还不限制流量,而且还有日本、新加坡、美国洛杉矶、英国、西班牙、荷兰、挪威、丹麦这些可选数据中心。2020年,digital-vm新增了“独立服务器”业务,暂时只限“日本”、“新加坡”机房,最高也是支持10Gbps带宽... 官方网站:https://digital-vm.co...

declare styleable为你推荐
蓝屏代码电脑启动出现蓝屏代码链接转换怎么把普通网页链接转化成在微信键接qq实名注册请问手机QQ上实名认证怎么弄?torrent文件怎么打开BT下载后的文件怎么打开rs485协议RS485和RS232协议的区别阶乘函数C语言编写一个求n阶乘的函数,在主函数中输入n,调用函数求n阶乘。。谢谢阶乘函数用函数求阶乘的C语言邮件服务器软件Windows邮件服务器软件那个好印度it印度IT业与中国IT业的差异?深度剖析!空间图片qq空间图片
krypt site5 加勒比群岛 Dedicated 国内php空间 卡巴斯基官方免费版 徐正曦 免费美国空间 hdd 万网空间管理 主机管理系统 net空间 114dns xshell5注册码 建站技术 winserver2008r2 zencart安装 此网页包含的内容将不使用安全的https 香港打折信息 卡巴斯基免费版下载 更多