This repository was archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
OptionGroup
Yanndroid edited this page Jan 28, 2022
·
1 revision
de.dlyt.yanndroid.oneui.view.OptionGroup
OptionButton and OptionGroup are working together like RadioButton and RadioGroup. It will select an OptionButton on click.

<de.dlyt.yanndroid.oneui.view.OptionGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:selectedOptionButton="...">
<de.dlyt.yanndroid.oneui.widget.OptionButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:icon="..."
app:text="..." />
...
</de.dlyt.yanndroid.oneui.view.OptionGroup>
app:selectedOptionButton="..."
will set the default selected OptionButton with this id. This view can also have other children, for example a divider:

<View style="@style/DrawerDividerStyle" />
Select an OptionButton with either the view, id or position.
public void setSelectedOptionButton(OptionButton optionButton)
public void setSelectedOptionButton(Integer id)
public void setSelectedOptionButton(int position)
Get the currently selected OptionButton.
public OptionButton getSelectedOptionButton()
Listener which will provide you view, id and position of the clicked OptionButton.
public void setOnOptionButtonClickListener(OnOptionButtonClickListener listener)
BlackMesa123 - OneUI Design Library - Yanndroid