Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

RadioButtons in RadionGroup #49

Closed
mehrad-rafigh opened this issue Apr 14, 2015 · 6 comments
Closed

RadioButtons in RadionGroup #49

mehrad-rafigh opened this issue Apr 14, 2015 · 6 comments

Comments

@mehrad-rafigh
Copy link

I have a strange issue here. I put a few Radiobuttons from the library inside a RadioGroup. The aim was that only one Radiobutton could be selected at a time. Unfortunately this is not working. Did somebody experience the same issue or could help me out?

@rey5137
Copy link
Owner

rey5137 commented Apr 16, 2015

Can you please post your xml?

@mehrad-rafigh
Copy link
Author

Here is the xml:

    <HorizontalScrollView
        android:layout_height="100dp"
        android:layout_width="match_parent"
        android:fillViewport="true"
        android:fadeScrollbars="false">

        <RadioGroup
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:orientation="horizontal">

            <com.rey.material.widget.RadioButton
                android:id="@+id/create_deal_10_discount"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="10%"/>
            <com.rey.material.widget.RadioButton
                android:id="@+id/create_deal_15_discount"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:gravity="center"
                android:text="15%"/>
            <com.rey.material.widget.RadioButton
                android:id="@+id/create_deal_20_discount"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:gravity="center"
                android:text="20%"/>
            <com.rey.material.widget.RadioButton
                android:id="@+id/create_deal_25_discount"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:gravity="center"
                android:text="25%"/>
            <com.rey.material.widget.RadioButton
                android:id="@+id/create_deal_30_discount"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:gravity="center"
                android:text="30%"/>
            <com.rey.material.widget.RadioButton
                android:id="@+id/create_deal_35_discount"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:gravity="center"
                android:text="35%"/>
            <com.rey.material.widget.RadioButton
                android:id="@+id/create_deal_40_discount"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:gravity="center"
                android:text="40%"/>
            <com.rey.material.widget.RadioButton
                android:id="@+id/create_deal_45_discount"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:gravity="center"
                android:text="45%"/>
            <com.rey.material.widget.RadioButton
                android:id="@+id/create_deal_50_discount"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:gravity="center"
                android:text="50%"/>

        </RadioGroup>

    </HorizontalScrollView>

@peternguyen88
Copy link

I have the same problem, com.rey.material.widget.RadioButton doesn't work with default RadioGroup.

@rey5137
Copy link
Owner

rey5137 commented Apr 24, 2015

The cause of this issue is RadioGroup check if child view is instance of android.widget.RadioButton or not, but com.rey.material.widget.RadioButton is a class extends from android.widget.CompoundButton.

For now you will have to handle the onCheckChanged event yourself. May be I will add a RadioGroup view that support com.rey.material.widget.RadioButton in next version.

@sud007
Copy link

sud007 commented Sep 1, 2015

is there a option available now for this?

@nikunjparadva
Copy link

i have same problem .. any solution?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants