Creating Simple Piano app | using event listeners
We are creating a simple Piano app using event listeners.
when touch down we create touch effect and playsound when user lift up the finger we stop playing sound and reset background colour of the keys ..... this project is available on our jokhio Sketch Projects app. and the codes also.
________________________________
demo app
https://play.google.com/store/apps/details?id=jokhio.simple.piano
_____________________________________
download Jokhio Sketch Projects
https://jokhioapps.blogspot.com/2021/01/our-project-store.html
________________________________
btw these are the codes
//ASSIGN LISTENER TO THE VIEW
/**
*"key1" IS THE I'D OF VIEW (LINEAR, TEXTVIEW ETC)
* YOU HAVE TO CHANGE VARIABLE NAME ALSO "l1" HERE TO "l2" OR "l3" ETC.
**/
MyOnTouchListener1 l1 = new MyOnTouchListener1();
key1.setOnTouchListener(l1);
//DEFINING LISTENER CLASS
class MyOnTouchListener1 implements OnTouchListener {
public boolean onTouch(View v, MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
// touch down code
break;
case MotionEvent.ACTION_MOVE:
// touch move code
break;
case MotionEvent.ACTION_UP:
// touch up code
break;
}
return true;
}
}
Видео Creating Simple Piano app | using event listeners канала Jokhio Apps
when touch down we create touch effect and playsound when user lift up the finger we stop playing sound and reset background colour of the keys ..... this project is available on our jokhio Sketch Projects app. and the codes also.
________________________________
demo app
https://play.google.com/store/apps/details?id=jokhio.simple.piano
_____________________________________
download Jokhio Sketch Projects
https://jokhioapps.blogspot.com/2021/01/our-project-store.html
________________________________
btw these are the codes
//ASSIGN LISTENER TO THE VIEW
/**
*"key1" IS THE I'D OF VIEW (LINEAR, TEXTVIEW ETC)
* YOU HAVE TO CHANGE VARIABLE NAME ALSO "l1" HERE TO "l2" OR "l3" ETC.
**/
MyOnTouchListener1 l1 = new MyOnTouchListener1();
key1.setOnTouchListener(l1);
//DEFINING LISTENER CLASS
class MyOnTouchListener1 implements OnTouchListener {
public boolean onTouch(View v, MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
// touch down code
break;
case MotionEvent.ACTION_MOVE:
// touch move code
break;
case MotionEvent.ACTION_UP:
// touch up code
break;
}
return true;
}
}
Видео Creating Simple Piano app | using event listeners канала Jokhio Apps
Комментарии отсутствуют
Информация о видео
3 февраля 2021 г. 14:19:01
00:10:40
Другие видео канала