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

Java Icon类代码示例

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

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



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

示例1: showError

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
/**
 * Show the error notification as a modal dialog, according to the provided details.
 *
 * @param errorResId      The resource ID of the error message.
 * @param icon            The error icon. This is currently ignored here.
 * @param actionTextResId The resource ID of the action button text.
 * @param actionListener  The callback to be invoked when the action button is clicked.
 */
@Override
public void showError(@StringRes final int errorResId,
                      @Nullable final Icon icon,
                      @StringRes final int actionTextResId,
                      @Nullable final View.OnClickListener actionListener) {
    if (baseFragment.isResumed()) {
        AlertDialogFragment.newInstance(0, errorResId,
                actionListener == null ? null :
                        new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                actionListener.onClick(((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE));
                            }
                        }
        ).show(baseFragment.getChildFragmentManager(), null);
    }
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:26,代码来源:DialogErrorNotification.java


示例2: setupNavItem

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
private void setupNavItem(int item, Icon icon) {
    MenuItem navItem = navigationView.getMenu().findItem(item);

    int color = ContextCompat.getColor(this, R.color.colorTextPrimary);

    SpannableString s = new SpannableString(navItem.getTitle());
    s.setSpan(new ForegroundColorSpan(color), 0, s.length(), 0);
    navItem.setTitle(s);

    navItem.setIcon(new IconDrawable(this, icon).color(color));
}
 
开发者ID:wcomartin,项目名称:PlexPy-Remote,代码行数:12,代码来源:NavBaseActivity.java


