mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
[Android] Open the navigation drawer by clicking on the button. Woops, didn't realize that gmail did this as well.
This commit is contained in:
@ -11,6 +11,7 @@ import android.preference.PreferenceManager;
|
|||||||
import android.support.v4.app.ActionBarDrawerToggle;
|
import android.support.v4.app.ActionBarDrawerToggle;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
@ -74,6 +75,13 @@ public class GameListActivity extends Activity
|
|||||||
R.string.drawer_open, /* "open drawer" description for accessibility */
|
R.string.drawer_open, /* "open drawer" description for accessibility */
|
||||||
R.string.drawer_close /* "close 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);
|
mDrawerLayout.setDrawerListener(mDrawerToggle);
|
||||||
|
|
||||||
@ -215,6 +223,16 @@ public class GameListActivity extends Activity
|
|||||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||||
return super.onPrepareOptionsMenu(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()
|
public void onBackPressed()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user