adding some new grouping related constants
This commit is contained in:
parent
07e6ce9a23
commit
3e2c66e294
|
@ -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) {
|
||||
|
|
|
@ -18,7 +18,7 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickImage
|
|||
|
||||
override fun doInBackground(vararg params: Void): ArrayList<ThumbnailItem> {
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue