mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Clean up
This commit is contained in:
parent
fbc4f04ff2
commit
9aba7d289a
@ -115,7 +115,7 @@ class ExploreFragment : MainNavFragmentX() {
|
|||||||
*categories.sorted().toTypedArray()
|
*categories.sorted().toTypedArray()
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
viewModel.setSection(
|
viewModel.sections.postValue(
|
||||||
when (it) {
|
when (it) {
|
||||||
getString(R.string.all_applications) -> Section.All
|
getString(R.string.all_applications) -> Section.All
|
||||||
else -> Section.Category(it)
|
else -> Section.Category(it)
|
||||||
|
@ -129,30 +129,6 @@ class MainNavFragmentViewModelX(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setSection(newSection: Section) {
|
|
||||||
viewModelScope.launch {
|
|
||||||
if (newSection != sections.value) {
|
|
||||||
sections.value = newSection
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setOrder(newOrder: Order) {
|
|
||||||
viewModelScope.launch {
|
|
||||||
if (newOrder != order.value) {
|
|
||||||
order.value = newOrder
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setSearchQuery(newSearchQuery: String) {
|
|
||||||
viewModelScope.launch {
|
|
||||||
if (newSearchQuery != searchQuery.value) {
|
|
||||||
searchQuery.value = newSearchQuery
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Factory(
|
class Factory(
|
||||||
val db: DatabaseX,
|
val db: DatabaseX,
|
||||||
private val primarySource: Source,
|
private val primarySource: Source,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user