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


Java Color.GRAY属性代码示例

本文整理汇总了Java中android.graphics.Color.GRAY属性的典型用法代码示例。如果您正苦于以下问题:Java Color.GRAY属性的具体用法?Java Color.GRAY怎么用?Java Color.GRAY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.graphics.Color的用法示例。


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

示例1: initRecycleView

private void initRecycleView() {
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    adapter = new SimpleRvAdapter();
    recyclerView.setAdapter(adapter);
    adapter.showLoading();
    recyclerView.postDelayed(new Runnable() {
        @Override
        public void run() {
            adapter.hideLoading();
            List<FiveBean> fiveBeen = mockMoreData();
            adapter.setData(getCells(fiveBeen));
        }
    },2000);
    RecycleViewItemLine line = new RecycleViewItemLine(this,LinearLayoutManager.HORIZONTAL,2, Color.GRAY);
    recyclerView.addItemDecoration(line);
}
 
开发者ID:yangchong211,项目名称:YCBaseAdapter,代码行数:16,代码来源:FiveActivity.java

示例2: getColor

public static @ColorInt int getColor(int index) {
    int color = Color.TRANSPARENT;
    switch (index) {
        case 0:
            color = R.color.color0;
            break;
        case 1:
            color = Color.BLUE;
            break;

        case 2:
            color = Color.GRAY;
            break;
    }

    return color;
}
 
开发者ID:yushiwo,项目名称:StatusBarManager,代码行数:17,代码来源:ColorUtil.java

示例3: Options

public Options() {
    mHeaderSizes = new float[] {
            1.5f, // h1
            1.4f, // h2
            1.3f, // h3
            1.2f, // h4
            1.1f, // h5
            1.0f, // h6
    };

    mUnorderedListItem = "\u2022";
    mListItemIndentUnit = TypedValue.COMPLEX_UNIT_DIP;
    mListItemIndentSize = 10;

    mBlockQuoteColor = 0xff0000ff;
    mBlockQuoteIndentUnit = TypedValue.COMPLEX_UNIT_DIP;
    mBlockQuoteIndentSize = 10;

    mCodeBlockIndentUnit = TypedValue.COMPLEX_UNIT_DIP;
    mCodeBlockIndentSize = 10;

    mHruleColor = Color.GRAY;
    mHruleUnit = TypedValue.COMPLEX_UNIT_DIP;
    mHruleSize = 1;
}
 
开发者ID:PaulKlinger,项目名称:Sprog-App,代码行数:25,代码来源:Bypass.java

示例4: bindImageAndForeground

@RequiresApi(api = Build.VERSION_CODES.M)
private void bindImageAndForeground(View image, Bitmap bitmap) {
    if (bitmap == null) {
        bitmap = BitmapUtils.bitmapResizeFromResource(context.getResources(), R.drawable.default_song, imageWidth, imageHeight);
    }

    int defaultTC = Color.WHITE;
    int defaultBC = Color.GRAY;
    int[] colors = new int[4];
    ColorUtils.get4LightColorWithTextFormBitmap(bitmap, defaultBC, defaultTC, colors);

    int color = colors[0];
    color = color == defaultBC ? colors[2] : color;
    color = android.support.v4.graphics.ColorUtils.setAlphaComponent(color, 255);
    GradientDrawable dra = new GradientDrawable(
            GradientDrawable.Orientation.LEFT_RIGHT,
            new int[]{color, Color.TRANSPARENT});
    dra.setGradientType(GradientDrawable.LINEAR_GRADIENT);
    image.setBackground(dra);
}
 
开发者ID:DuanJiaNing,项目名称:Musicoco,代码行数:20,代码来源:RMPAdapter.java

示例5: Attributes

