Java Code Examples for android.graphics.Color.DKGRAY

The following are Jave code examples for showing how to use DKGRAY of the android.graphics.Color class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Musicoco   File: OptionsAdapter.java   View Source Code Vote up 6 votes
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);
    }
}
 
Example 2
Project: VRPlayer   File: BulingBulingTextView.java   View Source Code Vote up 6 votes
@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();

        }
    }
}
 
Example 3
Project: Cashew   File: BulingBulingTextView.java   View Source Code Vote up 6 votes
@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();

        }
    }
}
 
Example 4
Project: ceji_android   File: BatteryView.java   View Source Code Vote up 5 votes
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);
}
 
Example 5
Project: Eye   File: PersonInfoView.java   View Source Code Vote up 5 votes
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;
    }
}
 
Example 6
Project: silly-android   File: Coloring.java   View Source Code Vote up 5 votes
/**
 * 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;
    }
}
 
Example 7
Project: SSTVEncoder2   File: EditTextActivity.java   View Source Code Vote up 5 votes
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);
}
 
Example 8
Project: RNLearn_Project1   File: FlatViewGroup.java   View Source Code Vote up 5 votes
/**
 * 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;
}
 
Example 9
Project: RNLearn_Project1   File: FlatViewGroup.java   View Source Code Vote up 5 votes
/**
 * 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;
}
 
Example 10
Project: SmartMath   File: OGLChartOperator.java   View Source Code Vote up 5 votes
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;
	}
}
 
Example 11
Project: SmartMath   File: XYChartOperator.java   View Source Code Vote up 5 votes
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;
	}
}
 
Example 12
Project: GitHub   File: FlyRefreshStyleActivity.java   View Source Code Vote up 4 votes
public ItemData(int icon, String title) {
    this(Color.DKGRAY, icon, title, new Date());
}
 
Example 13
Project: Musicoco   File: OptionsAdapter.java   View Source Code Vote up 4 votes
public OptionsAdapter(Context context) {
    this.context = context;
    this.iconColor = this.titleColor = Color.DKGRAY;
    this.msgColor = Color.GRAY;
    this.options = new ArrayList<>();
}
 
Example 14
Project: Musicoco   File: OptionsAdapter.java   View Source Code Vote up 4 votes
public OptionsAdapter(Context context, List<Option> options) {
    this.context = context;
    this.iconColor = this.titleColor = Color.DKGRAY;
    this.msgColor = Color.GRAY;
    this.options = options;
}
 
Example 15
Project: Minimal-Todo   File: MainActivity.java   View Source Code Vote up 4 votes
@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);
            }


        }
 
Example 16
Project: snippety   File: ShimmerSpan.java   View Source Code Vote up 4 votes
public ShimmerSpan() {
    colors = new int[3];
    colors[0] = Color.WHITE;
    colors[1] = Color.LTGRAY;
    colors[2] = Color.DKGRAY;
}
 
Example 17
Project: SmartRefreshLayout   File: FlyRefreshStyleActivity.java   View Source Code Vote up 4 votes
public ItemData(int icon, String title) {
    this(Color.DKGRAY, icon, title, new Date());
}
 
Example 18
Project: richeditor   File: DarkTheme.java   View Source Code Vote up 4 votes
public int[] getBackGroundColors() {
    return new int[]{Color.DKGRAY,Color.rgb(50,50,50)};
}
 
Example 19
Project: andcircularselect   File: QuantityDataView.java   View Source Code Vote up 4 votes
public Builder() {
    view = new QuantityDataView();
    view.selectorColor = Color.BLACK;
    view.smallSelectorColor = Color.DKGRAY;
}
 
Example 20
Project: RLibrary   File: SkinImpl.java   View Source Code Vote up 4 votes
@Override
public int getThemeDarkColor() {
    return Color.DKGRAY;
}