Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

RecordView

> 开发工具
Open source

A Simple Audio Recorder View with "hold to Record Button" and "Swipe to Cancel " Like WhatsApp

374 stars0 likes2 views
WebsiteGitHub

About

A Simple Audio Recorder View with "hold to Record Button" and "Swipe to Cancel " Like WhatsApp

RecordView

A Simple Audio Recorder View with hold to Record Button and Swipe to Cancel

Demo

Install

Add this to your project build.gradle (for older versions only)

gradle
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io }
    }
}

Add this to your settings.gradle(for newer versions only)

gradle
dependencyResolutionManagement {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add this to your module build.gradle

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'

}

Usage

XML

xml

    

    

Java

java

RecordView recordView = (RecordView) findViewById(R.id.record_view);
RecordButton recordButton = (RecordButton) findViewById(R.id.record_button);

//IMPORTANT
recordButton.setRecordView(recordView);

Handling States

…

Handle Clicks for Record Button

java

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");
            }
        });

Listen for Basket Animation End

java

recordView.setOnBasketAnimationEndListener(new OnBasketAnimationEnd() {
            @Override
            public void onAnimationEnd() {
                Log.d("RecordView", "Basket Animation Finished");
            }
        });

Enable Record Lock Feature

xml
java
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

java
recordView.setCancelBounds(8);//dp

Handling Permissions(Optional)

…

Some Customization

…

Thanks/Credits

  • NetoDevel for some inspiration and some code in his lib audio-recorder-button
  • alexjlockwood for making this Awesome tool ShapeShifter which helped me to animate vectors easily
  • team-supercharge for making ShimmerLayout

Looking for IOS Version?

try out iRecordView

Need a Chat app ?

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.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javarecordviewslide-to-cancelswipewhatsapp

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具