GitXplorerGitXplorer
T

AudioRecorderView

public
60 stars
13 forks
3 issues

Commits

List of commits on branch master.
Unverified
d6a4a434e16af67e988e9d5e17188ffc117d63ed

Bump version to 1.0.4

TTougee committed 4 years ago
Verified
12884cda4b61ef1738f33bc11ba9f5c3c20fe349

Merge pull request #17 from sahuadarsh0/feature/view-binding

TTougee committed 4 years ago
Unverified
dc1f7ad4d5fd025aecb7ca43316e511b53e2d32d

*fixed typo

committed 4 years ago
Verified
e6f5987f011f498c1e7061f22d68fa430e7a8654

Merge pull request #16 from Tougee/feature/androidx

TTougee committed 4 years ago
Unverified
b4749599631d9e9d84378bbc7963e52fa3d4a1bb

Migrate view binding

committed 4 years ago
Unverified
0bcacc786add665ea3d0274268385530dd1fe541

Migrage to AndroidX

TTougee committed 4 years ago

README

The README file for this repository.

AudioRecorderView

Simple Audio Recorder View with 'swap-to-cancel' Like Telegram

Usage

    // AndroidManifest.xml
    <uses-permission android:name="android.permission.RECORD_AUDIO" />

    // layout include AudioRecordView
    <com.tougee.recorderview.AudioRecordView
        android:id="@+id/record_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:mic_icon="@mipmap/ic_custom_mic"
        app:mic_active_icon="@drawable/custom_mic_active"
        app:mic_hint_enable="false"
        app:mic_hint_color="@color/custom_hint_color"
        app:mic_hint_text="@string/custom_hint_text"
        app:mic_hint_bg="@drawable/custom_hint_bg"
        app:blink_color="@color/custom_blink_color"
        app:circle_color="@color/custom_circle_color"
        app:cancel_icon_color="@color/custom_cancel_icon_color"
        app:slide_cancel_text="@string/custom_slide_cancel_text"
        app:cancel_text="@string/custom_cancel_text"
        app:vibration_enable="false"
        android:layout_alignParentBottom="true"/>
        // activity implemented AudioRecordView.Callback

        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            setContentView(R.layout.activity_main)

            record_view.apply {
                activity = this@MainActivity
                callback = this@MainActivity

                micIcon = R.drawable.ic_chevron_left_gray_24dp
                micActiveIcon = R.drawable.ic_play_arrow_black_24dp
                micHintEnable = false
                micHintText = "Custom hint text"
                micHintColor = ContextCompat.getColor(this@MainActivity, android.R.color.holo_red_light)
                micHintBg = R.drawable.ic_launcher_background
                blinkColor = ContextCompat.getColor(this@MainActivity, R.color.color_blue)
                circleColor = ContextCompat.getColor(this@MainActivity, R.color.color_blink)
                cancelIconColor = ContextCompat.getColor(this@MainActivity, R.color.color_blue)
                slideCancelText = "Custom Slide to cancel"
                cancelText = "Custom Cancel"
                vibrationEnable = false
            }

            record_view.setTimeoutSeconds(20)
        }

        override fun onRecordStart() {}

        override fun isReady() = true

        override fun onRecordEnd() {}

        override fun onRecordCancel() {}

Setup

Android Studio / Gradle

Add the following dependency in your root build.gradle at the end of repositories:

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

Add the dependency:

dependencies {
    implementation 'com.github.tougee:audiorecorderview:1.0.4'
}

License details

Copyright 2018 Touge

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.