Fix back action in group chat + get friend in search conctacts
This commit is contained in:
parent
bb208448cb
commit
a085e6424e
2 changed files with 21 additions and 22 deletions
|
@ -424,6 +424,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
||||||
fragment = new ChatListFragment();
|
fragment = new ChatListFragment();
|
||||||
break;
|
break;
|
||||||
case CREATE_CHAT:
|
case CREATE_CHAT:
|
||||||
|
checkAndRequestWriteContactsPermission();
|
||||||
fragment = new ChatCreationFragment();
|
fragment = new ChatCreationFragment();
|
||||||
break;
|
break;
|
||||||
case INFO_GROUP_CHAT:
|
case INFO_GROUP_CHAT:
|
||||||
|
@ -1275,7 +1276,8 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
||||||
int readContactsI = -1;
|
int readContactsI = -1;
|
||||||
for (int i = 0; i < permissions.length; i++) {
|
for (int i = 0; i < permissions.length; i++) {
|
||||||
Log.i("[Permission] " + permissions[i] + " is " + (grantResults[i] == PackageManager.PERMISSION_GRANTED ? "granted" : "denied"));
|
Log.i("[Permission] " + permissions[i] + " is " + (grantResults[i] == PackageManager.PERMISSION_GRANTED ? "granted" : "denied"));
|
||||||
if (permissions[i].compareTo(Manifest.permission.READ_CONTACTS) == 0)
|
if (permissions[i].compareTo(Manifest.permission.READ_CONTACTS) == 0 ||
|
||||||
|
permissions[i].compareTo(Manifest.permission.WRITE_CONTACTS) == 0)
|
||||||
readContactsI = i;
|
readContactsI = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1548,10 +1550,11 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
||||||
|
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
if (currentFragment == FragmentsAvailable.DIALER
|
switch(currentFragment) {
|
||||||
|| currentFragment == FragmentsAvailable.CONTACTS_LIST
|
case DIALER :
|
||||||
|| currentFragment == FragmentsAvailable.HISTORY_LIST
|
case CONTACTS_LIST:
|
||||||
|| currentFragment == FragmentsAvailable.CHAT_LIST) {
|
case HISTORY_LIST:
|
||||||
|
case CHAT_LIST:
|
||||||
boolean isBackgroundModeActive = LinphonePreferences.instance().isBackgroundModeEnabled();
|
boolean isBackgroundModeActive = LinphonePreferences.instance().isBackgroundModeEnabled();
|
||||||
if (!isBackgroundModeActive) {
|
if (!isBackgroundModeActive) {
|
||||||
stopService(new Intent(Intent.ACTION_MAIN).setClass(this, LinphoneService.class));
|
stopService(new Intent(Intent.ACTION_MAIN).setClass(this, LinphoneService.class));
|
||||||
|
@ -1559,6 +1562,12 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
||||||
} else if (LinphoneUtils.onKeyBackGoHome(this, keyCode, event)) {
|
} else if (LinphoneUtils.onKeyBackGoHome(this, keyCode, event)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case GROUP_CHAT:
|
||||||
|
LinphoneActivity.instance().goToChatList();
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.onKeyDown(keyCode, event);
|
return super.onKeyDown(keyCode, event);
|
||||||
|
|
|
@ -165,16 +165,6 @@ public class SearchContactsListAdapter extends BaseAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void searchContacts(String search, ListView resultContactsSearch) {
|
public void searchContacts(String search, ListView resultContactsSearch) {
|
||||||
if (search == null || search.length() == 0 || search.trim().length() == 0) {
|
|
||||||
contacts = getContactsList();
|
|
||||||
resultContactsSearch.setAdapter(this);
|
|
||||||
if (ContactsManager.getInstance() != null) {
|
|
||||||
ContactsManager.getInstance().getMagicSearch().resetSearchCache();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
search = search.trim();
|
|
||||||
List<ContactAddress> result = new ArrayList<>();
|
List<ContactAddress> result = new ArrayList<>();
|
||||||
|
|
||||||
String domain = "";
|
String domain = "";
|
||||||
|
|
Loading…
Reference in a new issue