As in whatsapp I need a recoding button and a slide to cancel and fade animation , I have searched for similar code but didn\'t got one. I am new to android programming any
you can use the library that i have made RecordView
it's easy to setup and it's simulates the same behavior like WhatsApp.
Simply add the Views RecordView and RecordButton
then in your Activity
RecordView recordView = (RecordView) findViewById(R.id.record_view);
RecordButton recordButton = (RecordButton)
findViewById(R.id.record_button);
//IMPORTANT
recordButton.setRecordView(recordView);
lastly you can handle the Record States
onLessThanSecond when the record time <= 1Second
recordView.setOnRecordListener(this);
@Override
public void onStart() {
//Start Recording..
Log.d("RecordView", "onStart");
}
@Override
public void onCancel() {
//On Swipe To Cancel
Log.d("RecordView", "onCancel");
}
@Override
public void onFinish(long recordTime) {
//Stop Recording..
String time = getHumanTimeText(recordTime);
Log.d("RecordView", "onFinish");
Log.d("RecordTime", time);
}
@Override
public void onLessThanSecond() {
//When the record time is less than One Second
Log.d("RecordView", "onLessThanSecond");
}