Fix displaying recipe ingredient note twice (#197)

* Update README.md

* Bump version to 35

* Cleanup dependencies

* Bump versions of dependencies

* Save isFood/disableAmount flags to db

* Fix displaying ingredient note twice

* Remove whitespace after note is extracted
This commit is contained in:
Kirill Kamakin
2024-01-14 11:44:21 +01:00
committed by GitHub
parent c8f1f477cc
commit 7c02a8341d
17 changed files with 100 additions and 119 deletions

View File

@@ -18,7 +18,8 @@ repository.
## What is this? ## What is this?
An unofficial Android client for [Mealie](https://hay-kot.github.io/mealie/). It enables you to An unofficial Android client for [Mealie](https://github.com/mealie-recipes/mealie/). It enables you
to
easily access your recipes using an Android device. The main advantage over website is that easily access your recipes using an Android device. The main advantage over website is that
recipe data is stored locally and can be accessed without the Internet connection. recipe data is stored locally and can be accessed without the Internet connection.

View File

@@ -7,7 +7,6 @@ import java.util.Properties
plugins { plugins {
id("gq.kirmanak.mealient.application") id("gq.kirmanak.mealient.application")
id("kotlin-kapt") id("kotlin-kapt")
id("androidx.navigation.safeargs.kotlin")
id("dagger.hilt.android.plugin") id("dagger.hilt.android.plugin")
alias(libs.plugins.ksp) alias(libs.plugins.ksp)
alias(libs.plugins.appsweep) alias(libs.plugins.appsweep)
@@ -17,8 +16,8 @@ plugins {
android { android {
defaultConfig { defaultConfig {
applicationId = "gq.kirmanak.mealient" applicationId = "gq.kirmanak.mealient"
versionCode = 34 versionCode = 35
versionName = "0.4.5" versionName = "0.4.6"
testInstrumentationRunner = "gq.kirmanak.mealient.MealientTestRunner" testInstrumentationRunner = "gq.kirmanak.mealient.MealientTestRunner"
testInstrumentationRunnerArguments += mapOf("clearPackageData" to "true") testInstrumentationRunnerArguments += mapOf("clearPackageData" to "true")
resourceConfigurations += listOf("en", "es", "ru", "fr", "nl", "pt", "de") resourceConfigurations += listOf("en", "es", "ru", "fr", "nl", "pt", "de")
@@ -75,6 +74,9 @@ android {
} }
} }
} }
buildFeatures {
buildConfig = true
}
} }
ksp { ksp {
@@ -98,20 +100,11 @@ dependencies {
implementation(libs.android.material.material) implementation(libs.android.material.material)
implementation(libs.androidx.navigation.fragmentKtx)
implementation(libs.androidx.navigation.runtimeKtx)
implementation(libs.androidx.navigation.uiKtx)
implementation(libs.androidx.coreKtx) implementation(libs.androidx.coreKtx)
implementation(libs.androidx.splashScreen) implementation(libs.androidx.splashScreen)
implementation(libs.androidx.appcompat) implementation(libs.androidx.appcompat)
implementation(libs.androidx.constraintLayout)
implementation(libs.androidx.swipeRefreshLayout)
implementation(libs.androidx.lifecycle.livedataKtx)
implementation(libs.androidx.lifecycle.viewmodelKtx) implementation(libs.androidx.lifecycle.viewmodelKtx)
implementation(libs.androidx.shareTarget) implementation(libs.androidx.shareTarget)
@@ -131,8 +124,6 @@ dependencies {
implementation(libs.jetbrains.kotlinx.datetime) implementation(libs.jetbrains.kotlinx.datetime)
implementation(libs.kirich1409.viewBinding)
implementation(libs.androidx.datastore.preferences) implementation(libs.androidx.datastore.preferences)
implementation(libs.coil) implementation(libs.coil)

View File

@@ -1,36 +0,0 @@
package gq.kirmanak.mealient.ui
import android.os.Bundle
import android.view.View
import androidx.annotation.IdRes
import androidx.annotation.LayoutRes
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.WindowInsetsControllerCompat
import androidx.viewbinding.ViewBinding
import by.kirich1409.viewbindingdelegate.viewBinding
import gq.kirmanak.mealient.extensions.isDarkThemeOn
import gq.kirmanak.mealient.logging.Logger
import javax.inject.Inject
abstract class BaseActivity<T : ViewBinding>(
binder: (View) -> T,
@IdRes containerId: Int,
@LayoutRes layoutRes: Int,
) : AppCompatActivity(layoutRes) {
protected val binding by viewBinding(binder, containerId)
@Inject
lateinit var logger: Logger
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
logger.v { "onCreate() called with: savedInstanceState = $savedInstanceState" }
setContentView(binding.root)
with(WindowInsetsControllerCompat(window, window.decorView)) {
val isAppearanceLightBars = !isDarkThemeOn()
isAppearanceLightNavigationBars = isAppearanceLightBars
isAppearanceLightStatusBars = isAppearanceLightBars
}
}
}

View File

@@ -86,13 +86,14 @@ private fun IngredientListItem(
onCheckedChange = { isChecked = it }, onCheckedChange = { isChecked = it },
) )
val (text, note) = item.textAndNote
Column { Column {
Text( Text(
text = item.display, text = text,
style = MaterialTheme.typography.bodyLarge, style = MaterialTheme.typography.bodyLarge,
) )
if (item.note.isNotBlank()) { if (note.isNotBlank()) {
Text( Text(
text = item.note, text = item.note,
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
@@ -100,4 +101,21 @@ private fun IngredientListItem(
} }
} }
} }
} }
private val RecipeIngredientEntity.textAndNote: Pair<String, String>
get() = when {
disableAmount -> note to ""
note.isBlank() -> display to ""
else -> {
val text = if (display.endsWith(note)) {
display.dropLast(note.length).trimEnd()
} else {
display
}
text to note
}
}

View File

@@ -12,9 +12,11 @@ internal val INGREDIENT_TWO = RecipeIngredientEntity(
note = "Recipe ingredient note", note = "Recipe ingredient note",
food = "Recipe ingredient food", food = "Recipe ingredient food",
unit = "Recipe ingredient unit", unit = "Recipe ingredient unit",
display = "Recipe ingredient display that is very long and should be wrapped",
quantity = 1.0, quantity = 1.0,
display = "Recipe ingredient display that is very long and should be wrapped",
title = null, title = null,
isFood = false,
disableAmount = true,
) )
internal val SUMMARY_ENTITY = RecipeSummaryEntity( internal val SUMMARY_ENTITY = RecipeSummaryEntity(
@@ -34,9 +36,11 @@ internal val INGREDIENT_ONE = RecipeIngredientEntity(
note = "Recipe ingredient note", note = "Recipe ingredient note",
food = "Recipe ingredient food", food = "Recipe ingredient food",
unit = "Recipe ingredient unit", unit = "Recipe ingredient unit",
display = "Recipe ingredient display that is very long and should be wrapped",
quantity = 1.0, quantity = 1.0,
display = "Recipe ingredient display that is very long and should be wrapped",
title = "Recipe ingredient section title", title = "Recipe ingredient section title",
isFood = false,
disableAmount = true,
) )
internal val INSTRUCTION_ONE = RecipeInstructionEntity( internal val INSTRUCTION_ONE = RecipeInstructionEntity(

View File

@@ -67,7 +67,7 @@ internal fun Project.configureKotlinAndroid(
} }
dependencies { dependencies {
add("coreLibraryDesugaring", libs.findLibrary("android-tools-desugar").get()) add("coreLibraryDesugaring", library("android-tools-desugar").get())
} }
} }

View File

@@ -10,7 +10,6 @@ buildscript {
classpath(libs.google.dagger.hiltPlugin) classpath(libs.google.dagger.hiltPlugin)
classpath(libs.jetbrains.kotlinPlugin) classpath(libs.jetbrains.kotlinPlugin)
classpath(libs.jetbrains.serializationPlugin) classpath(libs.jetbrains.serializationPlugin)
classpath(libs.androidx.navigation.safeArgsPlugin)
} }
} }

