updating gradle, kotlin and some crashfixes
This commit is contained in:
parent
85882c5304
commit
2eef96b8f0
5 changed files with 21 additions and 14 deletions
|
@ -4,7 +4,7 @@
|
|||
package="com.simplemobiletools.voicerecorder"
|
||||
android:installLocation="auto">
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission
|
||||
|
|
|
@ -49,7 +49,10 @@ class MainActivity : SimpleActivity() {
|
|||
|
||||
Intent(this@MainActivity, RecorderService::class.java).apply {
|
||||
action = STOP_AMPLITUDE_UPDATE
|
||||
startService(this)
|
||||
try {
|
||||
startService(this)
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -309,8 +309,8 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||
|
||||
private fun getProgressUpdateTask() = object : TimerTask() {
|
||||
override fun run() {
|
||||
if (player != null) {
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
if (player != null) {
|
||||
val progress = Math.round(player!!.currentPosition / 1000.toDouble()).toInt()
|
||||
updateCurrentProgress(progress)
|
||||
player_progressbar.progress = progress
|
||||
|
|
|
@ -111,16 +111,20 @@ class RecorderService : Service() {
|
|||
isRecording = false
|
||||
|
||||
recorder?.apply {
|
||||
stop()
|
||||
release()
|
||||
try {
|
||||
stop()
|
||||
release()
|
||||
|
||||
ensureBackgroundThread {
|
||||
if (isQPlus()) {
|
||||
addFileInNewMediaStore()
|
||||
} else {
|
||||
addFileInLegacyMediaStore()
|
||||
ensureBackgroundThread {
|
||||
if (isQPlus()) {
|
||||
addFileInNewMediaStore()
|
||||
} else {
|
||||
addFileInLegacyMediaStore()
|
||||
}
|
||||
EventBus.getDefault().post(Events.RecordingCompleted())
|
||||
}
|
||||
EventBus.getDefault().post(Events.RecordingCompleted())
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
recorder = null
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.3.71'
|
||||
ext.kotlin_version = '1.3.72'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.6.1'
|
||||
classpath 'com.android.tools.build:gradle:3.6.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
|
Loading…
Reference in a new issue