Skip to content

Commit

Permalink
Display all existing tag descriptions (fixes #11)
Browse files Browse the repository at this point in the history
  • Loading branch information
marc136 committed Oct 12, 2020
1 parent bf48ebb commit f2b3b5c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/src/main/java/de/mw136/tonuino/ui/ReadActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ class ReadActivity : NfcIntentActivity() {
setText(R.id.mode, data.mode.value)
findViewById<TextView>(R.id.mode_description).apply {
val mode = data.mode.value?.toInt() ?: 0
text = if (mode in 1..6) {
resources.getStringArray(R.array.edit_mode)[mode - 1] + ": " +
resources.getStringArray(R.array.edit_mode_description)[mode - 1]
val title = resources.getStringArray(R.array.edit_mode)[mode - 1] ?: ""
val description =
resources.getStringArray(R.array.edit_mode_description)[mode - 1] ?: ""
text = if (title.isNotEmpty() && description.isNotEmpty()) {
"$title: $description"
} else {
Log.w(
"$TAG:displayTonuinoInfo",
Expand Down

0 comments on commit f2b3b5c

Please sign in to comment.