SlidingDrawer animation velocity

江枫思渺然 提交于 2019-11-30 23:21:00

I believe R.styleable was removed from the sdk, you can write your own though, something like this should work

In the values folder create an xml file

<?xml version="1.0" encoding="UTF-8"?>
<resources>
<declare-styleable name="MySlider"> 
        <attr name = "SlidingDrawer_orientation"  format="integer"/>
        <attr name = "SlidingDrawer_bottomOffset" format = "dimension"/>
        <attr name = "SlidingDrawer_topOffset" format = "dimension"/>
        <attr name = "SlidingDrawer_allowSingleTap" format = "boolean"/>
        <attr name = "SlidingDrawer_animateOnClick" format = "boolean"/>
        <attr name = "SlidingDrawer_handle" format = "reference"/>
        <attr name = "SlidingDrawer_content" format = "reference"/>
    </declare-styleable>
</resources>

Then in the slider class you can reference the xml file

TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MySlider, defStyle, 0);

int orientation = a.getInt(R.styleable.MySlider_SlidingDrawer_orientation, ORIENTATION_VERTICAL);
//...etc. ...

I am also extending the slidingdrawer class and this works for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!