Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Open the navigation drawer by clicking on the button. Woops…
…, didn't realize that gmail did this as well.
  • Loading branch information
Sonicadvance1 committed Jun 25, 2013
1 parent 5595036 commit fc0f347
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Source/Android/src/org/dolphinemu/dolphinemu/GameListActivity.java
Expand Up @@ -11,6 +11,7 @@
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.widget.DrawerLayout;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
Expand Down Expand Up @@ -74,6 +75,13 @@ protected void onCreate(Bundle savedInstanceState) {
R.string.drawer_open, /* "open drawer" description for accessibility */
R.string.drawer_close /* "close drawer" description for accessibility */
) {
public void onDrawerClosed(View view) {
invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}

public void onDrawerOpened(View drawerView) {
invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);

Expand Down Expand Up @@ -215,6 +223,16 @@ public void onConfigurationChanged(Configuration newConfig) {
public boolean onPrepareOptionsMenu(Menu menu) {
return super.onPrepareOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// The action bar home/up action should open or close the drawer.
// ActionBarDrawerToggle will take care of this.
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
return super.onOptionsItemSelected(item);
}
public void onBackPressed()
{

Expand Down

0 comments on commit fc0f347

Please sign in to comment.