本文整理汇总了Java中net.simonvt.menudrawer.MenuDrawer.STATE_OPENING属性的典型用法代码示例。如果您正苦于以下问题:Java MenuDrawer.STATE_OPENING属性的具体用法?Java MenuDrawer.STATE_OPENING怎么用?Java MenuDrawer.STATE_OPENING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.simonvt.menudrawer.MenuDrawer
的用法示例。
在下文中一共展示了MenuDrawer.STATE_OPENING属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBackPressed
@Override
public void onBackPressed() {
final int drawerState = mMenuDrawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING) {
mMenuDrawer.closeMenu();
return;
} else {
if (isTaskRoot()) {
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
homeIntent.addCategory(Intent.CATEGORY_HOME);
homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(homeIntent);
return;
}
}
super.onBackPressed();
}
示例2: onBackPressed
@Override
public void onBackPressed()
{
final int drawerState = menuDrawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING)
{
menuDrawer.closeMenu(true);
return;
}
finish();
super.onBackPressed();
}
示例3: onBackPressed
@Override
public void onBackPressed()
{
final int drawerState = menuDrawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING)
{
menuDrawer.closeMenu(true);
return;
}
super.onBackPressed();
}
示例4: onBackPressed
@Override
public void onBackPressed() {
final int drawerState = mMenuDrawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN
|| drawerState == MenuDrawer.STATE_OPENING) {
mMenuDrawer.closeMenu();
return;
}
ActivityCollector.finishAll();
super.onBackPressed();
}
示例5: onBackPressed
@Override
public void onBackPressed() {
if (mMenuDrawer != null) {
final int drawerState = mMenuDrawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN ||
drawerState == MenuDrawer.STATE_OPENING) {
mMenuDrawer.closeMenu();
return;
}
}
super.onBackPressed();
}
示例6: dispatchKeyEvent
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
final int drawerState = mMenuDrawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN
|| drawerState == MenuDrawer.STATE_OPENING) {
mMenuDrawer.closeMenu();
return true;
}
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK
&& event.getAction() == KeyEvent.ACTION_DOWN) {
MainActivityExit();
}
return super.dispatchKeyEvent(event);
}
示例7: onBackPressed
@Override
public void onBackPressed() {
final int drawerState = mMenuDrawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING) {
mMenuDrawer.closeMenu();
return;
}
super.onBackPressed();
}
示例8: onBackPressed
/**
* Called when the activity has detected the user's press of the back key.
* If the activity has a menu drawer attached that is opened or in the
* process of opening, the back button press closes it. Otherwise, the
* normal back action is taken.
*/
@Override
public void onBackPressed() {
if (mMenuDrawer != null) {
final int drawerState = mMenuDrawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN
|| drawerState == MenuDrawer.STATE_OPENING) {
mMenuDrawer.closeMenu();
finish();
return;
}
}
super.onBackPressed();
}
示例9: onBackPressed
@Override public void onBackPressed() {
final int drawerState = drawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING) {
drawer.closeMenu();
return;
}
if (stack.pop(true)) return;
super.onBackPressed();
}
示例10: onOptionsItemSelected
@Override public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
final int drawerState = drawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING) {
drawer.closeMenu();
} else if (!stack.pop(drawerState == MenuDrawer.STATE_CLOSED)) {
drawer.toggleMenu();
}
return true;
}
return super.onOptionsItemSelected(item);
}