Reversed media/documents list order to have most recents ones at the top

This commit is contained in:
Sylvain Berfini 2024-04-16 10:53:43 +02:00
parent 680c6877e4
commit 7e0208f8e8
2 changed files with 4 additions and 4 deletions

View file

@ -32,7 +32,7 @@ class ConversationDocumentsListViewModel @UiThread constructor() : AbstractConve
private const val TAG = "[Conversation Documents List ViewModel]"
}
val documentsList = MutableLiveData<ArrayList<FileModel>>()
val documentsList = MutableLiveData<List<FileModel>>()
val operationInProgress = MutableLiveData<Boolean>()
@ -81,7 +81,7 @@ class ConversationDocumentsListViewModel @UiThread constructor() : AbstractConve
}
Log.i("$TAG [${documents.size}] documents have been processed")
documentsList.postValue(list)
documentsList.postValue(list.reversed()) // To have most recent documents at the top
operationInProgress.postValue(false)
}
}

View file

@ -32,7 +32,7 @@ class ConversationMediaListViewModel @UiThread constructor() : AbstractConversat
private const val TAG = "[Conversation Media List ViewModel]"
}
val mediaList = MutableLiveData<ArrayList<FileModel>>()
val mediaList = MutableLiveData<List<FileModel>>()
val fullScreenMode = MutableLiveData<Boolean>()
@ -85,7 +85,7 @@ class ConversationMediaListViewModel @UiThread constructor() : AbstractConversat
}
Log.i("$TAG [${media.size}] media have been processed")
mediaList.postValue(list)
mediaList.postValue(list.reversed()) // To have most recent files at the top
operationInProgress.postValue(false)
}
}