use date_modified instead of date_taken everywhere

This commit is contained in:
tibbi 2016-11-09 23:20:18 +01:00
parent fa14b43e3e
commit 267317c7c2
3 changed files with 7 additions and 7 deletions

View file

@ -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 {

View file

@ -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);

View file

@ -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
}