示例3: CustomTypefaceSpan

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
public CustomTypefaceSpan(@NonNull TextView view, @NonNull Icon icon,
        @NonNull Typeface type, @Size float iconSizePx,
        @FloatRange(from = -1f, to = 1f) float iconSizeRatio,
        @ColorInt int iconColor, @NonNull Animation animation,
        boolean baselineAligned) {
    this.view = view;
    this.animation = animation;
    this.baselineAligned = baselineAligned;
    this.icon = String.valueOf(icon.character());
    this.type = type;
    this.iconSizePx = iconSizePx;
    this.iconSizeRatio = iconSizeRatio;
    this.iconColor = iconColor;
    this.mirrorable = SDK_INT >= JELLY_BEAN_MR1 && icon.supportsRtl();
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:16,代码来源:CustomTypefaceSpan.java


示例4: IconFontDescriptorWrapper

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
public IconFontDescriptorWrapper(@NonNull IconFontDescriptor iconFontDescriptor) {
    this.iconFontDescriptor = iconFontDescriptor;
    iconsByKey = new HashMap<String, Icon>();
    Icon[] characters = iconFontDescriptor.characters();
    for (int i = 0, charactersLength = characters.length; i < charactersLength; i++) {
        Icon icon = characters[i];
        iconsByKey.put(icon.key(), icon);
    }
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:10,代码来源:IconFontDescriptorWrapper.java


示例5: getIcon

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
@Nullable
public final Icon getIcon() {
    Drawable drawable = getDrawable();
    if (drawable instanceof IconDrawable) {
        return ((IconDrawable) drawable).getIcon();
    }
    return null;
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:9,代码来源:IconImageView.java


示例6: showErrorMessage

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
/**
 * Shows the error message with the given icon, if the web page failed to load
 *
 * @param errorMsg  The error message to show
 * @param errorIcon The error icon to show with the error message
 */
private void showErrorMessage(@StringRes int errorMsg, @NonNull Icon errorIcon) {
    if (!pageIsLoaded) {
        tryToClearWebView();
        showErrorView(getResources().getString(errorMsg), errorIcon);
    }
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:13,代码来源:AuthenticatedWebView.java


示例7: showErrorView

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
private void showErrorView(@NonNull String errorMsg, @NonNull Icon errorIcon) {
    if (isManuallyReloadable) {
        fullScreenErrorNotification.showError(errorMsg, errorIcon, R.string.lbl_reload, new OnClickListener() {
            @Override
            public void onClick(View v) {
                onRefresh();
            }
        });
    } else {
        fullScreenErrorNotification.showError(errorMsg, errorIcon, 0, null);
    }
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:13,代码来源:AuthenticatedWebView.java


示例8: getIndeterminateIcon

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
@Nullable
public final Icon getIndeterminateIcon() {
    Drawable drawable = getIndeterminateDrawable();
    if (drawable instanceof IconDrawable) {
        return ((IconDrawable) drawable).getIcon();
    }
    return null;
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:9,代码来源:IconProgressBar.java


示例9: bindNumberCommentsView

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
private void bindNumberCommentsView(NumberResponsesViewHolder holder, DiscussionComment response) {
    String text;
    Icon icon;

    int numChildren = response == null ? 0 : response.getChildCount();

    if (response.getChildCount() == 0) {
        if (discussionThread.isClosed() || courseData.isDiscussionBlackedOut()) {
            text = context.getString(R.string.discussion_add_comment_disabled_title);
            icon = FontAwesomeIcons.fa_lock;
        } else {
            text = context.getString(R.string.number_responses_or_comments_add_comment_label);
            icon = FontAwesomeIcons.fa_comment;
        }
    } else {
        text = context.getResources().getQuantityString(
                R.plurals.number_responses_or_comments_comments_label, numChildren, numChildren);
        icon = FontAwesomeIcons.fa_comment;
    }

    holder.numberResponsesOrCommentsLabel.setText(text);
    TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(
            holder.numberResponsesOrCommentsLabel,
            new IconDrawable(context, icon)
                    .colorRes(context, R.color.edx_brand_gray_base)
                    .sizeRes(context, R.dimen.edx_small),
            null, null, null);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:29,代码来源:CourseDiscussionResponsesAdapter.java


示例10: showErrorMessage

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
private void showErrorMessage(String errorMsg, @NonNull Icon errorIcon) {
    errorTextView.setVisibility(View.VISIBLE);
    errorTextView.setText(errorMsg);
    errorTextView.setCompoundDrawablesWithIntrinsicBounds(null,
            new IconDrawable(this, errorIcon)
                    .sizeRes(this, R.dimen.content_unavailable_error_icon_size)
                    .colorRes(this, R.color.edx_brand_gray_back),
            null, null
    );
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:11,代码来源:RegisterActivity.java


示例11: addDetectedValueHeader

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
private static void addDetectedValueHeader(@NonNull ListView listView, @StringRes int labelRes, @NonNull String labelKey, @NonNull String labelValue, @NonNull String value, @NonNull Icon icon) {
    final TextView textView = (TextView) LayoutInflater.from(listView.getContext()).inflate(R.layout.edx_selectable_list_item, listView, false);
    {
        final SpannableString labelValueSpan = new SpannableString(labelValue);
        labelValueSpan.setSpan(new ForegroundColorSpan(listView.getResources().getColor(R.color.edx_brand_gray_base)), 0, labelValueSpan.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        textView.setText(ResourceUtil.getFormattedString(listView.getContext().getResources(), labelRes, labelKey, labelValueSpan));
    }
    Context context = textView.getContext();
    TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(textView,
            new IconDrawable(context, icon)
                    .sizeRes(context, R.dimen.edx_base)
                    .colorRes(context, R.color.edx_brand_gray_back)
            , null, null, null);
    listView.addHeaderView(textView, new FormOption(labelValue, value), true);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:16,代码来源:FormFieldSelectFragment.java


示例12: FragmentItemModel

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
public FragmentItemModel(@NonNull Class<? extends Fragment> fragmentClass, @NonNull CharSequence title,
                         Icon icon, Bundle args, FragmentStateListener listener) {
    if (args != null) {
        args.setClassLoader(fragmentClass.getClassLoader());
    }
    this.fragmentClass = fragmentClass;
    this.title = title;
    this.icon = icon;
    this.args = args;
    this.listener = listener;
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:12,代码来源:FragmentItemModel.java


示例13: showError

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
/**
 * Show the error notification with the message appropriate for the provided error.
 *
 * @param context         The Context, to be used for checking connectivity status.
 * @param error           The error that occurred while attempting to retrieve from or deliver to the
 *                        remote server. This may be an {@link IOException} if the request failed due to a
 *                        network failure, an {HttpResponseStatusException} if the failure was due to
 *                        receiving an error code, or any {@link Throwable} implementation if one was
 *                        thrown unexpectedly while creating the request or processing the response.
 * @param actionTextResId The resource ID of the action button text.
 * @param actionListener  The callback to be invoked when the action button is clicked.
 */
public void showError(@NonNull final Context context, @NonNull final Throwable error,
                      @StringRes int actionTextResId,
                      @Nullable View.OnClickListener actionListener) {
    @StringRes
    final int errorResId = ErrorUtils.getErrorMessageRes(context, error, this);
    final Icon icon = ErrorUtils.getErrorIcon(error);

    if (errorResId == R.string.app_version_unsupported) {
        actionTextResId = R.string.label_update;
        actionListener = AppStoreUtils.OPEN_APP_IN_APP_STORE_CLICK_LISTENER;
    }
    showError(errorResId, icon, actionTextResId, actionListener);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:26,代码来源:ErrorNotification.java


示例14: showError

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
/**
 * Show the error notification as a persistent Snackbar, according to the provided details.
 *
 * @param errorResId      The resource ID of the error message.
 * @param icon            The error icon. This is ignored here, since Snackbar doesn't really support
 *                        icons.
 * @param actionTextResId The resource ID of the action button text.
 * @param actionListener  The callback to be invoked when the action button is clicked.
 */
@Override
public void showError(@StringRes final int errorResId,
                      @Nullable final Icon icon,
                      @StringRes final int actionTextResId,
                      @Nullable final View.OnClickListener actionListener) {
    if (snackbar == null) {
        snackbar = Snackbar.make(view, errorResId, LENGTH_INDEFINITE);
        if (actionTextResId != 0) {
            // SnackBar automatically dimisses when the action item is pressed.
            // This workaround has been implemented to by pass that behaviour.
            snackbar.setAction(actionTextResId, new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                }
            });
        }
        snackbar.addCallback(new BaseTransientBottomBar.BaseCallback<Snackbar>() {
            @Override
            public void onDismissed(Snackbar transientBottomBar, int event) {
                super.onDismissed(transientBottomBar, event);
                snackbar = null;
            }
        });
        // By applying the listener to the button like we have done below, the Snackbar
        // doesn't automatically dismiss and we have to manually dismiss it.
        final Button actionButton = (Button) snackbar.getView().findViewById(android.support.design.R.id.snackbar_action);
        actionButton.setOnClickListener(actionListener);
        snackbar.show();
    }
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:41,代码来源:SnackbarErrorNotification.java


示例15: showError

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
/**
 * Show the error notification as an overlay message on top of the content area, according to
 * the provided details.
 * <p>
 * The root view will be determined by walking up the view tree to see if there is any view with
 * the ID of {@link R.id#content_error R.id.content_error}. If one is found, then that would be
 * used as the root. If not, then if the content view's parent is already a FrameLayout, then
 * that would be used; otherwise a new one will be created, inserted as the new parent, and used
 * as the root.
 *
 * @param errorMsg        The error message.
 * @param icon            The error icon.
 * @param actionTextResId The resource ID of the action button text.
 * @param actionListener  The callback to be invoked when the action button is clicked.
 */
public void showError(@NonNull final String errorMsg,
                      @Nullable final Icon icon,
                      @StringRes final int actionTextResId,
                      @Nullable final View.OnClickListener actionListener) {
    final ViewGroup root = findSuitableAncestorLayout();
    if (root == null) return;

    final View layoutView = root.findViewById(R.id.content_error);
    if (layoutView instanceof ViewGroup) {
        errorLayout = (ViewGroup) layoutView;
    } else {
        final LayoutInflater layoutInflater = LayoutInflater.from(view.getContext());
        errorLayout = (ViewGroup) layoutInflater.inflate(R.layout.content_error, root, false);
        root.addView(errorLayout);
    }
    final TextView messageView = (TextView) errorLayout.findViewById(R.id.content_error_text);
    final Button actionButton = (Button) errorLayout.findViewById(R.id.content_error_action);
    final IconImageView iconView = (IconImageView) errorLayout.findViewById(R.id.content_error_icon);

    messageView.setText(errorMsg);
    if (icon == null) {
        iconView.setVisibility(GONE);
    } else {
        iconView.setVisibility(VISIBLE);
        iconView.setIcon(icon);
    }
    if (actionTextResId == 0 || actionListener == null) {
        actionButton.setVisibility(GONE);
    } else {
        actionButton.setVisibility(VISIBLE);
        actionButton.setText(actionTextResId);
        actionButton.setOnClickListener(actionListener);
    }

    view.setVisibility(GONE);
    errorLayout.setVisibility(VISIBLE);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:53,代码来源:FullScreenErrorNotification.java


示例16: characters

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
@Override
public Icon[] characters() {
    return EcIcons.values();
}
 
开发者ID:remerber,项目名称:FastEc,代码行数:5,代码来源:FontEcModule.java


示例17: characters

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
@Override
public Icon[] characters() {
    return BitpieIcon.values();
}
 
开发者ID:chaincloud-dot-com,项目名称:chaincloud-v,代码行数:5,代码来源:BitpieIconFontDescriptor.java


示例18: setMenuItem

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
protected final void setMenuItem(Icon icon, int color, MenuItem menuItem) {
    menuItem.setIcon(
            new IconDrawable(this, icon)
                    .colorRes(color)
                    .actionBarSize());
}
 
开发者ID:vihuela,项目名称:Lay-s,代码行数:7,代码来源:ActivityPresenter.java


示例19: getIcon

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
@CheckResult
@Nullable
public Icon getIcon(@NonNull String key) {
    return iconsByKey.get(key);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:6,代码来源:IconFontDescriptorWrapper.java


示例20: hasIcon

import com.joanzapata.iconify.Icon; //导入依赖的package包/类
@CheckResult
public boolean hasIcon(@NonNull Icon icon) {
    return iconsByKey.values().contains(icon);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:5,代码来源:IconFontDescriptorWrapper.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java AssetRendererFactory类代码示例发布时间:2022-05-22
下一篇:
Java ConstraintKind类代码示例发布时间: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