Skip to content

Commit

Permalink
update about page
Browse files Browse the repository at this point in the history
  • Loading branch information
shaoshuai904 committed Jun 30, 2020
1 parent 904f02f commit af3c2ed
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 17 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# RecordWav


[![demo](https://img.shields.io/badge/download-demo-blue.svg)](https://github.com/shaoshuai904/RecordWav/blob/master/screens/app_v1.0.2_11.apk)
[![demo](https://img.shields.io/badge/download-demo-blue.svg)](https://github.com/shaoshuai904/RecordWav/blob/master/screens/app_v1.0.3_12.apk)
[![API](https://img.shields.io/badge/API-14%2B-green.svg?style=flat)](https://android-arsenal.com/api?level=14)


Expand Down Expand Up @@ -37,16 +37,19 @@

```groovy
dependencies {
implementation 'com.github.shaoshuai904:RecordWav:1.0.2'
implementation 'com.github.shaoshuai904:RecordWav:1.0.3'
}
```


### 快速使用
### 示例代码

构造参数:[ 文件保存路径 + 参数配置 + 各类监听回调(音频数据块拉取监听/沉默监听) ]
方法:startRecording pauseRecording resumeRecording stopRecording


获取普通录音机(java)

```java
Recorder recorder;
recorder = MsRecorder.wav(
Expand Down Expand Up @@ -84,7 +87,7 @@
// 沉默监听
.setOnSilenceListener { silenceTime, discardTime ->
Log.e("降噪模式", "沉默时间:$silenceTime ,丢弃时间:$discardTime")
}
})
```


Expand Down
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.maple.recordwav">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:name=".WavApp"
android:allowBackup="true"
Expand Down
27 changes: 24 additions & 3 deletions app/src/main/java/com/maple/recordwav/ui/AboutPage.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package com.maple.recordwav.ui

import android.Manifest
import android.annotation.SuppressLint
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import com.maple.msdialog.AlertDialog
import com.maple.recordwav.R
import com.maple.recordwav.base.BaseFragment
import com.maple.recordwav.databinding.FragmentAboutBinding
import com.maple.recordwav.utils.permission.RxPermissions

/**
* about
Expand All @@ -27,12 +31,29 @@ class AboutPage : BaseFragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
initView()

}

private fun initView() {
binding.apply {
tvInfo.text = "WAV 解析界面!"
requestPermission()
}

@SuppressLint("CheckResult")
private fun requestPermission() {
RxPermissions(this).request(
Manifest.permission.INTERNET,
Manifest.permission.ACCESS_NETWORK_STATE
).subscribe { granted ->
if (granted) {
binding.wbWeb.loadUrl("https://github.com/shaoshuai904/RecordWav")
} else {
AlertDialog(mContext).apply {
setCancelable(false)
setCanceledOnTouchOutside(false)
setTitle("连个网?")
setLeftButton("拒绝")
setRightButton("再选一次", View.OnClickListener { requestPermission() })
}.show()
}
}
}
}
3 changes: 1 addition & 2 deletions app/src/main/java/com/maple/recordwav/ui/RecordPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ class RecordPage : BaseFragment() {
val message = "沉默时间:$silenceTime ,丢弃时间:$discardTime"
Log.e("降噪模式", message)
T.showShort(mContext, message)
}
)
})
}

// 录音文件存储名称
Expand Down
34 changes: 26 additions & 8 deletions app/src/main/res/layout/fragment_about.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<layout xmlns:android="http://schemas.android.com/apk/res/android">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
android:id="@+id/tv_info"
<WebView
android:id="@+id/wb_web"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#abcdef"
android:padding="10dp"
tools:text="获取信息" />
android:layout_height="match_parent" />

<!-- <ImageView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_margin="30dp"-->
<!-- android:src="@drawable/ic_launcher" />-->

<!-- <TextView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:gravity="center"-->
<!-- android:padding="10dp"-->
<!-- android:text="Email: [email protected] \n Github: https://github.com/shaoshuai904/RecordWav" />-->

<!-- <TextView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="30dp"-->
<!-- android:gravity="center"-->
<!-- android:padding="10dp"-->
<!-- android:text="欢迎Star和Issues\n\n和你的start是我不断更新的动力!"-->
<!-- android:textSize="18sp" />-->

</LinearLayout>

Expand Down
Binary file added screens/app_v1.0.3_12.apk
Binary file not shown.

0 comments on commit af3c2ed

Please sign in to comment.