mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
update commons to 2.17.3
This commit is contained in:
parent
f94c09a83c
commit
972916f6b2
5 changed files with 14 additions and 16 deletions
|
@ -32,7 +32,7 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.simplemobiletools:commons:2.17.2'
|
||||
compile 'com.simplemobiletools:commons:2.17.3'
|
||||
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
|
||||
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
|
||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||
|
|
|
@ -47,18 +47,18 @@ class SaveAsDialog(val activity: SimpleActivity, val path: String, val callback:
|
|||
val extension = view.save_as_extension.value
|
||||
|
||||
if (filename.isEmpty()) {
|
||||
context.toast(R.string.filename_cannot_be_empty)
|
||||
activity.toast(R.string.filename_cannot_be_empty)
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
if (extension.isEmpty()) {
|
||||
context.toast(R.string.extension_cannot_be_empty)
|
||||
activity.toast(R.string.extension_cannot_be_empty)
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
val newFile = File(realPath, "$filename.$extension")
|
||||
if (!newFile.name.isAValidFilename()) {
|
||||
context.toast(R.string.filename_invalid_characters)
|
||||
activity.toast(R.string.filename_invalid_characters)
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
|
|
|
@ -175,6 +175,15 @@ fun Activity.hasNavBar(): Boolean {
|
|||
}
|
||||
}
|
||||
|
||||
fun Activity.launchCamera() {
|
||||
val intent = Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA)
|
||||
if (intent.resolveActivity(packageManager) != null) {
|
||||
startActivity(intent)
|
||||
} else {
|
||||
toast(R.string.no_camera_app_found)
|
||||
}
|
||||
}
|
||||
|
||||
fun SimpleActivity.launchAbout() {
|
||||
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_MULTISELECT or LICENSE_RTL
|
||||
or LICENSE_PHOTOVIEW or LICENSE_SUBSAMPLING, BuildConfig.VERSION_NAME)
|
||||
|
|
|
@ -6,8 +6,6 @@ import android.database.Cursor
|
|||
import android.net.Uri
|
||||
import android.provider.MediaStore
|
||||
import com.simplemobiletools.commons.extensions.humanizePath
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.gallery.R
|
||||
import com.simplemobiletools.gallery.activities.SettingsActivity
|
||||
import com.simplemobiletools.gallery.helpers.Config
|
||||
import com.simplemobiletools.gallery.helpers.NOMEDIA
|
||||
|
@ -35,15 +33,6 @@ fun Context.getHumanizedFilename(path: String): String {
|
|||
return humanized.substring(humanized.lastIndexOf("/") + 1)
|
||||
}
|
||||
|
||||
fun Context.launchCamera() {
|
||||
val intent = Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA)
|
||||
if (intent.resolveActivity(packageManager) != null) {
|
||||
startActivity(intent)
|
||||
} else {
|
||||
toast(R.string.no_camera_app_found)
|
||||
}
|
||||
}
|
||||
|
||||
fun Context.launchSettings() {
|
||||
startActivity(Intent(this, SettingsActivity::class.java))
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ class PhotoFragment : ViewPagerFragment() {
|
|||
rotated.compress(Bitmap.CompressFormat.JPEG, 100, out)
|
||||
medium.path = file.absolutePath
|
||||
} catch (e: Exception) {
|
||||
context.toast(R.string.unknown_error_occurred)
|
||||
activity.toast(R.string.unknown_error_occurred)
|
||||
return view
|
||||
} finally {
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue