Professional Documents
Culture Documents
O O O O O O O O O: App:Headerlayout "@Lyout/Headerxml"
O O O O O O O O O: App:Headerlayout "@Lyout/Headerxml"
o Create a layout file, change type to toolbar, height is 56 for portrait orientation and 48 hor,
64 for tablets
o Change main layout type (activity main xml) to drawer layout and give it an id.
o In main activity declare your tool bar and initialized it using fvbid (oncreate method)
o (if toolbar is placed at center (likely) put it on a vertical linear layout (inside main xml).
o Prepare your menu >> along with its icon (try it by setting it up)
o Now lets initialize our Drawer layout inside main java, should not come before toolbar
initialized.
o Then create and initialize instance of ActionBarDrawertogle like below, along wth its plug
ActionBarDraweTogle instance = new ActionBarDrawerTogle(Activityname.this,
drawerlayoutCreted, toolbarCreated, “OPEN TEXT FOR R.sting”, “CLOSE TEXT FOR
R.string”, )
{
//this is a plug
//override onDrawerOpened
//override onDrawerClosed
After plug
o Add drawer listener to the drawerlyout created and pass actionbardrawertoggle instance
as parameters
Drawelayoutname.addDraweListener(instance);
o Example; actionbardrawertoggle.syncState.