Java Code Examples for android.graphics.Color.YELLOW

The following are Jave code examples for showing how to use YELLOW 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: DebugOverlay-Android   File: LogcatLineColorScheme.java   View Source Code Vote up 6 votes
@Override
public int getTextColor(LogcatLine.Priority priority, String tag) {
    switch (priority) {
        case VERBOSE: {
            return Color.BLACK;
        }
        case DEBUG: {
            return Color.BLUE;
        }
        case INFO: {
            return Color.GREEN;
        }
        case WARNING: {
            return Color.YELLOW;
        }
        case ERROR:
        case FATAL:
        case ASSERT: {
            return Color.RED;
        }
        default: {
            return Color.WHITE;
        }
    }
}
 
Example 2
Project: DroidSpeech   File: Activity_DroidSpeech.java   View Source Code Vote up 6 votes
@Override
public void onDroidSpeechFinalResult(String finalSpeechResult)
{
    // Setting the final speech result
    this.finalSpeechResult.setText(finalSpeechResult);

    if(droidSpeech.getContinuousSpeechRecognition())
    {
        int[] colorPallets1 = new int[] {Color.RED, Color.GREEN, Color.BLUE, Color.CYAN, Color.MAGENTA};
        int[] colorPallets2 = new int[] {Color.YELLOW, Color.RED, Color.CYAN, Color.BLUE, Color.GREEN};

        // Setting random color pallets to the recognition progress view
        droidSpeech.setRecognitionProgressViewColors(new Random().nextInt(2) == 0 ? colorPallets1 : colorPallets2);
    }
    else
    {
        stop.setVisibility(View.GONE);
        start.setVisibility(View.VISIBLE);
    }
}
 
Example 3
Project: stars-daydream-android   File: UniverseBuilder.java   View Source Code Vote up 6 votes
UniverseBuilder() {
    width = 600;
    height = 800;
    maxStars = 100;
    maxStarLifespan = 60;
    spawnInterval = 10;
    colorPalette = new int[]{Color.BLACK, Color.GREEN, Color.YELLOW,
            Color.MAGENTA, Color.CYAN, Color.RED};
}
 
Example 4
Project: LucaHome-MediaServer   File: GameSurfaceView.java   View Source Code Vote up 6 votes
private int getColor(@NonNull Piece piece) {
    switch (piece) {
        case T:
            return Color.GREEN;
        case L:
            return Color.RED;
        case Z:
            return Color.YELLOW;
        case S:
            return Color.BLUE;
        case LL:
            return Color.MAGENTA;
        default:
            return Color.CYAN;
    }
}
 
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: mongol-library   File: MongolLabelActivity.java   View Source Code Vote up 5 votes
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
        // An item was selected. You can retrieve the selected item using
        // parent.getItemAtPosition(pos)

        int viewid = parent.getId();
        if (viewid == R.id.fontcolor_spinner) {
            int color = Color.BLACK;
            String item = String.valueOf(parent.getItemAtPosition(pos));
            switch (item) {
                case "BLUE":
                    color = Color.BLUE;
                    break;
                case "RED":
                    color = Color.RED;
                    break;
                case "YELLOW":
                    color = Color.YELLOW;
                    break;
            }
            mMongolLabelMatchParent.setTextColor(color);
            mMongolLabelWrapContent.setTextColor(color);
        } else if (viewid == R.id.fontsize_spinner) {
            int size = Integer.parseInt(parent.getSelectedItem().toString());
            mMongolLabelMatchParent.setTextSize(size);
            mMongolLabelWrapContent.setTextSize(size);
//        } else if (viewid == R.id.alignment_spinner) {
//            int gravity = Gravity.TOP;
//            String item = String.valueOf(parent.getItemAtPosition(pos));
//            switch (item) {
//                case "CENTER":
//                    gravity = Gravity.CENTER;
//                    break;
//                case "BOTTOM":
//                    gravity = Gravity.BOTTOM;
//                    break;
//            }
//            mMongolLabelMatchParent.setGravity(gravity);
//            mMongolLabelWrapContent.setGravity(gravity);
        }
    }
 
