项目作者: emrekose26

项目描述 :
Android record button view
高级语言: Kotlin
项目地址: git://github.com/emrekose26/RecordButton.git
创建时间: 2017-10-18T10:09:35Z
项目社区:https://github.com/emrekose26/RecordButton

开源协议:Apache License 2.0

下载


Record Button

License
Android Arsenal

This is a library which can you create a record button view in android

Download

1.Add this in your root build.gradle at the end of repositories:

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url "https://jitpack.io" }
  5. }
  6. }

2.Add this dependency in your app level build.gradle:

  1. dependencies {
  2. ...
  3. compile 'com.github.emrekose26:RecordButton:1.2.4'
  4. }

Usage

1. In your layout XML file:

  1. <com.emrekose.recordbutton.RecordButton
  2. android:id="@+id/recordBtn"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. app:buttonGap="10dp"
  6. app:buttonRadius="40dp"
  7. app:maxMilisecond="10000"
  8. app:progressColor="@color/colorPrimary"
  9. app:progressStroke="15"
  10. app:recordIcon="@drawable/ic_keyboard_voice_white_36dp" ></com.emrekose.recordbutton.RecordButton>

2. In your class file:

  1. RecordButton recordButton = (RecordButton) findViewById(R.id.recordBtn);
  2. recordButton.setRecordListener(new OnRecordListener() {
  3. @Override
  4. public void onRecord() {
  5. Log.e(TAG, "onRecord: ");
  6. }
  7. @Override
  8. public void onRecordCancel() {
  9. Log.e(TAG, "onRecordCancel: ");
  10. }
  11. @Override
  12. public void onRecordFinish() {
  13. Log.e(TAG, "onRecordFinish: ");
  14. }
  15. });

License

  1. Copyright 2017 Emre Köse
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.