I mean I want to drawline but slowly.
I write this code to draw line in ondraw method.
.
.
.
.
caneta.setARGB(255, 255, 0,0);caneta.setStrokeWidth(10);
canvas.drawLine(0, ys * 1/2, this.getWidth(), ys * 1/2, caneta);
.
.
.
how I did it slowly?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s nearly like a gameloop works:
-invalidate your canvas ever X milliseconds (using a loop and Thread.sleep())
-increment your X/Y coords after every loop
-handle the new coords in onDraw() again
Example:
in your existing view class, where you already have your onDraw method