updating gradle, kotlin and some crashfixes

This commit is contained in:
tibbi 2020-04-17 22:23:34 +02:00
parent 85882c5304
commit 2eef96b8f0
5 changed files with 21 additions and 14 deletions

View file

@ -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

View file

@ -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) {
}
}
}

View file

@ -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

View file

@ -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

View file

@ -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