public Attributes(Context context) {
    mContext = context;
    this.background = new ColorDrawable(Color.TRANSPARENT);
    this.cancelButtonBackground = new ColorDrawable(Color.BLACK);
    ColorDrawable gray = new ColorDrawable(Color.GRAY);
    this.otherButtonTopBackground = gray;
    this.otherButtonMiddleBackground = gray;
    this.otherButtonBottomBackground = gray;
    this.otherButtonSingleBackground = gray;
    this.cancelButtonTextColor = Color.WHITE;
    this.otherButtonTextColor = Color.BLACK;
    this.padding = dp2px(20);
    this.otherButtonSpacing = dp2px(2);
    this.cancelButtonMarginTop = dp2px(10);
    this.actionSheetTextSize = dp2px(16);
}
 
开发者ID:quickhybrid,项目名称:quickhybrid-android,代码行数:16,代码来源:ActionSheet.java

示例6: setDefaultNumKey

private void setDefaultNumKey(TextView view, int key) {
    view.setText(String.valueOf(key));
    if (null != mNumBgDrawSelector) {
        Drawable tempNumBg = mNumBgDrawSelector.getConstantState()
                .newDrawable();
        view.setBackgroundDrawable(tempNumBg);
    } else {
        ColorDrawable normal = new ColorDrawable(Color.WHITE);
        ColorDrawable press = new ColorDrawable(Color.GRAY);
        view.setBackgroundDrawable(getDrawableSeletor(normal, press));
    }
}
 
开发者ID:VigorousLiang,项目名称:PWEditText-SafeKeyboard,代码行数:12,代码来源:SafetyKeyboard.java

示例7: Builder

