mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-27 06:41:15 +00:00
Close drawer on back button press (ref #486).
This commit is contained in:
parent
ecbce403ff
commit
bb886e9b72
1 changed files with 11 additions and 0 deletions
|
@ -362,6 +362,17 @@ public class MainActivity extends SyncthingActivity
|
||||||
return super.onKeyDown(keyCode, e);
|
return super.onKeyDown(keyCode, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close drawer on back button press.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if (mDrawerLayout.isDrawerOpen(GravityCompat.START))
|
||||||
|
closeDrawer();
|
||||||
|
else
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculating width based on
|
* Calculating width based on
|
||||||
* http://www.google.com/design/spec/patterns/navigation-drawer.html#navigation-drawer-specs.
|
* http://www.google.com/design/spec/patterns/navigation-drawer.html#navigation-drawer-specs.
|
||||||
|
|
Loading…
Reference in a new issue