diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index f262f6514..117eda6f8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -134,7 +134,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { if (!config.wasRecycleBinPinned) { config.addPinnedFolders(hashSetOf(RECYCLE_BIN)) config.wasRecycleBinPinned = true - config.saveFolderGrouping(SHOW_ALL, GROUP_BY_DATE_TAKEN or GROUP_DESCENDING) + config.saveFolderGrouping(SHOW_ALL, GROUP_BY_DATE_TAKEN_DAILY or GROUP_DESCENDING) } if (!config.wasSVGShowingHandled) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt index d382422a4..5c21358cc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt @@ -18,7 +18,7 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickImage override fun doInBackground(vararg params: Void): ArrayList { val pathToUse = if (showAll) SHOW_ALL else mPath - val getProperDateTaken = context.config.getFileSorting(pathToUse) and SORT_BY_DATE_TAKEN != 0 || context.config.getFolderGrouping(pathToUse) and GROUP_BY_DATE_TAKEN != 0 + val getProperDateTaken = context.config.getFileSorting(pathToUse) and SORT_BY_DATE_TAKEN != 0 || context.config.getFolderGrouping(pathToUse) and GROUP_BY_DATE_TAKEN_DAILY != 0 val getProperFileSize = context.config.getFileSorting(pathToUse) and SORT_BY_SIZE != 0 val favoritePaths = context.getFavoritePaths() val getVideoDurations = context.config.showThumbnailVideoDuration diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeGroupingDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeGroupingDialog.kt index 90d1bdf6c..b477b8501 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeGroupingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeGroupingDialog.kt @@ -41,8 +41,8 @@ class ChangeGroupingDialog(val activity: BaseSimpleActivity, val path: String = val groupBtn = when { currGrouping and GROUP_BY_NONE != 0 -> groupingRadio.grouping_dialog_radio_none - currGrouping and GROUP_BY_LAST_MODIFIED != 0 -> groupingRadio.grouping_dialog_radio_last_modified - currGrouping and GROUP_BY_DATE_TAKEN != 0 -> groupingRadio.grouping_dialog_radio_date_taken + currGrouping and GROUP_BY_LAST_MODIFIED_DAILY != 0 -> groupingRadio.grouping_dialog_radio_last_modified + currGrouping and GROUP_BY_DATE_TAKEN_DAILY != 0 -> groupingRadio.grouping_dialog_radio_date_taken currGrouping and GROUP_BY_FILE_TYPE != 0 -> groupingRadio.grouping_dialog_radio_file_type currGrouping and GROUP_BY_EXTENSION != 0 -> groupingRadio.grouping_dialog_radio_extension else -> groupingRadio.grouping_dialog_radio_folder @@ -64,8 +64,8 @@ class ChangeGroupingDialog(val activity: BaseSimpleActivity, val path: String = val groupingRadio = view.grouping_dialog_radio_grouping var grouping = when (groupingRadio.checkedRadioButtonId) { R.id.grouping_dialog_radio_none -> GROUP_BY_NONE - R.id.grouping_dialog_radio_last_modified -> GROUP_BY_LAST_MODIFIED - R.id.grouping_dialog_radio_date_taken -> GROUP_BY_DATE_TAKEN + R.id.grouping_dialog_radio_last_modified -> GROUP_BY_LAST_MODIFIED_DAILY + R.id.grouping_dialog_radio_date_taken -> GROUP_BY_DATE_TAKEN_DAILY R.id.grouping_dialog_radio_file_type -> GROUP_BY_FILE_TYPE R.id.grouping_dialog_radio_extension -> GROUP_BY_EXTENSION else -> GROUP_BY_FOLDER diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt index 481d49080..382f31ecb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt @@ -161,11 +161,13 @@ const val LOCATION_SD = 2 const val LOCATION_OTG = 3 const val GROUP_BY_NONE = 1 -const val GROUP_BY_LAST_MODIFIED = 2 -const val GROUP_BY_DATE_TAKEN = 4 +const val GROUP_BY_LAST_MODIFIED_DAILY = 2 +const val GROUP_BY_DATE_TAKEN_DAILY = 4 const val GROUP_BY_FILE_TYPE = 8 const val GROUP_BY_EXTENSION = 16 const val GROUP_BY_FOLDER = 32 +const val GROUP_BY_LAST_MODIFIED_MONTHLY = 64 +const val GROUP_BY_DATE_TAKEN_MONTHLY = 128 const val GROUP_DESCENDING = 1024 // bottom actions diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index c64a0d88a..a7f867c7b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -336,7 +336,7 @@ class MediaFetcher(val context: Context) { } val sortDescending = currentGrouping and GROUP_DESCENDING != 0 - val sorted = if (currentGrouping and GROUP_BY_DATE_TAKEN != 0 || currentGrouping and GROUP_BY_LAST_MODIFIED != 0) { + val sorted = if (currentGrouping and GROUP_BY_DATE_TAKEN_DAILY != 0 || currentGrouping and GROUP_BY_LAST_MODIFIED_DAILY != 0) { mediumGroups.toSortedMap(if (sortDescending) compareByDescending { it.toLongOrNull() ?: 0L } else { @@ -364,7 +364,7 @@ class MediaFetcher(val context: Context) { private fun getFormattedKey(key: String, grouping: Int, today: String, yesterday: String): String { return when { - grouping and GROUP_BY_LAST_MODIFIED != 0 || grouping and GROUP_BY_DATE_TAKEN != 0 -> getFinalDate(formatDate(key), today, yesterday) + grouping and GROUP_BY_LAST_MODIFIED_DAILY != 0 || grouping and GROUP_BY_DATE_TAKEN_DAILY != 0 -> getFinalDate(formatDate(key), today, yesterday) grouping and GROUP_BY_FILE_TYPE != 0 -> getFileTypeString(key) grouping and GROUP_BY_EXTENSION != 0 -> key.toUpperCase() grouping and GROUP_BY_FOLDER != 0 -> context.humanizePath(key) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt index 4851de9b0..6be0459e9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt @@ -56,8 +56,8 @@ data class Medium( fun getGroupingKey(groupBy: Int): String { return when { - groupBy and GROUP_BY_LAST_MODIFIED != 0 -> getDayStartTS(modified) - groupBy and GROUP_BY_DATE_TAKEN != 0 -> getDayStartTS(taken) + groupBy and GROUP_BY_LAST_MODIFIED_DAILY != 0 -> getDayStartTS(modified) + groupBy and GROUP_BY_DATE_TAKEN_DAILY != 0 -> getDayStartTS(taken) groupBy and GROUP_BY_FILE_TYPE != 0 -> type.toString() groupBy and GROUP_BY_EXTENSION != 0 -> name.getFilenameExtension().toLowerCase() groupBy and GROUP_BY_FOLDER != 0 -> parentPath