private Builder() {
    text = "";
    color = Color.GRAY;
    textColor = Color.WHITE;
    borderThickness = 0;
    width = -1;
    height = -1;
    shape = new RectShape();
    font = Typeface.create("sans-serif-light", Typeface.NORMAL);
    fontSize = -1;
    isBold = false;
    toUpperCase = false;
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:13,代码来源:TextDrawable.java

示例8: setSelectionColor

/**
 * @param color The selection color
 */
public void setSelectionColor(int color) {
    if (color == 0) {
        if (!isInEditMode()) {
            return;
        } else {
            color = Color.GRAY;
        }
    }
    accentColor = color;
    adapter.setSelectionColor(color);
    invalidate();
}
 
开发者ID:ptrstovka,项目名称:calendarview2,代码行数:15,代码来源:CalendarView2.java

示例9: cvtStr2Color

public static int cvtStr2Color(String str)	{
	if (str.trim().toLowerCase(Locale.US).equals("blue"))	{
		return Color.BLUE; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("cyan"))	{
		return Color.CYAN; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("dkgray"))	{
		return Color.DKGRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("gray"))	{
		return Color.GRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("green"))	{
		return Color.GREEN; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("ltgray"))	{
		return Color.LTGRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("magenta"))	{
		return Color.MAGENTA; 	
	/*} else if (str.trim().toLowerCase(Locale.US).equals("orange"))	{
		return Color.ORANGE; 	// Pink and orange are not predefined colors in Android
	} else if (str.trim().toLowerCase(Locale.US).equals("pink"))	{
		return Color.PINK; 	*/
	} else if (str.trim().toLowerCase(Locale.US).equals("red"))	{
		return Color.RED; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("white"))	{
		return Color.WHITE;
	} else if (str.trim().toLowerCase(Locale.US).equals("yellow"))	{
		return Color.YELLOW;
	} else	{
		return Color.BLACK;
	}
}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:29,代码来源:OGLChartOperator.java

示例10: cvtStr2Color

public static int cvtStr2Color(String str)	{
	if (str.trim().toLowerCase(Locale.US).equals("blue"))	{
		return Color.BLUE; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("cyan"))	{
		return Color.CYAN; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("dkgray"))	{
		return Color.DKGRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("gray"))	{
		return Color.GRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("green"))	{
		return Color.GREEN; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("ltgray"))	{
		return Color.LTGRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("magenta"))	{
		return Color.MAGENTA; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("red"))	{
		return Color.RED; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("transparent"))	{
		return Color.TRANSPARENT; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("white"))	{
		return Color.WHITE;
	} else if (str.trim().toLowerCase(Locale.US).equals("yellow"))	{
		return Color.YELLOW;
	} else	{
		return Color.BLACK;
	}
}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:27,代码来源:XYChartOperator.java

示例11: initRecycleView

private void initRecycleView() {
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    adapter = new SecondAdapter(this,this);
    recyclerView.setAdapter(adapter);
    adapter.setData(list);
    RecycleViewItemLine line = new RecycleViewItemLine(this,LinearLayoutManager.HORIZONTAL,2, Color.GRAY);
    recyclerView.addItemDecoration(line);
}
 
开发者ID:yangchong211,项目名称:YCBaseAdapter,代码行数:8,代码来源:SecondActivity.java

示例12: getRandomMaterialColor

private int getRandomMaterialColor() {
    int returnColor = Color.GRAY;
    int arrayId = context.getResources().getIdentifier("mdcolor_400", "array", context.getPackageName());

    if (arrayId != 0) {
        TypedArray colors = context.getResources().obtainTypedArray(arrayId);
        int index = (int) (Math.random() * colors.length());
        returnColor = colors.getColor(index, Color.GRAY);
        colors.recycle();
    }
    return returnColor;
}
 
开发者ID:Pritom14,项目名称:Password-Storage,代码行数:12,代码来源:PasswordRecyclerViewAdapter.java

示例13: getRandomColor

public int getRandomColor() {
    Random random = new Random();

    switch (random.nextInt(10)) {
        case 0:
            return Color.WHITE;
        case 1:
            return Color.BLACK;
        case 2:
            return Color.BLUE;
        case 3:
            return Color.CYAN;
        case 4:
            return Color.YELLOW;
        case 5:
            return Color.GREEN;
        case 6:
            return Color.RED;
        case 7:
            return Color.GRAY;
        case 8:
            return Color.LTGRAY;
        case 9:
            return Color.DKGRAY;
        default:
            return Color.MAGENTA;
    }
}
 
开发者ID:adk96r,项目名称:Eye,代码行数:28,代码来源:PersonInfoView.java

示例14: initDefault

private void initDefault() {
    //mDisplayText = "abc";
    //mKeyColor = Color.LTGRAY;
    mPressedColor = Color.GRAY;
    //mTextColor = Color.BLACK;
    //mBorderColor = Color.BLACK;
    //mBorderWidth = 10;
    //mBorderRadius = 30;
}
 
开发者ID:suragch,项目名称:mongol-library,代码行数:9,代码来源:Key.java

示例15: init

private void init(Context context,AttributeSet attrs){
    View view = inflate(context,R.layout.nav_item,this);
    ButterKnife.bind(view);
    //自定义视图属性
    TypedArray typedArray = context.obtainStyledAttributes(attrs,R.styleable.NavItem);
    String action = typedArray.getString(R.styleable.NavItem_action);
    String actionState = typedArray.getString(R.styleable.NavItem_actionState);
    if (actionState != null){
        mTvActionState.setText(actionState);
    }
    mTvActionTitle.setText(action != null ? action:"");
    int startIcon = typedArray.getResourceId(R.styleable.NavItem_startIcon,0);
    if (startIcon != 0){
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ){
            mIvStartIcon.setImageDrawable(context.getResources().getDrawable(startIcon,context.getTheme()));
        }else {
            mIvStartIcon.setImageDrawable(context.getResources().getDrawable(startIcon));
        }
    }
    int color = typedArray.getColor(R.styleable.NavItem_textColor, Color.GRAY);
    if (color != Color.GRAY){
        mTvActionTitle.setTextColor(color);
        mTvActionState.setTextColor(color);
    }

    int tint = typedArray.getColor(R.styleable.NavItem_tint,Color.TRANSPARENT);
    if (tint != Color.TRANSPARENT){
        mIvStartIcon.setImageTintList(ColorStateList.valueOf(tint));
    }

    typedArray.recycle();
}
 
开发者ID:haihaio,项目名称:AmenEye,代码行数:32,代码来源:NavItem.java


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