Fix about button

Fix create new contact
This commit is contained in:
Margaux Clerc 2015-04-15 14:55:23 +02:00
parent 38a02c96f5
commit 69950b81ef
3 changed files with 24 additions and 18 deletions

View file

@ -49,27 +49,33 @@
<View android:layout_weight="30" android:layout_width="0dp" android:layout_height="0dp" />
<LinearLayout
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<Button
android:id="@+id/send_log"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/menu_send_log"/>
<Button
android:id="@+id/reset_log"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/menu_reset_log"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="30dp">
<Button
android:id="@+id/send_log"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/menu_send_log"/>
<Button
android:id="@+id/reset_log"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/menu_reset_log"
/>
<Button android:id="@+id/exit"
<Button android:id="@+id/exit"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View file

@ -300,7 +300,7 @@ public class ContactsManager {
public boolean isContactHasAddress(Contact contact, String address){
if(contact != null) {
contact.refresh(contentResolver);
if (contact.getNumbersOrAddresses().contains("sip:" + address)) {
if (contact.getNumbersOrAddresses().contains(address)) {
return true;
} else {
return false;

View file

@ -392,10 +392,10 @@ public class EditContactFragment extends Fragment {
private void addLinphoneFriendIfNeeded(){
for (NewOrUpdatedNumberOrAddress numberOrAddress : numbersAndAddresses) {
if(numberOrAddress.newNumberOrAddress != null && numberOrAddress.isSipAddress && !contactsManager.isContactHasAddress(contact, numberOrAddress.newNumberOrAddress)) {
if(numberOrAddress.newNumberOrAddress != null && numberOrAddress.isSipAddress) {
if(isNewContact){
Contact c = contactsManager.findContactWithDisplayName(ContactsManager.getInstance().getDisplayName(firstName.getText().toString(), lastName.getText().toString()));
if (c != null) {
if (c != null && !contactsManager.isContactHasAddress(c, numberOrAddress.newNumberOrAddress)) {
contactsManager.createNewFriend(c, numberOrAddress.newNumberOrAddress);
}
} else {