mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
do not show the Date Taken value fixing related toast messages at bin
This commit is contained in:
parent
dcfca72064
commit
376c3d0d1e
2 changed files with 14 additions and 6 deletions
|
@ -331,7 +331,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
|
||||||
|
|
||||||
private fun fixDateTaken() {
|
private fun fixDateTaken() {
|
||||||
Thread {
|
Thread {
|
||||||
activity.fixDateTaken(getSelectedPaths()) {
|
activity.fixDateTaken(getSelectedPaths(), true) {
|
||||||
listener?.refreshItems()
|
listener?.refreshItems()
|
||||||
finishActMode()
|
finishActMode()
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,7 +278,7 @@ fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList<String>, mediumDa
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
|
|
||||||
fixDateTaken(newPaths)
|
fixDateTaken(newPaths, false)
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,9 +328,12 @@ fun Activity.hasNavBar(): Boolean {
|
||||||
return (realDisplayMetrics.widthPixels - displayMetrics.widthPixels > 0) || (realDisplayMetrics.heightPixels - displayMetrics.heightPixels > 0)
|
return (realDisplayMetrics.widthPixels - displayMetrics.widthPixels > 0) || (realDisplayMetrics.heightPixels - displayMetrics.heightPixels > 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Activity.fixDateTaken(paths: ArrayList<String>, callback: (() -> Unit)? = null) {
|
fun Activity.fixDateTaken(paths: ArrayList<String>, showToasts: Boolean, callback: (() -> Unit)? = null) {
|
||||||
val BATCH_SIZE = 50
|
val BATCH_SIZE = 50
|
||||||
toast(R.string.fixing)
|
if (showToasts) {
|
||||||
|
toast(R.string.fixing)
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var didUpdateFile = false
|
var didUpdateFile = false
|
||||||
val operations = ArrayList<ContentProviderOperation>()
|
val operations = ArrayList<ContentProviderOperation>()
|
||||||
|
@ -371,13 +374,18 @@ fun Activity.fixDateTaken(paths: ArrayList<String>, callback: (() -> Unit)? = nu
|
||||||
didUpdateFile = false
|
didUpdateFile = false
|
||||||
}
|
}
|
||||||
|
|
||||||
toast(if (didUpdateFile) R.string.dates_fixed_successfully else R.string.unknown_error_occurred)
|
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
if (showToasts) {
|
||||||
|
toast(if (didUpdateFile) R.string.dates_fixed_successfully else R.string.unknown_error_occurred)
|
||||||
|
}
|
||||||
|
|
||||||
callback?.invoke()
|
callback?.invoke()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
if (showToasts) {
|
||||||
|
showErrorToast(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue