message status icons approximately work - still a problem on first send though

This commit is contained in:
geeksville 2020-05-31 11:23:25 -07:00
parent 7506d712ff
commit 0b66d813ef
4 changed files with 83 additions and 48 deletions

View file

@ -151,12 +151,13 @@ class MessagesFragment : ScreenFragment("Messages"), Logging {
private var messages = arrayOf<DataPacket>()
/// Called when our node DB changes
fun onMessagesChanged(nodesIn: Collection<DataPacket>) {
messages = nodesIn.toTypedArray()
fun onMessagesChanged(msgIn: Collection<DataPacket>) {
messages = msgIn.toTypedArray()
notifyDataSetChanged() // FIXME, this is super expensive and redraws all messages
// scroll to the last line
messageListView.scrollToPosition(this.itemCount - 1)
if (itemCount != 0)
messageListView.scrollToPosition(itemCount - 1)
}
}