StateButton

介绍:

一个可以用代码设置selector背景(按下去背景颜色更改,样式变化等等)的button, 再也不用写selector了

运行效果:

使用说明:

<deadline.statebutton.StateButton
            android:id="@+id/stateButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="StateButton"
            app:radius="5dp"
            app:round="true"
            app:animationDuration="200"
            app:strokeDashGap="2dp"
            app:strokeDashWidth="5dp"
            app:normalStrokeWidth="2dp"
            app:pressedStrokeWidth="2dp"
            app:unableStrokeWidth="2dp"
            app:normalStrokeColor="@android:color/white"
            app:pressedStrokeColor="@android:color/white"
            app:unableStrokeColor="@android:color/white"
            app:normalTextColor="@android:color/white"
            app:pressedTextColor="@android:color/white"
            app:unableTextColor="@android:color/white"
            app:normalBackgroundColor="@color/colorPrimaryDark"
            app:pressedBackgroundColor="@color/colorPrimaryDark"
            app:unableBackgroundColor="@color/colorPrimaryDark"/>
已下载
0