Added "Last updated" string to FoodFragment and info dialog, simplified "if-else" branch in MiscData.getIcon() to when-statement

This commit is contained in:
Deniz Düzgören
2019-07-31 11:27:46 +02:00
parent 47cbaaf53c
commit dbea6a60eb
8 changed files with 89 additions and 121 deletions
@@ -253,7 +253,9 @@ class Main : AppCompatActivity(R.layout.app_bar_main) {
val dialog = AlertDialog.Builder(context)
val dialogView = LayoutInflater.from(context).inflate(R.layout.simple_dialog, null)
dialogView.findViewById<TextView>(R.id.textviewtitle).text = getString(R.string.information)
dialogView.findViewById<TextView>(R.id.dialogtext).text = prefs.getString("informational", "")
val sb = StringBuilder()
val dialogText = sb.append(getText(R.string.lastupdatedK)).append((prefs.getString("time", "") ?: "") + "\n\n").append(prefs.getString("informational", ""))
dialogView.findViewById<TextView>(R.id.dialogtext).text = dialogText
dialog.setView(dialogView).show()
}