Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

OptionButton

Yanndroid edited this page Jan 28, 2022 · 1 revision

de.dlyt.yanndroid.oneui.widget.OptionButton

Create lists inside DrawerLayout without using RecyclerView with OptionButton.

<de.dlyt.yanndroid.oneui.widget.OptionButton
android:layout_width="match_parent"android:layout_height="wrap_content"app:icon="..."app:text="..."app:selected="..."app:counter="..."app:counterEnabled="..." />

app:icon="..." attribute is the button icon, and app:text="..." the text. app:selected="..." is to show the OptionButton as selected (colored and bold text), it's false by default. app:counterEnabled="..." and app:counter="..." can customize a counter at the end of the view, which is disabled by default. Make sure to enable the app:counterEnabled attribute or it won't show up.

Methods

Set/get the icon and text.

publicvoidsetIcon(Drawableicon)
publicStringgetText()
publicvoidsetText(Stringtext)

Manage the counter.

publicIntegergetCounter()
publicvoidsetCounter(Integerinteger)
publicvoidsetCounterEnabled(Booleanenabled)
publicvoidtoggleCounterEnabled()
publicBooleanisCounterEnabled()

Control the state (colored, bold text).

publicvoidsetButtonSelected(Booleanselected)
publicvoidtoggleButtonSelected()
publicBooleanisButtonSelected()

Enable/disable the OptionButton.

publicvoidsetButtonEnabled(Booleanenabled)

Clone this wiki locally