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

@@ -8,8 +8,8 @@ data class GetRecipeResponse(
@SerialName("id") val remoteId: String,
@SerialName("name") val name: String,
@SerialName("recipeYield") val recipeYield: String = "",
@SerialName("recipeIngredient") val recipeIngredients: List<GetRecipeIngredientResponse> = emptyList(),
@SerialName("recipeInstructions") val recipeInstructions: List<GetRecipeInstructionResponse> = emptyList(),
@SerialName("recipeIngredient") val ingredients: List<GetRecipeIngredientResponse> = emptyList(),
@SerialName("recipeInstructions") val instructions: List<GetRecipeInstructionResponse> = emptyList(),
@SerialName("settings") val settings: GetRecipeSettingsResponse? = null,
)
@@ -24,10 +24,20 @@ data class GetRecipeIngredientResponse(
@SerialName("unit") val unit: GetUnitResponse?,
@SerialName("food") val food: GetFoodResponse?,
@SerialName("quantity") val quantity: Double?,
@SerialName("display") val display: String,
@SerialName("referenceId") val referenceId: String,
@SerialName("title") val title: String?,
)
@Serializable
data class GetRecipeInstructionResponse(
@SerialName("id") val id: String,
@SerialName("title") val title: String = "",
@SerialName("text") val text: String,
@SerialName("ingredientReferences") val ingredientReferences: List<GetRecipeInstructionIngredientReference> = emptyList(),
)
@Serializable
data class GetRecipeInstructionIngredientReference(
@SerialName("referenceId") val referenceId: String,
)