当前位置: 首页>>代码示例>>Java>>正文


Java IconicsDrawable类代码示例

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


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

示例1: buildAuthor

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
private void buildAuthor(Context context, MaterialAboutCard.Builder authorCardBuilder) {
    authorCardBuilder.title(getString(R.string.about_author))
            .addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_authorname))
                    .subText(getString(R.string.about_country))
                    .icon(new IconicsDrawable(context)
                            .icon(GoogleMaterial.Icon.gmd_person)
                            .color(Color.GRAY)
                            .sizeDp(18))
                    .build())
            .addItem(ConvenienceBuilder.createEmailItem(context, new IconicsDrawable(context)
                    .icon(GoogleMaterial.Icon.gmd_email)
                    .color(Color.GRAY)
                    .sizeDp(18), getString(R.string.about_sendemail), true, getString(R.string.about_emailaddress), ""))
            .addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_github))
                    .subText(getString(R.string.about_githubusername))
                    .icon(new IconicsDrawable(context)
                            .icon(CommunityMaterial.Icon.cmd_github_circle)
                            .color(Color.GRAY)
                            .sizeDp(18))
                    .setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(context, Uri.parse("https://github.com/Jiikuy/") ))
                    .build());
}
 
开发者ID:Jiikuy,项目名称:VelocityCalculator,代码行数:25,代码来源:AboutActivity.java

示例2: buildContribute

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
private void buildContribute(Context context, MaterialAboutCard.Builder contributeCardBuilder) {
    contributeCardBuilder.title(getString(R.string.about_contribute))
            .addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_reportissue))
                    .subText(getString(R.string.about_reportissuehere))
                    .icon(new IconicsDrawable(context)
                            .icon(GoogleMaterial.Icon.gmd_bug_report)
                            .color(Color.GRAY)
                            .sizeDp(18))
                    .setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(context, Uri.parse("https://github.com/Jiikuy/VelocityCalculator/issues")))
                    .build())
            .addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_translate))
                    .subText(getString(R.string.about_translatehere))
                    .icon(new IconicsDrawable(context)
                            .icon(GoogleMaterial.Icon.gmd_translate)
                            .color(Color.GRAY)
                            .sizeDp(18))
                    .setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(context, Uri.parse("https://www.poeditor.com/join/project/EIvRjgfGRO")))
                    .build());
}
 
开发者ID:Jiikuy,项目名称:VelocityCalculator,代码行数:22,代码来源:AboutActivity.java

示例3: onCreate

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_status);

    Toolbar 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("Status");
    }
}
 
开发者ID:pazaan,项目名称:600SeriesAndroidUploader,代码行数:21,代码来源:StatusActivity.java

示例4: init

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
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);
}
 
开发者ID:adrielcafe,项目名称:NMSAlphabetAndroidApp,代码行数:17,代码来源:CropImageActivity.java

示例5: initUI

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
public void initUI() {
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    info = (TextView) findViewById(R.id.progress_status_text);
    progressBar = (ProgressBar) findViewById(R.id.progressbar);
    errorView = (ImageView) findViewById(R.id.error_view);
    viewLog = (Button) findViewById(R.id.progress_watch_log);

    viewLog.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            while (SimpleFunctions.debugMessages.size() > 0) {
                debugLog += SimpleFunctions.debugMessages.remove() + "\n";
            }
            new AlertDialog.Builder(ProgressActivity.this)
                    .setMessage(debugLog)
                    .setTitle("Debug Log")
                    .setPositiveButton(android.R.string.ok, null)
                    .show();
        }
    });

    errorView.setImageDrawable(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_warning).color(
            SimpleFunctions.colorFromTheme(this, android.R.attr.textColorSecondary)).sizeDp(100));
}
 
开发者ID:vit1-irk,项目名称:idec-mobile,代码行数:27,代码来源:ProgressActivity.java

