mirror of
https://github.com/SimpleMobileTools/Simple-Voice-Recorder.git
synced 2025-06-05 21:59:31 +02:00
catch and show errors thrown at playing a recording
This commit is contained in:
@@ -57,7 +57,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.27.6'
|
implementation 'com.simplemobiletools:commons:5.28.14'
|
||||||
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'
|
||||||
}
|
}
|
||||||
|
@@ -42,7 +42,7 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
setupColors()
|
setupColors()
|
||||||
if (!prevSavePath.isEmpty() && context!!.config.saveRecordingsFolder != prevSavePath) {
|
if (prevSavePath.isNotEmpty() && context!!.config.saveRecordingsFolder != prevSavePath) {
|
||||||
setupAdapter()
|
setupAdapter()
|
||||||
} else {
|
} else {
|
||||||
getRecordingsAdapter()?.updateTextColor(context.config.textColor)
|
getRecordingsAdapter()?.updateTextColor(context.config.textColor)
|
||||||
@@ -269,10 +269,14 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||||||
player!!.apply {
|
player!!.apply {
|
||||||
reset()
|
reset()
|
||||||
|
|
||||||
if (isQPlus()) {
|
try {
|
||||||
setDataSource(context, getAudioFileContentUri(recording.id.toLong()))
|
if (isQPlus()) {
|
||||||
} else {
|
setDataSource(context, getAudioFileContentUri(recording.id.toLong()))
|
||||||
setDataSource(recording.path)
|
} else {
|
||||||
|
setDataSource(recording.path)
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
context?.showErrorToast(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareAsync()
|
prepareAsync()
|
||||||
|
Reference in New Issue
Block a user