From ad168a662f1e5adaf6b5b24b2cf52ba9be8c5330 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 15 Mar 2016 16:20:25 +0100 Subject: [PATCH] Added a way to hide phone numbers and/or sip addresses in contact view --- res/values/non_localizable_custom.xml | 4 ++++ src/org/linphone/ContactDetailsFragment.java | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/res/values/non_localizable_custom.xml b/res/values/non_localizable_custom.xml index ddd28e398..f99b87b04 100644 --- a/res/values/non_localizable_custom.xml +++ b/res/values/non_localizable_custom.xml @@ -74,6 +74,10 @@ false false + + false + false + false diff --git a/src/org/linphone/ContactDetailsFragment.java b/src/org/linphone/ContactDetailsFragment.java index 90aa91e8a..f77b16ea4 100644 --- a/src/org/linphone/ContactDetailsFragment.java +++ b/src/org/linphone/ContactDetailsFragment.java @@ -134,6 +134,7 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener TableLayout controls = (TableLayout) view.findViewById(R.id.controls); controls.removeAllViews(); for (String numberOrAddress : contact.getNumbersOrAddresses()) { + boolean skip = false; View v = inflater.inflate(R.layout.contact_control_row, null); String displayednumberOrAddress = numberOrAddress; @@ -144,8 +145,10 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener TextView label = (TextView) v.findViewById(R.id.address_label); if(LinphoneUtils.isSipAddress(numberOrAddress)) { label.setText(R.string.sip_address); + skip |= getResources().getBoolean(R.bool.hide_contact_sip_addresses); } else { label.setText(R.string.phone_number); + skip |= getResources().getBoolean(R.bool.hide_contact_phone_numbers); } 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); } - controls.addView(v); + if (!skip) { + controls.addView(v); + } } }