messaging: better user feedback when not connected

smart_log
Georg Lukas 2011-09-05 19:07:48 +02:00
rodzic 1a2366b976
commit 3b04e5ad6a
2 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -37,6 +37,7 @@
<string name="msg_send_new">Send message to...</string>
<string name="msg_message_text">Message text</string>
<string name="msg_empty_list">There are no stored conversations.</string>
<string name="msg_stored_offline">The message will be sent as soon as you start tracking.</string>
<!-- AprsService -->
<string name="aprsservice">APRSdroid Service</string>

Wyświetl plik

@ -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