Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to create a blinking line in android?
- canvas.drawLine(100,100,600, 600,mpaint);
- boolean blink = false;
- // Define paint objects
- Paint red = new Paint;
- red.setColor(Color.RED);
- Paint blue = new Paint;
- blue.setColor(Color.BLUE);
- if(blink == false) {
- blink = true;
- }
- else {
- blink = false;
- }
- if(blink == true) {
- canvas.drawLine(100,100,600, 600,red);
- }
- else {
- canvas.drawLine(100,100,600, 600,blue);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement