A Simple Audio Recorder View with "hold to Record Button" and "Swipe to Cancel " Like WhatsApp
A Simple Audio Recorder View with "hold to Record Button" and "Swipe to Cancel " Like WhatsApp
A Simple Audio Recorder View with hold to Record Button and Swipe to Cancel
Add this to your project build.gradle (for older versions only)
allprojects {
repositories {
...
maven { url 'https://jitpack.io }
}
}Add this to your settings.gradle(for newer versions only)
dependencyResolutionManagement {
repositories {
...
maven { url 'https://jitpack.io' }
}
}Add this to your module build.gradle
dependencies {
//for AppCompat use:
//appcompat v26+ is higly recommended to support older APIs
implementation 'com.devlomi.record-view:record-view:2.0.1'
//for AndroidX use:
implementation 'com.github.3llomi:RecordView:3.1.3'
}
RecordView recordView = (RecordView) findViewById(R.id.record_view);
RecordButton recordButton = (RecordButton) findViewById(R.id.record_button);
//IMPORTANT
recordButton.setRecordView(recordView);
…
recordButton.setListenForRecord(false);
//ListenForRecord must be false ,otherwise onClick will not be called
recordButton.setOnRecordClickListener(new OnRecordClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "RECORD BUTTON CLICKED", Toast.LENGTH_SHORT).show();
Log.d("RecordButton","RECORD BUTTON CLICKED");
}
});
recordView.setOnBasketAnimationEndListener(new OnBasketAnimationEnd() {
@Override
public void onAnimationEnd() {
Log.d("RecordView", "Basket Animation Finished");
}
});
recordView.setLockEnabled(true);
recordView.setRecordLockImageView(findViewById(R.id.record_lock));Change Swipe To Cancel Bounds (when the 'Slide To Cancel' Text View get before Counter). default is 8dp
recordView.setCancelBounds(8);//dpHandling Permissions(Optional)
……try out iRecordView
Check out FireApp Chat
Copyright 2018 AbdulAlim Rajjoub
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.No open issues yet, or sync has not completed.