Fix bug with progress bar on contacts list

This commit is contained in:
Erwan Croze 2017-04-20 17:07:34 +02:00
parent fde919a851
commit 168ae3f4d7

View file

@ -349,7 +349,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
} }
contactsList.setFastScrollEnabled(true); contactsList.setFastScrollEnabled(true);
adapter.notifyDataSetInvalidated(); adapter.notifyDataSetInvalidated();
if (adapter.getCount() > 0) { if (adapter.getCount() > 0) {
contactsFetchInProgress.setVisibility(View.GONE); contactsFetchInProgress.setVisibility(View.GONE);
@ -393,6 +393,10 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
sipAddressToAdd = null; sipAddressToAdd = null;
} }
if (searchField != null && searchField.getText().toString().length() > 0) {
if (contactsFetchInProgress != null) contactsFetchInProgress.setVisibility(View.GONE);
}
if (LinphoneActivity.isInstanciated()) { if (LinphoneActivity.isInstanciated()) {
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACTS_LIST); LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACTS_LIST);
LinphoneActivity.instance().hideTabBar(false); LinphoneActivity.instance().hideTabBar(false);
@ -463,7 +467,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
ContactsListAdapter(List<LinphoneContact> contactsList) { ContactsListAdapter(List<LinphoneContact> contactsList) {
updateDataSet(contactsList); updateDataSet(contactsList);
} }
public void updateDataSet(List<LinphoneContact> contactsList) { public void updateDataSet(List<LinphoneContact> contactsList) {
contacts = contactsList; contacts = contactsList;
@ -484,7 +488,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
sectionsList = new ArrayList<String>(map.keySet()); sectionsList = new ArrayList<String>(map.keySet());
sections = new String[sectionsList.size()]; sections = new String[sectionsList.size()];
sectionsList.toArray(sections); sectionsList.toArray(sections);
notifyDataSetChanged(); notifyDataSetChanged();
} }