Added a way to hide phone numbers and/or sip addresses in contact view
This commit is contained in:
parent
2d8e567bb5
commit
ad168a662f
2 changed files with 10 additions and 1 deletions
|
@ -74,6 +74,10 @@
|
||||||
|
|
||||||
<bool name="hide_phone_numbers_in_editor">false</bool>
|
<bool name="hide_phone_numbers_in_editor">false</bool>
|
||||||
<bool name="hide_sip_addresses_in_editor">false</bool>
|
<bool name="hide_sip_addresses_in_editor">false</bool>
|
||||||
|
|
||||||
|
<bool name="hide_contact_phone_numbers">false</bool>
|
||||||
|
<bool name="hide_contact_sip_addresses">false</bool>
|
||||||
|
|
||||||
<bool name="setup_cancel_move_to_back">false</bool>
|
<bool name="setup_cancel_move_to_back">false</bool>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -134,6 +134,7 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
||||||
TableLayout controls = (TableLayout) view.findViewById(R.id.controls);
|
TableLayout controls = (TableLayout) view.findViewById(R.id.controls);
|
||||||
controls.removeAllViews();
|
controls.removeAllViews();
|
||||||
for (String numberOrAddress : contact.getNumbersOrAddresses()) {
|
for (String numberOrAddress : contact.getNumbersOrAddresses()) {
|
||||||
|
boolean skip = false;
|
||||||
View v = inflater.inflate(R.layout.contact_control_row, null);
|
View v = inflater.inflate(R.layout.contact_control_row, null);
|
||||||
|
|
||||||
String displayednumberOrAddress = numberOrAddress;
|
String displayednumberOrAddress = numberOrAddress;
|
||||||
|
@ -144,8 +145,10 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
||||||
TextView label = (TextView) v.findViewById(R.id.address_label);
|
TextView label = (TextView) v.findViewById(R.id.address_label);
|
||||||
if(LinphoneUtils.isSipAddress(numberOrAddress)) {
|
if(LinphoneUtils.isSipAddress(numberOrAddress)) {
|
||||||
label.setText(R.string.sip_address);
|
label.setText(R.string.sip_address);
|
||||||
|
skip |= getResources().getBoolean(R.bool.hide_contact_sip_addresses);
|
||||||
} else {
|
} else {
|
||||||
label.setText(R.string.phone_number);
|
label.setText(R.string.phone_number);
|
||||||
|
skip |= getResources().getBoolean(R.bool.hide_contact_phone_numbers);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextView tv = (TextView) v.findViewById(R.id.numeroOrAddress);
|
TextView tv = (TextView) v.findViewById(R.id.numeroOrAddress);
|
||||||
|
@ -209,7 +212,9 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
||||||
v.findViewById(R.id.contact_chat).setVisibility(View.GONE);
|
v.findViewById(R.id.contact_chat).setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
controls.addView(v);
|
if (!skip) {
|
||||||
|
controls.addView(v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue