mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 11:46:32 +00:00
fix empty states
This commit is contained in:
parent
6da4f1a34d
commit
136f6a5fec
6 changed files with 14 additions and 5 deletions
|
|
@ -8,7 +8,7 @@ class EmptyShopCategory(categoryIdentifier: String, context: Context?) {
|
|||
val description: String
|
||||
init {
|
||||
val stringId = when (categoryIdentifier) {
|
||||
"background" -> R.string.try_on_next_month
|
||||
"backgrounds" -> R.string.try_on_next_month
|
||||
"color" -> R.string.try_on_next_season
|
||||
"skin" -> R.string.try_on_next_season
|
||||
"mystery_sets" -> R.string.try_on_equipment
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ open class ShopItem : RealmObject(), BaseObject {
|
|||
|
||||
@SerializedName("klass")
|
||||
var habitClass: String? = null
|
||||
var specialClass: String? = null
|
||||
var previous: String? = null
|
||||
|
||||
@SerializedName("lvl")
|
||||
|
|
|
|||
|
|
@ -380,6 +380,12 @@ open class ShopFragment : BaseMainFragment<FragmentRefreshRecyclerviewBinding>()
|
|||
newCategory.items.add(item)
|
||||
}
|
||||
}
|
||||
val mysterySetCategory = newCategories.find { it.identifier == "mystery_sets" } ?: ShopCategory()
|
||||
if (mysterySetCategory.identifier.isEmpty()) {
|
||||
mysterySetCategory.identifier = "mystery_sets"
|
||||
mysterySetCategory.text = getString(R.string.mystery_sets)
|
||||
newCategories.add(mysterySetCategory)
|
||||
}
|
||||
shop.categories = newCategories
|
||||
return shop
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,9 +154,9 @@ class PurchaseDialog(
|
|||
}
|
||||
|
||||
val userLvl = user?.stats?.lvl ?: 0
|
||||
if (shopItem.habitClass != null && (shopItem.habitClass != "special" || shopItem.pinType == "marketGear") && shopItem.habitClass != "armoire" && user?.stats?.habitClass != shopItem.habitClass) {
|
||||
if (shopItem.habitClass != null && shopItem.specialClass != null && (shopItem.habitClass != "special" || shopItem.pinType == "marketGear") && shopItem.habitClass != "armoire" && user?.stats?.habitClass != shopItem.specialClass) {
|
||||
val classDisclaimerView = contentView.findViewById<TextView>(R.id.class_disclaimer_view)
|
||||
val className = getTranslatedClassNamePlural(context.resources, shopItem.habitClass ?: "")
|
||||
val className = getTranslatedClassNamePlural(context.resources, shopItem.specialClass ?: "")
|
||||
classDisclaimerView.text =
|
||||
if (userLvl >= 10) {
|
||||
context.getString(R.string.class_equipment_shop_dialog_new, className)
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
NAME=4.3.7
|
||||
CODE=7701
|
||||
CODE=7721
|
||||
|
|
@ -121,7 +121,9 @@ class LoginViewModel
|
|||
// the app access to the account, but the user can fix this.
|
||||
// Forward the user to an activity in Google Play services.
|
||||
val intent = e.intent
|
||||
recoverFromPlayServicesErrorResult.launch(intent)
|
||||
if (intent != null) {
|
||||
recoverFromPlayServicesErrorResult.launch(intent)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue