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


Java Color.DKGRAY属性代码示例

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


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

示例1: OptionsAdapter

public OptionsAdapter(Context context, @Nullable int[] iconsID, @Nullable int[] ids, @NonNull String[] texts, @Nullable String[] msgs, @Nullable OptionClickListener[] listener) {
    this.context = context;
    this.iconColor = this.titleColor = Color.DKGRAY;
    this.msgColor = Color.GRAY;

    for (int i = 0; i < texts.length; i++) {
        Option option = new Option(
                texts[i],
                ids == null ? 0 : (ids.length == texts.length ? ids[i] : 0),
                msgs == null ? null : msgs[i],
                iconsID == null ? -1 : iconsID[i],
                listener == null ? null : listener[i]
        );
        options.add(option);
    }
}
 
开发者ID:DuanJiaNing,项目名称:Musicoco,代码行数:16,代码来源:OptionsAdapter.java

示例2: onSizeChanged

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
    super.onSizeChanged(w, h, oldw, oldh);
    if (mViewWidth == 0) {
        mViewWidth = getMeasuredWidth();
        if (mViewWidth > 0) {
            mPaint = getPaint();
            mLinearGradient = new LinearGradient(
                    0,
                    0,
                    mViewWidth,
                    0,
                    new int[]{
                            Color.DKGRAY, 0xffffffff,
                            Color.DKGRAY
                    },
                    null,
                    Shader.TileMode.CLAMP);
            mPaint.setShader(mLinearGradient);
            mGradientMatrix = new Matrix();

        }
    }
}
 
开发者ID:wheat7,项目名称:VRPlayer,代码行数:24,代码来源:BulingBulingTextView.java

示例3: init

private void init() {
    radius = oneDp;
    contactWidth = oneDp;
    batteryColor = Color.DKGRAY;
    paintFrame = new Paint();
    paintSolid = new Paint();
    paintFrame.setColor(batteryColor);
    paintFrame.setStyle(Paint.Style.STROKE);
    // 电池边框
    paintFrame.setStrokeWidth(oneDp * 1);
    paintSolid.setColor(batteryColor);

    setBatteryLevel(0.8f);
}
 
开发者ID:ceji-longquan,项目名称:ceji_android,代码行数:14,代码来源:BatteryView.java

示例4: 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

示例5: decodeColor

/**
 * Converts an ARGB hex color String value to an Android Integer color value.
 * <br>
 * Supported formats:
 * <br>
 * <ul>
 * <li>#aaRRggBb</li>
 * <li>0xaaRRggBb</li>
 * <li>0XaaRRggBb</li>
 * <li>#RRggBb</li>
 * <li>0xRRggBb</li>
 * <li>0XRRggBb</li>
 * </ul>
 * <i>* Plus all caps variants.</i>
 *
 * @param hexValue Hex value
 * @return Integer color, or {@link Color#DKGRAY} if something goes wrong
 */
@ColorInt
public static int decodeColor(@NonNull final String hexValue) {
    if (SillyAndroid.isEmpty(hexValue)) {
        return Color.DKGRAY;
    }

    String colorHex = hexValue.trim();
    colorHex = colorHex.replace("#", "").replace("0x", "").replace("0X", "");
    final int length = colorHex.length();
    if (length != 6 && length != 8) {
        return Color.DKGRAY;
    }

    int alpha = 255;
    final int red;
    final int green;
    final int blue;
    try {
        if (length == 8) {
            alpha = Integer.parseInt(colorHex.substring(0, 2), 16);
            red = Integer.parseInt(colorHex.substring(2, 4), 16);
            green = Integer.parseInt(colorHex.substring(4, 6), 16);
            blue = Integer.parseInt(colorHex.substring(6, 8), 16);
        } else {
            red = Integer.parseInt(colorHex.substring(0, 2), 16);
            green = Integer.parseInt(colorHex.substring(2, 4), 16);
            blue = Integer.parseInt(colorHex.substring(4, 6), 16);
        }
        return Color.argb(alpha, red, green, blue);
    } catch (Throwable ignored) {
        return Color.DKGRAY;
    }
}
 
开发者ID:milosmns,项目名称:silly-android,代码行数:51,代码来源:Coloring.java

示例6: enableOutline

private void enableOutline(boolean enabled) {
    findViewById(R.id.text_outline_size).setEnabled(enabled);
    findViewById(R.id.edit_outline_size).setEnabled(enabled);
    findViewById(R.id.text_outline_color).setEnabled(enabled);
    findViewById(R.id.edit_outline_color).setEnabled(enabled);
    @ColorInt
    int color = enabled ? mLabel.getOutlineColor() : Color.DKGRAY;
    findViewById(R.id.edit_outline_color).setBackgroundColor(color);
}
 
开发者ID:olgamiller,项目名称:SSTVEncoder2,代码行数:9,代码来源:EditTextActivity.java

示例7: getChildAt

/**
 * Draw layout bounds for the next child.
 *
 * @param canvas The canvas to draw on.
 */
