From b433e743401709ffb50643aac528ab693f3e7af4 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 22 Mar 2013 10:50:16 +0100 Subject: [PATCH] Fix delete contact button position --- src/org/linphone/EditContactFragment.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/org/linphone/EditContactFragment.java b/src/org/linphone/EditContactFragment.java index 1d82dbaa0..c9e34268a 100644 --- a/src/org/linphone/EditContactFragment.java +++ b/src/org/linphone/EditContactFragment.java @@ -243,7 +243,10 @@ public class EditContactFragment extends Fragment { numberOrAddress = numberOrAddress.replace("sip:", ""); } if ((getResources().getBoolean(R.bool.hide_phone_numbers_in_editor) && !isSip) || (getResources().getBoolean(R.bool.hide_sip_addresses_in_editor) && isSip)) { - isSip = !isSip; // If number can't be displayed because we hide a sort of number, change that category + if (forceAddNumber) + isSip = !isSip; // If number can't be displayed because we hide a sort of number, change that category + else + return null; } NewOrUpdatedNumberOrAddress tempNounoa; @@ -341,11 +344,6 @@ public class EditContactFragment extends Fragment { if (isSip) { controls.addView(view, controls.getChildCount()); - if (deleteContact != null) { - // Move to the bottom the remove contact button - controls.removeView(deleteContact); - controls.addView(deleteContact, controls.getChildCount()); - } } else { if (firstSipAddressIndex != -1) { controls.addView(view, firstSipAddressIndex); @@ -353,6 +351,11 @@ public class EditContactFragment extends Fragment { controls.addView(view); } } + if (deleteContact != null) { + // Move to the bottom the remove contact button + controls.removeView(deleteContact); + controls.addView(deleteContact, controls.getChildCount()); + } } private void createNewContact() {