fix contact list display and keyboard in edit contact
This commit is contained in:
parent
69b1eb2f74
commit
623fd4da1c
2 changed files with 22 additions and 11 deletions
|
@ -324,6 +324,18 @@ public class ContactEditorFragment extends Fragment {
|
||||||
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
// Force hide keyboard
|
||||||
|
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
View view = getActivity().getCurrentFocus();
|
||||||
|
if (imm != null && view != null) {
|
||||||
|
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
private void pickImage() {
|
private void pickImage() {
|
||||||
imageToUploadUri = null;
|
imageToUploadUri = null;
|
||||||
final List<Intent> cameraIntents = new ArrayList<Intent>();
|
final List<Intent> cameraIntents = new ArrayList<Intent>();
|
||||||
|
|
|
@ -386,26 +386,26 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
||||||
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getAllContacts(), allContactsCursor));
|
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getAllContacts(), allContactsCursor));
|
||||||
} else {
|
} else {
|
||||||
if (onlyDisplayLinphoneContacts) {
|
if (onlyDisplayLinphoneContacts) {
|
||||||
if (sipContactsCursor != null && sipContactsCursor.getCount() == 0) {
|
if (sipContactsCursor != null) {
|
||||||
noSipContact.setVisibility(View.VISIBLE);
|
|
||||||
contactsList.setVisibility(View.GONE);
|
|
||||||
edit.setEnabled(false);
|
|
||||||
} else if (sipContactsCursor != null) {
|
|
||||||
indexer = new AlphabetIndexer(sipContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(sipContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
indexer = new AlphabetIndexer(sipContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(sipContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||||
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
|
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
|
||||||
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getSIPContacts(), sipContactsCursor));
|
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getSIPContacts(), sipContactsCursor));
|
||||||
edit.setEnabled(true);
|
edit.setEnabled(true);
|
||||||
}
|
} else {
|
||||||
} else {
|
noSipContact.setVisibility(View.VISIBLE);
|
||||||
if (allContactsCursor != null && allContactsCursor.getCount() == 0) {
|
|
||||||
noContact.setVisibility(View.VISIBLE);
|
|
||||||
contactsList.setVisibility(View.GONE);
|
contactsList.setVisibility(View.GONE);
|
||||||
edit.setEnabled(false);
|
edit.setEnabled(false);
|
||||||
} else if (allContactsCursor != null) {
|
}
|
||||||
|
} else {
|
||||||
|
if (allContactsCursor != null) {
|
||||||
indexer = new AlphabetIndexer(allContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(allContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
indexer = new AlphabetIndexer(allContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(allContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||||
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
|
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
|
||||||
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getAllContacts(), allContactsCursor));
|
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getAllContacts(), allContactsCursor));
|
||||||
edit.setEnabled(true);
|
edit.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
noContact.setVisibility(View.VISIBLE);
|
||||||
|
contactsList.setVisibility(View.GONE);
|
||||||
|
edit.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -454,7 +454,6 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
||||||
onlyDisplayLinphoneContacts = ContactsManager.getInstance().isLinphoneContactsPrefered();
|
onlyDisplayLinphoneContacts = ContactsManager.getInstance().isLinphoneContactsPrefered();
|
||||||
}
|
}
|
||||||
changeContactsToggle();
|
changeContactsToggle();
|
||||||
|
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue