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


Java ColorRes类代码示例

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


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

示例1: newInstance

import android.support.annotation.ColorRes; //导入依赖的package包/类
public static VerificationFragment newInstance(@StringRes int title,
                                               @StringRes int content,
                                               @ColorRes int color,
                                               int position) {

    VerificationFragment fragmentInfo = new VerificationFragment();

    Bundle bundle = new Bundle(4);
    bundle.putInt("title", title);
    bundle.putInt("content", content);
    bundle.putInt("color", color);
    bundle.putInt("order", position);

    fragmentInfo.setArguments(bundle);

    return fragmentInfo;
}
 
开发者ID:LCA311,项目名称:leoapp-sources,代码行数:18,代码来源:VerificationFragment.java

示例2: setStatusColorRes

import android.support.annotation.ColorRes; //导入依赖的package包/类
@Override
public void setStatusColorRes(@ColorRes int colorRes) {
    Activity activity = mActivityRef.get();
    if (activity != null) {
        int color = ContextCompat.getColor(activity, colorRes);
        setStatusColor(color);
    }
}
 
开发者ID:ls1110924,项目名称:ImmerseMode,代码行数:9,代码来源:NormalImmerseMode.java

示例3: setMsgColor

import android.support.annotation.ColorRes; //导入依赖的package包/类
@Override
public BuildBean setMsgColor(@ColorRes int colorRes) {
    if (colorRes > 0) {
        this.msgTxtColor = colorRes;
    }
    return this;
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:8,代码来源:BuildBean.java

示例4: setNavigationColorRes

import android.support.annotation.ColorRes; //导入依赖的package包/类
@Override
public void setNavigationColorRes(@ColorRes int colorRes) {
    Activity activity = mActivityRef.get();
    if (activity != null) {
        int color = ContextCompat.getColor(activity, colorRes);
        setNavigationColor(color);
    }
}
 
开发者ID:ls1110924,项目名称:ImmerseMode,代码行数:9,代码来源:TlSbNNbImmerseMode.java

示例5: getColorValue

import android.support.annotation.ColorRes; //导入依赖的package包/类
public int getColorValue(@ColorRes int color) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        return getColor(color);
    } else {
        return getResources().getColor(color);
    }
}
 
开发者ID:approov,项目名称:AppAuth-OAuth2-Books-Demo,代码行数:8,代码来源:BooksApp.java

示例6: setColors

import android.support.annotation.ColorRes; //导入依赖的package包/类
public void setColors(@ColorRes int... colorResIds) {
    int colorsCount = Math.min(colorResIds.length, mCount);
    int[] colorRes = new int[colorsCount];
    for (int i = 0; i < colorRes.length; i++) {
        colorRes[i] = ContextCompat.getColor(context, colorResIds[i]);
    }
    setColorSchemeColors(colorRes);
}
 
开发者ID:yanyiqun001,项目名称:goRefresh,代码行数:9,代码来源:MulRingProgressBar.java

示例7: setColorSchemeResources

import android.support.annotation.ColorRes; //导入依赖的package包/类
public void setColorSchemeResources(@ColorRes int... colorResIds) {
    Resources res = getResources();
    int[] colorRes = new int[colorResIds.length];
    for (int i = 0; i < colorResIds.length; i++) {
        colorRes[i] = res.getColor(colorResIds[i]);
    }
    setColorSchemeColors(colorRes);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:SwipeRefreshLayout.java

示例8: animateRevealColorFromCoordinates

import android.support.annotation.ColorRes; //导入依赖的package包/类
private Animator animateRevealColorFromCoordinates(ViewGroup viewRoot, @ColorRes int color, int x, int y) {
    float finalRadius = (float) Math.hypot(viewRoot.getWidth(), viewRoot.getHeight());

    Animator anim = ViewAnimationUtils.createCircularReveal(viewRoot, x, y, 0, finalRadius);
    viewRoot.setBackgroundColor(ContextCompat.getColor(this, color));
    anim.setDuration(getResources().getInteger(R.integer.anim_duration_long));
    anim.setInterpolator(new AccelerateDecelerateInterpolator());
    anim.start();
    return anim;
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:11,代码来源:RevealActivity.java

示例9: get

import android.support.annotation.ColorRes; //导入依赖的package包/类
/**
 * Get a {@link ColorRes} from the given color resource ids
 *
 * @param index the index of the randomized {@link ColorRes}
 * @return a {@link ColorRes}
 */
@ColorRes
public int get(@IntRange(from = 0, to = Integer.MAX_VALUE) int index) {
    if (index < 0) {
        index = Math.abs(index);
    }
    return mColorPalette[index % mCount];
}
 
开发者ID:Tenor-Inc,项目名称:tenor-android-demo-search,代码行数:14,代码来源:ColorPalette.java

示例10: SingleOption

import android.support.annotation.ColorRes; //导入依赖的package包/类
public SingleOption(String title, @ColorRes int titleColor, @DrawableRes int icon, @ColorRes int selectedIconColor,
                    @ColorRes int deselectedIconColor, int borderWidth, @ColorRes int borderColor) {
    super(title, titleColor);
    this.icon = icon;
    this.borderWidth = borderWidth;
    this.borderColor = borderColor;
    this.selectedIconColor = selectedIconColor;
    this.deselectedIconColor = deselectedIconColor;
}
 
开发者ID:FranciscoJavierPRamos,项目名称:Android-FilterView,代码行数:10,代码来源:SingleOption.java

示例11: setBtnColor

import android.support.annotation.ColorRes; //导入依赖的package包/类
@Override
public BuildBean setBtnColor(@ColorRes int btn1Color, @ColorRes int btn2Color, @ColorRes int btn3Color) {
    if (btn1Color > 0)
        this.btn1Color = btn1Color;
    if (btn2Color > 0)
        this.btn2Color = btn2Color;
    if (btn3Color > 0)
        this.btn3Color = btn3Color;
    return this;
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:11,代码来源:BuildBean.java

示例12: setBackgroundColor

import android.support.annotation.ColorRes; //导入依赖的package包/类
/**
 * Update the background color of the mBgCircle image view.
 */
public void setBackgroundColor(@ColorRes int colorRes) {
    if (getBackground() instanceof ShapeDrawable) {
        final Resources res = getResources();
        ((ShapeDrawable) getBackground()).getPaint().setColor(res.getColor(colorRes));
    }
}
 
开发者ID:lanyuanxiaoyao,项目名称:PicKing,代码行数:10,代码来源:GoogleCircleProgressView.java

示例13: getColor

import android.support.annotation.ColorRes; //导入依赖的package包/类
@ColorInt
public static int getColor(@NonNull Resources res, @ColorRes int id, @Nullable Theme theme) throws NotFoundException {
    if (VERSION.SDK_INT >= 23) {
        return ResourcesCompatApi23.getColor(res, id, theme);
    }
    return res.getColor(id);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:ResourcesCompat.java

示例14: setProgressColorRes

import android.support.annotation.ColorRes; //导入依赖的package包/类
/**
 * Set the Progress bar color from a color resource
 *
 * @param color The color resource
 * @return This Alerter
 */
public Alerter setProgressColorRes(@ColorRes final int color) {
    if (getAlert() != null) {
        getAlert().setProgressColorRes(color);
    }

    return this;
}
 
开发者ID:Tapadoo,项目名称:Alerter,代码行数:14,代码来源:Alerter.java

示例15: setAllPageBackgroundColor

import android.support.annotation.ColorRes; //导入依赖的package包/类
public LoadDataLayout setAllPageBackgroundColor(@ColorRes int colorId) {
    loadingView.setBackgroundColor(getColor(colorId));
    emptyView.setBackgroundColor(getColor(colorId));
    errorView.setBackgroundColor(getColor(colorId));
    noNetworkView.setBackgroundColor(getColor(colorId));
    return this;
}
 
开发者ID:WangGanxin,项目名称:LoadDataLayout,代码行数:8,代码来源:LoadDataLayout.java


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