Example 7
Project: silly-android   File: ColoringTest.java   View Source Code Vote up 5 votes
/**
 * Tests the {@link Coloring#createStateList(Context, int, int, int, boolean, int)} method.
 * <p>
 * Unfortunately {@link StateListDrawable#getCurrent()} is not shadowed by Robolectric yet.
 */
@Test
public final void testCreateStateList() {
    final int colorNormal = Color.WHITE;
    final int colorActive = Color.GRAY;
    final int colorFocused = Color.YELLOW;
    final StateListDrawable drawable = Coloring.createStateList(mActivityContext, colorNormal, colorActive, colorFocused, true, 0);
    assertNotNull("StateListDrawable is null", drawable);
    drawable.setState(new int[] {});
    assertTrue("StateListDrawable is not stateful", drawable.isStateful());
    final Drawable.ConstantState constantState = drawable.getConstantState();
    assertNotNull("Constant state is null", constantState);
    final Drawable currentState = drawable.getCurrent();
    assertNull("Robolectric started shadowing current state", currentState);
}
 
Example 8
Project: Phial   File: PhialButtonTest.java   View Source Code Vote up 5 votes
@Test
public void init_fromAttributes() {
    final int bgColor = Color.RED;
    final int iconColor = Color.YELLOW;
    final int shadowColor = Color.BLUE;

    final AttributeSet attrs = Robolectric.buildAttributeSet()
            .addAttribute(getButtonStyleable(R.styleable.PhialButton_phial_color_background),
                    hexColor(bgColor))

            .addAttribute(getButtonStyleable(R.styleable.PhialButton_phial_color_icon),
                    hexColor(iconColor))

            .addAttribute(getButtonStyleable(R.styleable.PhialButton_phial_color_shadow),
                    hexColor(shadowColor))

            .addAttribute(getButtonStyleable(R.styleable.PhialButton_phial_icon),
                    "@drawable/ic_handle")

            .addAttribute(getButtonStyleable(R.styleable.PhialButton_phial_size),
                    "20px")

            .addAttribute(getButtonStyleable(R.styleable.PhialButton_phial_size_shadow),
                    "5px")

            .build();

    final PhialButton button = new PhialButton(context, attrs);

    assertEquals(bgColor, button.getBackgroundColor());
    assertEquals(iconColor, button.getIconColor());
    assertEquals(shadowColor, button.getShadowColor());
    assertEquals(context.getDrawable(R.drawable.ic_handle), button.getIcon());
    assertEquals(20, button.getSuggestedSize());
    assertEquals(5, button.getShadowSize());
}
 
Example 9
Project: Hackathon_2017   File: MainActivity.java   View Source Code Vote up 5 votes
private void selecciona(int index, boolean seleccionado){
    r1.setBackgroundColor(Color.WHITE);
    r2.setBackgroundColor(Color.WHITE);
    r3.setBackgroundColor(Color.WHITE);
    r4.setBackgroundColor(Color.WHITE);

    if (seleccionado)
        selecion = index;

    int color = (selecion!=index ? Color.GREEN : Color.YELLOW);

    TextView selec = dameRespuesta(index);
    String resp = selec.getText().toString();
    selec.setBackgroundColor(color);

    if (selecion != 0){
        tiempo += 1;
        if (tiempo == 4){
            tiempo = 0;
            if (resp.equals(preguntas.get(this.index).respC))
                siguiente();
            else{
                selec.setBackgroundColor(Color.RED);
            }
        }
    }else{
        tiempo = 0;
    }



}
 
Example 10
Project: EasyChart   File: EasyGraphHistogram.java   View Source Code Vote up 5 votes
/**
 * 使用默认值初始化柱状图图形
 *
 * @param context Context
 */
public EasyGraphHistogram(Context context) {
    this(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, context.getResources().getDisplayMetrics()),
            Color.GRAY,
            Color.RED,
            TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, context.getResources().getDisplayMetrics()),
            Color.RED,
            Color.YELLOW,
            Color.BLACK,
            Color.RED,
            TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 16, context.getResources().getDisplayMetrics()),
            Color.BLUE,
            TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, context.getResources().getDisplayMetrics()));
}
 
Example 11
Project: EasyChart   File: EasyGraphLine.java   View Source Code Vote up 5 votes
/**
 * 使用默认值初始化图形
 */
