ColorfulToggleButton的功能。
1.是能夠動態改變顏色和邊框顏色的ToggleButton
2.可動態改變形狀(圓形或方形)
3.設置邊框的顯示或隱藏(個人項目裏,邊框顯示即爲選中效果)
4.type=1是圓形toggleButton,type=2是方形toggleButton
具體的使用方法:
<?xml version="1.0" encoding="utf-8"?>
<com.tutao.lib.view.ColorfulToggleButton xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/[本身的項目包名]"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_margin="2dp"
custom:borderColor="@android :color/white"
custom:borderLine="3dp"
custom:innerDiffOutter="3dp"
custom:solidColor="@android :color/black"
custom:type="2">android
</com.tutao.lib.view.ColorfulToggleButton>git
github地址:https://github.com/Freshman585/colorful_toggle_buttongithub