"Last updated" time is now compared to a string embedded in the HTML instead of the "Last-Updated" header field to prevent duplicate notifications when the food menu refreshes

This commit is contained in:
Deniz Düzgören
2019-07-30 11:18:01 +02:00
parent 14477c8f55
commit 2fb0506db9
4 changed files with 110 additions and 106 deletions
@@ -350,7 +350,7 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
dialogView.findViewById<TextView>(R.id.dialogtext).text = getString(R.string.fortest)
dialogButton.setOnClickListener {
when (dialogEditText.text.toString()) {
"@DIAGNOSTICS" -> {
"_DIAGNOSTICS" -> {
val alertDialogDev = AlertDialog.Builder(mContext, R.style.AlertDialog)
val devDialogView = LayoutInflater.from(mContext).inflate(R.layout.diagnostics_dialog, null)
val devDialogText = devDialogView.findViewById<TextView>(R.id.dialogtext)
@@ -382,11 +382,11 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
Toast.makeText(mContext, R.string.noyoutube, Toast.LENGTH_LONG).show()
}
}
"@NOTIFICATION" -> {
"_NOTIFICATION" -> {
edit.putString("time", "").apply()
Toast.makeText(mContext, "Notification time cleared", Toast.LENGTH_LONG).show()
} // TODO add option to clear database
"@FIRSTTIME" -> {
"_FIRSTTIME" -> {
edit.putBoolean("firstTime", true).apply()
Toast.makeText(mContext, "First time flag cleared", Toast.LENGTH_LONG).show()
}