|
|
@ -155,6 +155,11 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV |
|
|
|
sortCheck(Sort.Update) |
|
|
|
sortCheck(Sort.Update) |
|
|
|
upBookSource(searchView.query?.toString()) |
|
|
|
upBookSource(searchView.query?.toString()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
R.id.menu_sort_respondTime -> { |
|
|
|
|
|
|
|
item.isChecked = true |
|
|
|
|
|
|
|
sortCheck(Sort.Respond) |
|
|
|
|
|
|
|
upBookSource(searchView.query?.toString()) |
|
|
|
|
|
|
|
} |
|
|
|
R.id.menu_sort_enable -> { |
|
|
|
R.id.menu_sort_enable -> { |
|
|
|
item.isChecked = true |
|
|
|
item.isChecked = true |
|
|
|
sortCheck(Sort.Enable) |
|
|
|
sortCheck(Sort.Enable) |
|
|
@ -233,6 +238,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV |
|
|
|
} |
|
|
|
} |
|
|
|
Sort.Url -> data.sortedBy { it.bookSourceUrl } |
|
|
|
Sort.Url -> data.sortedBy { it.bookSourceUrl } |
|
|
|
Sort.Update -> data.sortedByDescending { it.lastUpdateTime } |
|
|
|
Sort.Update -> data.sortedByDescending { it.lastUpdateTime } |
|
|
|
|
|
|
|
Sort.Respond -> data.sortedBy { it.respondTime } |
|
|
|
Sort.Enable -> data.sortedWith { o1, o2 -> |
|
|
|
Sort.Enable -> data.sortedWith { o1, o2 -> |
|
|
|
var sort = -o1.enabled.compareTo(o2.enabled) |
|
|
|
var sort = -o1.enabled.compareTo(o2.enabled) |
|
|
|
if (sort == 0) { |
|
|
|
if (sort == 0) { |
|
|
@ -249,6 +255,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV |
|
|
|
} |
|
|
|
} |
|
|
|
Sort.Url -> data.sortedByDescending { it.bookSourceUrl } |
|
|
|
Sort.Url -> data.sortedByDescending { it.bookSourceUrl } |
|
|
|
Sort.Update -> data.sortedBy { it.lastUpdateTime } |
|
|
|
Sort.Update -> data.sortedBy { it.lastUpdateTime } |
|
|
|
|
|
|
|
Sort.Respond -> data.sortedByDescending { it.respondTime } |
|
|
|
Sort.Enable -> data.sortedWith { o1, o2 -> |
|
|
|
Sort.Enable -> data.sortedWith { o1, o2 -> |
|
|
|
var sort = o1.enabled.compareTo(o2.enabled) |
|
|
|
var sort = o1.enabled.compareTo(o2.enabled) |
|
|
|
if (sort == 0) { |
|
|
|
if (sort == 0) { |
|
|
@ -547,6 +554,6 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
enum class Sort { |
|
|
|
enum class Sort { |
|
|
|
Default, Name, Url, Weight, Update, Enable |
|
|
|
Default, Name, Url, Weight, Update, Enable, Respond |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |