百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

RecordView

> 开发工具
开源

一个简单的音频录音器视图,具有"按住录音按钮"和"向左滑动取消"功能,类似于 WhatsApp

374 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个简单的音频录音器视图,具有"按住录音按钮"和"向左滑动取消"功能,类似于 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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javarecordviewslide-to-cancelswipewhatsapp

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

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