示例6: onCreateOptionsMenu

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    final Activity activity = getActivity();

    int iconColor = SimpleFunctions.colorFromTheme(activity, R.attr.menuIconColor);
    if (echoarea.equals("_favorites")) {
        MenuItem favItem = menu.findItem(R.id.action_favorites_remove_all);
        favItem.setVisible(true);
        favItem.setIcon(new IconicsDrawable(activity,
                GoogleMaterial.Icon.gmd_clear_all).actionBar()
                .color(iconColor));
    }

    if (echoarea.equals("_unread") || echoarea.equals("_search_results")) {
        MenuItem action_unread_only = menu.findItem(R.id.action_display_unread_only);
        action_unread_only.setVisible(false);
    }

    if (countMessages <= 1) menu.findItem(R.id.action_search).setVisible(false);

    super.onCreateOptionsMenu(menu, inflater);
}
 
开发者ID:vit1-irk,项目名称:idec-mobile,代码行数:23,代码来源:MessageListFragment.java

示例7: onCreateView

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_what_to_manage, container, false);
    unbinder = ButterKnife.bind(this, view);
    activity = getActivity();

    secondaryText = SimpleFunctions.colorFromTheme(activity, android.R.attr.textColorSecondary);
    final int iconSize = 40;
    final GoogleMaterial.Icon icons[] = {Icon.gmd_message, Icon.gmd_folder_shared, Icon.gmd_cached};

    ButterKnife.apply(buttons, new ButterKnife.Action<Button>() {
        @Override
        public void apply(@NonNull Button btn, int index) {
            btn.setCompoundDrawablesWithIntrinsicBounds(null, new IconicsDrawable(activity, icons[index])
                    .sizeDp(iconSize).color(secondaryText), null, null);
            btn.setCompoundDrawablePadding(iconSize);
        }
    });

    return view;
}
 
开发者ID:vit1-irk,项目名称:idec-mobile,代码行数:23,代码来源:WhatToManageFragment.java

示例8: initialize

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
private void initialize(Context context, AttributeSet attrs, int defStyleAttr) {
	if (isInEditMode()) {
		return;
	}

	final TypedArray a = context.obtainStyledAttributes(attrs, com.mikepenz.iconics.core.R.styleable.IconicsImageView, defStyleAttr, 0);
	mColor = a.getColor(com.mikepenz.iconics.core.R.styleable.IconicsImageView_iiv_color, 0);
	mSize = a.getDimensionPixelSize(com.mikepenz.iconics.core.R.styleable.IconicsImageView_iiv_size, -1);
	mPadding = a.getDimensionPixelSize(com.mikepenz.iconics.core.R.styleable.IconicsImageView_iiv_padding, -1);
	mContourColor = a.getColor(com.mikepenz.iconics.core.R.styleable.IconicsImageView_iiv_contour_color, 0);
	mContourWidth = a.getDimensionPixelSize(com.mikepenz.iconics.core.R.styleable.IconicsImageView_iiv_contour_width, -1);
	mBackgroundColor = a.getColor(com.mikepenz.iconics.core.R.styleable.IconicsImageView_iiv_background_color, 0);
	mCornerRadius = a.getDimensionPixelSize(com.mikepenz.iconics.core.R.styleable.IconicsImageView_iiv_corner_radius, -1);

	if (a.hasValue(com.mikepenz.iconics.core.R.styleable.IconicsImageView_iiv_icon)) {
		String icon = a.getString(com.mikepenz.iconics.core.R.styleable.IconicsImageView_iiv_icon);
		setAttributes(new IconicsDrawable(getContext(), icon));
	}

	a.recycle();
}
 
开发者ID:frodoking,项目名称:GithubAndroidClient,代码行数:22,代码来源:FrescoAndIconicsImageView.java

示例9: onCreateOptionsMenu

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    if (menu == null) {
        return false;
    }
    mMenu = menu;
    if (mComponent != null && !hasInitMenu) {
        hasInitMenu = true;
        getMenuInflater().inflate(R.menu.menu_icon_dialog, menu);
        mShowOriginMenuItem = menu.findItem(R.id.action_show_origin_icon);
        mShowOriginMenuItem.setCheckable(false);
        findViewById(mShowOriginMenuItem.getItemId()).setAlpha(0);
        mShowOriginMenuItem.setIcon(new IconicsDrawable(mContext, gmd_compare)
                .sizeDp(24).paddingDp(2)
                .color(ResourceUtil
                        .getAttrColor(mContext, android.R.attr.textColorSecondary))
        );
    }
    return super.onCreateOptionsMenu(menu);
}
 
