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

Boomer.Host(年付3.5美)休斯敦便宜VPS

Boomer.Host是一家比较新的国外主机商,虽然LEB自述 we’re now more than 2 year old,商家提供虚拟主机和VPS,其中VPS主机基于OpenVZ架构,数据中心为美国得克萨斯州休斯敦。目前,商家在LET发了两款特别促销套餐,年付最低3.5美元起,特别提醒:低价低配,且必须年付,请务必自行斟酌确定需求再入手。下面列出几款促销套餐的配置信息。CPU:1core内存:...

LiCloud:香港CMI/香港CN2+BGP服务器,30Mbps,$39.99/月;香港KVM VPS仅$6.99/月

licloud怎么样?licloud目前提供香港cmi服务器及香港CN2+BGP服务器/E3-1230v2/16GB内存/240GB SSD硬盘/不限流量/30Mbps带宽,$39.99/月。licloud 成立於2021年,是香港LiCloud Limited(CR No.3013909)旗下的品牌,主要提供香港kvm vps,分为精简网络和高级网络A、高级网络B,现在精简网络和高级网络A。现在...

弘速云香港VPSVPS线路有CN2+BGP、CN2 GIA,KVM虚拟化架构,裸金属月付564元

弘速云怎么样?弘速云是创建于2021年的品牌,运营该品牌的公司HOSU LIMITED(中文名称弘速科技有限公司)公司成立于2021年国内公司注册于2019年。HOSU LIMITED主要从事出售香港vps、美国VPS、香港独立服务器、香港站群服务器等,目前在售VPS线路有CN2+BGP、CN2 GIA,该公司旗下产品均采用KVM虚拟化架构。可联系商家代安装iso系统。点击进入:弘速云官方网站地址...

declare styleable为你推荐
ucosiiucosii任务堆栈的作用是什么呢?wrangleGXG,CK,wrangle,replay哪个牌子档次高?linux安装教程怎么装LINUX的系统....rs485协议RS485和RS232协议的区别第五人格抄袭那个模仿第五人格的游戏叫什么微信红包封面11位兑换码微信红包兑换码怎么用空间图片从哪里能找到更好的空间图片比特币官方客户端比特币钱包官方客户端地址是什么?无线呼叫系统无线呼叫对讲器系统哪个牌子好?刷荣誉怎么刷荣誉最快最快?
免费域名注册 拜登买域名批特朗普 163网 60g硬盘 12306抢票攻略 网站监控 lamp配置 dd444 全站静态化 免空 服务器维护方案 cdn联盟 股票老左 赞助 hinet 广州服务器 umax120 能外链的相册 吉林铁通 跟踪路由命令 更多