This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
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.
Set/get the icon and text.
public void setIcon(Drawable icon)
public String getText()
public void setText(String text)
Manage the counter.
public Integer getCounter()
public void setCounter(Integer integer)
public void setCounterEnabled(Boolean enabled)
public void toggleCounterEnabled()
public Boolean isCounterEnabled()
Control the state (colored, bold text).
public void setButtonSelected(Boolean selected)
public void toggleButtonSelected()
public Boolean isButtonSelected()
Enable/disable the OptionButton.
public void setButtonEnabled(Boolean enabled)
BlackMesa123 - OneUI Design Library - Yanndroid