update commons, kotlin, gradle

This commit is contained in:
tibbi 2017-06-14 23:06:42 +02:00
parent 0c9c3c6916
commit 99836e3276
6 changed files with 13 additions and 8 deletions

View file

@ -32,7 +32,7 @@ android {
}
dependencies {
compile 'com.simplemobiletools:commons:2.16.1'
compile 'com.simplemobiletools:commons:2.20.1'
compile 'com.squareup:otto:1.3.8'
compile 'com.facebook.stetho:stetho:1.4.2'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
@ -40,7 +40,7 @@ dependencies {
}
buildscript {
ext.kotlin_version = '1.1.1'
ext.kotlin_version = '1.1.2-5'
repositories {
mavenCentral()
}

View file

@ -256,7 +256,6 @@ class MainActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener {
override fun onDestroy() {
super.onDestroy()
config.isFirstRun = false
mBus.unregister(this)
}
@ -281,6 +280,11 @@ class MainActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener {
progressbar.progress = event.progress
}
@Subscribe
fun noStoragePermission(event: Events.NoStoragePermission) {
toast(R.string.no_permissions)
}
private fun markCurrentSong() {
val newSongId = MusicService.mCurrSong?.id ?: -1L
val cnt = mSongs.size - 1

View file

@ -38,7 +38,7 @@ class EditDialog(val activity: SimpleActivity, val song: Song, val callback: (So
val newFileExtension = view.extension.value
if (newTitle.isEmpty() || newArtist.isEmpty() || newFilename.isEmpty() || newFileExtension.isEmpty()) {
context.toast(R.string.rename_song_empty)
activity.toast(R.string.rename_song_empty)
return@setOnClickListener
}
@ -66,7 +66,7 @@ class EditDialog(val activity: SimpleActivity, val song: Song, val callback: (So
return@setOnClickListener
}
context.toast(R.string.rename_song_error)
activity.toast(R.string.rename_song_error)
}
})
}

View file

@ -10,4 +10,6 @@ class Events {
class PlaylistUpdated internal constructor(val songs: ArrayList<Song>)
class ProgressUpdated internal constructor(val progress: Int)
class NoStoragePermission internal constructor()
}

View file

@ -21,7 +21,6 @@ import android.util.Log
import com.simplemobiletools.commons.extensions.getIntValue
import com.simplemobiletools.commons.extensions.getStringValue
import com.simplemobiletools.commons.extensions.hasWriteStoragePermission
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.musicplayer.R
import com.simplemobiletools.musicplayer.activities.MainActivity
import com.simplemobiletools.musicplayer.extensions.config
@ -79,7 +78,7 @@ class MusicService : Service(), MediaPlayer.OnPreparedListener, MediaPlayer.OnEr
if (hasWriteStoragePermission()) {
initService()
} else {
toast(R.string.no_permissions)
mBus!!.post(Events.NoStoragePermission())
}
}

View file

@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files