/* package */ void debugDrawNextChild(Canvas canvas) {
  View child = getChildAt(mDrawChildIndex);
  // Draw FlatViewGroups a different color than regular child views.
  int color = child instanceof FlatViewGroup ? Color.DKGRAY : Color.RED;
  debugDrawRect(
      canvas,
      color,
      child.getLeft(),
      child.getTop(),
      child.getRight(),
      child.getBottom());
  ++mDrawChildIndex;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:18,代码来源:FlatViewGroup.java

示例8: 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

示例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("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

示例10: ItemData

public ItemData(int icon, String title) {
    this(Color.DKGRAY, icon, title, new Date());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:3,代码来源:FlyRefreshStyleActivity.java

示例11: onBindViewHolder

@Override
        public void onBindViewHolder(final BasicListAdapter.ViewHolder holder, final int position) {
            ToDoItem item = items.get(position);
//            if(item.getToDoDate()!=null && item.getToDoDate().before(new Date())){
//                item.setToDoDate(null);
//            }
            SharedPreferences sharedPreferences = getSharedPreferences(THEME_PREFERENCES, MODE_PRIVATE);
            //Background color for each to-do item. Necessary for night/day mode
            int bgColor;
            //color of title text in our to-do item. White for night mode, dark gray for day mode
            int todoTextColor;
            if(sharedPreferences.getString(THEME_SAVED, LIGHTTHEME).equals(LIGHTTHEME)){
                bgColor = Color.WHITE;
                todoTextColor = getResources().getColor(R.color.secondary_text);
            }
            else{
                bgColor = Color.DKGRAY;
                todoTextColor = Color.WHITE;
            }
            holder.linearLayout.setBackgroundColor(bgColor);

            if(item.hasReminder() && item.getToDoDate()!=null){
                holder.mToDoTextview.setMaxLines(1);
                holder.mTimeTextView.setVisibility(View.VISIBLE);
//                holder.mToDoTextview.setVisibility(View.GONE);
            }
            else{
                holder.mTimeTextView.setVisibility(View.GONE);
                holder.mToDoTextview.setMaxLines(2);
            }
            holder.mToDoTextview.setText(item.getToDoText());
            holder.mToDoTextview.setTextColor(todoTextColor);
//            holder.mColorTextView.setBackgroundColor(Color.parseColor(item.getTodoColor()));

//            TextDrawable myDrawable = TextDrawable.builder().buildRoundRect(item.getToDoText().substring(0,1),Color.RED, 10);
            //We check if holder.color is set or not
//            if(item.getTodoColor() == null){
//                ColorGenerator generator = ColorGenerator.MATERIAL;
//                int color = generator.getRandomColor();
//                item.setTodoColor(color+"");
//            }
//            Log.d("OskarSchindler", "Color: "+item.getTodoColor());
            TextDrawable myDrawable = TextDrawable.builder().beginConfig()
                    .textColor(Color.WHITE)
                    .useFont(Typeface.DEFAULT)
                    .toUpperCase()
                    .endConfig()
                    .buildRound(item.getToDoText().substring(0,1),item.getTodoColor());

//            TextDrawable myDrawable = TextDrawable.builder().buildRound(item.getToDoText().substring(0,1),holder.color);
            holder.mColorImageView.setImageDrawable(myDrawable);
            if(item.getToDoDate()!=null){
                String timeToShow;
                if(android.text.format.DateFormat.is24HourFormat(MainActivity.this)){
                    timeToShow = AddToDoActivity.formatDate(MainActivity.DATE_TIME_FORMAT_24_HOUR, item.getToDoDate());
                }
                else{
                    timeToShow = AddToDoActivity.formatDate(MainActivity.DATE_TIME_FORMAT_12_HOUR, item.getToDoDate());
                }
                holder.mTimeTextView.setText(timeToShow);
            }


        }
 
开发者ID:kotlin-korea,项目名称:Minimal-Todo,代码行数:64,代码来源:MainActivity.java

示例12: ShimmerSpan

public ShimmerSpan() {
    colors = new int[3];
    colors[0] = Color.WHITE;
    colors[1] = Color.LTGRAY;
    colors[2] = Color.DKGRAY;
}
 
开发者ID:Fueled,项目名称:snippety,代码行数:6,代码来源:ShimmerSpan.java

示例13: getBackGroundColors

public int[] getBackGroundColors() {
    return new int[]{Color.DKGRAY,Color.rgb(50,50,50)};
}
 
开发者ID:nowandfurure,项目名称:richeditor,代码行数:3,代码来源:DarkTheme.java

示例14: Builder

public Builder() {
    view = new QuantityDataView();
    view.selectorColor = Color.BLACK;
    view.smallSelectorColor = Color.DKGRAY;
}
 
开发者ID:Kaufland,项目名称:andcircularselect,代码行数:5,代码来源:QuantityDataView.java

示例15: getThemeDarkColor

@Override
public int getThemeDarkColor() {
    return Color.DKGRAY;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:4,代码来源:SkinImpl.java


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