Customization to display only username in history activity.
This commit is contained in:
parent
4224a5b7dc
commit
288fa28143
2 changed files with 8 additions and 9 deletions
|
@ -14,6 +14,7 @@
|
|||
<bool name="use_video_activity">true</bool>
|
||||
<bool name="autostart_video_activity">false</bool>
|
||||
<bool name="show_full_remote_address_on_incoming_call">true</bool>
|
||||
<bool name="show_only_username_in_history">false</bool>
|
||||
|
||||
<bool name="allow_transfers">true</bool>
|
||||
|
||||
|
|
|
@ -153,23 +153,21 @@ public class HistoryActivity extends ListActivity {
|
|||
lDirectionImageIn.setVisibility(View.GONE);
|
||||
lDirectionImageOut.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
Uri uri = LinphoneUtils.findUriPictureOfContactAndSetDisplayName(lAddress, getContentResolver());
|
||||
LinphoneUtils.setImagePictureFromUri(lView.getContext(), lContactPicture, uri, R.drawable.unknown_person);
|
||||
|
||||
|
||||
LinphoneCore lc = LinphoneManager.getLc();
|
||||
LinphoneProxyConfig lProxyConfig = lc.getDefaultProxyConfig();
|
||||
boolean showOnlyUsername = getResources().getBoolean(R.bool.show_only_username_in_history);
|
||||
String lDetailedName=null;
|
||||
String lDisplayName = lAddress.getDisplayName();
|
||||
if (lDisplayName == null)
|
||||
lDisplayName = LinphoneUtils.findDisplayNameOfContact(lAddress, getContentResolver());
|
||||
|
||||
if (lProxyConfig != null && lProxyConfig.getDomain().equals(lAddress.getDomain())) {
|
||||
String lDisplayName = !showOnlyUsername ? lAddress.getDisplayName() : null;
|
||||
if (showOnlyUsername || (lProxyConfig != null && lProxyConfig.getDomain().equals(lAddress.getDomain()))) {
|
||||
lDetailedName = lAddress.getUserName();
|
||||
} else {
|
||||
lDetailedName = lAddress.asStringUriOnly();
|
||||
}
|
||||
|
||||
|
||||
if (lDisplayName == null) {
|
||||
lFirstLineView.setText(lDetailedName);
|
||||
lSecondLineView.setVisibility(View.GONE);
|
||||
|
@ -178,7 +176,7 @@ public class HistoryActivity extends ListActivity {
|
|||
lSecondLineView.setText(lDetailedName);
|
||||
lSecondLineView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
return lView;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue