Implemented ability to change the fragment opened on app start; made some optimisations to DietaryPreferences.kt. BUG: tab layout mediator is annoying af

This commit is contained in:
denizk0461
2023-04-27 15:15:29 +02:00
parent 1828a4b02e
commit 9d6489f83b
11 changed files with 92 additions and 77 deletions
@@ -45,14 +45,16 @@ class AllergenSheet(
// Inflate the view
val prefLine = ItemSheetPreferenceBinding.inflate(LayoutInflater.from(context))
val (stringId, drawableId) = DietaryPreferences.getData(index)
// Add the localised text for the preference
prefLine.preferenceText.text = getString(DietaryPreferences.indexToString[index]!!)
prefLine.preferenceText.text = getString(stringId)
// Set the appropriate icon
prefLine.preferenceImage.setImageDrawable(
getDrawable(
context,
DietaryPreferences.indexToDrawable[index]!!,
drawableId,
)
)