How to place an ActionBar on a SlidingMenu ( like in the Evernote app)?
android, android-actionbar, user-interface
Solution
Ok I managed to do it with the help of Gunnar Karlsson who pushed me in the right direction Instead of a SearchView
I implemented an ImageButton like so:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#333333" >
<ImageButton
android:layout_width="wrap_content"
android:layout_height="60dp"
android:src="@drawable/ic_launcher"
android:onClick="showPopup" />
</LinearLayout>
<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" />
</LinearLayout>
and in the my mainActivity I simply pulled this from the google sample code for creating a pop up menu:
public void showPopup(View v) {
PopupMenu popup = new PopupMenu(this, v);
MenuInflater inflater = popup.getMenuInflater();
inflater.inflate(R.menu.actions, popup.getMenu());
popup.show();
}
And it worked. Thank you Gunnar Karlsson.
Problem
I want to make slide menu that has ActionBar like in Evernote. In this app, Seem like it has 2 ActionBars(I'm not sure about it). One at main and another one is in the sliding menu. Is there anyway to build 2 ActionBars like this? Or it's just a layout arrangement to resemble ActionBar look. Thank for all your help and sorry for my english. ps. I use ActionBarSherlock and SlidingMenu to achieve this, but I can't find the way to do it like in Evernote.