kopia lustrzana https://github.com/ge0rg/aprsdroid
new message table type: aborted
rodzic
4ad6470c26
commit
121d93d2e2
|
@ -15,8 +15,8 @@ object MessageListAdapter {
|
||||||
val LIST_TO = Array(R.id.listts, R.id.liststatus, R.id.listmessage)
|
val LIST_TO = Array(R.id.listts, R.id.liststatus, R.id.listmessage)
|
||||||
|
|
||||||
val NUM_OF_RETRIES = 7
|
val NUM_OF_RETRIES = 7
|
||||||
// null, incoming, out-new, out-acked, out-rejected
|
// null, incoming, out-new, out-acked, out-rejected, out-aborted
|
||||||
val COLORS = Array(0, 0xff8080b0, 0xff80a080, 0xff30b030, 0xffb03030)
|
val COLORS = Array(0, 0xff8080b0, 0xff80a080, 0xff30b030, 0xffb03030, 0xffa08080)
|
||||||
}
|
}
|
||||||
|
|
||||||
class MessageListAdapter(context : Context, prefs : PrefsWrapper,
|
class MessageListAdapter(context : Context, prefs : PrefsWrapper,
|
||||||
|
@ -41,17 +41,19 @@ class MessageListAdapter(context : Context, prefs : PrefsWrapper,
|
||||||
val statusview = view.findViewById(R.id.liststatus).asInstanceOf[TextView]
|
val statusview = view.findViewById(R.id.liststatus).asInstanceOf[TextView]
|
||||||
statusview.setTextColor(MessageListAdapter.COLORS(msgtype))
|
statusview.setTextColor(MessageListAdapter.COLORS(msgtype))
|
||||||
super.bindView(view, context, cursor)
|
super.bindView(view, context, cursor)
|
||||||
msgtype match {
|
val status = msgtype match {
|
||||||
case TYPE_INCOMING =>
|
case TYPE_INCOMING =>
|
||||||
statusview.setText(targetcall)
|
targetcall
|
||||||
case TYPE_OUT_NEW =>
|
case TYPE_OUT_NEW =>
|
||||||
statusview.setText("%s %d/%d".format(mycall, retrycnt, MessageListAdapter.NUM_OF_RETRIES))
|
"%s %d/%d".format(mycall, retrycnt, MessageListAdapter.NUM_OF_RETRIES)
|
||||||
case TYPE_OUT_ACKED =>
|
case TYPE_OUT_ACKED =>
|
||||||
//statusview.setText("%s ack #%d".format(mycall, retrycnt))
|
mycall
|
||||||
statusview.setText(mycall)
|
|
||||||
case TYPE_OUT_REJECTED =>
|
case TYPE_OUT_REJECTED =>
|
||||||
statusview.setText("%s rej #%d".format(mycall, retrycnt))
|
"%s %s".format(mycall, context.getString(R.string.msg_type_rejected))
|
||||||
|
case TYPE_OUT_ABORTED =>
|
||||||
|
"%s %s".format(mycall, context.getString(R.string.msg_type_aborted))
|
||||||
}
|
}
|
||||||
|
statusview.setText(status)
|
||||||
}
|
}
|
||||||
|
|
||||||
def load_cursor(i : Intent) = {
|
def load_cursor(i : Intent) = {
|
||||||
|
|
|
@ -143,6 +143,7 @@ object StorageDatabase {
|
||||||
val TYPE_OUT_NEW = 2
|
val TYPE_OUT_NEW = 2
|
||||||
val TYPE_OUT_ACKED = 3
|
val TYPE_OUT_ACKED = 3
|
||||||
val TYPE_OUT_REJECTED = 4
|
val TYPE_OUT_REJECTED = 4
|
||||||
|
val TYPE_OUT_ABORTED = 5
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -396,6 +397,11 @@ class StorageDatabase(context : Context) extends
|
||||||
def updateMessage(id : Long, cv : ContentValues) = {
|
def updateMessage(id : Long, cv : ContentValues) = {
|
||||||
getWritableDatabase().update(Message.TABLE, cv, "_id = ?", Array(id.toString))
|
getWritableDatabase().update(Message.TABLE, cv, "_id = ?", Array(id.toString))
|
||||||
}
|
}
|
||||||
|
def updateMessageType(id : Long, msg_type : Int) = {
|
||||||
|
val cv = new ContentValues()
|
||||||
|
cv.put(Message.TYPE, msg_type.asInstanceOf[java.lang.Integer])
|
||||||
|
updateMessage(id, cv)
|
||||||
|
}
|
||||||
|
|
||||||
def updateMessageAcked(call : String, msgid : String, new_type : Int) = {
|
def updateMessageAcked(call : String, msgid : String, new_type : Int) = {
|
||||||
val cv = new ContentValues()
|
val cv = new ContentValues()
|
||||||
|
|
Ładowanie…
Reference in New Issue