com.mikepenz.iconics.IconicsDrawable Java Examples
The following examples show how to use
com.mikepenz.iconics.IconicsDrawable.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RoutinesCardListFragment.java From timecat with Apache License 2.0 | 6 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_routines_card_list, container, false); listview = rootView.findViewById(R.id.routines_list); View empty = rootView.findViewById(android.R.id.empty); listview.setEmptyView(empty); mDBRoutines = DB.routines().findAllForActiveUser(); ic = new IconicsDrawable(getContext()).icon(CommunityMaterial.Icon.cmd_clock).colorRes(R.color.agenda_item_title).paddingDp(8).sizeDp(40); adapter = new RoutinesListAdapter(getActivity(), R.layout.item_routines_list, mDBRoutines); listview.setAdapter(adapter); return rootView; }
Example #2
Source File: PostFragment.java From hipda with GNU General Public License v2.0 | 6 votes |
private void showDeletePostDialog() { final AlertDialog.Builder popDialog = new AlertDialog.Builder(getActivity()); popDialog.setTitle("删除本帖?"); popDialog.setMessage(HtmlCompat.fromHtml("确认删除发表的内容吗?<br><br><font color=red>注意:此操作不可恢复。</font>")); popDialog.setPositiveButton("删除", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mDeleteMode = true; postReply(); } }); popDialog.setIcon(new IconicsDrawable(getActivity(), FontAwesome.Icon.faw_exclamation_circle).sizeDp(24).color(Color.RED)); popDialog.setNegativeButton("取消", null); popDialog.create().show(); }
Example #3
Source File: ExampleMaterialAboutFragment.java From material-about-library with Apache License 2.0 | 6 votes |
private MaterialAboutActionItem createDynamicItem(String subText, final Context c) { final MaterialAboutActionItem item = new MaterialAboutActionItem.Builder() .text("Dynamic UI") .subText(subText) .icon(new IconicsDrawable(c) .icon(CommunityMaterial.Icon.cmd_refresh) .sizeDp(18)) .build(); item.setOnClickAction(new MaterialAboutItemOnClickAction() { @Override public void onClick() { item.setSubText("Random number: " + ((int) (Math.random() * 10))); refreshMaterialAboutList(); } }); return item; }
Example #4
Source File: SearchFragment.java From hipda with GNU General Public License v2.0 | 6 votes |
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); mPreferences = getActivity().getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); RecyclerItemClickListener itemClickListener = new RecyclerItemClickListener(getActivity(), new OnItemClickListener()); mSimpleListAdapter = new SimpleListAdapter(this, mType, itemClickListener); mHistoryAdapter = new SearchHistoryAdapter(getActivity(), new RecyclerItemClickListener(getActivity(), new HistoryItemClickListener())); mIconDrawable = new IconicsDrawable(getActivity(), GoogleMaterial.Icon.gmd_history).sizeDp(16).color(Color.GRAY); mIbDrawable = new IconicsDrawable(getActivity(), GoogleMaterial.Icon.gmd_close).sizeDp(12).color(Color.GRAY); loadQueries(); }
Example #5
Source File: HiProgressDialog.java From hipda with GNU General Public License v2.0 | 6 votes |
private void dismiss(String message, int millisToWait, int status) { setCancelable(true); if (message != null) setMessage(message); if (status == ERROR) { setIndeterminateDrawable(new IconicsDrawable(getContext(), GoogleMaterial.Icon.gmd_error).sizeDp(48) .color(ContextCompat.getColor(getContext(), R.color.red))); } else { setIndeterminateDrawable(new IconicsDrawable(getContext(), GoogleMaterial.Icon.gmd_info).sizeDp(48) .color(ContextCompat.getColor(getContext(), R.color.md_green_500))); } setIndeterminate(true); mMillisToWait = Math.max(millisToWait, MIN_SHOW_TIME); dismiss(); }
Example #6
Source File: ExampleMaterialAboutActivity.java From material-about-library with Apache License 2.0 | 6 votes |
private MaterialAboutActionItem createDynamicItem(String subText, final Context c) { final MaterialAboutActionItem item = new MaterialAboutActionItem.Builder() .text("Dynamic UI") .subText(subText) .icon(new IconicsDrawable(c) .icon(CommunityMaterial.Icon.cmd_refresh) .sizeDp(18)) .build(); item.setOnClickAction(new MaterialAboutItemOnClickAction() { @Override public void onClick() { getList().getCards().get(4).getItems().remove(getList().getCards().get(4).getItems().indexOf(item)); int newIndex = ((int) (Math.random() * 5)); getList().getCards().get(4).getItems().add(newIndex, item); item.setSubText("Random number: " + ((int) (Math.random() * 10))); setMaterialAboutList(getList()); } }); return item; }
Example #7
Source File: CocoQuery.java From COCOFramework with Apache License 2.0 | 6 votes |
/** * Sets a iconic image to right of textview/buttonview with padding * * @param icon * @return */ public ExtViewQuery rightDrawable(IIcon icon, int sizedp, int padding) { if (view instanceof TextView) { IconicsDrawable draw = new IconicsDrawable(context, icon); draw.color((((TextView) view).getCurrentTextColor())); if (padding < 0) padding = 8; draw.paddingDp(padding); if (sizedp > 0) { draw.sizeDp(sizedp); } else { draw.sizeDp((int) ((TextView) view).getTextSize()); } Drawable[] ds = ((TextView) view).getCompoundDrawables(); ((TextView) view).setCompoundDrawablesWithIntrinsicBounds(ds[0], ds[1], draw, ds[3]); } return self(); }
Example #8
Source File: PostFragment.java From hipda with GNU General Public License v2.0 | 6 votes |
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { menu.clear(); inflater.inflate(R.menu.menu_reply, menu); menu.findItem(R.id.action_upload_img).setIcon(new IconicsDrawable(getActivity(), GoogleMaterial.Icon.gmd_add_a_photo).actionBar() .color(HiSettingsHelper.getInstance().getToolbarTextColor())); if (HiUtils.CLIENT_TID == Utils.parseInt(mTid)) { MenuItem menuItem = menu.findItem(R.id.action_device_info); menuItem.setIcon(new IconicsDrawable(getActivity(), GoogleMaterial.Icon.gmd_bug_report).actionBar() .color(HiSettingsHelper.getInstance().getToolbarTextColor())); menuItem.setVisible(true); } super.onCreateOptionsMenu(menu, inflater); }
Example #9
Source File: ImageHolder.java From MaterialDrawer-Xamarin with Apache License 2.0 | 6 votes |
/** * this only handles Drawables * * @param ctx * @param iconColor * @param tint * @return */ public Drawable decideIcon(Context ctx, int iconColor, boolean tint, int paddingDp) { Drawable icon = getIcon(); if (mIIcon != null) { icon = new IconicsDrawable(ctx, mIIcon).color(iconColor).sizeDp(24).paddingDp(paddingDp); } else if (getIconRes() != -1) { icon = UIUtils.getCompatDrawable(ctx, getIconRes()); } else if (getUri() != null) { try { InputStream inputStream = ctx.getContentResolver().openInputStream(getUri()); icon = Drawable.createFromStream(inputStream, getUri().toString()); } catch (FileNotFoundException e) { //no need to handle this } } //if we got an icon AND we have auto tinting enabled AND it is no IIcon, tint it ;) if (icon != null && tint && mIIcon == null) { icon = icon.mutate(); icon.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN); } return icon; }
Example #10
Source File: AccountHeaderBuilder.java From MaterialDrawer-Xamarin with Apache License 2.0 | 6 votes |
/** * helper method to toggle the collection * * @param ctx */ protected void toggleSelectionList(Context ctx) { if (mDrawer != null) { //if we already show the list. reset everything instead if (mDrawer.switchedDrawerContent()) { resetDrawerContent(ctx); mSelectionListShown = false; } else { //build and set the drawer selection list buildDrawerSelectionList(); // update the arrow image within the drawer mAccountSwitcherArrow.setImageDrawable(new IconicsDrawable(ctx, MaterialDrawerFont.Icon.mdf_arrow_drop_up).sizeRes(R.dimen.material_drawer_account_header_dropdown).paddingRes(R.dimen.material_drawer_account_header_dropdown_padding).color(ColorHolder.color(mTextColor, ctx, R.attr.material_drawer_header_selection_text, R.color.material_drawer_header_selection_text))); mSelectionListShown = true; } } }
Example #11
Source File: ThreadListFragment.java From hipda with GNU General Public License v2.0 | 6 votes |
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { menu.clear(); inflater.inflate(R.menu.menu_thread_list, menu); if (mForumId == HiUtils.FID_BS) { mForumTypeMenuItem = menu.findItem(R.id.action_filter_by_type); mForumTypeMenuItem.setVisible(true); String typeId = HiSettingsHelper.getInstance().getBSTypeId(); int typeIdIndex = HiUtils.getBSTypeIndexByFid(typeId); if (typeIdIndex == -1) typeIdIndex = 0; if (mCtx != null) mForumTypeMenuItem.setIcon(new IconicsDrawable(mCtx, HiUtils.BS_TYPE_ICONS[typeIdIndex]) .color(HiSettingsHelper.getInstance().getToolbarTextColor()).actionBar()); } MenuItem showStickItem = menu.findItem(R.id.action_show_stick_threads); showStickItem.setChecked(HiSettingsHelper.getInstance().isShowStickThreads()); super.onCreateOptionsMenu(menu, inflater); }
Example #12
Source File: StatusActivity.java From 600SeriesAndroidUploader with MIT License | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_status); Toolbar toolbar = findViewById(R.id.toolbar); if (toolbar != null) { setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeAsUpIndicator( new IconicsDrawable(this) .icon(GoogleMaterial.Icon.gmd_close) .color(Color.WHITE) .sizeDp(24) ); getSupportActionBar().setElevation(0); getSupportActionBar().setTitle("add"); } }
Example #13
Source File: ThreadListFragment.java From hipda with GNU General Public License v2.0 | 6 votes |
@Override public View getView(int position, View convertView, @NonNull ViewGroup parent) { View row; if (convertView == null) { LayoutInflater inflater = getActivity().getLayoutInflater(); row = inflater.inflate(R.layout.item_forum_type, parent, false); } else { row = convertView; } ImageView icon = row.findViewById(R.id.forum_type_icon); TextView text = row.findViewById(R.id.forum_type_text); text.setText(HiUtils.BS_TYPES[position]); if (position == HiUtils.getBSTypeIndexByFid(HiSettingsHelper.getInstance().getBSTypeId())) { icon.setImageDrawable(new IconicsDrawable(getActivity(), HiUtils.BS_TYPE_ICONS[position]).color(ColorHelper.getColorAccent(getActivity())).sizeDp(20)); text.setTextColor(ColorHelper.getColorAccent(getActivity())); } else { icon.setImageDrawable(new IconicsDrawable(getActivity(), HiUtils.BS_TYPE_ICONS[position]).color(ColorHelper.getTextColorPrimary(getActivity())).sizeDp(20)); text.setTextColor(ColorHelper.getTextColorPrimary(getActivity())); } return row; }
Example #14
Source File: SelectAlbumBuilder.java From leafpicrevived with GNU General Public License v3.0 | 6 votes |
@NonNull @Override public View getView(int position, View convertView, @NonNull ViewGroup parent) { View view = super.getView(position, convertView, parent); GoogleMaterial.Icon icon; switch (position) { case INTERNAL_STORAGE: icon = GoogleMaterial.Icon.gmd_storage; break; default: icon = GoogleMaterial.Icon.gmd_sd_card; break; } ((ImageView) view.findViewById(R.id.volume_image)).setImageDrawable(new IconicsDrawable(getContext()).icon(icon).size(IconicsSize.dp(24)).color(IconicsColor.colorInt(Color.WHITE))); return view; }
Example #15
Source File: CropImageActivity.java From NMSAlphabetAndroidApp with MIT License | 6 votes |
protected void init() { Glide.with(this) .load(imagePath) .asBitmap() .into(new SimpleTarget<Bitmap>(1024, 1024) { @Override public void onResourceReady(Bitmap bitmap, GlideAnimation anim) { cropView.setImageBitmap(bitmap); } }); Drawable fabIcon = new IconicsDrawable(this) .icon(MaterialDesignIconic.Icon.gmi_crop) .color(Color.WHITE) .sizeDp(50); fabView.setImageDrawable(fabIcon); }
Example #16
Source File: IconUtils.java From outlay with Apache License 2.0 | 5 votes |
@Deprecated public static Drawable getToolbarIcon(Context context, IIcon icon, int paddingDp) { return new IconicsDrawable(context) .icon(icon) .paddingDp(paddingDp) .color(Color.WHITE) .sizeDp(24); }
Example #17
Source File: MainActivity.java From WhatsAppBetaUpdater with GNU General Public License v3.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); setSupportActionBar(toolbar); this.appPreferences = WhatsAppBetaUpdaterApplication.getAppPreferences(); // Set drawable to FAB fab.setImageDrawable(new IconicsDrawable(this).icon(MaterialDesignIconic.Icon.gmi_download).color(Color.WHITE).sizeDp(24)); // Check if there is an app update and show dialog if (appPreferences.getShowAppUpdates()) { new UtilsAsync.LatestAppVersion(this, UtilsApp.getAppVersionName(this), new UpdaterCallback() { @Override public void onFinished(Update update, boolean isUpdateAvailable) { if (isUpdateAvailable) UtilsDialog.showUpdateAvailableDialog(MainActivity.this, update); } @Override public void onLoading() {} @Override public void onError(UpdaterError error) {} }).execute(); } // PullToRefresh swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { new GetLatestVersion(MainActivity.this, UtilsWhatsApp.getInstalledWhatsAppVersion(MainActivity.this), MainActivity.this).execute(); swipeRefreshLayout.setRefreshing(false); } }); swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light); }
Example #18
Source File: IconicsHelper.java From PowerSwitch_Android with GNU General Public License v3.0 | 5 votes |
/** * Get "Search" icon * * @param context any suitable context * @return "Search" icon */ public static IconicsDrawable getSearchIcon(Context context, int color) { IconicsDrawable iconicsDrawable = new IconicsDrawable(context, MaterialDesignIconic.Icon.gmi_search) .color(color) .sizeDp(24); return iconicsDrawable; }
Example #19
Source File: MainActivity.java From WhatsAppBetaUpdater with GNU General Public License v3.0 | 5 votes |
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); menu.findItem(R.id.action_donate).setIcon(new IconicsDrawable(this).icon(MaterialDesignIconic.Icon.gmi_paypal_alt).color(Color.WHITE).actionBar()); menu.findItem(R.id.action_settings).setIcon(new IconicsDrawable(this).icon(MaterialDesignIconic.Icon.gmi_settings).color(Color.WHITE).actionBar()); return true; }
Example #20
Source File: IconicsHelper.java From PowerSwitch_Android with GNU General Public License v3.0 | 5 votes |
/** * Get "Attention" icon * * @param context any suitable context * @return "Attention" icon */ public static IconicsDrawable getAttentionIcon(Context context) { IconicsDrawable iconicsDrawable = new IconicsDrawable(context, GoogleMaterial.Icon.gmd_report_problem) .color(ContextCompat.getColor(context, R.color.color_red_a700)) .sizeDp(24); return iconicsDrawable; }
Example #21
Source File: IconicsHelper.java From PowerSwitch_Android with GNU General Public License v3.0 | 5 votes |
/** * Get "Up" icon * * @param context any suitable context * @return "Up" icon */ public static Drawable getUpIcon(Context context) { final int color = ThemeHelper.getThemeAttrColor(context, android.R.attr.textColorPrimary); IconicsDrawable iconicsDrawable = new IconicsDrawable(context, GoogleMaterial.Icon.gmd_arrow_upward) .sizeDp(24) .color(color); return iconicsDrawable; }
Example #22
Source File: MainActivity.java From Faker with Apache License 2.0 | 5 votes |
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu_main, menu); MenuItem menuItem = menu.findItem(R.id.action_about); menuItem.setIcon(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_info_outline).actionBar().color(Color.WHITE)); return super.onCreateOptionsMenu(menu); }
Example #23
Source File: IconicsHelper.java From PowerSwitch_Android with GNU General Public License v3.0 | 5 votes |
/** * Get "Delete" icon * * @param context any suitable context * @return "Delete" icon */ public static IconicsDrawable getDeleteIcon(Context context, int color) { IconicsDrawable iconicsDrawable = new IconicsDrawable(context, MaterialDesignIconic.Icon.gmi_delete) .color(color) .sizeDp(36); return iconicsDrawable; }
Example #24
Source File: IconUtils.java From outlay with Apache License 2.0 | 5 votes |
@Deprecated public static Drawable getIconMaterialIcon(Context context, IIcon icon, int color, int sizeRes, int paddingDp) { return new IconicsDrawable(context) .icon(icon) .color(color) .paddingDp(paddingDp) .sizeRes(sizeRes); }
Example #25
Source File: IconUtils.java From outlay with Apache License 2.0 | 5 votes |
@Deprecated public static Drawable getToolbarIcon(Context context, IIcon icon) { return new IconicsDrawable(context) .icon(icon) .color(Color.WHITE) .sizeDp(24); }
Example #26
Source File: MainActivity.java From ROMInstaller with MIT License | 5 votes |
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuItem mSettings, mChangelog, mDefaultOptions; getMenuInflater().inflate(R.menu.activity_main_menu, menu); IconicsDrawable mSettingsIcon = new IconicsDrawable(MainActivity.this) .icon(ControlCenter.SETTINGS_ICON) .actionBar() .color(Color.WHITE) .sizeDp(30); IconicsDrawable mChangelogIcon = new IconicsDrawable(MainActivity.this) .icon(ControlCenter.CHANGELOG_ICON) .actionBar() .color(Color.WHITE) .sizeDp(30); IconicsDrawable mDefaultValuesIcon = new IconicsDrawable(MainActivity.this) .icon(ControlCenter.DEFAULT_VALUES_ICON) .actionBar() .color(Color.WHITE) .sizeDp(35); mSettings = menu.findItem(R.id.settings); mSettings.setIcon(mSettingsIcon); mChangelog = menu.findItem(R.id.changelog); mChangelog.setIcon(mChangelogIcon); mDefaultOptions = menu.findItem(R.id.default_values); mDefaultOptions.setIcon(mDefaultValuesIcon); return true; }
Example #27
Source File: SearchFragment.java From hipda with GNU General Public License v2.0 | 5 votes |
@Override public void onBindViewHolderImpl(RecyclerView.ViewHolder viewHolder, final int position) { final ViewHolderImpl holder = (ViewHolderImpl) viewHolder; SearchBean item = getItem(position); holder.textview.setText(item.getDescription()); Forum forum = HiUtils.getForumByFid(Utils.parseInt(item.getForum())); if (forum != null) { holder.imageview.setImageDrawable(new IconicsDrawable(getActivity(), forum.getIcon()).sizeDp(16).color(Color.GRAY)); } else { holder.imageview.setImageDrawable(mIconDrawable); } holder.ib_remove.setImageDrawable(mIbDrawable); holder.ib_remove.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mHistoryAdapter.getDatas().remove(position); mHistoryAdapter.notifyItemRemoved(position); mHistoryAdapter.notifyItemRangeChanged(position, mHistoryAdapter.getItemCount()); saveQueries(); new Handler().postDelayed(new Runnable() { @Override public void run() { mHistoryAdapter.notifyDataSetChanged(); } }, 350); } }); }
Example #28
Source File: MainActivity.java From BottomDialogs with Apache License 2.0 | 5 votes |
@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); menu.findItem(R.id.action_about).setIcon(new IconicsDrawable(this).icon(MaterialDesignIconic.Icon.gmi_info).color(Color.WHITE).actionBar()); return true; }
Example #29
Source File: MainActivity.java From BottomDialogs with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setImageDrawable(new IconicsDrawable(this).icon(MaterialDesignIconic.Icon.gmi_github).color(Color.WHITE).sizeDp(24)); }
Example #30
Source File: MainActivity.java From NMSAlphabetAndroidApp with MIT License | 5 votes |
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); proUpgradeMenuItem = menu.findItem(R.id.pro_upgrade).setIcon(new IconicsDrawable(this) .icon(MaterialDesignIconic.Icon.gmi_shopping_basket) .color(Color.WHITE) .sizeDp(20)); menu.findItem(R.id.settings).setIcon(new IconicsDrawable(this) .icon(MaterialDesignIconic.Icon.gmi_tune) .color(Color.WHITE) .sizeDp(20)); updateUi(); return true; }