Question Detail

I want RadioButtons something below image.
How can I do this?


 Image result for how to create multiple radio buttons in android
 


Thread Reply

Anonymous

- 1 years ago

try This,

<RadioGroup
    android:id="@+id/radioGroup"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:orientation="horizontal">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="left"
        android:orientation="vertical">

        <me.omidh.liquidradiobutton.LiquidRadioButton
            android:id="@+id/Stayapt_radioButton"
            style="@style/textStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="Stayapt"
            android:textColor="@color/gray"
            app:lrb_checkedColor="@color/colorAccent"
            app:lrb_explodeCount="10"
            app:lrb_inAnimDuration="400"
            app:lrb_innerCircleRadius="8dp"
            app:lrb_outAnimDuration="300"
            app:lrb_strokeRadius="12dp"
            app:lrb_strokeWidth="1dp"
            app:lrb_unCheckedColor="@color/colorAccent"
            />

        <View
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"/>

        <me.omidh.liquidradiobutton.LiquidRadioButton
            android:id="@+id/Friends_radioButton"
            style="@style/textStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="Friends"
            android:textColor="@color/gray"
            app:lrb_checkedColor="@color/colorAccent"
            app:lrb_explodeCount="10"
            app:lrb_inAnimDuration="400"
            app:lrb_innerCircleRadius="8dp"
            app:lrb_outAnimDuration="300"
            app:lrb_strokeRadius="12dp"
            app:lrb_strokeWidth="1dp"
            app:lrb_unCheckedColor="@color/colorAccent"
            />

        <View
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"/>
        <me.omidh.liquidradiobutton.LiquidRadioButton
            android:id="@+id/Ads_radioButton"
            style="@style/textStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checked="true"
            android:gravity="center"
            android:text="Ads"
            android:textColor="@color/gray"
            app:lrb_checkedColor="@color/colorAccent"
            app:lrb_explodeCount="10"
            app:lrb_inAnimDuration="400"
            app:lrb_innerCircleRadius="8dp"
            app:lrb_outAnimDuration="300"
            app:lrb_strokeRadius="12dp"
            app:lrb_strokeWidth="1dp"
            app:lrb_unCheckedColor="@color/colorAccent"
            />
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <me.omidh.liquidradiobutton.LiquidRadioButton
            android:id="@+id/Facebook_radioButton2"
            style="@style/textStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="Facebook"
            android:textColor="@color/gray"
            app:lrb_checkedColor="@color/colorAccent"
            app:lrb_explodeCount="10"
            app:lrb_inAnimDuration="400"
            app:lrb_innerCircleRadius="8dp"
            app:lrb_outAnimDuration="300"
            app:lrb_strokeRadius="12dp"
            app:lrb_strokeWidth="1dp"
            app:lrb_unCheckedColor="@color/colorAccent"
            />
        <me.omidh.liquidradiobutton.LiquidRadioButton
            android:id="@+id/Internet_radioButton"
            style="@style/textStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="Internet"
            android:textColor="@color/gray"
            app:lrb_checkedColor="@color/colorAccent"
            app:lrb_explodeCount="10"
            app:lrb_inAnimDuration="400"
            app:lrb_innerCircleRadius="8dp"
            app:lrb_outAnimDuration="300"
            app:lrb_strokeRadius="12dp"
            app:lrb_strokeWidth="1dp"
            app:lrb_unCheckedColor="@color/colorAccent"
            />
        <me.omidh.liquidradiobutton.LiquidRadioButton
            android:id="@+id/Others_radioButton"
            style="@style/textStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="Others"
            android:textColor="@color/gray"
            app:lrb_checkedColor="@color/colorAccent"
            app:lrb_explodeCount="10"
            app:lrb_inAnimDuration="400"
            app:lrb_innerCircleRadius="8dp"
            app:lrb_outAnimDuration="300"
            app:lrb_strokeRadius="12dp"
            app:lrb_strokeWidth="1dp"
            app:lrb_unCheckedColor="@color/colorAccent"
            />
    </LinearLayout>
</RadioGroup>

Hemant Sharma

- 1 years ago

Instant of Radio Button Use Spinner

Hemant Sharma

- 1 years ago

Instant of Radio Button Use Spinner