Created
February 12, 2016 17:22
-
-
Save StrixG/200684a4e0c0956fbe15 to your computer and use it in GitHub Desktop.
rect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onDraw(Canvas canvas) { | |
canvas.drawColor(Color.BLACK); | |
Paint paint = new Paint(); | |
paint.setStyle(Paint.Style.FILL); | |
for (int i = 1; i < 5; i ++) { | |
Log.d("MyView", "onDraw " + Integer.toString(i)); | |
switch (i) { | |
case 1: { | |
paint.setColor(Color.BLUE); | |
break; | |
} | |
case 2: { | |
paint.setColor(Color.RED); | |
break; | |
} | |
case 3: { | |
paint.setColor(Color.WHITE); | |
break; | |
} | |
case 4: { | |
paint.setColor(Color.GREEN); | |
break; | |
} | |
} | |
canvas.drawRect(100, 100 * i, 100 * i, 100 + 100 * i, paint); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment