Correctly sort seasonal shop

This commit is contained in:
Phillip Thelen 2021-04-07 16:21:21 +02:00
parent 20c5dd83a3
commit 3d2fa60d98
2 changed files with 11 additions and 25 deletions

View file

@ -162,13 +162,17 @@ open class ShopFragment : BaseMainFragment<FragmentRecyclerviewBinding>() {
specialCategory.items.add(ShopItem.makeFortifyItem(context?.resources))
shop1.categories.add(specialCategory)
}
if (shop1.identifier == Shop.TIME_TRAVELERS_SHOP) {
formatTimeTravelersShop(shop1)
} else if (shop1.identifier == Shop.SEASONAL_SHOP) {
shop1.categories.reverse()
shop1
} else {
shop1
when (shop1.identifier) {
Shop.TIME_TRAVELERS_SHOP -> {
formatTimeTravelersShop(shop1)
}
Shop.SEASONAL_SHOP -> {
shop1.categories.sortWith(compareBy<ShopCategory> { it.items.size != 1 }.thenByDescending { it.items.firstOrNull()?.event?.end })
shop1
}
else -> {
shop1
}
}
}
.subscribe({

View file

@ -1,18 +0,0 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.habitrpg.android.habitica",
"variantName": "processStaffReleaseResources",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 2841,
"versionName": "3.2.1",
"outputFile": "Habitica-staff-release.apk"
}
]
}