@Override
  public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    if (PhoneConfiguration.getInstance().HandSide == 1) { // lefthand
      int flag = PhoneConfiguration.getInstance().getUiFlag();
      if (flag == 1 || flag == 3 || flag == 5 || flag == 7) { // 文章列表,UIFLAG为1或者1+2或者1+4或者1+2+4
        inflater.inflate(R.menu.articlelist_menu_left, menu);
      } else {
        inflater.inflate(R.menu.articlelist_menu, menu);
      }
    } else {
      inflater.inflate(R.menu.articlelist_menu, menu);
    }
    final int flags = ThemeManager.ACTION_BAR_FLAG;

    MenuItem lock = menu.findItem(R.id.article_menuitem_lock);
    int orentation = ThemeManager.getInstance().screenOrentation;
    if (orentation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
        || orentation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
      lock.setTitle(R.string.unlock_orientation);
      lock.setIcon(R.drawable.ic_menu_always_landscape_portrait);
    }

    ReflectionUtil.actionBar_setDisplayOption(this, flags);
    return super.onCreateOptionsMenu(menu);
  }
コード例 #2
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   this.getMenuInflater().inflate(R.menu.imageview_option_menu, menu);
   final int flags = ThemeManager.ACTION_BAR_FLAG;
   ReflectionUtil.actionBar_setDisplayOption(this, flags);
   return super.onCreateOptionsMenu(menu);
 }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    if (this.getOptionMenuId() != 0) {
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(this.getOptionMenuId(), menu);
    }

    int actionNum = ThemeManager.ACTION_IF_ROOM; // SHOW_AS_ACTION_IF_ROOM
    int i = 0;
    for (i = 0; i < menu.size(); i++) {
      ReflectionUtil.setShowAsAction(menu.getItem(i), actionNum);
    }

    // ReflectionUtil.actionBar_setDisplayOption(this, flags);
    return super.onCreateOptionsMenu(menu);
  }
コード例 #4
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   if (PhoneConfiguration.getInstance().HandSide == 1) { // lefthand
     int flag = PhoneConfiguration.getInstance().getUiFlag();
     if (flag >= 4) { // 大于等于4肯定有
       getMenuInflater().inflate(R.menu.messagepost_menu_left, menu);
     } else {
       getMenuInflater().inflate(R.menu.messagepost_menu, menu);
     }
   } else {
     getMenuInflater().inflate(R.menu.messagepost_menu, menu);
   }
   final int flags = ThemeManager.ACTION_BAR_FLAG;
   /*
    * ActionBar.DISPLAY_SHOW_HOME;//2 flags |=
    * ActionBar.DISPLAY_USE_LOGO;//1 flags |=
    * ActionBar.DISPLAY_HOME_AS_UP;//4
    */
   ReflectionUtil.actionBar_setDisplayOption(this, flags);
   return true;
 }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {

    ReflectionUtil.actionBar_setDisplayOption(this, flags);
    return false; // super.onCreateOptionsMenu(menu);
  }