diff --git a/Habitica/AndroidManifest.xml b/Habitica/AndroidManifest.xml
index 39e9edf19..ed0a0b018 100644
--- a/Habitica/AndroidManifest.xml
+++ b/Habitica/AndroidManifest.xml
@@ -204,9 +204,6 @@
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
-
diff --git a/Habitica/src/androidTest/java/com/habitrpg/android/habitica/ui/fragments/inventory/items/ItemRecyclerFragmentTest.kt b/Habitica/src/androidTest/java/com/habitrpg/android/habitica/ui/fragments/inventory/items/ItemRecyclerFragmentTest.kt
index d4806812c..ca01795b6 100644
--- a/Habitica/src/androidTest/java/com/habitrpg/android/habitica/ui/fragments/inventory/items/ItemRecyclerFragmentTest.kt
+++ b/Habitica/src/androidTest/java/com/habitrpg/android/habitica/ui/fragments/inventory/items/ItemRecyclerFragmentTest.kt
@@ -134,7 +134,7 @@ internal class ItemRecyclerFragmentTest : FragmentTestCase()
- every { hatchPetUseCase.observable(capture(slot)) } returns mockk(relaxed = true)
+ every { hatchPetUseCase.callInteractor(capture(slot)) } returns mockk(relaxed = true)
fragment.itemType = "eggs"
launchFragment()
screen {
@@ -142,7 +142,7 @@ internal class ItemRecyclerFragmentTest : FragmentTestCase { withDescendant { withText("Wolf") } }.click()
KView { withText(R.string.hatch_with_potion) }.click()
KView { withText("Shade") }.click()
- verify { hatchPetUseCase.observable(any()) }
+ verify { hatchPetUseCase.callInteractor(any()) }
slot.captured.egg.key shouldBe "Wolf"
slot.captured.potion.key shouldBe "Shade"
}
@@ -152,7 +152,7 @@ internal class ItemRecyclerFragmentTest : FragmentTestCase()
- every { hatchPetUseCase.observable(capture(slot)) } returns mockk(relaxed = true)
+ every { hatchPetUseCase.callInteractor(capture(slot)) } returns mockk(relaxed = true)
fragment.itemType = "hatchingPotions"
launchFragment()
screen {
@@ -160,7 +160,7 @@ internal class ItemRecyclerFragmentTest : FragmentTestCase { withDescendant { withText("Shade") } }.click()
KView { withText(R.string.hatch_egg) }.click()
KView { withText("Wolf") }.click()
- verify { hatchPetUseCase.observable(any()) }
+ verify { hatchPetUseCase.callInteractor(any()) }
slot.captured.egg.key shouldBe "Wolf"
slot.captured.potion.key shouldBe "Shade"
}
diff --git a/Habitica/src/androidTest/java/com/habitrpg/android/habitica/ui/fragments/inventory/stable/PetDetailFragmentTest.kt b/Habitica/src/androidTest/java/com/habitrpg/android/habitica/ui/fragments/inventory/stable/PetDetailFragmentTest.kt
index 78509ba7e..b44295720 100644
--- a/Habitica/src/androidTest/java/com/habitrpg/android/habitica/ui/fragments/inventory/stable/PetDetailFragmentTest.kt
+++ b/Habitica/src/androidTest/java/com/habitrpg/android/habitica/ui/fragments/inventory/stable/PetDetailFragmentTest.kt
@@ -69,7 +69,7 @@ internal class PetDetailRecyclerFragmentTest :
@Test
fun canFeedPet() {
val slot = CapturingSlot()
- every { feedPetUseCase.observable(capture(slot)) } returns mockk(relaxed = true)
+ every { feedPetUseCase.callInteractor(capture(slot)) } returns mockk(relaxed = true)
every {
inventoryRepository.getPets(
any(),
@@ -92,7 +92,7 @@ internal class PetDetailRecyclerFragmentTest :
childWith { withContentDescription("Skeleton Cactus") }.click()
KView { withText(R.string.feed) }.click()
KView { withText("Meat") }.click()
- verify { feedPetUseCase.observable(any()) }
+ verify { feedPetUseCase.callInteractor(any()) }
slot.captured.pet.key shouldBe "Cactus-Skeleton"
slot.captured.food.key shouldBe "Meat"
}
@@ -102,7 +102,7 @@ internal class PetDetailRecyclerFragmentTest :
@Test
fun canUseSaddle() {
val slot = CapturingSlot()
- every { feedPetUseCase.observable(capture(slot)) } returns mockk(relaxed = true)
+ every { feedPetUseCase.callInteractor(capture(slot)) } returns mockk(relaxed = true)
every {
inventoryRepository.getPets(
any(),
@@ -122,7 +122,7 @@ internal class PetDetailRecyclerFragmentTest :
recycler {
childWith { withContentDescription("Shade Fox") }.click()
KView { withText(R.string.use_saddle) }.click()
- verify { feedPetUseCase.observable(any()) }
+ verify { feedPetUseCase.callInteractor(any()) }
slot.captured.pet.key shouldBe "Fox-Shade"
slot.captured.food.key shouldBe "Saddle"
}
diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/api/ApiService.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/api/ApiService.kt
index 8fb909988..e56a215b0 100644
--- a/Habitica/src/main/java/com/habitrpg/android/habitica/api/ApiService.kt
+++ b/Habitica/src/main/java/com/habitrpg/android/habitica/api/ApiService.kt
@@ -36,7 +36,6 @@ import com.habitrpg.shared.habitica.models.responses.FeedResponse
import com.habitrpg.shared.habitica.models.responses.Status
import com.habitrpg.shared.habitica.models.responses.TaskDirectionData
import com.habitrpg.shared.habitica.models.responses.VerifyUsernameResponse
-import io.reactivex.rxjava3.core.Flowable
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
@@ -60,7 +59,7 @@ interface ApiService {
@GET("inbox/messages")
suspend fun getInboxMessages(@Query("conversation") uuid: String, @Query("page") page: Int): HabitResponse>
@GET("inbox/conversations")
- fun getInboxConversations(): Flowable>>
+ suspend fun getInboxConversations(): HabitResponse>
@GET("tasks/user")
suspend fun getTasks(): HabitResponse
@@ -75,13 +74,13 @@ interface ApiService {
suspend fun updateUser(@Body updateDictionary: Map): HabitResponse
@PUT("user/")
- fun registrationLanguage(@Header("Accept-Language") registrationLanguage: String): Flowable>
+ suspend fun registrationLanguage(@Header("Accept-Language") registrationLanguage: String): HabitResponse
@GET("user/in-app-rewards")
suspend fun retrieveInAppRewards(): HabitResponse>
@POST("user/equip/{type}/{key}")
- fun equipItem(@Path("type") type: String, @Path("key") itemKey: String): Flowable>
+ suspend fun equipItem(@Path("type") type: String, @Path("key") itemKey: String): HabitResponse
@POST("user/buy/{key}")
suspend fun buyItem(@Path("key") itemKey: String, @Body quantity: Map): HabitResponse
@@ -106,72 +105,72 @@ interface ApiService {
suspend fun purchaseSpecialSpell(@Path("key") key: String): HabitResponse
@POST("user/sell/{type}/{key}")
- fun sellItem(@Path("type") itemType: String, @Path("key") itemKey: String): Flowable>
+ suspend fun sellItem(@Path("type") itemType: String, @Path("key") itemKey: String): HabitResponse
@POST("user/feed/{pet}/{food}")
- fun feedPet(@Path("pet") petKey: String, @Path("food") foodKey: String): Flowable>
+ suspend fun feedPet(@Path("pet") petKey: String, @Path("food") foodKey: String): HabitResponse
@POST("user/hatch/{egg}/{hatchingPotion}")
- fun hatchPet(@Path("egg") eggKey: String, @Path("hatchingPotion") hatchingPotionKey: String): Flowable>
+ suspend fun hatchPet(@Path("egg") eggKey: String, @Path("hatchingPotion") hatchingPotionKey: String): HabitResponse
@GET("tasks/user")
- fun getTasks(@Query("type") type: String): Flowable>
+ suspend fun getTasks(@Query("type") type: String): HabitResponse
@GET("tasks/user")
- fun getTasks(@Query("type") type: String, @Query("dueDate") dueDate: String): Flowable>
+ suspend fun getTasks(@Query("type") type: String, @Query("dueDate") dueDate: String): HabitResponse
@POST("user/unlock")
suspend fun unlockPath(@Query("path") path: String): HabitResponse
@GET("tasks/{id}")
- fun getTask(@Path("id") id: String): Flowable>
+ suspend fun getTask(@Path("id") id: String): HabitResponse
@POST("tasks/{id}/score/{direction}")
suspend fun postTaskDirection(@Path("id") id: String, @Path("direction") direction: String): HabitResponse
@POST("tasks/bulk-score")
- fun bulkScoreTasks(@Body data: List