0

enter image description hereI have a requirement to implement the sliding drawer in android. I'm using the jfeinstein10/ SlidingMenu library to get my sliding drawing component which will basically open a listview. However, onclick of the list menu item ,a secondary menu with another list should slide down the main menu.

MainActivity class which instantiates the SlidingMenu

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_sliding_menu_demo);
        setBehindContentView(R.layout.activity_menu);
        ListView listView = (ListView) findViewById(R.id.list);
        getData();
        ListItemAdapter listadapter = new ListItemAdapter(data, this);
        listView.setAdapter(listadapter);
        listView.setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1, int item,
                    long arg3) {
                Toast.makeText(SlidingMenuDemo.this, "item clicked " + item,
                        Toast.LENGTH_SHORT).show();


            }
        });
        getSlidingMenu().setBehindOffset(250);
        getSlidingMenu().setFadeDegree(0.35f);
        getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);

    }
jasdmystery
  • 1,742
  • 1
  • 19
  • 31

1 Answers1

1

I implemented it by using nested menus. It is not the most elegant solution, but so far works pretty well.

More details here: How to implement two level slidingmenu in Android using jfeinstein10 / SlidingMenu?

Community
  • 1
  • 1
mdelolmo
  • 6,417
  • 3
  • 40
  • 58