I want a slide to cancel Animation like whatsapp in my App.
Firstly, when I hold on record button it will start recording. This part is working good.
Secondly, when I move the finger in back direction towards trash can while already tapped then "Text View Slide to cancel" should slide backwards and recording should paused. After a certain point I will perform the trash can open animation. But if While sliding back ward if I slide towards forward then text view should be set at its original position and recording should play again.
My problem: I am not getting any help how to slide text view exactly.
I have also taken the help from here https://github.com/sarathnk/Audio but I was not able to achieve desired result.
This is my Java code:
holdtoRecord = (ImageView) findViewById(R.id.hold);
slider = (TextView) findViewById(R.id.slide);
holdtoRecord.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
// start recording.
mVideoView.pause();
onHold();
return true;
}
if (event.getAction() == MotionEvent.ACTION_UP) {
// Stop recording and save file
mVideoView.start();
offHold();
return true;
}
if (event.getAction() == MotionEvent.ACTION_MOVE) {
}