mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-03 10:11:09 +02:00
remove used classes
This commit is contained in:
parent
0937d0da24
commit
bfadeedacf
3
app/proguard-rules.pro
vendored
3
app/proguard-rules.pro
vendored
@ -1,6 +1,3 @@
|
|||||||
-keep class com.simplemobiletools.notes.pro.models.ChecklistItem {
|
-keep class com.simplemobiletools.notes.pro.models.ChecklistItem {
|
||||||
<fields>;
|
<fields>;
|
||||||
}
|
}
|
||||||
-keep class com.simplemobiletools.notes.pro.models.ChecklistSort {
|
|
||||||
<fields>;
|
|
||||||
}
|
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
package com.simplemobiletools.notes.pro.models
|
|
||||||
|
|
||||||
data class ChecklistSort(
|
|
||||||
val field: ChecklistSortField,
|
|
||||||
val direction: ChecklistSortDirection,
|
|
||||||
) {
|
|
||||||
|
|
||||||
fun getSortComparator(): Comparator<ChecklistItem> {
|
|
||||||
return when (field) {
|
|
||||||
ChecklistSortField.TITLE -> compareWithSortDirection { it.title }
|
|
||||||
ChecklistSortField.DATE_CREATED -> compareWithSortDirection { it.dateCreated }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun compareWithSortDirection(compareFunc: (ChecklistItem) -> Comparable<*>): Comparator<ChecklistItem> {
|
|
||||||
return when (direction) {
|
|
||||||
ChecklistSortDirection.ASCENDING -> compareBy(compareFunc)
|
|
||||||
ChecklistSortDirection.DESCENDING -> compareByDescending(compareFunc)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
package com.simplemobiletools.notes.pro.models
|
|
||||||
|
|
||||||
enum class ChecklistSortDirection {
|
|
||||||
ASCENDING,
|
|
||||||
DESCENDING,
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
package com.simplemobiletools.notes.pro.models
|
|
||||||
|
|
||||||
enum class ChecklistSortField {
|
|
||||||
TITLE,
|
|
||||||
DATE_CREATED,
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user