CUSTOM DRAWER
android.support.v4.widget.DrawerLayout drawer = new android.support.v4.widget.DrawerLayout(this);
android.support.v4.widget.DrawerLayout drawer1 = new android.support.v4.widget.DrawerLayout(this);
LinearLayout slideView1 = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.right_drawer, null);
LinearLayout innerView = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.main, null);
LinearLayout slideView = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.left_drawer, null);
android.support.v4.widget.DrawerLayout.LayoutParams lp1 = new android.support.v4.widget.DrawerLayout.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT);
android.support.v4.widget.DrawerLayout.LayoutParams lp = new android.support.v4.widget.DrawerLayout.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT);
android.widget.FrameLayout.LayoutParams fl = new android.widget.FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
lp1.gravity = (Gravity.RIGHT);
lp.gravity = (Gravity.LEFT);
slideView1.setLayoutParams(lp1);
innerView.setLayoutParams(fl);
slideView.setLayoutParams(lp);
drawer1.addView(innerView);
drawer.addView(drawer1);
drawer1.addView(slideView1);
drawer.addView(slideView);
setContentView(drawer);
initialize();
0 Comments: