Awesome
demo演示:
Description
-
This is a moveable RadioGroup could fade out, and auto return to its parent's left or right, it has no side effect to RadioGroup's setOnCheckedChangeListener method .
-
Though it's a RadioGroup , the ideas used here make it very easy for you to custom your own View or ViewGroup which reacts in the similar way.
Usage
- In your root build.gradle add:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
- Add the dependency
compile 'com.github.Sbingo:FreeRadioGroup:v1.0.0'
- In the xml layout file:
<sbingo.freeradiogroup.FreeRadioGroup
android:id="@+id/group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:background="@drawable/black_bg"
app:autoBack="true" //松手后是否自动回到父布局左侧或右侧
app:millisInFuture="2500" //从松手到淡出的时间
app:toAlpha="0.3" //淡出后的透明度值
app:moveable="true"> //是否能拖动
<RadioButton
.....
/>
.
.
.
<RadioButton
.....
/>
</sbingo.freeradiogroup.FreeRadioGroup>