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:
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user