开发者ID:sorcererXW,项目名称:SorceryIconPack,代码行数:21,代码来源:IconDialogActivity.java

示例10: applyTo

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
/**
 * sets an existing image to the imageView
 *
 * @param imageView
 * @param tag       used to identify imageViews and define different placeholders
 * @return true if an image was set
 */
@Override
public boolean applyTo(ImageView imageView, String tag) {
    if (getUri() != null) {
        boolean consumed = DrawerImageLoader.getInstance().setImage(imageView, getUri(), tag);
        if (!consumed) {
            imageView.setImageURI(getUri());
        }
    } else if (getIcon() != null) {
        imageView.setImageDrawable(getIcon());
    } else if (getBitmap() != null) {
        imageView.setImageBitmap(getBitmap());
    } else if (getIconRes() != -1) {
        imageView.setImageResource(getIconRes());
    } else if (mIIcon != null) {
        imageView.setImageDrawable(new IconicsDrawable(imageView.getContext(), mIIcon).actionBar());
    } else {
        imageView.setImageBitmap(null);
        return false;
    }
    return true;
}
 
开发者ID:LeMinhAn,项目名称:MaterialDrawer,代码行数:29,代码来源:ImageHolder.java

示例11: decideIcon

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:LeMinhAn,项目名称:MaterialDrawer,代码行数:33,代码来源:ImageHolder.java

示例12: toggleSelectionList

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
/**
 * 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;
        }
    }
}
 
开发者ID:FreedomZZQ,项目名称:YouJoin-Android,代码行数:22,代码来源:AccountHeaderBuilder.java

示例13: get

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
public static Drawable get(Context context, String name, int color, Size size){
    Drawable icon=null;
    if(name.startsWith("faw")){
        icon = new IconicsDrawable(context)
                .icon(FontAwesome.Icon.valueOf(name))
                .color(color)
                .sizeDp(size.value)
                .paddingDp(16);
    } else if(name.startsWith("gmd")){
        icon = new IconicsDrawable(context)
                .icon(GoogleMaterial.Icon.valueOf(name))
                .color(color)
                .sizeDp(size.value)
                .paddingDp(16);
    }
    return icon;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Utilities,代码行数:18,代码来源:Icon.java

示例14: onCreate

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_network_list);

    final ActionBar actionBar = getSupportActionBar();

    if (actionBar != null) {
        actionBar.setHomeAsUpIndicator(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_arrow_back).color(Color.WHITE).sizeDp(IconicsDrawable.ANDROID_ACTIONBAR_ICON_SIZE_DP).paddingDp(IconicsDrawable.ANDROID_ACTIONBAR_ICON_SIZE_PADDING_DP));
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setTitle(R.string.title_activity_network);
    }


    ListView List = (ListView)findViewById(R.id.network_list);
    listWifiNetworks(List);
}
 
开发者ID:indianpoptart,项目名称:RadioControl,代码行数:18,代码来源:NetworkListActivity.java

示例15: onCreate

import com.mikepenz.iconics.IconicsDrawable; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.preference);
    ButterKnife.bind(this);

    setSupportActionBar(toolbar);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    toolbar.setNavigationIcon(new IconicsDrawable(this)
            .icon(CommunityMaterial.Icon.cmd_keyboard_backspace)
            .color(Color.WHITE)
            .actionBar());

    toolbar.setTitleTextColor(Color.WHITE);

    FragmentManager manager = getFragmentManager();
    FragmentTransaction transaction = manager.beginTransaction();
    PreferenceFrag myPreference = new PreferenceFrag(); //宣告剛剛做好的PreferenceFragment
    transaction.replace(R.id.content_wrapper, myPreference); //將content內容取代為myPreference
    transaction.commit(); //送出交易

}
 
开发者ID:ccjeng,项目名称:News,代码行数:24,代码来源:Preference.java


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