Fix delete contact button position

This commit is contained in:
Sylvain Berfini 2013-03-22 10:50:16 +01:00
parent 4af85a96e4
commit b433e74340

View file

@ -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() {