public EasyGraphLine() {
    this(Color.BLUE,
            Color.RED,
            Color.YELLOW,
            5.0f,
            10.0f,
            Color.RED,
            4.0f);
}
 
Example 12
Project: SimpleDialogFragments   File: ColorWheelView.java   View Source Code Vote up 5 votes
private void updateShader(){
    int[] gradient = new int[]{Color.RED, Color.YELLOW, Color.GREEN,
            Color.CYAN, Color.BLUE, Color.MAGENTA, Color.RED};
    SweepGradient rainbow = new SweepGradient(center.x, center.y, gradient, null);

    paint.setShader(rainbow);
}
 
Example 13
Project: SSTVEncoder2   File: GridColorPalette.java   View Source Code Vote up 5 votes
static int[] getStandardColors() {
    return new int[]{
            Color.BLACK,
            Color.GRAY,
            Color.LTGRAY,
            Color.WHITE,
            Color.YELLOW,
            Color.CYAN,
            Color.GREEN,
            Color.MAGENTA,
            Color.RED,
            Color.BLUE
    };
}
 
Example 14
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 15
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 16
Project: android-util2   File: SimpleToast.java   View Source Code Vote up 5 votes
private int getColorByType() {
    switch (getType()) {
        case TYPE_DEBUG:
        case TYPE_NORMAL:
            return Color.GREEN;

        case TYPE_WARN:
            return Color.YELLOW;
        case TYPE_ERROR:
            return Color.RED;

        default:
            return Color.GREEN;
    }
}
 
Example 17
Project: ceji_android   File: BookView.java   View Source Code Vote up 4 votes
public SearchResultSpan() {
    super( Color.YELLOW );
}
 
Example 18
Project: javaide   File: CodeTheme.java   View Source Code Vote up 4 votes
public int getBracketColor() {
    // TODO: 21-Jul-17  change color dynamic
    return Color.YELLOW;
}
 
Example 19
Project: haven   File: MotionAsyncTask.java   View Source Code Vote up 4 votes
@Override
public void run() {
	int[] newPicLuma = ImageCodec.N21toLuma(rawNewPic, width, height);
	if (rawOldPic == null) {
		newBitmap = ImageCodec.lumaToBitmapGreyscale(newPicLuma, width, height);
		lastBitmap = newBitmap;
	} else {
	    int[] oldPicLuma = ImageCodec.N21toLuma(rawOldPic, width, height);
		detector = new LuminanceMotionDetector();
		detector.setThreshold(motionSensitivity);
		List<Integer> changedPixels = 
				detector.detectMotion(oldPicLuma, newPicLuma, width, height);
		hasChanged = false;

		int[] newPic = ImageCodec.lumaToGreyscale(newPicLuma, width, height);
		if (changedPixels != null) {
			hasChanged = true;
			for (int changedPixel : changedPixels) {
				newPic[changedPixel] = Color.YELLOW;
			}
		}

		lastBitmap = ImageCodec.lumaToBitmapGreyscale(oldPicLuma, width, height);
		newBitmap = Bitmap.createBitmap(newPic, width, height, Bitmap.Config.RGB_565);

		if (hasChanged) {
			YuvImage image = new YuvImage(rawNewPic, ImageFormat.NV21, width, height, null);
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			image.compressToJpeg(
					new Rect(0, 0, image.getWidth(), image.getHeight()), 90,
					baos);

			byte[] imageBytes = baos.toByteArray();
			rawBitmap = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length);
			// Setting post rotate to 90
			Matrix mtx = new Matrix();
			mtx.postRotate(-90);
			// Rotating Bitmap
			rawBitmap = Bitmap.createBitmap(rawBitmap, 0, 0, width, height, mtx, true);
		}
		else
		{
			rawBitmap = null;
		}
	}
	
	Log.i("MotionAsyncTask", "Finished processing, sending results");
	handler.post(new Runnable() {
		
		public void run() {
			for (MotionListener listener : listeners) {
				Log.i("MotionAsyncTask", "Updating back view");
				listener.onProcess(
						lastBitmap,
						newBitmap,
						rawBitmap,
						hasChanged);
			}
			
		}
	});
}