From 1d2c5584a808593098934820eecc62f3501a8708 Mon Sep 17 00:00:00 2001 From: Kirill Kamakin Date: Sat, 20 Nov 2021 20:21:46 +0300 Subject: [PATCH] Read instructions step header from resources --- .../mealient/ui/recipes/info/RecipeInstructionsAdapter.kt | 5 ++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/RecipeInstructionsAdapter.kt b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/RecipeInstructionsAdapter.kt index cd2ff00..4d353db 100644 --- a/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/RecipeInstructionsAdapter.kt +++ b/app/src/main/java/gq/kirmanak/mealient/ui/recipes/info/RecipeInstructionsAdapter.kt @@ -5,6 +5,7 @@ import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView +import gq.kirmanak.mealient.R import gq.kirmanak.mealient.data.recipes.db.entity.RecipeInstructionEntity import gq.kirmanak.mealient.databinding.ViewHolderInstructionBinding @@ -29,7 +30,9 @@ class RecipeInstructionsAdapter : class RecipeInstructionViewHolder(private val binding: ViewHolderInstructionBinding) : RecyclerView.ViewHolder(binding.root) { fun bind(item: RecipeInstructionEntity, position: Int) { - binding.step.text = "Step: ${position + 1}" + binding.step.text = binding.root.resources.getString( + R.string.view_holder_recipe_instructions_step, position + 1 + ) binding.instruction.text = item.text } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7113319..ebc20ed 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -15,4 +15,5 @@ This project is NOT associated with the core Mealie developers. If you face any issues when using the application or have a feature request DO NOT send them to the Mealie developers. Instead, report a new issue in the Mealient repository. THAT IS NOT AN OFFICIAL CLIENT. DISCLAIMER OKAY + Step: %d \ No newline at end of file