Fixed hide_[phone_numbers/sip_addresses]_in_editor custom

This commit is contained in:
Sylvain Berfini 2016-03-15 16:06:41 +01:00 committed by Jehan Monnier
parent 100134426c
commit 2d8e567bb5
2 changed files with 14 additions and 1 deletions

View file

@ -138,6 +138,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/sip_addresses"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
@ -176,8 +177,8 @@
</LinearLayout>
<LinearLayout
android:id="@+id/phone_numbers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"

View file

@ -71,6 +71,7 @@ public class ContactEditorFragment extends Fragment {
private View view;
private ImageView cancel, deleteContact, ok;
private ImageView addNumber, addSipAddress, contactPicture;
private LinearLayout phoneNumbersSection, sipAddressesSection;
private EditText firstName, lastName;
private LayoutInflater inflater;
private static final int ADD_PHOTO = 1337;
@ -113,6 +114,17 @@ public class ContactEditorFragment extends Fragment {
contactsManager = ContactsManager.getInstance();
view = inflater.inflate(R.layout.contact_edit, container, false);
phoneNumbersSection = (LinearLayout) view.findViewById(R.id.phone_numbers);
if (getResources().getBoolean(R.bool.hide_phone_numbers_in_editor)) {
phoneNumbersSection.setVisibility(View.GONE);
}
sipAddressesSection = (LinearLayout) view.findViewById(R.id.sip_addresses);
if (getResources().getBoolean(R.bool.hide_sip_addresses_in_editor)) {
sipAddressesSection.setVisibility(View.GONE);
}
deleteContact = (ImageView) view.findViewById(R.id.delete_contact);