updating commons + some minor things

This commit is contained in:
tibbi
2021-11-12 11:23:15 +01:00
parent fc1155ee72
commit d0c4369692
5 changed files with 18 additions and 15 deletions

View File

@@ -56,7 +56,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:f1ba19dcc0' implementation 'com.github.SimpleMobileTools:Simple-Commons:9f9fe73d80'
implementation 'org.greenrobot:eventbus:3.2.0' implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.github.Armen101:AudioRecordView:1.0.2' implementation 'com.github.Armen101:AudioRecordView:1.0.2'
implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.documentfile:documentfile:1.0.1'

View File

@@ -85,6 +85,8 @@ class RecorderService : Service() {
} }
currFilePath = "$baseFolder/${getCurrentFormattedDateTime()}.${config.getExtensionText()}" currFilePath = "$baseFolder/${getCurrentFormattedDateTime()}.${config.getExtensionText()}"
try {
recorder = MediaRecorder().apply { recorder = MediaRecorder().apply {
setAudioSource(MediaRecorder.AudioSource.CAMCORDER) setAudioSource(MediaRecorder.AudioSource.CAMCORDER)
setOutputFormat(config.getOutputFormat()) setOutputFormat(config.getOutputFormat())
@@ -92,7 +94,6 @@ class RecorderService : Service() {
setAudioEncodingBitRate(config.bitrate) setAudioEncodingBitRate(config.bitrate)
setAudioSamplingRate(44100) setAudioSamplingRate(44100)
try {
if (!isQPlus() && isPathOnSD(currFilePath)) { if (!isQPlus() && isPathOnSD(currFilePath)) {
var document = getDocumentFile(currFilePath.getParentPath()) var document = getDocumentFile(currFilePath.getParentPath())
document = document?.createFile("", currFilePath.getFilenameFromPath()) document = document?.createFile("", currFilePath.getFilenameFromPath())
@@ -114,12 +115,12 @@ class RecorderService : Service() {
durationTimer.scheduleAtFixedRate(getDurationUpdateTask(), 1000, 1000) durationTimer.scheduleAtFixedRate(getDurationUpdateTask(), 1000, 1000)
startAmplitudeUpdates() startAmplitudeUpdates()
}
} catch (e: Exception) { } catch (e: Exception) {
showErrorToast(e) showErrorToast(e)
stopRecording() stopRecording()
} }
} }
}
private fun stopRecording() { private fun stopRecording() {
durationTimer.cancel() durationTimer.cancel()

View File

@@ -6,7 +6,7 @@
android:width="@dimen/one_dp" android:width="@dimen/one_dp"
android:color="@color/divider_grey" /> android:color="@color/divider_grey" />
<corners android:radius="@dimen/normal_margin" /> <corners android:radius="@dimen/activity_margin" />
<solid android:color="@color/activated_item_foreground" /> <solid android:color="@color/activated_item_foreground" />

View File

@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item <item
android:id="@+id/cab_rename" android:id="@+id/cab_rename"
android:icon="@drawable/ic_rename_new" android:icon="@drawable/ic_rename_new_vector"
android:title="@string/rename" android:title="@string/rename"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item

View File

@@ -3,10 +3,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item <item
android:id="@+id/settings" android:id="@+id/settings"
android:icon="@drawable/ic_settings_cog_vector"
android:title="@string/settings" android:title="@string/settings"
app:showAsAction="never" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/about" android:id="@+id/about"
android:icon="@drawable/ic_info_vector"
android:title="@string/about" android:title="@string/about"
app:showAsAction="never" /> app:showAsAction="ifRoom" />
</menu> </menu>