Fixing freeze on contact update
This commit is contained in:
parent
0f91e5bc21
commit
9b13d2a5da
4 changed files with 18 additions and 2 deletions
|
@ -102,6 +102,7 @@ import java.util.List;
|
|||
import java.util.Locale;
|
||||
|
||||
import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION;
|
||||
import static org.linphone.FragmentsAvailable.CHAT;
|
||||
|
||||
|
||||
public class ChatFragment extends Fragment implements OnClickListener, LinphoneChatMessage.LinphoneChatMessageListener, ContactsUpdatedListener{
|
||||
|
@ -544,7 +545,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CHAT);
|
||||
LinphoneActivity.instance().selectMenu(CHAT);
|
||||
}
|
||||
|
||||
LinphoneManager.addListener(this);
|
||||
|
@ -973,7 +974,9 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
|
||||
@Override
|
||||
public void onContactsUpdated() {
|
||||
if(fileSharedUri != null || message.getText() != null){
|
||||
if(LinphoneActivity.isInstanciated()
|
||||
&& LinphoneActivity.instance().getCurrentFragment() == CHAT
|
||||
&& fileSharedUri != null || message.getText() != null){
|
||||
initNewChatConversation();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,8 @@ import org.linphone.mediastream.Log;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import static org.linphone.FragmentsAvailable.CHAT_LIST;
|
||||
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
|
@ -231,6 +233,9 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
|
||||
@Override
|
||||
public void onContactsUpdated() {
|
||||
if (!LinphoneActivity.isInstanciated() || LinphoneActivity.instance().getCurrentFragment() != CHAT_LIST)
|
||||
return;
|
||||
|
||||
ChatListAdapter adapter = (ChatListAdapter)chatList.getAdapter();
|
||||
if (adapter != null) {
|
||||
adapter.notifyDataSetChanged();
|
||||
|
|
|
@ -49,6 +49,8 @@ import java.util.List;
|
|||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.linphone.FragmentsAvailable.CONTACTS_LIST;
|
||||
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
|
@ -418,6 +420,8 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
|||
|
||||
@Override
|
||||
public void onContactsUpdated() {
|
||||
if (!LinphoneActivity.isInstanciated() || LinphoneActivity.instance().getCurrentFragment() != CONTACTS_LIST)
|
||||
return;
|
||||
ContactsListAdapter adapter = (ContactsListAdapter)contactsList.getAdapter();
|
||||
if (adapter != null) {
|
||||
contactsList.setFastScrollEnabled(false);
|
||||
|
|
|
@ -50,6 +50,8 @@ import android.widget.ListView;
|
|||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import static org.linphone.FragmentsAvailable.HISTORY_LIST;
|
||||
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
|
@ -222,6 +224,8 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
|
||||
@Override
|
||||
public void onContactsUpdated() {
|
||||
if (!LinphoneActivity.isInstanciated() || LinphoneActivity.instance().getCurrentFragment() != HISTORY_LIST)
|
||||
return;
|
||||
CallHistoryAdapter adapter = (CallHistoryAdapter)historyList.getAdapter();
|
||||
if (adapter != null) {
|
||||
adapter.notifyDataSetChanged();
|
||||
|
|
Loading…
Reference in a new issue