Android Evernote like slidingMenu -
i want design evernote sliding menu android app includes gridview , listview of content in sliding menu.

i have implemented 2 framelayouts in slidingmenu layout file, 1 gridview , other listview. here xml file of it.
menu_frame.xml
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <framelayout android:id="@+id/grid_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <framelayout android:id="@+id/menu_frame" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/grid_frame"/> </relativelayout> list view framelayout xml file id:menu_frame
<listview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/list_padding" android:paddingright="@dimen/list_padding" /> gridview framelayout xml file id:grid_frame
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/list_padding" android:paddingright="@dimen/list_padding"> <!-- android:id="@+id/grid_list" --> <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_marginleft="51dp" android:layout_margintop="81dp" android:text="grid layout" android:textappearance="?android:attr/textappearancelarge" /> </relativelayout> and finaly here java code slidingmenu: slidemenubaseactivity.java
public class slidemenubaseactivity extends slidingfragmentactivity{ private int mtitleres; protected sherlocklistfragment mfrag; protected sherlockfragment mfraggrid; public slidemenubaseactivity(int titleres) { // todo auto-generated constructor stub mtitleres = titleres; } @override public void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); settitle(mtitleres); setbehindcontentview(r.layout.menu_frame); if (savedinstancestate == null) { fragmenttransaction t = this.getsupportfragmentmanager().begintransaction(); mfrag = new slidingmenufragment(); mfraggrid = new slidinggridfragment(); fragmenttransaction t2 = this.getsupportfragmentmanager().begintransaction(); t2.replace(r.id.grid_frame, mfraggrid); t2.commit(); t.replace(r.id.menu_frame, mfrag); //t.replace(r.id.grid_frame, mfraggrid); t.commit(); } else { mfrag = (sherlocklistfragment)this.getsupportfragmentmanager().findfragmentbyid(r.id.menu_frame); mfraggrid = (sherlockfragment)this.getsupportfragmentmanager().findfragmentbyid(r.id.grid_frame); } // customize slidingmenu slidingmenu sm = getslidingmenu(); sm.setshadowwidthres(r.dimen.shadow_width); sm.setshadowdrawable(r.drawable.shadow); sm.setbehindoffsetres(r.dimen.slidingmenu_offset); sm.setfadedegree(0.35f); sm.settouchmodeabove(slidingmenu.touchmode_fullscreen); getsupportactionbar().setdisplayhomeasupenabled(true); getsupportactionbar().setdisplayshowcustomenabled(true); getsupportactionbar().sethomebuttonenabled(true); } @override public boolean oncreateoptionsmenu(menu menu) { // todo auto-generated method stub return super.oncreateoptionsmenu(menu); } @override public boolean onoptionsitemselected(menuitem item) { // todo auto-generated method stub switch (item.getitemid()) { case android.r.id.home: toggle(); return true; default: break; } return super.onoptionsitemselected(item); } } i have implemented code above grid_view content visible on slidingmenu not list_view content. can 1 please suggest me solution complete view evernote sliding menu using fragments app.....
thanks
maybe should consider using navigation drawer instead of sliding menu. it's more easier achieve goal.
simple check links:
create navigation drawer , see example
it's simple use, , want fragments. can make custom design left drawer. me looks evernote uses same pattern.
Comments
Post a Comment