update commons to 2.28.8

This commit is contained in:
tibbi 2017-09-27 23:28:56 +02:00
parent 262b81c1b0
commit f25fa53ca5
3 changed files with 3 additions and 18 deletions

View File

@ -37,7 +37,7 @@ android {
}
dependencies {
compile 'com.simplemobiletools:commons:2.28.4'
compile 'com.simplemobiletools:commons:2.28.8'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

View File

@ -6,7 +6,6 @@ import android.content.ActivityNotFoundException
import android.content.Intent
import android.content.pm.PackageManager
import android.content.res.Resources
import android.database.Cursor
import android.hardware.Camera
import android.hardware.SensorManager
import android.net.Uri
@ -382,7 +381,7 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
private fun setupPreviewImage(isPhoto: Boolean) {
val uri = if (isPhoto) MediaStore.Images.Media.EXTERNAL_CONTENT_URI else MediaStore.Video.Media.EXTERNAL_CONTENT_URI
val lastMediaId = getLastMediaId(uri)
val lastMediaId = getLatestMediaId(uri)
if (lastMediaId == 0L) {
return
}
@ -403,21 +402,6 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
}
}
private fun getLastMediaId(uri: Uri): Long {
val projection = arrayOf(MediaStore.Images.ImageColumns._ID)
val sortOrder = "${MediaStore.Images.ImageColumns.DATE_TAKEN} DESC"
var cursor: Cursor? = null
try {
cursor = contentResolver.query(uri, projection, null, null, sortOrder)
if (cursor?.moveToFirst() == true) {
return cursor.getLongValue(MediaStore.Images.ImageColumns._ID)
}
} finally {
cursor?.close()
}
return 0
}
private fun scheduleFadeOut() = mFadeHandler.postDelayed({ fadeOutButtons() }, FADE_DELAY.toLong())
private fun fadeOutButtons() {

View File

@ -15,6 +15,7 @@ buildscript {
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}