Added a customization setting to show full SIP addresses in contact detail & editor
This commit is contained in:
parent
6b3bff4412
commit
7416f5fe41
3 changed files with 16 additions and 8 deletions
|
@ -226,8 +226,11 @@ public class ContactDetailsFragment extends Fragment
|
|||
View v = inflater.inflate(R.layout.contact_control_row, null);
|
||||
|
||||
String value = noa.getValue();
|
||||
String displayednumberOrAddress =
|
||||
LinphoneUtils.getDisplayableUsernameFromAddress(value);
|
||||
String displayedNumberOrAddress = value;
|
||||
if (getResources()
|
||||
.getBoolean(R.bool.only_show_address_username_if_matches_default_domain)) {
|
||||
displayedNumberOrAddress = LinphoneUtils.getDisplayableUsernameFromAddress(value);
|
||||
}
|
||||
|
||||
TextView label = v.findViewById(R.id.address_label);
|
||||
if (noa.isSIPAddress()) {
|
||||
|
@ -239,12 +242,12 @@ public class ContactDetailsFragment extends Fragment
|
|||
}
|
||||
|
||||
TextView tv = v.findViewById(R.id.numeroOrAddress);
|
||||
tv.setText(displayednumberOrAddress);
|
||||
tv.setText(displayedNumberOrAddress);
|
||||
tv.setSelected(true);
|
||||
|
||||
ProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig();
|
||||
if (lpc != null) {
|
||||
String username = lpc.normalizePhoneNumber(displayednumberOrAddress);
|
||||
String username = lpc.normalizePhoneNumber(displayedNumberOrAddress);
|
||||
if (username != null) {
|
||||
value = LinphoneUtils.getFullAddressFromUsername(username);
|
||||
}
|
||||
|
|
|
@ -563,14 +563,18 @@ public class ContactEditorFragment extends Fragment {
|
|||
|
||||
private View displayNumberOrAddress(
|
||||
final LinearLayout controls, String numberOrAddress, boolean isSIP) {
|
||||
String displayNumberOrAddress = numberOrAddress;
|
||||
String displayedNumberOrAddress = numberOrAddress;
|
||||
if (isSIP) {
|
||||
if (mFirstSipAddressIndex == -1) {
|
||||
mFirstSipAddressIndex = controls.getChildCount();
|
||||
}
|
||||
displayNumberOrAddress =
|
||||
|
||||
if (getResources()
|
||||
.getBoolean(R.bool.only_show_address_username_if_matches_default_domain)) {
|
||||
displayedNumberOrAddress =
|
||||
LinphoneUtils.getDisplayableUsernameFromAddress(numberOrAddress);
|
||||
}
|
||||
}
|
||||
if ((getResources().getBoolean(R.bool.hide_phone_numbers_in_editor) && !isSIP)
|
||||
|| (getResources().getBoolean(R.bool.hide_sip_addresses_in_editor) && isSIP)) {
|
||||
return null;
|
||||
|
@ -591,7 +595,7 @@ public class ContactEditorFragment extends Fragment {
|
|||
if (!isSIP) {
|
||||
noa.setInputType(InputType.TYPE_CLASS_PHONE);
|
||||
}
|
||||
noa.setText(displayNumberOrAddress);
|
||||
noa.setText(displayedNumberOrAddress);
|
||||
noa.addTextChangedListener(
|
||||
new TextWatcher() {
|
||||
@Override
|
||||
|
|
|
@ -121,6 +121,7 @@
|
|||
<bool name="use_native_contact_editor">false</bool>
|
||||
<bool name="hide_invite_contact">false</bool>
|
||||
<bool name="generate_text_avatar">true</bool>
|
||||
<bool name="only_show_address_username_if_matches_default_domain">true</bool>
|
||||
|
||||
<!-- Side Menu -->
|
||||
<bool name="hide_assistant_from_side_menu">false</bool>
|
||||
|
|
Loading…
Reference in a new issue