• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SupportMenu类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.support.v4.internal.view.SupportMenu的典型用法代码示例。如果您正苦于以下问题:Java SupportMenu类的具体用法?Java SupportMenu怎么用?Java SupportMenu使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SupportMenu类属于android.support.v4.internal.view包,在下文中一共展示了SupportMenu类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: inflate

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public void inflate(int menuRes, Menu menu) {
    if (menu instanceof SupportMenu) {
        XmlResourceParser parser = null;
        try {
            parser = this.mContext.getResources().getLayout(menuRes);
            parseMenu(parser, Xml.asAttributeSet(parser), menu);
            if (parser != null) {
                parser.close();
            }
        } catch (XmlPullParserException e) {
            throw new InflateException("Error inflating menu XML", e);
        } catch (IOException e2) {
            throw new InflateException("Error inflating menu XML", e2);
        } catch (Throwable th) {
            if (parser != null) {
                parser.close();
            }
        }
    } else {
        super.inflate(menuRes, menu);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:23,代码来源:SupportMenuInflater.java


示例2: onActivityResult

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    this.mFragments.noteStateNotSaved();
    int requestIndex = requestCode >> 16;
    if (requestIndex != 0) {
        requestIndex--;
        String who = (String) this.mPendingFragmentActivityResults.get(requestIndex);
        this.mPendingFragmentActivityResults.remove(requestIndex);
        if (who == null) {
            Log.w(TAG, "Activity result delivered for unknown Fragment.");
            return;
        }
        Fragment targetFragment = this.mFragments.findFragmentByWho(who);
        if (targetFragment == null) {
            Log.w(TAG, "Activity result no fragment exists for who: " + who);
            return;
        } else {
            targetFragment.onActivityResult(SupportMenu.USER_MASK & requestCode, resultCode, data);
            return;
        }
    }
    super.onActivityResult(requestCode, resultCode, data);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:23,代码来源:FragmentActivity.java


示例3: d

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public final int[] d() {
    if (this.c == 0) {
        return new int[0];
    }
    List<NeighboringCellInfo> neighboringCellInfo = this.q.getNeighboringCellInfo();
    if (neighboringCellInfo == null || neighboringCellInfo.size() == 0) {
        return new int[]{this.c};
    }
    Object obj = new int[((neighboringCellInfo.size() * 2) + 2)];
    obj[0] = this.c;
    obj[1] = this.a;
    int i = 2;
    for (NeighboringCellInfo neighboringCellInfo2 : neighboringCellInfo) {
        int cid = neighboringCellInfo2.getCid();
        if (cid > 0 && cid != SupportMenu.USER_MASK) {
            int i2 = i + 1;
            obj[i] = cid;
            i = i2 + 1;
            obj[i2] = neighboringCellInfo2.getRssi();
        }
    }
    Object obj2 = new int[i];
    System.arraycopy(obj, 0, obj2, 0, i);
    return obj2;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:26,代码来源:b.java


示例4: refreshUserView

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
private void refreshUserView() {
    AccountUtils.getUserProfile(this.ctx, new OnGetUserProfile() {
        public void onGetUserProfile(User usr) {
            AccountSettingActivity.this.user = usr;
            if (AccountSettingActivity.this.user == null) {
                return;
            }
            if (TextUtils.isEmpty(AccountSettingActivity.this.user.cellphone)) {
                AccountSettingActivity.this.tvCellPhone.setText("请填写");
            } else if (AccountSettingActivity.this.user.cellphone_state) {
                AccountSettingActivity.this.tvCellPhone.setText(AccountSettingActivity.this
                        .user.cellphone + "(已验证)");
                AccountSettingActivity.this.tvCellPhone.setTextColor(AccountSettingActivity
                        .this.getResources().getColor(R.color.h5));
            } else {
                AccountSettingActivity.this.tvCellPhone.setText(AccountSettingActivity.this
                        .user.cellphone + "(未验证)");
                AccountSettingActivity.this.tvCellPhone.setTextColor(SupportMenu.CATEGORY_MASK);
            }
        }

        public void onGetUserProfileFinish() {
        }
    });
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:26,代码来源:AccountSettingActivity.java


示例5: addIntentOptions

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public int addIntentOptions(int paramInt1, int paramInt2, int paramInt3, ComponentName paramComponentName, Intent[] paramArrayOfIntent, Intent paramIntent, int paramInt4, MenuItem[] paramArrayOfMenuItem)
{
  MenuItem[] arrayOfMenuItem = null;
  if (paramArrayOfMenuItem != null) {
    arrayOfMenuItem = new MenuItem[paramArrayOfMenuItem.length];
  }
  int i = ((SupportMenu)this.mWrappedObject).addIntentOptions(paramInt1, paramInt2, paramInt3, paramComponentName, paramArrayOfIntent, paramIntent, paramInt4, arrayOfMenuItem);
  if (arrayOfMenuItem != null)
  {
    int j = 0;
    int k = arrayOfMenuItem.length;
    while (j < k)
    {
      paramArrayOfMenuItem[j] = getMenuItemWrapper(arrayOfMenuItem[j]);
      j++;
    }
  }
  return i;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:20,代码来源:MenuWrapperICS.java


示例6: addIntentOptions

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public int addIntentOptions(int i, int j, int k, ComponentName componentname, Intent aintent[], Intent intent, int l, 
        MenuItem amenuitem[])
{
    MenuItem amenuitem1[] = null;
    if (amenuitem != null)
    {
        amenuitem1 = new MenuItem[amenuitem.length];
    }
    j = ((SupportMenu)mWrappedObject).addIntentOptions(i, j, k, componentname, aintent, intent, l, amenuitem1);
    if (amenuitem1 != null)
    {
        i = 0;
        for (k = amenuitem1.length; i < k; i++)
        {
            amenuitem[i] = getMenuItemWrapper(amenuitem1[i]);
        }

    }
    return j;
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:21,代码来源:MenuWrapperICS.java


示例7: checkLogin

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
private boolean checkLogin() {
    String text;
    if (TextUtils.isEmpty(this.mUserName)) {
        text = LetvTools.getTextFromServer(DialogMsgConstantId.FIFTEEN_ZERO_ONE_CONSTANT, getString(2131100491));
        if (TextUtils.isEmpty(text)) {
            ToastUtils.showToast(2131101071);
        } else {
            ToastUtils.showToast(text);
        }
        this.mUserView.setBackgroundColor(SupportMenu.CATEGORY_MASK);
        this.mUserNameTv.requestFocus();
        return false;
    }
    this.mUserView.setBackgroundColor(getActivity().getResources().getColor(2131493321));
    if (TextUtils.isEmpty(this.mPassword)) {
        text = LetvTools.getTextFromServer(DialogMsgConstantId.FIFTEEN_ELEVEN_CONSTANT, getString(2131100709));
        if (TextUtils.isEmpty(text)) {
            ToastUtils.showToast(2131101071);
        } else {
            ToastUtils.showToast(text);
        }
        this.mPasswordView.setBackgroundColor(SupportMenu.CATEGORY_MASK);
        this.mPasswordBtnEt.requestFocus();
        return false;
    }
    this.mPasswordView.setBackgroundColor(getActivity().getResources().getColor(2131493321));
    return true;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:29,代码来源:LoginFragment.java


示例8: startActivityForResult

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public void startActivityForResult(Intent intent, int requestCode) {
    if (this.mStartedActivityFromFragment || requestCode == -1 || (SupportMenu.CATEGORY_MASK & requestCode) == 0) {
        super.startActivityForResult(intent, requestCode);
        return;
    }
    throw new IllegalArgumentException("Can only use lower 16 bits for requestCode");
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:FragmentActivity.java


示例9: startActivityFromFragment

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public void startActivityFromFragment(Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options) {
    this.mStartedActivityFromFragment = true;
    if (requestCode == -1) {
        try {
            ActivityCompat.startActivityForResult(this, intent, -1, options);
        } finally {
            this.mStartedActivityFromFragment = false;
        }
    } else if ((SupportMenu.CATEGORY_MASK & requestCode) != 0) {
        throw new IllegalArgumentException("Can only use lower 16 bits for requestCode");
    } else {
        ActivityCompat.startActivityForResult(this, intent, ((allocateRequestIndex(fragment) + 1) << 16) + (SupportMenu.USER_MASK & requestCode), options);
        this.mStartedActivityFromFragment = false;
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:16,代码来源:FragmentActivity.java


示例10: mostSignificantBit

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public static int mostSignificantBit(int x) {
    int length = 0;
    if ((SupportMenu.CATEGORY_MASK & x) != 0) {
        length = 0 + 16;
        x >>= 16;
    }
    if ((MotionEventCompat.ACTION_POINTER_INDEX_MASK & x) != 0) {
        length += 8;
        x >>= 8;
    }
    if ((x & SocializeConstants.MASK_USER_CENTER_HIDE_AREA) != 0) {
        length += 4;
        x >>= 4;
    }
    if ((x & 12) != 0) {
        length += 2;
        x >>= 2;
    }
    if ((x & 2) != 0) {
        length++;
        x >>= 1;
    }
    if ((x & 1) != 0) {
        length++;
    }
    return length - 1;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:28,代码来源:IndexWriter.java


示例11: setCheckInUI

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
private void setCheckInUI(int count, boolean isChecked) {
    boolean z;
    String message = String.format(getString(R.string.d7), new Object[]{Integer.valueOf
            (count)});
    SpannableString ss = new SpannableString(message);
    ss.setSpan(new ForegroundColorSpan(SupportMenu.CATEGORY_MASK), 5, message.length() - 1, 33);
    this.checkInMsgText.setText(ss);
    this.checkInBtn.setText(isChecked ? R.string.d4 : R.string.d6);
    TextView textView = this.checkInBtn;
    if (isChecked) {
        z = false;
    } else {
        z = true;
    }
    textView.setEnabled(z);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:17,代码来源:StatusBlockFragment.java


示例12: getMenuWrapper

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
private Menu getMenuWrapper(Menu menu) {
    Menu wrapper = (Menu) this.mMenus.get(menu);
    if (wrapper != null) {
        return wrapper;
    }
    wrapper = MenuWrapperFactory.wrapSupportMenu(this.mContext, (SupportMenu) menu);
    this.mMenus.put(menu, wrapper);
    return wrapper;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:SupportActionModeWrapper.java


示例13: readItem

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public void readItem(AttributeSet attrs) {
    TypedArray a = SupportMenuInflater.this.mContext.obtainStyledAttributes(attrs, R.styleable.MenuItem);
    this.itemId = a.getResourceId(R.styleable.MenuItem_android_id, 0);
    this.itemCategoryOrder = (SupportMenu.CATEGORY_MASK & a.getInt(R.styleable.MenuItem_android_menuCategory, this.groupCategory)) | (65535 & a.getInt(R.styleable.MenuItem_android_orderInCategory, this.groupOrder));
    this.itemTitle = a.getText(R.styleable.MenuItem_android_title);
    this.itemTitleCondensed = a.getText(R.styleable.MenuItem_android_titleCondensed);
    this.itemIconResId = a.getResourceId(R.styleable.MenuItem_android_icon, 0);
    this.itemAlphabeticShortcut = getShortcut(a.getString(R.styleable.MenuItem_android_alphabeticShortcut));
    this.itemNumericShortcut = getShortcut(a.getString(R.styleable.MenuItem_android_numericShortcut));
    if (a.hasValue(R.styleable.MenuItem_android_checkable)) {
        int i;
        if (a.getBoolean(R.styleable.MenuItem_android_checkable, false)) {
            i = 1;
        } else {
            i = 0;
        }
        this.itemCheckable = i;
    } else {
        this.itemCheckable = this.groupCheckable;
    }
    this.itemChecked = a.getBoolean(R.styleable.MenuItem_android_checked, false);
    this.itemVisible = a.getBoolean(R.styleable.MenuItem_android_visible, this.groupVisible);
    this.itemEnabled = a.getBoolean(R.styleable.MenuItem_android_enabled, this.groupEnabled);
    this.itemShowAsAction = a.getInt(R.styleable.MenuItem_showAsAction, -1);
    this.itemListenerMethodName = a.getString(R.styleable.MenuItem_android_onClick);
    this.itemActionViewLayout = a.getResourceId(R.styleable.MenuItem_actionLayout, 0);
    this.itemActionViewClassName = a.getString(R.styleable.MenuItem_actionViewClass);
    this.itemActionProviderClassName = a.getString(R.styleable.MenuItem_actionProviderClass);
    boolean hasActionProvider = this.itemActionProviderClassName != null;
    if (hasActionProvider && this.itemActionViewLayout == 0 && this.itemActionViewClassName == null) {
        this.itemActionProvider = (ActionProvider) newInstance(this.itemActionProviderClassName, SupportMenuInflater.ACTION_PROVIDER_CONSTRUCTOR_SIGNATURE, SupportMenuInflater.this.mActionProviderConstructorArguments);
    } else {
        if (hasActionProvider) {
            Log.w(SupportMenuInflater.LOG_TAG, "Ignoring attribute 'actionProviderClass'. Action view already specified.");
        }
        this.itemActionProvider = null;
    }
    a.recycle();
    this.itemAdded = false;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:41,代码来源:SupportMenuInflater.java


示例14: getOrdering

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
private static int getOrdering(int categoryOrder) {
    int index = (SupportMenu.CATEGORY_MASK & categoryOrder) >> 16;
    if (index >= 0 && index < sCategoryToOrder.length) {
        return (sCategoryToOrder[index] << 16) | (65535 & categoryOrder);
    }
    throw new IllegalArgumentException("order does not contain a valid category.");
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:MenuBuilder.java


示例15: addIntentOptions

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public int addIntentOptions(int groupId, int itemId, int order, ComponentName caller, Intent[] specifics, Intent intent, int flags, MenuItem[] outSpecificItems) {
    MenuItem[] items = null;
    if (outSpecificItems != null) {
        items = new MenuItem[outSpecificItems.length];
    }
    int result = ((SupportMenu) this.mWrappedObject).addIntentOptions(groupId, itemId, order, caller, specifics, intent, flags, items);
    if (items != null) {
        int z = items.length;
        for (int i = 0; i < z; i++) {
            outSpecificItems[i] = getMenuItemWrapper(items[i]);
        }
    }
    return result;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:15,代码来源:MenuWrapperICS.java


示例16: startActivityFromFragment

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public void startActivityFromFragment(Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options) {
    this.mStartedActivityFromFragment = true;
    if (requestCode == -1) {
        try {
            ActivityCompat.startActivityForResult(this, intent, -1, options);
        } finally {
            this.mStartedActivityFromFragment = false;
        }
    } else if ((SupportMenu.CATEGORY_MASK & requestCode) != 0) {
        throw new IllegalArgumentException("Can only use lower 16 bits for requestCode");
    } else {
        ActivityCompat.startActivityForResult(this, intent, ((allocateRequestIndex(fragment) + 1) << 16) + (65535 & requestCode), options);
        this.mStartedActivityFromFragment = false;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:16,代码来源:FragmentActivity.java


示例17: getMenuWrapper

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
private Menu getMenuWrapper(Menu paramMenu)
{
  Menu localMenu = (Menu)this.mMenus.get(paramMenu);
  if (localMenu == null)
  {
    localMenu = MenuWrapperFactory.wrapSupportMenu(this.mContext, (SupportMenu)paramMenu);
    this.mMenus.put(paramMenu, localMenu);
  }
  return localMenu;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:11,代码来源:SupportActionModeWrapper.java


示例18: wrapSupportMenu

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public static Menu wrapSupportMenu(Context paramContext, SupportMenu paramSupportMenu)
{
  if (Build.VERSION.SDK_INT >= 14) {
    return new MenuWrapperICS(paramContext, paramSupportMenu);
  }
  throw new UnsupportedOperationException();
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:8,代码来源:MenuWrapperFactory.java


示例19: clear

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public void clear()
{
  if (this.mMenuItems != null) {
    this.mMenuItems.clear();
  }
  if (this.mSubMenus != null) {
    this.mSubMenus.clear();
  }
  ((SupportMenu)this.mWrappedObject).clear();
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:11,代码来源:MenuWrapperICS.java


示例20: removeGroup

import android.support.v4.internal.view.SupportMenu; //导入依赖的package包/类
public void removeGroup(int paramInt)
{
  if (this.mMenuItems != null)
  {
    Iterator localIterator = this.mMenuItems.keySet().iterator();
    while (localIterator.hasNext()) {
      if (paramInt == ((MenuItem)localIterator.next()).getGroupId()) {
        localIterator.remove();
      }
    }
  }
  ((SupportMenu)this.mWrappedObject).removeGroup(paramInt);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:14,代码来源:MenuWrapperICS.java



注:本文中的android.support.v4.internal.view.SupportMenu类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LoginState类代码示例发布时间:2022-05-22
下一篇:
Java Battery类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap