Created
March 20, 2018 10:26
-
-
Save ssaurel/673d9742b70abe059b8f6e475601d7e0 to your computer and use it in GitHub Desktop.
onDraw method of the PianoView for the SSaurel's Channel
This file contains 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) { | |
for (Key k : whites) { | |
canvas.drawRect(k.rect, k.down ? yellow : white); | |
} | |
for (int i = 1; i < NB; i++) { | |
canvas.drawLine(i * keyWidth, 0, i * keyWidth, height, black); | |
} | |
for (Key k : blacks) { | |
canvas.drawRect(k.rect, k.down ? yellow : black); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment