Use Compose to draw the list of recipes (#187)

* Add paging-compose dependency

* Move progress indicator to separate module

* Introduce color scheme preview

* Move loading helper to UI module

* Move helper composables to UI module

* Rearrange shopping lists module

* Add LazyPagingColumnPullRefresh Composable

* Add BaseComposeFragment

* Add pagingDataRecipeState

* Add showFavoriteIcon to recipe state

* Disable unused placeholders

* Make "Try again" button optional

* Fix example email

* Wrap recipe info into a Scaffold

* Add dialog to confirm deletion

* Add RecipeItem Composable

* Add RecipeListError Composable

* Add RecipeList Composable

* Replace recipes list Views with Compose

* Update UI test

* Remove application from ViewModel
This commit is contained in:
Kirill Kamakin
2023-11-23 07:23:30 +01:00
committed by GitHub
parent 4301c623c9
commit f6f44c7592
72 changed files with 935 additions and 1131 deletions

View File

@@ -4,8 +4,10 @@ import androidx.lifecycle.asFlow
import com.google.common.truth.Truth.assertThat
import gq.kirmanak.mealient.data.auth.AuthRepo
import gq.kirmanak.mealient.data.recipes.RecipeRepo
import gq.kirmanak.mealient.data.recipes.impl.RecipeImageUrlProvider
import gq.kirmanak.mealient.database.CAKE_RECIPE_SUMMARY_ENTITY
import gq.kirmanak.mealient.test.BaseUnitTest
import gq.kirmanak.mealient.ui.recipes.list.RecipesListViewModel
import io.mockk.coEvery
import io.mockk.coVerify
import io.mockk.every
@@ -32,6 +34,9 @@ class RecipesListViewModelTest : BaseUnitTest() {
@MockK(relaxed = true)
lateinit var recipeRepo: RecipeRepo
@MockK(relaxed = true)
lateinit var recipeImageUrlProvider: RecipeImageUrlProvider
@Before
override fun setUp() {
super.setUp()
@@ -116,5 +121,10 @@ class RecipesListViewModelTest : BaseUnitTest() {
return results
}
private fun createSubject() = RecipesListViewModel(recipeRepo, authRepo, logger)
private fun createSubject() = RecipesListViewModel(
recipeRepo = recipeRepo,
logger = logger,
recipeImageUrlProvider = recipeImageUrlProvider,
authRepo = authRepo,
)
}