Unable to Implement a Navigation Drawer on the Right Side of The Screen - Android / Java -
i've implemented , navigation drawer appearing on left side of screen - i'd appear on right side of screen (with it's icon in upper right hand corner of screen - in top left). found following article explains how so:
http://stackoverflow.com/questions/18547277/how-to-set-navigation-drawer-to-be-opened-from-right-to-left/19358114#19358114
however when attempt implement code navigation drawer still appears on left side.
source (snippet):
@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.ss_home);
...
mdrawerlist = (listview) findviewbyid(r.id.drawer_list); mdrawer = ( linearlayout) findviewbyid(r.id.drawer); mdrawerlayout = (drawerlayout)findviewbyid(r.id.drawer_layout); madapter = new simpleadapter(this, mlist, r.layout.drawer_layout, from, to); mdrawertoggle = new actionbardrawertoggle(this, mdrawerlayout, r.drawable.icon_list_top_right , r.string.drawer_open){ @override public boolean onoptionsitemselected(menuitem item) { if (item != null && item.getitemid() == android.r.id.home) { if (mdrawerlayout.isdraweropen(gravity.right)) { mdrawerlayout.closedrawer(gravity.right); } else { mdrawerlayout.opendrawer(gravity.right); } } return false; }
xml layout files/source:
if there additional information necessary more happy provide (i'm stumped why navbar isn't appearing on right side of screen)
the android:layout_gravity="start"
on linearlayout
id="drawer" should set android:layout_gravity="end"
.
sidenote: xml structure poorly constructed, why id="drawer" , id="left_drawer" viewgroups
's siblings - , not nested? why framelayout
id="content_frame" empty?
Comments
Post a Comment