From 3b04e5ad6a8c7342deec595993de87ff6cd9671e Mon Sep 17 00:00:00 2001 From: Georg Lukas Date: Mon, 5 Sep 2011 19:07:48 +0200 Subject: [PATCH] messaging: better user feedback when not connected --- res/values/strings.xml | 1 + src/MessageActivity.scala | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 026aaa1..916c82d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -37,6 +37,7 @@ Send message to... Message text There are no stored conversations. +The message will be sent as soon as you start tracking. APRSdroid Service diff --git a/src/MessageActivity.scala b/src/MessageActivity.scala index 11501e7..2c763f6 100644 --- a/src/MessageActivity.scala +++ b/src/MessageActivity.scala @@ -9,7 +9,7 @@ import _root_.android.text.{Editable, TextWatcher} import _root_.android.util.Log import _root_.android.view.{KeyEvent, Menu, MenuItem, View, Window} import _root_.android.view.View.{OnClickListener, OnKeyListener} -import _root_.android.widget.{Button, EditText, ListView} +import _root_.android.widget.{Button, EditText, ListView, Toast} class MessageActivity extends LoadingListActivity with OnClickListener with OnKeyListener with TextWatcher { @@ -99,6 +99,11 @@ class MessageActivity extends LoadingListActivity storage.addMessage(cv) // notify backend sendBroadcast(new Intent(AprsService.MESSAGETX)) + // notify UI about new message + sendBroadcast(new Intent(AprsService.MESSAGE)) + // if not connected, notify user about postponed message + if (!AprsService.running) + Toast.makeText(this, R.string.msg_stored_offline, Toast.LENGTH_SHORT).show() } // button actions