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);
|
||||
}
|
||||
|
||||
@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() {
|
||||
imageToUploadUri = null;
|
||||
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));
|
||||
} else {
|
||||
if (onlyDisplayLinphoneContacts) {
|
||||
if (sipContactsCursor != null && sipContactsCursor.getCount() == 0) {
|
||||
noSipContact.setVisibility(View.VISIBLE);
|
||||
contactsList.setVisibility(View.GONE);
|
||||
edit.setEnabled(false);
|
||||
} else if (sipContactsCursor != null) {
|
||||
if (sipContactsCursor != null) {
|
||||
indexer = new AlphabetIndexer(sipContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(sipContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
|
||||
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getSIPContacts(), sipContactsCursor));
|
||||
edit.setEnabled(true);
|
||||
}
|
||||
} else {
|
||||
if (allContactsCursor != null && allContactsCursor.getCount() == 0) {
|
||||
noContact.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
noSipContact.setVisibility(View.VISIBLE);
|
||||
contactsList.setVisibility(View.GONE);
|
||||
edit.setEnabled(false);
|
||||
} else if (allContactsCursor != null) {
|
||||
}
|
||||
} else {
|
||||
if (allContactsCursor != null) {
|
||||
indexer = new AlphabetIndexer(allContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(allContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
|
||||
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getAllContacts(), allContactsCursor));
|
||||
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();
|
||||
}
|
||||
changeContactsToggle();
|
||||
|
||||
invalidate();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue