diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java index 9509d19bf..7facfcce5 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java @@ -216,7 +216,7 @@ public class MediaActivity extends SimpleActivity } final String where = MediaStore.Images.Media.DATA + " like ? "; final String[] args = new String[]{mPath + "%"}; - final String[] columns = {MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_TAKEN}; + final String[] columns = {MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_MODIFIED}; final Cursor cursor = getContentResolver().query(uri, columns, where, args, null); final String pattern = Pattern.quote(mPath) + "/[^/]*"; @@ -230,7 +230,7 @@ public class MediaActivity extends SimpleActivity if (curPath.matches(pattern) && !mToBeDeleted.contains(curPath)) { final File file = new File(curPath); if (file.exists()) { - final int dateIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN); + final int dateIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_MODIFIED); final long timestamp = cursor.getLong(dateIndex); media.add(new Medium(curPath, (i == 1), timestamp, file.length())); } else { diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java index b5d062661..ff68cca5d 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java @@ -363,7 +363,7 @@ public class ViewPagerActivity extends SimpleActivity } final String where = MediaStore.Images.Media.DATA + " like ? "; final String[] args = new String[]{mDirectory + "%"}; - final String[] columns = {MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_TAKEN, MediaStore.Images.Media.SIZE}; + final String[] columns = {MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_MODIFIED, MediaStore.Images.Media.SIZE}; final Cursor cursor = getContentResolver().query(uri, columns, where, args, null); final String pattern = Pattern.quote(mDirectory) + "/[^/]*"; @@ -375,7 +375,7 @@ public class ViewPagerActivity extends SimpleActivity continue; if (curPath.matches(pattern) && !curPath.equals(mToBeDeleted) && !curPath.equals(mBeingDeleted)) { - final int dateIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN); + final int dateIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_MODIFIED); final long timestamp = cursor.getLong(dateIndex); final int sizeIndex = cursor.getColumnIndex(MediaStore.Images.Media.SIZE); diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index bcdf5aa23..07c6f0eba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -38,7 +38,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI } - val columns = arrayOf(MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_TAKEN) + val columns = arrayOf(MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_MODIFIED) val order = getSortOrder() val cursor = context.contentResolver.query(uri, columns, null, null, order) @@ -54,7 +54,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va continue } - val dateIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN) + val dateIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_MODIFIED) val timestamp = cursor.getLong(dateIndex) if (directories.containsKey(parentDir)) { val directory: Directory = directories[parentDir]!! @@ -93,7 +93,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va // sort the files at querying too, just to get the correct thumbnail private fun getSortOrder(): String { val sorting = mConfig.directorySorting - var sortBy = MediaStore.Images.Media.DATE_TAKEN + var sortBy = MediaStore.Images.Media.DATE_MODIFIED if (sorting and Constants.SORT_BY_NAME != 0) { sortBy = MediaStore.Images.Media.DATA }