Removed useless invalidate() in chat causing bad performances + updated linphone to fix sqlite vfs error
This commit is contained in:
parent
3738e602eb
commit
20585afbc5
2 changed files with 15 additions and 15 deletions
|
@ -213,7 +213,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
if (from.asStringUriOnly().equals(sipUri)) {
|
if (from.asStringUriOnly().equals(sipUri)) {
|
||||||
LinphoneService.instance().removeMessageNotification();
|
LinphoneService.instance().removeMessageNotification();
|
||||||
cr.markAsRead();
|
cr.markAsRead();
|
||||||
invalidate();
|
adapter.addMessage(cr.getHistory(1)[0]);
|
||||||
messagesList.setSelection(adapter.getCount()-1);
|
messagesList.setSelection(adapter.getCount()-1);
|
||||||
|
|
||||||
String externalBodyUrl = message.getExternalBodyUrl();
|
String externalBodyUrl = message.getExternalBodyUrl();
|
||||||
|
@ -464,13 +464,19 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
contact = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
contact = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
||||||
if (chatRoom != null) {
|
if (chatRoom != null) {
|
||||||
displayChatHeader(lAddress);
|
displayChatHeader(lAddress);
|
||||||
dispayMessageList();
|
displayMessageList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void redrawMessageList() {
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void dispayMessageList() {
|
private void displayMessageList() {
|
||||||
if(chatRoom != null) {
|
if(chatRoom != null) {
|
||||||
if (adapter != null) {
|
if (adapter != null) {
|
||||||
adapter.refreshHistory();
|
adapter.refreshHistory();
|
||||||
|
@ -631,7 +637,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
isEditMode = false;
|
isEditMode = false;
|
||||||
editList.setVisibility(View.GONE);
|
editList.setVisibility(View.GONE);
|
||||||
topBar.setVisibility(View.VISIBLE);
|
topBar.setVisibility(View.VISIBLE);
|
||||||
dispayMessageList();
|
redrawMessageList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeChats(){
|
private void removeChats(){
|
||||||
|
@ -702,7 +708,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
topBar.setVisibility(View.INVISIBLE);
|
topBar.setVisibility(View.INVISIBLE);
|
||||||
editList.setVisibility(View.VISIBLE);
|
editList.setVisibility(View.VISIBLE);
|
||||||
isEditMode = true;
|
isEditMode = true;
|
||||||
dispayMessageList();
|
redrawMessageList();
|
||||||
//TODO refaire la liste
|
//TODO refaire la liste
|
||||||
}
|
}
|
||||||
if(id == R.id.start_call){
|
if(id == R.id.start_call){
|
||||||
|
@ -718,11 +724,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
message.setText("");
|
message.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayBubbleChat(LinphoneChatMessage message){
|
|
||||||
adapter.addMessage(message);
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sendTextMessage(String messageToSend) {
|
private void sendTextMessage(String messageToSend) {
|
||||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||||
boolean isNetworkReachable = lc == null ? false : lc.isNetworkReachable();
|
boolean isNetworkReachable = lc == null ? false : lc.isNetworkReachable();
|
||||||
|
@ -748,7 +749,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
if (newChatConversation) {
|
if (newChatConversation) {
|
||||||
exitNewConversationMode(lAddress.asStringUriOnly());
|
exitNewConversationMode(lAddress.asStringUriOnly());
|
||||||
} else {
|
} else {
|
||||||
displayBubbleChat(message);
|
adapter.addMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.i("Sent message current status: " + message.getStatus());
|
Log.i("Sent message current status: " + message.getStatus());
|
||||||
|
@ -767,7 +768,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
initChatRoom(address);
|
initChatRoom(address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
invalidate();
|
|
||||||
|
|
||||||
if (chatRoom != null && path != null && path.length() > 0 && isNetworkReachable) {
|
if (chatRoom != null && path != null && path.length() > 0 && isNetworkReachable) {
|
||||||
try {
|
try {
|
||||||
|
@ -924,7 +924,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
LinphoneManager.getInstance().setUploadingImageStream(mUploadingImageStream);
|
LinphoneManager.getInstance().setUploadingImageStream(mUploadingImageStream);
|
||||||
|
|
||||||
chatRoom.sendChatMessage(message);
|
chatRoom.sendChatMessage(message);
|
||||||
displayBubbleChat(message);
|
adapter.addMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1103,7 +1103,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
//LinphoneChatMessage Listener
|
//LinphoneChatMessage Listener
|
||||||
@Override
|
@Override
|
||||||
public void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state) {
|
public void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state) {
|
||||||
invalidate();
|
redrawMessageList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 34cd736aa2bee6de4bc8c264a0fb7c49f191401b
|
Subproject commit f426902ebe60f1467eb72c12d5aa493087eaf09d
|
Loading…
Reference in a new issue