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="use_video_activity">true</bool>
|
||||||
<bool name="autostart_video_activity">false</bool>
|
<bool name="autostart_video_activity">false</bool>
|
||||||
<bool name="show_full_remote_address_on_incoming_call">true</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>
|
<bool name="allow_transfers">true</bool>
|
||||||
|
|
||||||
|
|
|
@ -153,23 +153,21 @@ public class HistoryActivity extends ListActivity {
|
||||||
lDirectionImageIn.setVisibility(View.GONE);
|
lDirectionImageIn.setVisibility(View.GONE);
|
||||||
lDirectionImageOut.setVisibility(View.VISIBLE);
|
lDirectionImageOut.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Uri uri = LinphoneUtils.findUriPictureOfContactAndSetDisplayName(lAddress, getContentResolver());
|
Uri uri = LinphoneUtils.findUriPictureOfContactAndSetDisplayName(lAddress, getContentResolver());
|
||||||
LinphoneUtils.setImagePictureFromUri(lView.getContext(), lContactPicture, uri, R.drawable.unknown_person);
|
LinphoneUtils.setImagePictureFromUri(lView.getContext(), lContactPicture, uri, R.drawable.unknown_person);
|
||||||
|
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
LinphoneProxyConfig lProxyConfig = lc.getDefaultProxyConfig();
|
LinphoneProxyConfig lProxyConfig = lc.getDefaultProxyConfig();
|
||||||
|
boolean showOnlyUsername = getResources().getBoolean(R.bool.show_only_username_in_history);
|
||||||
String lDetailedName=null;
|
String lDetailedName=null;
|
||||||
String lDisplayName = lAddress.getDisplayName();
|
String lDisplayName = !showOnlyUsername ? lAddress.getDisplayName() : null;
|
||||||
if (lDisplayName == null)
|
if (showOnlyUsername || (lProxyConfig != null && lProxyConfig.getDomain().equals(lAddress.getDomain()))) {
|
||||||
lDisplayName = LinphoneUtils.findDisplayNameOfContact(lAddress, getContentResolver());
|
|
||||||
|
|
||||||
if (lProxyConfig != null && lProxyConfig.getDomain().equals(lAddress.getDomain())) {
|
|
||||||
lDetailedName = lAddress.getUserName();
|
lDetailedName = lAddress.getUserName();
|
||||||
} else {
|
} else {
|
||||||
lDetailedName = lAddress.asStringUriOnly();
|
lDetailedName = lAddress.asStringUriOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lDisplayName == null) {
|
if (lDisplayName == null) {
|
||||||
lFirstLineView.setText(lDetailedName);
|
lFirstLineView.setText(lDetailedName);
|
||||||
lSecondLineView.setVisibility(View.GONE);
|
lSecondLineView.setVisibility(View.GONE);
|
||||||
|
@ -178,7 +176,7 @@ public class HistoryActivity extends ListActivity {
|
||||||
lSecondLineView.setText(lDetailedName);
|
lSecondLineView.setText(lDetailedName);
|
||||||
lSecondLineView.setVisibility(View.VISIBLE);
|
lSecondLineView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return lView;
|
return lView;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue