Back to project page android-menudrawer.
The source code is released under:
Apache License
If you think the Android project android-menudrawer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.simonvt.menudrawer.samples; //from ww w . ja v a 2 s .c om import net.simonvt.menudrawer.MenuDrawer; import net.simonvt.menudrawer.Position; import android.app.Activity; import android.os.Bundle; import android.view.Gravity; import android.widget.ListView; import android.widget.TextView; import java.util.ArrayList; import java.util.List; public class RightOverlaySample extends Activity { private MenuDrawer mDrawer; private MenuAdapter mAdapter; private ListView mList; @Override protected void onCreate(Bundle inState) { super.onCreate(inState); mDrawer = MenuDrawer.attach(this, MenuDrawer.Type.OVERLAY, Position.END); List<Object> items = new ArrayList<Object>(); items.add(new Item("Item 1", R.drawable.ic_action_refresh_dark)); items.add(new Item("Item 2", R.drawable.ic_action_select_all_dark)); items.add(new Category("Cat 1")); items.add(new Item("Item 3", R.drawable.ic_action_refresh_dark)); items.add(new Item("Item 4", R.drawable.ic_action_select_all_dark)); items.add(new Category("Cat 2")); items.add(new Item("Item 5", R.drawable.ic_action_refresh_dark)); items.add(new Item("Item 6", R.drawable.ic_action_select_all_dark)); items.add(new Category("Cat 3")); items.add(new Item("Item 7", R.drawable.ic_action_refresh_dark)); items.add(new Item("Item 8", R.drawable.ic_action_select_all_dark)); items.add(new Category("Cat 4")); items.add(new Item("Item 9", R.drawable.ic_action_refresh_dark)); items.add(new Item("Item 10", R.drawable.ic_action_select_all_dark)); mList = new ListView(this); mAdapter = new MenuAdapter(this, items); mList.setAdapter(mAdapter); mDrawer.setMenuView(mList); TextView content = new TextView(this); content.setText("This is a sample of an overlayed right drawer."); content.setGravity(Gravity.CENTER); mDrawer.setContentView(content); } }