nex3z / ToggleButtonGroup

A group of flowable toggle buttons, with multiple / single selection support and button customization.
Apache License 2.0
421 stars 48 forks source link

For SingleSelectToggleGroup, I am unable to "select none" after any one LabelToggle is selected #58

Closed vaidyasanket closed 4 years ago

vaidyasanket commented 4 years ago

I wanted a Select None option too for SingleSelectToggleGroup. But when I click any LabelToggle, I am unable to deselect all.

nex3z commented 4 years ago

Please make sure all button are in the same SingleSelectToggleGroup, for example,

    <com.nex3z.togglebuttongroup.SingleSelectToggleGroup
        android:id="@+id/group_choices"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tbgCheckedButton="@+id/choice_a">

        <com.nex3z.togglebuttongroup.button.LabelToggle
            android:id="@+id/choice_a"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:textSize="16sp"
            android:text="A"/>

        <com.nex3z.togglebuttongroup.button.LabelToggle
            android:id="@+id/choice_b"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:textSize="16sp"
            android:text="B"/>

        <com.nex3z.togglebuttongroup.button.LabelToggle
            android:id="@+id/choice_c"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:textSize="16sp"
            android:text="C"/>

        <com.nex3z.togglebuttongroup.button.LabelToggle
            android:id="@+id/choice_d"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:textSize="16sp"
            android:text="None"/>

    </com.nex3z.togglebuttongroup.SingleSelectToggleGroup>

ezgif com-crop