1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-23 04:41:16 +00:00

Close drawer on back button press (ref #486).

This commit is contained in:
Felix Ableitner 2015-11-15 20:01:09 +01:00
parent ecbce403ff
commit bb886e9b72

View file

@ -362,6 +362,17 @@ public class MainActivity extends SyncthingActivity
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
* http://www.google.com/design/spec/patterns/navigation-drawer.html#navigation-drawer-specs.