mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
update commons to 2.28.8
This commit is contained in:
@ -37,7 +37,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.simplemobiletools:commons:2.28.4'
|
compile 'com.simplemobiletools:commons:2.28.8'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import android.content.ActivityNotFoundException
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
import android.database.Cursor
|
|
||||||
import android.hardware.Camera
|
import android.hardware.Camera
|
||||||
import android.hardware.SensorManager
|
import android.hardware.SensorManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
@ -382,7 +381,7 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
|
|||||||
|
|
||||||
private fun setupPreviewImage(isPhoto: Boolean) {
|
private fun setupPreviewImage(isPhoto: Boolean) {
|
||||||
val uri = if (isPhoto) MediaStore.Images.Media.EXTERNAL_CONTENT_URI else MediaStore.Video.Media.EXTERNAL_CONTENT_URI
|
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) {
|
if (lastMediaId == 0L) {
|
||||||
return
|
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 scheduleFadeOut() = mFadeHandler.postDelayed({ fadeOutButtons() }, FADE_DELAY.toLong())
|
||||||
|
|
||||||
private fun fadeOutButtons() {
|
private fun fadeOutButtons() {
|
||||||
|
@ -15,6 +15,7 @@ buildscript {
|
|||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
|
maven { url 'https://jitpack.io' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user