@@ -98,6 +96,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
...
@@ -98,6 +96,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
overridefunonDestroyView(){
overridefunonDestroyView(){
presenter.unsubscribeMessages()
presenter.unsubscribeMessages()
handler.removeCallbacksAndMessages(null)
super.onDestroyView()
super.onDestroyView()
}
}
...
@@ -144,7 +143,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
...
@@ -144,7 +143,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
})
})
}
}
}
}
adapter.addDataSet(dataSet)
adapter.addDataSet(dataSet)
}
}
}
}
...
@@ -156,23 +154,12 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
...
@@ -156,23 +154,12 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
}
}
overridefunuploadFile(uri:Uri){
overridefunuploadFile(uri:Uri){
activity?.apply{
// TODO Just leaving a blank message that comes with the file for now. In the future lets add the possibility to add a message with the file to be uploaded.
valfileName=uri.getFileName(this)
presenter.uploadFile(chatRoomId,uri,"")
valmimeType=uri.getMimeType(this)
valfileRealPath=uri.getRealPathFromURI(this)
if(fileName!=null&&fileRealPath!=null){
presenter.uploadFile(
chatRoomId,
File(fileRealPath),
mimeType,
"",// TODO Just leaving it for now, in the future lets add the possibility to add a message with the file to be uploaded.