Read instructions step header from resources
This commit is contained in:
@@ -5,6 +5,7 @@ import android.view.ViewGroup
|
|||||||
import androidx.recyclerview.widget.DiffUtil
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
import androidx.recyclerview.widget.ListAdapter
|
import androidx.recyclerview.widget.ListAdapter
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import gq.kirmanak.mealient.R
|
||||||
import gq.kirmanak.mealient.data.recipes.db.entity.RecipeInstructionEntity
|
import gq.kirmanak.mealient.data.recipes.db.entity.RecipeInstructionEntity
|
||||||
import gq.kirmanak.mealient.databinding.ViewHolderInstructionBinding
|
import gq.kirmanak.mealient.databinding.ViewHolderInstructionBinding
|
||||||
|
|
||||||
@@ -29,7 +30,9 @@ class RecipeInstructionsAdapter :
|
|||||||
class RecipeInstructionViewHolder(private val binding: ViewHolderInstructionBinding) :
|
class RecipeInstructionViewHolder(private val binding: ViewHolderInstructionBinding) :
|
||||||
RecyclerView.ViewHolder(binding.root) {
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
fun bind(item: RecipeInstructionEntity, position: Int) {
|
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
|
binding.instruction.text = item.text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,4 +15,5 @@
|
|||||||
<string name="fragment_disclaimer_main_text">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.</string>
|
<string name="fragment_disclaimer_main_text">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.</string>
|
||||||
<string name="fragment_disclaimer_header">DISCLAIMER</string>
|
<string name="fragment_disclaimer_header">DISCLAIMER</string>
|
||||||
<string name="fragment_disclaimer_button_okay">OKAY</string>
|
<string name="fragment_disclaimer_button_okay">OKAY</string>
|
||||||
|
<string name="view_holder_recipe_instructions_step">Step: %d</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user