View File

@@ -1,11 +1,17 @@
package gq.kirmanak.mealient.database package gq.kirmanak.mealient.database
import androidx.room.* import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import gq.kirmanak.mealient.database.recipe.RecipeDao import gq.kirmanak.mealient.database.recipe.RecipeDao
import gq.kirmanak.mealient.database.recipe.entity.* import gq.kirmanak.mealient.database.recipe.entity.RecipeEntity
import gq.kirmanak.mealient.database.recipe.entity.RecipeIngredientEntity
import gq.kirmanak.mealient.database.recipe.entity.RecipeIngredientToInstructionEntity
import gq.kirmanak.mealient.database.recipe.entity.RecipeInstructionEntity
import gq.kirmanak.mealient.database.recipe.entity.RecipeSummaryEntity
@Database( @Database(
version = 11, version = 12,
entities = [ entities = [
RecipeSummaryEntity::class, RecipeSummaryEntity::class,
RecipeEntity::class, RecipeEntity::class,

View File

@@ -25,4 +25,6 @@ data class RecipeIngredientEntity(
@ColumnInfo(name = "recipe_ingredient_quantity") val quantity: Double?, @ColumnInfo(name = "recipe_ingredient_quantity") val quantity: Double?,
@ColumnInfo(name = "recipe_ingredient_display") val display: String, @ColumnInfo(name = "recipe_ingredient_display") val display: String,
@ColumnInfo(name = "recipe_ingredient_title") val title: String?, @ColumnInfo(name = "recipe_ingredient_title") val title: String?,
@ColumnInfo(name = "recipe_ingredient_is_food") val isFood: Boolean,
@ColumnInfo(name = "recipe_ingredient_disable_amount") val disableAmount: Boolean,
) )

View File

@@ -70,22 +70,26 @@ val CAKE_SUGAR_RECIPE_INGREDIENT_ENTITY = RecipeIngredientEntity(
id = "1", id = "1",
recipeId = "1", recipeId = "1",
note = "2 oz of white sugar", note = "2 oz of white sugar",
quantity = 1.0,
unit = null,
food = null, food = null,
unit = null,
quantity = 1.0,
display = "2 oz of white sugar", display = "2 oz of white sugar",
title = "Sugar", title = "Sugar",
isFood = false,
disableAmount = true,
) )
val CAKE_BREAD_RECIPE_INGREDIENT_ENTITY = RecipeIngredientEntity( val CAKE_BREAD_RECIPE_INGREDIENT_ENTITY = RecipeIngredientEntity(
id = "3", id = "3",
recipeId = "1", recipeId = "1",
note = "2 oz of white bread", note = "2 oz of white bread",
quantity = 1.0,
unit = null,
food = null, food = null,
unit = null,
quantity = 1.0,
display = "2 oz of white bread", display = "2 oz of white bread",
title = null, title = null,
isFood = false,
disableAmount = true,
) )
val FULL_CAKE_INFO_ENTITY = RecipeWithSummaryAndIngredientsAndInstructions( val FULL_CAKE_INFO_ENTITY = RecipeWithSummaryAndIngredientsAndInstructions(
@@ -115,22 +119,26 @@ val PORRIDGE_MILK_RECIPE_INGREDIENT_ENTITY = RecipeIngredientEntity(
id = "1", id = "1",
recipeId = "2", recipeId = "2",
note = "2 oz of white milk", note = "2 oz of white milk",
quantity = 1.0,
unit = null,
food = null, food = null,
unit = null,
quantity = 1.0,
display = "2 oz of white milk", display = "2 oz of white milk",
title = null, title = null,
isFood = false,
disableAmount = true,
) )
val PORRIDGE_SUGAR_RECIPE_INGREDIENT_ENTITY = RecipeIngredientEntity( val PORRIDGE_SUGAR_RECIPE_INGREDIENT_ENTITY = RecipeIngredientEntity(
id = "2", id = "2",
recipeId = "2", recipeId = "2",
note = "2 oz of white sugar", note = "2 oz of white sugar",
quantity = 1.0,
unit = null,
food = null, food = null,
unit = null,
quantity = 1.0,
display = "2 oz of white sugar", display = "2 oz of white sugar",
title = "Sugar", title = "Sugar",
isFood = false,
disableAmount = true,
) )
val PORRIDGE_MIX_RECIPE_INSTRUCTION_ENTITY = RecipeInstructionEntity( val PORRIDGE_MIX_RECIPE_INSTRUCTION_ENTITY = RecipeInstructionEntity(

View File

@@ -11,6 +11,9 @@ android {
consumerProguardFiles("consumer-proguard-rules.pro") consumerProguardFiles("consumer-proguard-rules.pro")
} }
namespace = "gq.kirmanak.mealient.datasource" namespace = "gq.kirmanak.mealient.datasource"
buildFeatures {
buildConfig = true
}
} }
dependencies { dependencies {

View File

@@ -27,6 +27,8 @@ data class GetRecipeIngredientResponse(
@SerialName("display") val display: String, @SerialName("display") val display: String,
@SerialName("referenceId") val referenceId: String, @SerialName("referenceId") val referenceId: String,
@SerialName("title") val title: String?, @SerialName("title") val title: String?,
@SerialName("isFood") val isFood: Boolean,
@SerialName("disableAmount") val disableAmount: Boolean,
) )
@Serializable @Serializable

View File

@@ -74,32 +74,38 @@ val PORRIDGE_RECIPE_SUMMARY_RESPONSE = GetRecipeSummaryResponse(
val MILK_RECIPE_INGREDIENT_RESPONSE = GetRecipeIngredientResponse( val MILK_RECIPE_INGREDIENT_RESPONSE = GetRecipeIngredientResponse(
note = "2 oz of white milk", note = "2 oz of white milk",
quantity = 1.0,
unit = null, unit = null,
food = null, food = null,
quantity = 1.0,
display = "2 oz of white milk", display = "2 oz of white milk",
referenceId = "1", referenceId = "1",
title = null, title = null,
isFood = false,
disableAmount = true,
) )
val SUGAR_RECIPE_INGREDIENT_RESPONSE = GetRecipeIngredientResponse( val SUGAR_RECIPE_INGREDIENT_RESPONSE = GetRecipeIngredientResponse(
note = "2 oz of white sugar", note = "2 oz of white sugar",
quantity = 1.0,
unit = null, unit = null,
food = null, food = null,
quantity = 1.0,
display = "2 oz of white sugar", display = "2 oz of white sugar",
referenceId = "1", referenceId = "1",
title = "Sugar", title = "Sugar",
isFood = false,
disableAmount = true,
) )
val BREAD_RECIPE_INGREDIENT_RESPONSE = GetRecipeIngredientResponse( val BREAD_RECIPE_INGREDIENT_RESPONSE = GetRecipeIngredientResponse(
note = "2 oz of white bread", note = "2 oz of white bread",
quantity = 1.0,
unit = null, unit = null,
food = null, food = null,
quantity = 1.0,
display = "2 oz of white bread", display = "2 oz of white bread",
referenceId = "3", referenceId = "3",
title = null, title = null,
isFood = false,
disableAmount = true,
) )
val MIX_RECIPE_INSTRUCTION_RESPONSE = GetRecipeInstructionResponse( val MIX_RECIPE_INSTRUCTION_RESPONSE = GetRecipeInstructionResponse(

View File

@@ -0,0 +1 @@
Improve onboarding experience

View File

@@ -5,6 +5,5 @@ android.useAndroidX=true
android.enableJetifier=false android.enableJetifier=false
kotlin.code.style=official kotlin.code.style=official
kapt.incremental.apt=true kapt.incremental.apt=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false android.nonTransitiveRClass=false
android.nonFinalResIds=false android.nonFinalResIds=false

View File

@@ -1,50 +1,40 @@
[versions] [versions]
# https://maven.google.com/web/index.html?q=com.android.tools.build#com.android.tools.build:gradle # https://maven.google.com/web/index.html?q=com.android.tools.build#com.android.tools.build:gradle
androidGradlePlugin = "8.1.2" androidGradlePlugin = "8.2.1"
# https://github.com/JetBrains/kotlin/releases # https://github.com/JetBrains/kotlin/releases
kotlin = "1.9.10" kotlin = "1.9.22"
# https://developer.android.com/jetpack/androidx/releases/navigation
googleNavigation = "2.7.4"
# https://dagger.dev/hilt/gradle-setup # https://dagger.dev/hilt/gradle-setup
hilt = "2.48.1" hilt = "2.50"
# https://github.com/protocolbuffers/protobuf/releases # https://github.com/protocolbuffers/protobuf/releases
protobuf = "3.24.4" protobuf = "3.25.2"
# https://github.com/google/protobuf-gradle-plugin/releases # https://github.com/google/protobuf-gradle-plugin/releases
protobufPlugin = "0.9.4" protobufPlugin = "0.9.4"
# https://plugins.gradle.org/plugin/org.sonarqube # https://plugins.gradle.org/plugin/org.sonarqube
sonarqube = "4.4.1.3373" sonarqube = "4.4.1.3373"
# https://plugins.gradle.org/plugin/com.guardsquare.appsweep # https://plugins.gradle.org/plugin/com.guardsquare.appsweep
appsweep = "1.5.2" appsweep = "1.5.6"
# https://github.com/material-components/material-components-android/releases # https://github.com/material-components/material-components-android/releases
material = "1.10.0" material = "1.11.0"
# https://developer.android.com/kotlin/ktx#core # https://developer.android.com/kotlin/ktx#core
coreKtx = "1.12.0" coreKtx = "1.12.0"
# https://developer.android.com/jetpack/androidx/releases/appcompat # https://developer.android.com/jetpack/androidx/releases/appcompat
appcompat = "1.6.1" appcompat = "1.6.1"
# https://developer.android.com/jetpack/androidx/releases/constraintlayout
contraintLayout = "2.1.4"
# https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout
swipeRefreshLayout = "1.1.0"
# https://developer.android.com/jetpack/androidx/releases/core # https://developer.android.com/jetpack/androidx/releases/core
splashScreen = "1.0.1" splashScreen = "1.0.1"
# https://developer.android.com/jetpack/androidx/releases/lifecycle # https://developer.android.com/jetpack/androidx/releases/lifecycle
lifecycle = "2.6.2" lifecycle = "2.7.0"
# https://developer.android.com/jetpack/androidx/releases/arch-core # https://developer.android.com/jetpack/androidx/releases/arch-core
coreTesting = "2.2.0" coreTesting = "2.2.0"
# https://github.com/Kotlin/kotlinx.serialization/releases # https://github.com/Kotlin/kotlinx.serialization/releases
kotlinxSerialization = "1.6.0" kotlinxSerialization = "1.6.2"
# https://github.com/square/okhttp/tags # https://github.com/square/okhttp/tags
okhttp = "4.12.0" okhttp = "4.12.0"
# https://developer.android.com/jetpack/androidx/releases/paging # https://developer.android.com/jetpack/androidx/releases/paging
paging = "3.2.1" paging = "3.2.1"
# https://developer.android.com/jetpack/androidx/releases/room # https://developer.android.com/jetpack/androidx/releases/room
room = "2.6.0" room = "2.6.1"
# https://github.com/Kotlin/kotlinx-datetime/releases # https://github.com/Kotlin/kotlinx-datetime/releases
kotlinxDatetime = "0.4.0" kotlinxDatetime = "0.5.0"
# https://github.com/bumptech/glide/releases
glide = "4.16.0"
# https://github.com/androidbroadcast/ViewBindingPropertyDelegate/releases
viewBindingDelegate = "1.5.9"
# https://developer.android.com/jetpack/androidx/releases/datastore # https://developer.android.com/jetpack/androidx/releases/datastore
datastore = "1.0.0" datastore = "1.0.0"
# https://developer.android.com/jetpack/androidx/releases/security # https://developer.android.com/jetpack/androidx/releases/security
@@ -54,19 +44,19 @@ junit = "4.13.2"
# https://github.com/Kotlin/kotlinx.coroutines/releases # https://github.com/Kotlin/kotlinx.coroutines/releases
coroutines = "1.7.3" coroutines = "1.7.3"
# https://github.com/robolectric/robolectric/releases # https://github.com/robolectric/robolectric/releases
robolectric = "4.11" robolectric = "4.11.1"
# https://mvnrepository.com/artifact/com.google.truth/truth # https://mvnrepository.com/artifact/com.google.truth/truth
truth = "1.1.5" truth = "1.2.0"
# https://mockk.io/ # https://mockk.io/
mockk = "1.13.8" mockk = "1.13.9"
# https://github.com/square/leakcanary/releases # https://github.com/square/leakcanary/releases
leakcanary = "2.12" leakcanary = "2.13"
# https://github.com/ChuckerTeam/chucker/releases # https://github.com/ChuckerTeam/chucker/releases
chucker = "4.0.0" chucker = "4.0.0"
# https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md # https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md
desugar = "2.0.3" desugar = "2.0.4"
# https://github.com/google/ksp/releases # https://github.com/google/ksp/releases
kspPlugin = "1.9.10-1.0.13" kspPlugin = "1.9.22-1.0.16"
# https://developer.android.com/jetpack/androidx/releases/sharetarget # https://developer.android.com/jetpack/androidx/releases/sharetarget
shareTarget = "1.2.0" shareTarget = "1.2.0"
# https://github.com/KasperskyLab/Kaspresso/releases # https://github.com/KasperskyLab/Kaspresso/releases
@@ -80,17 +70,17 @@ junitKtx = "1.1.5"
# https://mvnrepository.com/artifact/androidx.compose/compose-bom # https://mvnrepository.com/artifact/androidx.compose/compose-bom
composeBom = "2023.10.01" composeBom = "2023.10.01"
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin # https://developer.android.com/jetpack/androidx/releases/compose-kotlin
composeKotlinCompilerExtension = "1.5.3" composeKotlinCompilerExtension = "1.5.8"
# https://google.github.io/accompanist/ # https://google.github.io/accompanist/
accompanistVersion = "0.32.0" accompanistVersion = "0.32.0"
# https://developer.android.com/jetpack/androidx/releases/compose-material # https://developer.android.com/jetpack/androidx/releases/compose-material
materialCompose = "1.5.4" materialCompose = "1.5.4"
# https://github.com/raamcosta/compose-destinations # https://github.com/raamcosta/compose-destinations/releases
composeDestinations = "1.9.54" composeDestinations = "1.9.59"
# https://developer.android.com/jetpack/androidx/releases/hilt # https://developer.android.com/jetpack/androidx/releases/hilt
androidxHilt = "1.1.0" androidxHilt = "1.1.0"
# https://github.com/ktorio/ktor/releases # https://github.com/ktorio/ktor/releases
ktor = "2.3.5" ktor = "2.3.7"
# https://github.com/coil-kt/coil/releases # https://github.com/coil-kt/coil/releases
coil = "2.5.0" coil = "2.5.0"
@@ -135,15 +125,8 @@ jetbrains-kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-
jetbrains-kotlinx-coroutinesAndroid = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "coroutines" } jetbrains-kotlinx-coroutinesAndroid = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "coroutines" }
jetbrains-kotlinx-coroutinesTest = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" } jetbrains-kotlinx-coroutinesTest = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" }
androidx-navigation-safeArgsPlugin = { group = "androidx.navigation", name = "navigation-safe-args-gradle-plugin", version.ref = "googleNavigation" }
androidx-navigation-fragmentKtx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "googleNavigation" }
androidx-navigation-runtimeKtx = { group = "androidx.navigation", name = "navigation-runtime-ktx", version.ref = "googleNavigation" }
androidx-navigation-uiKtx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "googleNavigation" }
androidx-coreKtx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } androidx-coreKtx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
androidx-constraintLayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "contraintLayout" }
androidx-swipeRefreshLayout = { group = "androidx.swiperefreshlayout", name = "swiperefreshlayout", version.ref = "swipeRefreshLayout" }
androidx-splashScreen = { group = "androidx.core", name = "core-splashscreen", version.ref = "splashScreen" } androidx-splashScreen = { group = "androidx.core", name = "core-splashscreen", version.ref = "splashScreen" }
androidx-coreTesting = { group = "androidx.arch.core", name = "core-testing", version.ref = "coreTesting" } androidx-coreTesting = { group = "androidx.arch.core", name = "core-testing", version.ref = "coreTesting" }
androidx-shareTarget = { group = "androidx.sharetarget", name = "sharetarget", version.ref = "shareTarget" } androidx-shareTarget = { group = "androidx.sharetarget", name = "sharetarget", version.ref = "shareTarget" }
@@ -152,7 +135,6 @@ androidx-paging-runtimeKtx = { group = "androidx.paging", name = "paging-runtime
androidx-paging-commonKtx = { group = "androidx.paging", name = "paging-common-ktx", version.ref = "paging" } androidx-paging-commonKtx = { group = "androidx.paging", name = "paging-common-ktx", version.ref = "paging" }
androidx-paging-compose = { group = "androidx.paging", name = "paging-compose", version.ref = "paging" } androidx-paging-compose = { group = "androidx.paging", name = "paging-compose", version.ref = "paging" }
androidx-lifecycle-livedataKtx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "lifecycle" }
androidx-lifecycle-viewmodelKtx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycle" } androidx-lifecycle-viewmodelKtx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycle" }
androidx-lifecycle-viewmodelCompose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" } androidx-lifecycle-viewmodelCompose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }
@@ -180,13 +162,6 @@ okhttp3-okhttp = { group = "com.squareup.okhttp3", name = "okhttp" }
okhttp3-loggingInterceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor" } okhttp3-loggingInterceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor" }
okhttp3-mockwebserver = { group = "com.squareup.okhttp3", name = "mockwebserver", version.ref = "okhttp" } okhttp3-mockwebserver = { group = "com.squareup.okhttp3", name = "mockwebserver", version.ref = "okhttp" }
bumptech-glide-glide = { group = "com.github.bumptech.glide", name = "glide", version.ref = "glide" }
bumptech-glide-okhttp3 = { group = "com.github.bumptech.glide", name = "okhttp3-integration", version.ref = "glide" }
bumptech-glide-recyclerview = { group = "com.github.bumptech.glide", name = "recyclerview-integration", version.ref = "glide" }
bumptech-glide-ksp = { group = "com.github.bumptech.glide", name = "ksp", version.ref = "glide" }
kirich1409-viewBinding = { group = "com.github.kirich1409", name = "viewbindingpropertydelegate-noreflection", version.ref = "viewBindingDelegate" }
junit = { group = "junit", name = "junit", version.ref = "junit" } junit = { group = "junit", name = "junit", version.ref = "junit" }
robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" } robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" }

View File

@@ -37,11 +37,13 @@ class ModelMapperImpl @Inject constructor() : ModelMapper {
id = ingredientResponse.referenceId, id = ingredientResponse.referenceId,
recipeId = recipeId, recipeId = recipeId,
note = ingredientResponse.note, note = ingredientResponse.note,
unit = ingredientResponse.unit?.name,
food = ingredientResponse.food?.name, food = ingredientResponse.food?.name,
unit = ingredientResponse.unit?.name,
quantity = ingredientResponse.quantity, quantity = ingredientResponse.quantity,
display = ingredientResponse.display, display = ingredientResponse.display,
title = ingredientResponse.title, title = ingredientResponse.title,
isFood = ingredientResponse.isFood,
disableAmount = ingredientResponse.disableAmount,
) )
override fun toRecipeInstructionEntity( override fun toRecipeInstructionEntity(