Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tougee/audiorecorderview

Simple Audio Recorder View with 'swap-to-cancel' Like Telegram
https://github.com/tougee/audiorecorderview

android audio kotlin recorderview

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# AudioRecorderView

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

## Usage
```xml

// AndroidManifest.xml

// layout include AudioRecordView

```
``` kotlin

// 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:
```Gradle
allprojects {
repositories {
//...
maven { url = 'https://jitpack.io' }
}
}
```
Add the dependency:
```Gradle
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.
```