Permalink
Browse files

Add functionality to set menu to shown on app startup.

  • Loading branch information...
1 parent 9c51a02 commit 990edce77cf08881ad4a2b6d27a9f1354aadbc25 @bk138 committed Sep 4, 2012
@@ -215,6 +215,18 @@ public void clearMenuItems() {
* Slide the menu in.
*/
public void show() {
+ this.show(true);
+ }
+
+ /**
+ * Set the menu to shown status without displaying any slide animation.
+ */
+ public void setAsShown() {
+ this.show(false);
+ }
+
+ private void show(boolean animate) {
+
/*
* We have to adopt to status bar height in most cases,
* but not if there is a support actionbar!
@@ -234,15 +246,6 @@ public void show() {
applyStatusbarOffset();
}
- /*
- * phew, finally!
- */
- this.show(true);
- }
-
-
-
- private void show(boolean animate) {
// modify content layout params
try {
@@ -35,6 +35,9 @@ protected void onCreate(Bundle savedInstanceState) {
slidemenu = (SlideMenu) findViewById(R.id.slideMenu);
slidemenu.init(this, R.menu.slide, this, 333);
+ // this can set the menu to initially shown instead of hidden
+// slidemenu.setAsShown();
+
// set optional header image
slidemenu.setHeaderImage(R.drawable.ic_launcher);

0 comments on commit 990edce

Please sign in to comment.