Add linked ingredients to recipe step (#177)

* Add Compose to app module

* Move Theme to ui module

* Add Coil image loader

* Use Compose for recipe screen

* Save instruction to ingredient relation to DB

* Display ingredients as server formats them

* Display linked ingredients under each step

* Fix ingredients padding

* Show recipe full screen

* Fix recipe screen UI issues

* Hide keyboard on recipe navigation

* Fix loading recipes from DB with no instructions or ingredients

* Add instructions section title

* Add ingredients section title

* Remove unused view holders
This commit is contained in:
Kirill Kamakin
2023-11-07 20:47:01 +01:00
committed by GitHub
parent 5ed1acb678
commit 941d45328e
46 changed files with 797 additions and 730 deletions

View File

@@ -24,11 +24,11 @@ interface ModelMapper {
fun toRecipeEntity(getRecipeResponse: GetRecipeResponse): RecipeEntity
fun toRecipeIngredientEntity(
ingredientResponse: GetRecipeIngredientResponse, remoteId: String
ingredientResponse: GetRecipeIngredientResponse, recipeId: String
): RecipeIngredientEntity
fun toRecipeInstructionEntity(
instructionResponse: GetRecipeInstructionResponse, remoteId: String
instructionResponse: GetRecipeInstructionResponse, recipeId: String
): RecipeInstructionEntity
fun toRecipeSummaryEntity(

View File

@@ -32,22 +32,26 @@ class ModelMapperImpl @Inject constructor() : ModelMapper {
override fun toRecipeIngredientEntity(
ingredientResponse: GetRecipeIngredientResponse,
remoteId: String
recipeId: String
) = RecipeIngredientEntity(
recipeId = remoteId,
id = ingredientResponse.referenceId,
recipeId = recipeId,
note = ingredientResponse.note,
unit = ingredientResponse.unit?.name,
food = ingredientResponse.food?.name,
quantity = ingredientResponse.quantity,
display = ingredientResponse.display,
title = ingredientResponse.title,
)
override fun toRecipeInstructionEntity(
instructionResponse: GetRecipeInstructionResponse,
remoteId: String
recipeId: String
) = RecipeInstructionEntity(
recipeId = remoteId,
id = instructionResponse.id,
recipeId = recipeId,
text = instructionResponse.text,
title = instructionResponse.title,
)
override fun toRecipeSummaryEntity(