Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created June 7, 2021 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeforfun-jp/1db09a5c4848609623367e189701659b to your computer and use it in GitHub Desktop.
Save codeforfun-jp/1db09a5c4848609623367e189701659b to your computer and use it in GitHub Desktop.
CTB 4-6
@Override
public boolean onTouchEvent(MotionEvent event) {
if (start_flg == false) {
start_flg = true;
startLabel.setVisibility(View.GONE);
timer.schedule(new TimerTask() {
@Override
public void run() {
handler.post(new Runnable() {
@Override
public void run() {
changePos();
}
});
}
}, 0, 20);
} else {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
action_flg = true;
} else if (event.getAction() == MotionEvent.ACTION_UP) {
action_flg = false;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment