Java Code Examples for android.support.v4.widget.DrawerLayout#LOCK_MODE_UNLOCKED
The following examples show how to use
android.support.v4.widget.DrawerLayout#LOCK_MODE_UNLOCKED .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DrawerToggle.java From Dashchan with Apache License 2.0 | 6 votes |
public boolean onOptionsItemSelected(MenuItem item) { if (item != null && item.getItemId() == android.R.id.home) { if (drawerLayout.getDrawerLockMode(Gravity.START) != DrawerLayout.LOCK_MODE_UNLOCKED) { return false; } if (mode == MODE_DRAWER) { if (drawerLayout.isDrawerVisible(Gravity.START)) { drawerLayout.closeDrawer(Gravity.START); } else { drawerLayout.openDrawer(Gravity.START); } return true; } else if (mode == MODE_UP) { if (drawerLayout.isDrawerVisible(Gravity.START)) { drawerLayout.closeDrawer(Gravity.START); return true; } } } return false; }
Example 2
Source File: ActionBarToggleAdapter.java From SlidingRootNav with Apache License 2.0 | 5 votes |
@Override public int getDrawerLockMode(int edgeGravity) { if (adaptee.isMenuLocked() && adaptee.isMenuClosed()) { return DrawerLayout.LOCK_MODE_LOCKED_CLOSED; } else if (adaptee.isMenuLocked() && !adaptee.isMenuClosed()) { return DrawerLayout.LOCK_MODE_LOCKED_OPEN; } else { return DrawerLayout.LOCK_MODE_UNLOCKED; } }
Example 3
Source File: WalletActivity.java From xmrwallet with Apache License 2.0 | 5 votes |
@Override public void setDrawerEnabled(boolean enabled) { Timber.d("setDrawerEnabled %b", enabled); final int lockMode = enabled ? DrawerLayout.LOCK_MODE_UNLOCKED : DrawerLayout.LOCK_MODE_LOCKED_CLOSED; drawer.setDrawerLockMode(lockMode); drawerToggle.setDrawerIndicatorEnabled(enabled); invalidateOptionsMenu(); // menu may need to be changed }