|
@@ -29,44 +29,46 @@ open class FileSortOrder(@JvmField var name: String, var isAscending: Boolean) {
|
|
|
}
|
|
|
|
|
|
enum class SortType {
|
|
|
- SIZE, ALPHABET, DATE
|
|
|
+ SIZE,
|
|
|
+ ALPHABET,
|
|
|
+ DATE
|
|
|
}
|
|
|
|
|
|
companion object {
|
|
|
- const val sort_a_to_z_id = "sort_a_to_z"
|
|
|
- const val sort_z_to_a_id = "sort_z_to_a"
|
|
|
- const val sort_old_to_new_id = "sort_old_to_new"
|
|
|
- const val sort_new_to_old_id = "sort_new_to_old"
|
|
|
- const val sort_small_to_big_id = "sort_small_to_big"
|
|
|
- const val sort_big_to_small_id = "sort_big_to_small"
|
|
|
+ const val SORT_A_TO_Z_ID = "sort_a_to_z"
|
|
|
+ const val SORT_Z_TO_A_ID = "sort_z_to_a"
|
|
|
+ const val SORT_OLD_TO_NEW_ID = "sort_old_to_new"
|
|
|
+ const val SORT_NEW_TO_OLD_ID = "sort_new_to_old"
|
|
|
+ const val SORT_SMALL_TO_BIG_ID = "sort_small_to_big"
|
|
|
+ const val SORT_BIG_TO_SMALL_ID = "sort_big_to_small"
|
|
|
|
|
|
@JvmField
|
|
|
- val sort_a_to_z: FileSortOrder = FileSortOrderByName(sort_a_to_z_id, true)
|
|
|
+ val SORT_A_TO_Z: FileSortOrder = FileSortOrderByName(SORT_A_TO_Z_ID, true)
|
|
|
|
|
|
@JvmField
|
|
|
- val sort_z_to_a: FileSortOrder = FileSortOrderByName(sort_z_to_a_id, false)
|
|
|
+ val SORT_Z_TO_A: FileSortOrder = FileSortOrderByName(SORT_Z_TO_A_ID, false)
|
|
|
|
|
|
@JvmField
|
|
|
- val sort_old_to_new: FileSortOrder = FileSortOrderByDate(sort_old_to_new_id, true)
|
|
|
+ val SORT_OLD_TO_NEW: FileSortOrder = FileSortOrderByDate(SORT_OLD_TO_NEW_ID, true)
|
|
|
|
|
|
@JvmField
|
|
|
- val sort_new_to_old: FileSortOrder = FileSortOrderByDate(sort_new_to_old_id, false)
|
|
|
+ val SORT_NEW_TO_OLD: FileSortOrder = FileSortOrderByDate(SORT_NEW_TO_OLD_ID, false)
|
|
|
|
|
|
@JvmField
|
|
|
- val sort_small_to_big: FileSortOrder = FileSortOrderBySize(sort_small_to_big_id, true)
|
|
|
+ val SORT_SMALL_TO_BIG: FileSortOrder = FileSortOrderBySize(SORT_SMALL_TO_BIG_ID, true)
|
|
|
|
|
|
@JvmField
|
|
|
- val sort_big_to_small: FileSortOrder = FileSortOrderBySize(sort_big_to_small_id, false)
|
|
|
+ val SORT_BIG_TO_SMALL: FileSortOrder = FileSortOrderBySize(SORT_BIG_TO_SMALL_ID, false)
|
|
|
|
|
|
@JvmField
|
|
|
val sortOrders: Map<String, FileSortOrder> = Collections.unmodifiableMap(
|
|
|
mapOf(
|
|
|
- sort_a_to_z.name to sort_a_to_z,
|
|
|
- sort_z_to_a.name to sort_z_to_a,
|
|
|
- sort_old_to_new.name to sort_old_to_new,
|
|
|
- sort_new_to_old.name to sort_new_to_old,
|
|
|
- sort_small_to_big.name to sort_small_to_big,
|
|
|
- sort_big_to_small.name to sort_big_to_small
|
|
|
+ SORT_A_TO_Z.name to SORT_A_TO_Z,
|
|
|
+ SORT_Z_TO_A.name to SORT_Z_TO_A,
|
|
|
+ SORT_OLD_TO_NEW.name to SORT_OLD_TO_NEW,
|
|
|
+ SORT_NEW_TO_OLD.name to SORT_NEW_TO_OLD,
|
|
|
+ SORT_SMALL_TO_BIG.name to SORT_SMALL_TO_BIG,
|
|
|
+ SORT_BIG_TO_SMALL.name to SORT_BIG_TO_SMALL
|
|
|
)
|
|
|
)
|
|
|
|
|
@@ -103,14 +105,14 @@ open class FileSortOrder(@JvmField var name: String, var isAscending: Boolean) {
|
|
|
|
|
|
open fun getType(): SortType {
|
|
|
return when (name) {
|
|
|
- sort_z_to_a_id,
|
|
|
- sort_a_to_z_id -> SortType.ALPHABET
|
|
|
+ SORT_Z_TO_A_ID,
|
|
|
+ SORT_A_TO_Z_ID -> SortType.ALPHABET
|
|
|
|
|
|
- sort_small_to_big_id,
|
|
|
- sort_big_to_small_id -> SortType.SIZE
|
|
|
+ SORT_SMALL_TO_BIG_ID,
|
|
|
+ SORT_BIG_TO_SMALL_ID -> SortType.SIZE
|
|
|
|
|
|
- sort_new_to_old_id,
|
|
|
- sort_old_to_new_id -> SortType.DATE
|
|
|
+ SORT_NEW_TO_OLD_ID,
|
|
|
+ SORT_OLD_TO_NEW_ID -> SortType.DATE
|
|
|
|
|
|
else -> SortType.ALPHABET
|
|
|
}
|