update commons to 2.28.8
This commit is contained in:
parent
262b81c1b0
commit
f25fa53ca5
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -15,6 +15,7 @@ buildscript {
|
|||
allprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue