本文整理了Java中android.support.design.widget.NavigationView.getContext()
方法的一些代码示例,展示了NavigationView.getContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NavigationView.getContext()
方法的具体详情如下:
包路径:android.support.design.widget.NavigationView
类名称:NavigationView
方法名:getContext
暂无
代码示例来源:origin: Catrobat/Paintroid
@Override
public void setVersion(String versionString) {
String appName = navigationView.getContext().getString(R.string.pocketpaint_app_name);
navigationMenuVersion.setTitle(appName + " v" + versionString);
}
代码示例来源:origin: konradrenner/kolabnotes-android
public MenuItem addNotebook(OnDrawerSelectionChangedListener listener, Notebook notebook){
return addNotebook(view.getContext(), view.getMenu().findItem(R.id.navigation_notebooks).getSubMenu(), listener, notebook);
}
代码示例来源:origin: konradrenner/kolabnotes-android
public void overrideNotebooks(OnDrawerSelectionChangedListener listener, Collection<Notebook> notebooks){
final Menu overview = view.getMenu();
final SubMenu notebookSubmenu = overview.findItem(R.id.navigation_notebooks).getSubMenu();
notebookSubmenu.clear();
for(Notebook book : notebooks){
addNotebook(view.getContext(), notebookSubmenu, listener, book);
}
}
代码示例来源:origin: konradrenner/kolabnotes-android
public Set<AccountIdentifier> overrideAccounts(OnAccountSwitchedFromNavListener list, Account[] accounts, AccountManager accountManager, DrawerLayout layout){
Set<AccountIdentifier> createdAccounts = new LinkedHashSet<>();
final Menu menu = nav.getMenu();
final Context context = nav.getContext();
menu.removeGroup(R.id.drawer_accounts);
createMenuItem(list, menu, context, 0, "local", context.getString(R.string.drawer_account_local), "Notes", "local", layout);
for(int i=0;i<accounts.length;i++) {
String email = accountManager.getUserData(accounts[i], AuthenticatorActivity.KEY_EMAIL);
String name = accountManager.getUserData(accounts[i],AuthenticatorActivity.KEY_ACCOUNT_NAME);
String rootFolder = accountManager.getUserData(accounts[i],AuthenticatorActivity.KEY_ROOT_FOLDER);
String accountType = accountManager.getUserData(accounts[i], AuthenticatorActivity.KEY_ACCOUNT_TYPE);
final AccountIdentifier accountIdentifier = createMenuItem(list, menu, context, i+1, email, name, rootFolder, accountType, layout);
createdAccounts.remove(accountIdentifier);
}
return createdAccounts;
}
内容来源于网络,如有侵权,请联系作者删除!