DrawerLayout - OneUIProject/OneUI-Design-Library GitHub Wiki
de.dlyt.yanndroid.oneui.layout.DrawerLayout
"Ready-to-go" DrawerLayout extending ToolbarLayout.
<de.dlyt.yanndroid.oneui.layout.DrawerLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout="..."
app:drawer_icon="...">
</de.dlyt.yanndroid.oneui.layout.DrawerLayout>
Additionally, to the four locations in the ToolbarLayout, children of this view can also be in the drawer (app:layout_location="drawer_panel"
).
The drawable in app:drawer_icon="..."
is the little icon in the header of the drawer panel. There are already a lot of stock OneUI Icons included in the library you can use.
All the other layout attributes of ToolbarLayout, are also available for this view. But for android:layout
you need to use all the views and ids of this view.
Methods
Additionally, to all the ToolbarLayout methods:
Manage the DrawerButton (icon in the top-right corner of the panel).
public void setDrawerButtonIcon(Drawable drawerIcon)
public void setDrawerButtonTooltip(CharSequence tooltipText)
public void setDrawerButtonOnClickListener(OnClickListener listener)
Show badges on the DrawerButton and NavigationIcon (use ToolbarLayout.N_BADGE
or a number).
public void setButtonBadges(int navigationIcon, int drawerIcon)
public void setDrawerButtonBadge(int count) //only the drawerButton
Open/close the drawer panel with an optional animation.
public void setDrawerOpen(Boolean open, Boolean animate)