SegmentedController
SegmentedController is an Android UI library for using customizable RadioGroup with RadioButtons.
Installation
Step 1: Add the JitPack repository to your build.gradle(Project: x) file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2: Add the dependency to your build.gradle(Module: x) file
dependencies {
...
//SegmentedController
implementation 'com.github.erayozenc:SegmentedController:1.0.0'
}
Usage
<com.erayozenc.lib.SegmentController
android:id="@+id/segmentedController"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:tab_cornerRadius="22dp"
app:tab_selectedColor="@color/white"
app:tab_unselectedColor="@color/light_grey"
app:tab_strokeWidth="4dp">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="First"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Second"/>
com.erayozenc.lib.SegmentController>
Attributes
<attr name="tab_strokeWidth" format="dimension"/> <attr name="tab_cornerRadius" format="dimension"/> <attr name="tab_selectedColor" format="color"/> <attr name="tab_unselectedColor" format="color"/>