diff --git a/README.md b/README.md
index 8c93865..111953d 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@ information about each of the recipes. Moreover, you can create a recipe from th
## Screenshots
-
+
## How to install
diff --git a/app/src/main/java/gq/kirmanak/mealient/extensions/ContextExtensions.kt b/app/src/main/java/gq/kirmanak/mealient/extensions/ContextExtensions.kt
new file mode 100644
index 0000000..5c3c909
--- /dev/null
+++ b/app/src/main/java/gq/kirmanak/mealient/extensions/ContextExtensions.kt
@@ -0,0 +1,14 @@
+package gq.kirmanak.mealient.extensions
+
+import android.app.Activity
+import android.content.Context
+import android.content.ContextWrapper
+
+fun Context.findActivity(): Activity? {
+ var context = this
+ while (context is ContextWrapper) {
+ if (context is Activity) return context
+ context = context.baseContext
+ }
+ return null
+}
diff --git a/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/HeaderSection.kt b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/HeaderSection.kt
new file mode 100644
index 0000000..d909c86
--- /dev/null
+++ b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/HeaderSection.kt
@@ -0,0 +1,88 @@
+package gq.kirmanak.mealient.ui.recipes.info
+
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.aspectRatio
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
+import androidx.compose.ui.layout.ContentScale
+import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+import coil.compose.AsyncImage
+import gq.kirmanak.mealient.R
+import gq.kirmanak.mealient.ui.AppTheme
+import gq.kirmanak.mealient.ui.Dimens
+
+@Composable
+internal fun HeaderSection(
+ imageUrl: String?,
+ title: String?,
+ description: String?,
+) {
+ val imageFallback = painterResource(id = R.drawable.placeholder_recipe)
+
+ Column(
+ verticalArrangement = Arrangement.spacedBy(Dimens.Small, Alignment.Top),
+ ) {
+ AsyncImage(
+ modifier = Modifier
+ .fillMaxWidth()
+ .aspectRatio(2f) // 2:1
+ .clip(
+ RoundedCornerShape(
+ topEnd = 0.dp,
+ topStart = 0.dp,
+ bottomEnd = Dimens.Intermediate,
+ bottomStart = Dimens.Intermediate,
+ )
+ ),
+ model = imageUrl,
+ contentDescription = stringResource(id = R.string.content_description_fragment_recipe_info_image),
+ placeholder = imageFallback,
+ error = imageFallback,
+ fallback = imageFallback,
+ contentScale = ContentScale.Crop,
+ )
+
+ if (!title.isNullOrEmpty()) {
+ Text(
+ modifier = Modifier
+ .padding(horizontal = Dimens.Small),
+ text = title,
+ style = MaterialTheme.typography.headlineSmall,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+ }
+
+ if (!description.isNullOrEmpty()) {
+ Text(
+ modifier = Modifier
+ .padding(horizontal = Dimens.Small),
+ text = description,
+ style = MaterialTheme.typography.bodyLarge,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+ }
+ }
+}
+
+@Preview
+@Composable
+private fun HeaderSectionPreview() {
+ AppTheme {
+ HeaderSection(
+ imageUrl = null,
+ title = "Recipe name",
+ description = "Recipe description",
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/IngredientsSection.kt b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/IngredientsSection.kt
new file mode 100644
index 0000000..f023812
--- /dev/null
+++ b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/IngredientsSection.kt
@@ -0,0 +1,111 @@
+package gq.kirmanak.mealient.ui.recipes.info
+
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Card
+import androidx.compose.material3.Checkbox
+import androidx.compose.material3.Divider
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.tooling.preview.Preview
+import gq.kirmanak.mealient.R
+import gq.kirmanak.mealient.database.recipe.entity.RecipeIngredientEntity
+import gq.kirmanak.mealient.ui.AppTheme
+import gq.kirmanak.mealient.ui.Dimens
+
+@Composable
+internal fun IngredientsSection(
+ ingredients: List,
+) {
+ Column(
+ verticalArrangement = Arrangement.spacedBy(Dimens.Small, Alignment.Top),
+ ) {
+ Text(
+ modifier = Modifier
+ .padding(horizontal = Dimens.Large),
+ text = stringResource(id = R.string.fragment_recipe_info_ingredients_header),
+ style = MaterialTheme.typography.titleLarge,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+
+ Card(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = Dimens.Small),
+ ) {
+ Column(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(Dimens.Small),
+ verticalArrangement = Arrangement.spacedBy(Dimens.Small, Alignment.Top),
+ ) {
+ ingredients.forEach { item ->
+ IngredientListItem(
+ item = item,
+ )
+ }
+ }
+ }
+ }
+}
+
+@Composable
+private fun IngredientListItem(
+ item: RecipeIngredientEntity,
+ modifier: Modifier = Modifier,
+) {
+ var isChecked by rememberSaveable { mutableStateOf(false) }
+
+ val title = item.title
+ if (!title.isNullOrBlank()) {
+ Text(
+ modifier = modifier
+ .padding(horizontal = Dimens.Medium),
+ text = title,
+ style = MaterialTheme.typography.titleMedium,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+
+ Divider(
+ color = MaterialTheme.colorScheme.outline,
+ )
+ }
+
+ Row(
+ modifier = modifier,
+ horizontalArrangement = Arrangement.spacedBy(Dimens.Small, Alignment.Start),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Checkbox(
+ checked = isChecked,
+ onCheckedChange = { isChecked = it },
+ )
+
+ Text(
+ text = item.display,
+ style = MaterialTheme.typography.bodyMedium,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+ }
+}
+
+@Preview
+@Composable
+private fun IngredientsSectionPreview() {
+ AppTheme {
+ IngredientsSection(
+ ingredients = INGREDIENTS,
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/InstructionsSection.kt b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/InstructionsSection.kt
new file mode 100644
index 0000000..e67b865
--- /dev/null
+++ b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/InstructionsSection.kt
@@ -0,0 +1,118 @@
+package gq.kirmanak.mealient.ui.recipes.info
+
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Card
+import androidx.compose.material3.Divider
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.tooling.preview.Preview
+import gq.kirmanak.mealient.R
+import gq.kirmanak.mealient.database.recipe.entity.RecipeIngredientEntity
+import gq.kirmanak.mealient.database.recipe.entity.RecipeInstructionEntity
+import gq.kirmanak.mealient.ui.AppTheme
+import gq.kirmanak.mealient.ui.Dimens
+
+@Composable
+internal fun InstructionsSection(
+ instructions: Map>,
+) {
+ Column(
+ verticalArrangement = Arrangement.spacedBy(Dimens.Small, Alignment.Top),
+ ) {
+ Text(
+ modifier = Modifier
+ .padding(horizontal = Dimens.Large),
+ text = stringResource(id = R.string.fragment_recipe_info_instructions_header),
+ style = MaterialTheme.typography.titleLarge,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+
+ var stepCount = 0
+ instructions.forEach { (instruction, ingredients) ->
+ InstructionListItem(
+ modifier = Modifier
+ .padding(horizontal = Dimens.Small),
+ item = instruction,
+ ingredients = ingredients,
+ index = stepCount++,
+ )
+ }
+ }
+}
+
+@Composable
+private fun InstructionListItem(
+ item: RecipeInstructionEntity,
+ index: Int,
+ ingredients: List,
+ modifier: Modifier = Modifier,
+) {
+ val title = item.title
+
+ if (!title.isNullOrBlank()) {
+ Text(
+ modifier = modifier
+ .padding(horizontal = Dimens.Medium),
+ text = title,
+ style = MaterialTheme.typography.titleMedium,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+
+ }
+
+ Card(
+ modifier = modifier
+ .fillMaxWidth(),
+ ) {
+ Column(
+ modifier = Modifier
+ .padding(Dimens.Medium),
+ verticalArrangement = Arrangement.spacedBy(Dimens.Small, Alignment.Top),
+ ) {
+ Text(
+ text = stringResource(
+ R.string.view_holder_recipe_instructions_step,
+ index + 1
+ ),
+ style = MaterialTheme.typography.titleSmall,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+
+ Text(
+ text = item.text.trim(),
+ style = MaterialTheme.typography.bodyMedium,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+
+ if (ingredients.isNotEmpty()) {
+ Divider(
+ color = MaterialTheme.colorScheme.outline,
+ )
+ ingredients.forEach { ingredient ->
+ Text(
+ text = ingredient.display,
+ style = MaterialTheme.typography.bodySmall,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+ }
+ }
+ }
+ }
+}
+
+@Preview
+@Composable
+private fun InstructionsSectionPreview() {
+ AppTheme {
+ InstructionsSection(
+ instructions = INSTRUCTIONS,
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/KeepScreenOn.kt b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/KeepScreenOn.kt
new file mode 100644
index 0000000..e260e30
--- /dev/null
+++ b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/KeepScreenOn.kt
@@ -0,0 +1,19 @@
+package gq.kirmanak.mealient.ui.recipes.info
+
+import android.view.WindowManager
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.DisposableEffect
+import androidx.compose.ui.platform.LocalContext
+import gq.kirmanak.mealient.extensions.findActivity
+
+@Composable
+fun KeepScreenOn() {
+ val context = LocalContext.current
+ val window = context.findActivity()?.window ?: return
+ DisposableEffect(Unit) {
+ window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
+ onDispose {
+ window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/PreviewData.kt b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/PreviewData.kt
new file mode 100644
index 0000000..c861b26
--- /dev/null
+++ b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/PreviewData.kt
@@ -0,0 +1,64 @@
+package gq.kirmanak.mealient.ui.recipes.info
+
+import gq.kirmanak.mealient.database.recipe.entity.RecipeIngredientEntity
+import gq.kirmanak.mealient.database.recipe.entity.RecipeInstructionEntity
+import gq.kirmanak.mealient.database.recipe.entity.RecipeSummaryEntity
+import kotlinx.datetime.LocalDate
+import kotlinx.datetime.LocalDateTime
+
+internal val INGREDIENT_TWO = RecipeIngredientEntity(
+ id = "2",
+ recipeId = "1",
+ note = "Recipe ingredient note",
+ food = "Recipe ingredient food",
+ unit = "Recipe ingredient unit",
+ display = "Recipe ingredient display that is very long and should be wrapped",
+ quantity = 1.0,
+ title = null,
+)
+
+internal val SUMMARY_ENTITY = RecipeSummaryEntity(
+ remoteId = "1",
+ name = "Recipe name",
+ slug = "recipe-name",
+ description = "Recipe description",
+ dateAdded = LocalDate(2021, 1, 1),
+ dateUpdated = LocalDateTime(2021, 1, 1, 1, 1, 1),
+ imageId = null,
+ isFavorite = false,
+)
+
+internal val INGREDIENT_ONE = RecipeIngredientEntity(
+ id = "1",
+ recipeId = "1",
+ note = "Recipe ingredient note",
+ food = "Recipe ingredient food",
+ unit = "Recipe ingredient unit",
+ display = "Recipe ingredient display that is very long and should be wrapped",
+ quantity = 1.0,
+ title = "Recipe ingredient section title",
+)
+
+internal val INSTRUCTION_ONE = RecipeInstructionEntity(
+ id = "1",
+ recipeId = "1",
+ text = "Recipe instruction",
+ title = "Section title",
+)
+
+internal val INSTRUCTION_TWO = RecipeInstructionEntity(
+ id = "2",
+ recipeId = "1",
+ text = "Recipe instruction",
+ title = "",
+)
+
+internal val INGREDIENTS = listOf(
+ INGREDIENT_ONE,
+ INGREDIENT_TWO,
+)
+
+internal val INSTRUCTIONS = mapOf(
+ INSTRUCTION_ONE to emptyList(),
+ INSTRUCTION_TWO to listOf(INGREDIENT_TWO),
+)
diff --git a/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/RecipeScreen.kt b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/RecipeScreen.kt
index 24ca985..7c92b7f 100644
--- a/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/RecipeScreen.kt
+++ b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/RecipeScreen.kt
@@ -4,45 +4,21 @@ import android.content.res.Configuration.UI_MODE_NIGHT_MASK
import android.content.res.Configuration.UI_MODE_NIGHT_YES
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.aspectRatio
-import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
-import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
-import androidx.compose.material3.Card
-import androidx.compose.material3.Checkbox
-import androidx.compose.material3.Divider
-import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.saveable.rememberSaveable
-import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
-import androidx.compose.ui.draw.clip
-import androidx.compose.ui.layout.ContentScale
-import androidx.compose.ui.res.painterResource
-import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
-import androidx.compose.ui.unit.dp
-import coil.compose.AsyncImage
-import gq.kirmanak.mealient.R
-import gq.kirmanak.mealient.database.recipe.entity.RecipeIngredientEntity
-import gq.kirmanak.mealient.database.recipe.entity.RecipeInstructionEntity
-import gq.kirmanak.mealient.database.recipe.entity.RecipeSummaryEntity
import gq.kirmanak.mealient.ui.AppTheme
import gq.kirmanak.mealient.ui.Dimens
-import kotlinx.datetime.LocalDate
-import kotlinx.datetime.LocalDateTime
@Composable
fun RecipeScreen(
uiState: RecipeInfoUiState,
) {
+ KeepScreenOn()
+
Column(
modifier = Modifier
.verticalScroll(
@@ -70,217 +46,12 @@ fun RecipeScreen(
}
}
-@Composable
-private fun HeaderSection(
- imageUrl: String?,
- title: String?,
- description: String?,
-) {
- val imageFallback = painterResource(id = R.drawable.placeholder_recipe)
-
- AsyncImage(
- modifier = Modifier
- .fillMaxWidth()
- .aspectRatio(2f) // 2:1
- .clip(
- RoundedCornerShape(
- topEnd = 0.dp,
- topStart = 0.dp,
- bottomEnd = Dimens.Intermediate,
- bottomStart = Dimens.Intermediate,
- )
- ),
- model = imageUrl,
- contentDescription = stringResource(id = R.string.content_description_fragment_recipe_info_image),
- placeholder = imageFallback,
- error = imageFallback,
- fallback = imageFallback,
- contentScale = ContentScale.Crop,
- )
-
- if (!title.isNullOrEmpty()) {
- Text(
- modifier = Modifier
- .padding(horizontal = Dimens.Small),
- text = title,
- style = MaterialTheme.typography.headlineSmall,
- color = MaterialTheme.colorScheme.onSurface,
- )
- }
-
- if (!description.isNullOrEmpty()) {
- Text(
- modifier = Modifier
- .padding(horizontal = Dimens.Small),
- text = description,
- style = MaterialTheme.typography.bodyLarge,
- color = MaterialTheme.colorScheme.onSurface,
- )
- }
-}
-
-@Composable
-private fun InstructionsSection(
- instructions: Map>,
-) {
- Text(
- modifier = Modifier
- .padding(horizontal = Dimens.Large),
- text = stringResource(id = R.string.fragment_recipe_info_instructions_header),
- style = MaterialTheme.typography.titleLarge,
- color = MaterialTheme.colorScheme.onSurface,
- )
-
- var stepCount = 0
- instructions.forEach { (instruction, ingredients) ->
- InstructionListItem(
- modifier = Modifier
- .padding(horizontal = Dimens.Small),
- item = instruction,
- ingredients = ingredients,
- index = stepCount++,
- )
- }
-}
-
-@Composable
-private fun IngredientsSection(
- ingredients: List,
-) {
- Text(
- modifier = Modifier
- .padding(horizontal = Dimens.Large),
- text = stringResource(id = R.string.fragment_recipe_info_ingredients_header),
- style = MaterialTheme.typography.titleLarge,
- color = MaterialTheme.colorScheme.onSurface,
- )
-
- Card(
- modifier = Modifier
- .fillMaxWidth()
- .padding(horizontal = Dimens.Small),
- ) {
- Column(
- modifier = Modifier
- .fillMaxWidth()
- .padding(Dimens.Small),
- verticalArrangement = Arrangement.spacedBy(Dimens.Small, Alignment.Top),
- ) {
- ingredients.forEach { item ->
- IngredientListItem(
- item = item,
- )
- }
- }
- }
-}
-
-@Composable
-private fun InstructionListItem(
- item: RecipeInstructionEntity,
- index: Int,
- ingredients: List,
- modifier: Modifier = Modifier,
-) {
- val title = item.title
-
- if (!title.isNullOrBlank()) {
- Text(
- modifier = modifier
- .padding(horizontal = Dimens.Medium),
- text = title,
- style = MaterialTheme.typography.titleMedium,
- color = MaterialTheme.colorScheme.onSurface,
- )
-
- }
-
- Card(
- modifier = modifier
- .fillMaxWidth(),
- ) {
- Column(
- modifier = Modifier
- .padding(Dimens.Medium),
- verticalArrangement = Arrangement.spacedBy(Dimens.Small, Alignment.Top),
- ) {
- Text(
- text = stringResource(
- R.string.view_holder_recipe_instructions_step,
- index + 1
- ),
- style = MaterialTheme.typography.titleSmall,
- color = MaterialTheme.colorScheme.onSurface,
- )
-
- Text(
- text = item.text.trim(),
- style = MaterialTheme.typography.bodyMedium,
- color = MaterialTheme.colorScheme.onSurface,
- )
-
- if (ingredients.isNotEmpty()) {
- Divider(
- color = MaterialTheme.colorScheme.outline,
- )
- ingredients.forEach { ingredient ->
- Text(
- text = ingredient.display,
- style = MaterialTheme.typography.bodySmall,
- color = MaterialTheme.colorScheme.onSurface,
- )
- }
- }
- }
- }
-}
-
-@Composable
-private fun IngredientListItem(
- item: RecipeIngredientEntity,
- modifier: Modifier = Modifier,
-) {
- var isChecked by rememberSaveable { mutableStateOf(false) }
-
- val title = item.title
- if (!title.isNullOrBlank()) {
- Text(
- modifier = modifier
- .padding(horizontal = Dimens.Medium),
- text = title,
- style = MaterialTheme.typography.titleMedium,
- color = MaterialTheme.colorScheme.onSurface,
- )
-
- Divider(
- color = MaterialTheme.colorScheme.outline,
- )
- }
-
- Row(
- modifier = modifier,
- horizontalArrangement = Arrangement.spacedBy(Dimens.Small, Alignment.Start),
- verticalAlignment = Alignment.CenterVertically,
- ) {
- Checkbox(
- checked = isChecked,
- onCheckedChange = { isChecked = it },
- )
-
- Text(
- text = item.display,
- style = MaterialTheme.typography.bodyMedium,
- color = MaterialTheme.colorScheme.onSurface,
- )
- }
-}
-
@Preview(showBackground = true)
@Composable
private fun RecipeScreenPreview() {
AppTheme {
RecipeScreen(
- uiState = previewUiState()
+ uiState = RECIPE_INFO_UI_STATE
)
}
}
@@ -290,65 +61,17 @@ private fun RecipeScreenPreview() {
private fun RecipeScreenNightPreview() {
AppTheme {
RecipeScreen(
- uiState = previewUiState()
+ uiState = RECIPE_INFO_UI_STATE
)
}
}
-private fun previewUiState(): RecipeInfoUiState {
- val ingredient = RecipeIngredientEntity(
- id = "2",
- recipeId = "1",
- note = "Recipe ingredient note",
- food = "Recipe ingredient food",
- unit = "Recipe ingredient unit",
- display = "Recipe ingredient display that is very long and should be wrapped",
- quantity = 1.0,
- title = null,
- )
- val uiState = RecipeInfoUiState(
- showIngredients = true,
- showInstructions = true,
- summaryEntity = RecipeSummaryEntity(
- remoteId = "1",
- name = "Recipe name",
- slug = "recipe-name",
- description = "Recipe description",
- dateAdded = LocalDate(2021, 1, 1),
- dateUpdated = LocalDateTime(2021, 1, 1, 1, 1, 1),
- imageId = null,
- isFavorite = false,
- ),
- recipeIngredients = listOf(
- RecipeIngredientEntity(
- id = "1",
- recipeId = "1",
- note = "Recipe ingredient note",
- food = "Recipe ingredient food",
- unit = "Recipe ingredient unit",
- display = "Recipe ingredient display that is very long and should be wrapped",
- quantity = 1.0,
- title = "Recipe ingredient section title",
- ),
- ingredient,
- ),
- recipeInstructions = mapOf(
- RecipeInstructionEntity(
- id = "1",
- recipeId = "1",
- text = "Recipe instruction",
- title = "Section title",
- ) to emptyList(),
- RecipeInstructionEntity(
- id = "2",
- recipeId = "1",
- text = "Recipe instruction",
- title = "",
- ) to listOf(ingredient),
- ),
- title = "Recipe title",
- description = "Recipe description",
- )
- return uiState
-}
-
+private val RECIPE_INFO_UI_STATE = RecipeInfoUiState(
+ showIngredients = true,
+ showInstructions = true,
+ summaryEntity = SUMMARY_ENTITY,
+ recipeIngredients = INGREDIENTS,
+ recipeInstructions = INSTRUCTIONS,
+ title = "Recipe title",
+ description = "Recipe description",
+)
diff --git a/fastlane/metadata/android/en-US/changelogs/31.txt b/fastlane/metadata/android/en-US/changelogs/31.txt
new file mode 100644
index 0000000..f03b172
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/31.txt
@@ -0,0 +1 @@
+Ingredients that are linked to a specific recipe step are shown under that step.
\ No newline at end of file
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png
index 8780231..b1772a7 100644
Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png
index 946a7d7..88fcd1c 100644
Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png
index dcd0550..11b70ed 100644
Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png
index 7b57c9f..ac7ef3d 100644
Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png
new file mode 100644
index 0000000..d368d0e
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png
new file mode 100644
index 0000000..8fd4129
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png differ