本文整理汇总了Java中com.mikepenz.iconics.typeface.FontAwesome类的典型用法代码示例。如果您正苦于以下问题:Java FontAwesome类的具体用法?Java FontAwesome怎么用?Java FontAwesome使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FontAwesome类属于com.mikepenz.iconics.typeface包,在下文中一共展示了FontAwesome类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreateOptionsMenu
import com.mikepenz.iconics.typeface.FontAwesome; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
//重载菜单图标
ActionItemBadge.update(this, menu.findItem(R.id.action_publish), FontAwesome.Icon.faw_plus, Color.GRAY, ActionItemBadge.BadgeStyles.GREY, Integer.MIN_VALUE);
ActionItemBadge.update(this, menu.findItem(R.id.action_chat), FontAwesome.Icon.faw_comment_o, Color.GRAY, ActionItemBadge.BadgeStyles.GREY, Integer.MIN_VALUE);
return true;
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:10,代码来源:AbstractMainActivity.java
示例2: onOptionsItemSelected
import com.mikepenz.iconics.typeface.FontAwesome; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_publish:
startActivityForResult(PublishActivity.newIntent(), PublishActivity.REQUEST_PUBLISH);
break;
case R.id.action_chat:
ActionItemBadge.update(this, item, FontAwesome.Icon.faw_comment_o,Color.GRAY, ActionItemBadge.BadgeStyles.GREY, Integer.MIN_VALUE);
PrefService.getInstance(getApplicationContext()).cleanUnread();
startActivity(ChatListActivity.newIntent());
break;
}
return true;
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:16,代码来源:AbstractMainActivity.java
示例3: onNewMsg
import com.mikepenz.iconics.typeface.FontAwesome; //导入依赖的package包/类
/**
* 新消息提示
*/
@Override
public void onNewMsg() {
int count=PrefService.getInstance(getApplicationContext()).getUnread();
Log.d("MainActivity", "Recieve msg:" + count);
ActionItemBadge.update(this, toolbar.getMenu().findItem(R.id.action_chat), FontAwesome.Icon.faw_comment_o,Color.GRAY, ActionItemBadge.BadgeStyles.RED, PrefService.getInstance(getApplicationContext()).getUnread());
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:10,代码来源:AbstractMainActivity.java
示例4: onCreate
import com.mikepenz.iconics.typeface.FontAwesome; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_macros);
initToolbar();
initDrawer();
mListView = (CardListView) findViewById(R.id.listview);
mListEmptyTextView = (TextView) findViewById(R.id.listEmptyText);
mMacroList = MacroUtils.loadMacroList(mPrefs);
// if (mMacroList.size() >= MACRO_SIZE_WARN) {
// macroListLengthWarningDialog(mMacroList.size());
// }
mCards = new ArrayList<Card>();
for (MacroEntry macroEntry : mMacroList) {
mCards.add(macroEntryToCard(macroEntry));
}
mCardArrayAdapter = new CardArrayAdapter(this, mCards);
if (mListView != null) {
mListView.setAdapter(mCardArrayAdapter);
}
Drawable plus = new IconicsDrawable(this, FontAwesome.Icon.faw_plus).color(Color.DKGRAY).sizeDp(20);
FloatingActionButton addButton = (FloatingActionButton) findViewById(R.id.add);
addButton.setImageDrawable(plus);
addButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addMacro();
}
});
}
开发者ID:mitchtech,项目名称:XposedMacroExpand,代码行数:37,代码来源:EditMacrosActivity.java
示例5: showNavigationDrawer
import com.mikepenz.iconics.typeface.FontAwesome; //导入依赖的package包/类
public static Drawer showNavigationDrawer(final Context context, Toolbar toolbar, final MoticonAdapter moticonAdapter, final MoticonAdapter moticonPositiveAdapter, final MoticonAdapter moticonNegativeAdapter, final MoticonAdapter moticonFunnyAdapter, final MoticonAdapter moticonAnimalsAdapter, final MoticonAdapter moticonSpecialAdapter, final RecyclerView recyclerView) {
Activity activity = (Activity) context;
AccountHeader headerResult = new AccountHeaderBuilder()
.withActivity(activity)
.withHeaderBackground(R.drawable.header)
.build();
return new DrawerBuilder()
.withActivity(activity)
.withToolbar(toolbar)
.withAccountHeader(headerResult)
.withStatusBarColor(context.getResources().getColor(R.color.primary_dark))
.addDrawerItems(
new PrimaryDrawerItem().withName(context.getResources().getString(R.string.app_name)).withIcon(R.mipmap.ic_launcher),
new DividerDrawerItem(),
new PrimaryDrawerItem().withName(context.getResources().getString(R.string.action_positive)).withIcon(FontAwesome.Icon.faw_thumbs_up).withBadge("(/^▽^)/"),
new PrimaryDrawerItem().withName(context.getResources().getString(R.string.action_negative)).withIcon(FontAwesome.Icon.faw_thumbs_down).withBadge("(>_<)"),
new PrimaryDrawerItem().withName(context.getResources().getString(R.string.action_funny)).withIcon(FontAwesome.Icon.faw_child).withBadge("¯\\_(ツ)_/¯"),
new PrimaryDrawerItem().withName(context.getResources().getString(R.string.action_animal)).withIcon(FontAwesome.Icon.faw_paw).withBadge("∪・ω・∪"),
new PrimaryDrawerItem().withName(context.getResources().getString(R.string.action_special)).withIcon(FontAwesome.Icon.faw_star).withBadge("ʕ•̬͡•ʕ•̫͡•♥"),
new DividerDrawerItem(),
new SecondaryDrawerItem().withName(context.getResources().getString(R.string.action_about)).withCheckable(false)
)
.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(AdapterView<?> adapterView, View view, int position, long id, IDrawerItem iDrawerItem) {
switch (position) {
case 0:
recyclerView.setAdapter(moticonAdapter);
break;
case 2:
recyclerView.setAdapter(moticonPositiveAdapter);
break;
case 3:
recyclerView.setAdapter(moticonNegativeAdapter);
break;
case 4:
recyclerView.setAdapter(moticonFunnyAdapter);
break;
case 5:
recyclerView.setAdapter(moticonAnimalsAdapter);
break;
case 6:
recyclerView.setAdapter(moticonSpecialAdapter);
break;
case 8:
context.startActivity(new Intent(context, AboutActivity.class));
break;
default:
break;
}
return false;
}
}).build();
}
开发者ID:javiersantos,项目名称:Moticons,代码行数:57,代码来源:UtilsUI.java
示例6: onCreate
import com.mikepenz.iconics.typeface.FontAwesome; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
//Utils.configureWindowEnterExitTransition(getWindow());
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Handle Back Navigation :D
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DetailActivity.this.onBackPressed();
}
});
// Row Container
rowContainer = (LinearLayout) findViewById(R.id.row_container);
// Fab Button
ImageButton fabButton = (ImageButton) findViewById(R.id.fab_button);
fabButton.setImageDrawable(new IconicsDrawable(this, FontAwesome.Icon.faw_upload).color(Color.WHITE).actionBarSize());
fabButton.setOnClickListener(fabClickListener);
Utils.configureFab(fabButton);
//getWindow().getEnterTransition().removeListener(this);
for (int i = 1; i < rowContainer.getChildCount(); i++) {
View rowView = rowContainer.getChildAt(i);
rowView.animate().setStartDelay(100 + i * SCALE_DELAY).scaleX(1).scaleY(1);
}
ComponentName componentName = null;
if (savedInstanceState != null) {
componentName = savedInstanceState.getParcelable("appInfo");
} else if (getIntent() != null && getIntent().getExtras() != null) {
componentName = (ComponentName) getIntent().getExtras().get("appInfo");
}
if (componentName != null) {
Intent intent = new Intent();
intent.setComponent(componentName);
ResolveInfo app = getPackageManager().resolveActivity(intent, 0);
appInfo = new AppInfo(this, app);
}
if (appInfo != null) {
//toolbar.setLogo(appInfo.getIcon());
toolbar.setTitle(appInfo.getName());
View view = rowContainer.findViewById(R.id.row_name);
fillRow(view, "Application Name", appInfo.getName());
((ImageView) view.findViewById(R.id.appIcon)).setImageDrawable(appInfo.getIcon());
view = rowContainer.findViewById(R.id.row_package_name);
fillRow(view, "Package Name", appInfo.getPackageName());
view = rowContainer.findViewById(R.id.row_activity);
fillRow(view, "Activity", appInfo.getActivityName());
view = rowContainer.findViewById(R.id.row_component_info);
fillRow(view, "ComponentInfo", appInfo.getComponentInfo());
view = rowContainer.findViewById(R.id.row_version);
fillRow(view, "Version", appInfo.getVersionName() + " (" + appInfo.getVersionCode() + ")");
view = rowContainer.findViewById(R.id.row_moments);
fillRow(view, "Moments", "First installed: " + new Date(appInfo.getFirstInstallTime()) + "\nLast updated: " + new Date(appInfo.getLastUpdateTime()));
}
}
开发者ID:brucetoo,项目名称:Materia-Design,代码行数:76,代码来源:DetailActivity.java
示例7: initDrawer
import com.mikepenz.iconics.typeface.FontAwesome; //导入依赖的package包/类
protected void initDrawer() {
mDrawer = new DrawerBuilder()
.withActivity(this)
.withToolbar(mToolbar)
.withTranslucentActionBarCompatibility(true)
.withCloseOnClick(true)
.withAnimateDrawerItems(true)
.withSelectedItem(-1)
.addDrawerItems(
new PrimaryDrawerItem().withName(MENU_TEXT_DYNAMIC_MACROS).withIcon(FontAwesome.Icon.faw_android).withIdentifier(MENU_DYNAMIC_MACROS),
new PrimaryDrawerItem().withName(MENU_TEXT_SETTINGS).withIcon(FontAwesome.Icon.faw_gear).withIdentifier(MENU_SETTINGS),
new PrimaryDrawerItem().withName(MENU_TEXT_ABOUT).withIcon(FontAwesome.Icon.faw_info).withIdentifier(MENU_ABOUT),
new PrimaryDrawerItem().withName(MENU_TEXT_HELP).withIcon(FontAwesome.Icon.faw_question).withIdentifier(MENU_HELP),
new DividerDrawerItem(),
new SecondaryDrawerItem().withName(MENU_TEXT_THEME).withIcon(FontAwesome.Icon.faw_paint_brush).withIdentifier(MENU_THEME),
new SecondaryDrawerItem().withName(MENU_TEXT_UPGRADE).withIcon(FontAwesome.Icon.faw_shopping_cart).withIdentifier(MENU_UPGRADE),
new SecondaryDrawerItem().withName(MENU_TEXT_DONATE).withIcon(FontAwesome.Icon.faw_dollar).withIdentifier(MENU_DONATE),
new SecondaryDrawerItem().withName(MENU_TEXT_SHARE).withIcon(FontAwesome.Icon.faw_share).withIdentifier(MENU_SHARE),
new SecondaryDrawerItem().withName(MENU_TEXT_RATE).withIcon(FontAwesome.Icon.faw_star).withIdentifier(MENU_RATE),
new SecondaryDrawerItem().withName(MENU_TEXT_MORE_APPS).withIcon(FontAwesome.Icon.faw_image).withIdentifier(MENU_MORE_APPS),
new SecondaryDrawerItem().withName(MENU_TEXT_SUPPORT_URL).withIcon(FontAwesome.Icon.faw_bookmark).withIdentifier(MENU_SUPPORT_URL),
new SecondaryDrawerItem().withName(MENU_TEXT_CONTACT).withIcon(FontAwesome.Icon.faw_bullhorn).withIdentifier(MENU_CONTACT),
new SecondaryDrawerItem().withName(MENU_TEXT_SOURCE_CODE).withIcon(FontAwesome.Icon.faw_github).withIdentifier(MENU_SOURCE_CODE),
new SecondaryDrawerItem().withName(MENU_TEXT_LICENSE).withIcon(FontAwesome.Icon.faw_copyright).withIdentifier(MENU_LICENSE),
new SecondaryDrawerItem().withName(MENU_TEXT_PRIVACY).withIcon(FontAwesome.Icon.faw_video_camera).withIdentifier(MENU_PRIVACY),
new SecondaryDrawerItem().withName(MENU_TEXT_CHANGE_LOG).withIcon(FontAwesome.Icon.faw_list).withIdentifier(MENU_CHANGE_LOG),
new SecondaryDrawerItem().withName(MENU_TEXT_EXIT).withIcon(FontAwesome.Icon.faw_power_off).withIdentifier(MENU_EXIT)
)
.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(AdapterView<?> parent, View view, int position, long id, IDrawerItem drawerItem) {
if (drawerItem != null) {
performAction(drawerItem.getIdentifier());
return true;
}
return false;
}
})
.withActionBarDrawerToggle(true)
.withShowDrawerOnFirstLaunch(true)
.build();
}
开发者ID:mitchtech,项目名称:XposedMacroExpand,代码行数:43,代码来源:BaseActivity.java
注:本文中的com.mikepenz.iconics.typeface.FontAwesome类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论