From fce589d973fa13ab44f13d07a2e55a6c5fa1c84b Mon Sep 17 00:00:00 2001 From: Phillip Thelen Date: Fri, 27 Jan 2023 13:12:32 +0100 Subject: [PATCH] fixes --- .../data/implementation/UserRepositoryImpl.kt | 13 +++++++++---- .../ui/adapter/CustomizationRecyclerViewAdapter.kt | 3 ++- .../customization/AvatarCustomizationFragment.kt | 4 +++- fastlane/changelog.txt | 13 +++++-------- version.properties | 4 ++-- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/data/implementation/UserRepositoryImpl.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/data/implementation/UserRepositoryImpl.kt index 274e8bd4b..b2b71a674 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/data/implementation/UserRepositoryImpl.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/data/implementation/UserRepositoryImpl.kt @@ -332,11 +332,16 @@ class UserRepositoryImpl( } } } - var updatePath = "preferences.$type" - if (category != null) { - updatePath = "$updatePath.$category" + if (type == "background") { + apiClient.unlockPath("background.$identifier") + return retrieveUser(false, true) + } else { + var updatePath = "preferences.$type" + if (category != null) { + updatePath = "$updatePath.$category" + } + return updateUser(updatePath, identifier) } - return updateUser(updatePath, identifier) } override suspend fun retrieveAchievements(): List? { diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/adapter/CustomizationRecyclerViewAdapter.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/adapter/CustomizationRecyclerViewAdapter.kt index 48743196d..aa77f755c 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/adapter/CustomizationRecyclerViewAdapter.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/adapter/CustomizationRecyclerViewAdapter.kt @@ -168,8 +168,9 @@ class CustomizationRecyclerViewAdapter() : androidx.recyclerview.widget.Recycler this.customization = customization if (customization.type == "background" && customization.identifier == "") { - binding.imageView.setImageResource(R.drawable.no_background) binding.imageView.bitmap = null + binding.imageView.tag = null + binding.imageView.setImageResource(R.drawable.no_background) } else { binding.imageView.loadImage(customization.getIconName(userSize, hairColor)) } diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/inventory/customization/AvatarCustomizationFragment.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/inventory/customization/AvatarCustomizationFragment.kt index 1ddaf740e..c31d311e6 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/inventory/customization/AvatarCustomizationFragment.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/inventory/customization/AvatarCustomizationFragment.kt @@ -82,7 +82,9 @@ class AvatarCustomizationFragment : showsBackButton = true adapter.onCustomizationSelected = { customization -> lifecycleScope.launchCatching { - if (customization.type == "background" && ownedCustomizations.value.firstOrNull { it.key == customization.identifier } == null) { + if (customization.identifier?.isNotBlank() != true) { + userRepository.useCustomization(customization.type ?: "", customization.category, activeCustomization ?: "") + } else if (customization.type == "background" && ownedCustomizations.value.firstOrNull { it.key == customization.identifier } == null) { userRepository.unlockPath(customization) userRepository.retrieveUser(false, true, true) } else { diff --git a/fastlane/changelog.txt b/fastlane/changelog.txt index fd05a0cc1..8a6cb751a 100644 --- a/fastlane/changelog.txt +++ b/fastlane/changelog.txt @@ -1,12 +1,9 @@ -New in 4.1: --You can view, complete, assign, and add tasks to your Group Plan's shared task board! +New in 4.1.2: +-Fixed equipping a blank background, buying animal ears/tails, and the task create button in light mode +-You can view, complete, assign, and add tasks to your Group Plan’s shared task board! -Tap your name on a task screen to switch to different task boards --Task details are now tinted based on task health +-More intuitive system notification settings -New Avatar Customization interface -Audio will be controlled by media volume now +-Task details are now tinted based on task health -Fixed a bug that caused tasks to shuffle around --Monthly Dailies should recur more consistently now --More intuitive system notification settings --Improved link support --More special event support - diff --git a/version.properties b/version.properties index 03a00515e..88f9fd688 100644 --- a/version.properties +++ b/version.properties @@ -1,2 +1,2 @@ -NAME=4.1.1 -CODE=5151 \ No newline at end of file +NAME=4.1.2 +CODE=5201 \ No newline at end of file