Rework contacts
This commit is contained in:
parent
35204a3808
commit
b24b1a43f3
9 changed files with 278 additions and 354 deletions
|
@ -12,48 +12,33 @@
|
|||
android:background="@color/colorF">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_back"
|
||||
android:id="@+id/back"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/back"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_back"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:padding="20dp"/>
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_edit"
|
||||
android:id="@+id/editContact"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="10dp"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"/>
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_delete"
|
||||
android:id="@+id/deleteContact"
|
||||
android:padding="10dp"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/delete"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toLeftOf="@+id/editContact"
|
||||
android:layout_toStartOf="@+id/editContact"/>
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_valid"
|
||||
android:id="@+id/ok"
|
||||
android:background="@drawable/valid"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:adjustViewBounds="true"/>
|
||||
android:layout_toLeftOf="@+id/editContact"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -61,40 +46,44 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contactPicture"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:src="@drawable/avatar" />
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mask"
|
||||
android:src="@drawable/avatar_mask"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contactName"
|
||||
android:id="@+id/contact_name"
|
||||
style="@style/font5"
|
||||
android:singleLine="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:paddingTop="10dp"
|
||||
android:textColor="@color/colorC" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contactAddress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/colorA" />
|
||||
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -2,39 +2,49 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/list_selector"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/separator"
|
||||
android:paddingLeft="10dp"
|
||||
android:textSize="30sp"
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/colorH"
|
||||
android:textColor="@color/colorA"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:orientation="horizontal">
|
||||
android:background="@color/colorH"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/separator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/separator_text"
|
||||
style="@style/font1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center" />
|
||||
|
||||
<ImageView
|
||||
android:background="@color/colorE"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="5dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
@ -43,8 +53,8 @@
|
|||
android:id="@+id/mask"
|
||||
android:src="@drawable/avatar_mask"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
@ -81,6 +91,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="gone"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp" />
|
||||
|
|
|
@ -3,102 +3,69 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="10dp">
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@color/colorE"/>
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@color/colorE"/>
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sip_address"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/colorE" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numeroOrAddress"
|
||||
android:lines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:fadingEdge="horizontal"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/colorC"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:gravity="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
<TextView
|
||||
android:id="@+id/address_label"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp">
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/colorE" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numeroOrAddress"
|
||||
style="@style/font6"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:fadingEdge="horizontal"
|
||||
android:singleLine="true"
|
||||
android:gravity="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_dial_back"
|
||||
android:id="@+id/dial"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:id="@+id/call"
|
||||
android:src="@drawable/call_start_body_default"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/chatRow"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp">
|
||||
android:contentDescription="@string/content_description_dial_back"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_centerInParent="true"/>
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_chat"
|
||||
android:id="@+id/start_chat"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:id="@+id/chat"
|
||||
android:src="@drawable/chat_start_body_default"
|
||||
android:contentDescription="@string/content_description_chat"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/addFriend"
|
||||
android:visibility="gone"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:contentDescription="@string/content_description_dial_back"
|
||||
android:gravity="right"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/contact_add" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</TableRow>
|
|
@ -1,34 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<EditText
|
||||
android:textCursorDrawable="@null"
|
||||
android:id="@+id/numoraddr"
|
||||
android:layout_width="300dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:inputType="textEmailAddress"
|
||||
android:layout_weight="0.9"/>
|
||||
android:layout_weight="0.09"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete"
|
||||
android:src="@drawable/delete_field_default"
|
||||
android:contentDescription="@string/content_description_add"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="30dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_weight="0.1"
|
||||
android:paddingLeft="10dp"/>
|
||||
android:layout_weight="0.91"
|
||||
android:layout_gravity="center"
|
||||
android:paddingLeft="5dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</TableRow>
|
|
@ -6,6 +6,7 @@
|
|||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="bottom"
|
||||
|
@ -14,18 +15,18 @@
|
|||
|
||||
<RelativeLayout
|
||||
android:id="@+id/all_contacts_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_all_contacts"
|
||||
android:id="@+id/all_contacts"
|
||||
android:contentDescription="@string/content_description_all_contacts"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/contacts_all"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:padding="15dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<RelativeLayout
|
||||
|
@ -40,8 +41,8 @@
|
|||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_toRightOf="@id/all_contacts_layout"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true">
|
||||
|
||||
|
@ -49,9 +50,9 @@
|
|||
android:contentDescription="@string/content_description_linphone_contacts"
|
||||
android:id="@+id/linphone_contacts"
|
||||
android:src="@drawable/contacts_sip"
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:padding="15dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<RelativeLayout
|
||||
|
@ -67,66 +68,29 @@
|
|||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_new_contact"
|
||||
android:id="@+id/newContact"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/contact_add"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:contentDescription="@string/content_description_new_contact"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toLeftOf="@id/edit"
|
||||
android:scaleType="center"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete"
|
||||
android:src="@drawable/delete"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_valid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/select_all"
|
||||
android:src="@drawable/select_all"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_valid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toLeftOf="@id/delete"
|
||||
android:padding="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/deselect_all"
|
||||
android:src="@drawable/deselect_all"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_valid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toLeftOf="@id/delete"
|
||||
android:padding="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
android:padding="15dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/edit"
|
||||
android:src="@drawable/edit_list_button"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="10dp"
|
||||
android:padding="15dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/edit_list"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -147,10 +111,8 @@
|
|||
<ImageView
|
||||
android:contentDescription="@string/content_description_cancel"
|
||||
android:id="@+id/clearSearchField"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="center"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/clean_field_default"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true"
|
||||
|
|
|
@ -9,40 +9,38 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/colorF"
|
||||
android:id="@+id/relativeLayout">
|
||||
android:background="@color/colorF">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_back"
|
||||
android:id="@+id/back"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/back"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_back"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:padding="20dp"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ok"
|
||||
android:contentDescription="@string/content_description_valid"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="20dp"
|
||||
android:src="@drawable/valid"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_valid"
|
||||
android:id="@+id/ok"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/valid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_delete"
|
||||
android:id="@+id/deleteContact"
|
||||
android:padding="10dp"
|
||||
android:contentDescription="@string/content_description_delete"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/delete"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toLeftOf="@+id/ok"
|
||||
android:layout_toStartOf="@+id/editContact"/>
|
||||
android:layout_toLeftOf="@+id/ok"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -66,16 +64,31 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="10dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contactPicture"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:src="@drawable/avatar" />
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mask"
|
||||
android:src="@drawable/avatar_mask"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
@ -96,8 +109,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:paddingRight="5dp"
|
||||
android:inputType="textPersonName|textCapWords"
|
||||
android:layout_column="0"/>
|
||||
android:inputType="textPersonName|textCapWords"/>
|
||||
|
||||
<TextView
|
||||
android:text="@string/contact_first_name"
|
||||
|
@ -116,8 +128,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:paddingRight="5dp"
|
||||
android:inputType="textPersonName|textCapWords"
|
||||
android:layout_column="1"/>
|
||||
android:inputType="textPersonName|textCapWords"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -129,15 +140,15 @@
|
|||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<TextView
|
||||
android:text="@string/sip_address"
|
||||
style="@style/font13"
|
||||
android:textAllCaps="true"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/add_address_field"
|
||||
|
@ -149,13 +160,13 @@
|
|||
android:paddingLeft="5dp"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<TableLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/controls_sip_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="20dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -168,15 +179,15 @@
|
|||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<TextView
|
||||
android:text="@string/phone_number"
|
||||
style="@style/font13"
|
||||
android:textAllCaps="true"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/add_number_field"
|
||||
|
@ -188,13 +199,13 @@
|
|||
android:paddingLeft="5dp"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<TableLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/controls_numbers"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="20dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
|||
|
||||
@SuppressLint("InflateParams")
|
||||
private void displayContact(LayoutInflater inflater, View view) {
|
||||
ImageView contactPicture = (ImageView) view.findViewById(R.id.contactPicture);
|
||||
ImageView contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
||||
if (contact.getPhotoUri() != null) {
|
||||
InputStream input = Compatibility.getContactPictureInputStream(LinphoneActivity.instance().getContentResolver(), contact.getID());
|
||||
contactPicture.setImageBitmap(BitmapFactory.decodeStream(input));
|
||||
|
@ -127,9 +127,8 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
|||
contactPicture.setImageResource(R.drawable.avatar);
|
||||
}
|
||||
|
||||
TextView contactName = (TextView) view.findViewById(R.id.contactName);
|
||||
TextView contactName = (TextView) view.findViewById(R.id.contact_name);
|
||||
contactName.setText(contact.getName());
|
||||
|
||||
|
||||
TableLayout controls = (TableLayout) view.findViewById(R.id.controls);
|
||||
controls.removeAllViews();
|
||||
|
@ -140,19 +139,26 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
|||
if (numberOrAddress.startsWith("sip:")) {
|
||||
displayednumberOrAddress = displayednumberOrAddress.replace("sip:", "");
|
||||
}
|
||||
|
||||
TextView label = (TextView) v.findViewById(R.id.address_label);
|
||||
if(LinphoneUtils.isSipAddress(numberOrAddress)) {
|
||||
label.setText(R.string.sip_address);
|
||||
} else {
|
||||
label.setText(R.string.phone_number);
|
||||
}
|
||||
|
||||
TextView tv = (TextView) v.findViewById(R.id.numeroOrAddress);
|
||||
tv.setText(displayednumberOrAddress);
|
||||
tv.setSelected(true);
|
||||
|
||||
if (!displayChatAddressOnly) {
|
||||
v.findViewById(R.id.dial).setOnClickListener(dialListener);
|
||||
v.findViewById(R.id.dial).setTag(displayednumberOrAddress);
|
||||
v.findViewById(R.id.call).setOnClickListener(dialListener);
|
||||
v.findViewById(R.id.call).setTag(displayednumberOrAddress);
|
||||
} else {
|
||||
v.findViewById(R.id.dial).setVisibility(View.GONE);
|
||||
v.findViewById(R.id.call).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
v.findViewById(R.id.start_chat).setOnClickListener(chatListener);
|
||||
v.findViewById(R.id.chat).setOnClickListener(chatListener);
|
||||
LinphoneProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig();
|
||||
if (lpc != null) {
|
||||
displayednumberOrAddress = lpc.normalizePhoneNumber(displayednumberOrAddress);
|
||||
|
@ -164,13 +170,13 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
|||
if (!numberOrAddress.contains("@")) {
|
||||
tag = numberOrAddress + "@" + lpc.getDomain();
|
||||
}
|
||||
v.findViewById(R.id.start_chat).setTag(tag);
|
||||
v.findViewById(R.id.chat).setTag(tag);
|
||||
} else {
|
||||
v.findViewById(R.id.start_chat).setTag(numberOrAddress);
|
||||
v.findViewById(R.id.chat).setTag(numberOrAddress);
|
||||
}
|
||||
|
||||
final String finalNumberOrAddress = numberOrAddress;
|
||||
ImageView friend = (ImageView) v.findViewById(R.id.addFriend);
|
||||
/*ImageView friend = (ImageView) v.findViewById(R.id.addFriend);
|
||||
if (getResources().getBoolean(R.bool.enable_linphone_friends) && !displayChatAddressOnly) {
|
||||
friend.setVisibility(View.VISIBLE);
|
||||
|
||||
|
@ -196,10 +202,10 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (getResources().getBoolean(R.bool.disable_chat)) {
|
||||
v.findViewById(R.id.start_chat).setVisibility(View.GONE);
|
||||
v.findViewById(R.id.chat).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
controls.addView(v);
|
||||
|
@ -209,7 +215,7 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
|||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACT);
|
||||
|
||||
|
@ -217,13 +223,13 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
|||
LinphoneActivity.instance().hideStatusBar();
|
||||
}
|
||||
}
|
||||
|
||||
contact.refresh(getActivity().getContentResolver());
|
||||
if (contact.getName() == null || contact.getName().equals("")) {
|
||||
//Contact has been deleted, return
|
||||
LinphoneActivity.instance().displayContacts(false);
|
||||
} else {
|
||||
displayContact(inflater, view);
|
||||
}
|
||||
displayContact(inflater, view);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.linphone.compatibility.Compatibility;
|
|||
import org.linphone.core.LinphoneCallLog;
|
||||
import org.linphone.core.LinphoneFriend;
|
||||
import org.linphone.core.PresenceActivityType;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
|
@ -62,9 +63,9 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
private LayoutInflater mInflater;
|
||||
private ListView contactsList;
|
||||
private TextView noSipContact, noContact;
|
||||
private ImageView allContacts, linphoneContacts, newContact, edit, selectAll, deselectAll, delete;
|
||||
private ImageView allContacts, linphoneContacts, newContact, edit, selectAll, deselectAll, delete, cancel;
|
||||
private boolean onlyDisplayLinphoneContacts, isEditMode;
|
||||
private RelativeLayout allContactsSelected, linphoneContactsSelected;
|
||||
private RelativeLayout allContactsSelected, linphoneContactsSelected, editList, topbar;
|
||||
private int lastKnownPosition;
|
||||
private AlphabetIndexer indexer;
|
||||
private boolean editOnClick = false, editConsumed = false, onlyDisplayChatAddress = false;
|
||||
|
@ -129,7 +130,12 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
|
||||
delete = (ImageView) view.findViewById(R.id.delete);
|
||||
delete.setOnClickListener(this);
|
||||
delete.setVisibility(View.INVISIBLE);
|
||||
|
||||
editList = (RelativeLayout) view.findViewById(R.id.edit_list);
|
||||
topbar = (RelativeLayout) view.findViewById(R.id.top_bar);
|
||||
|
||||
cancel = (ImageView) view.findViewById(R.id.cancel);
|
||||
cancel.setOnClickListener(this);
|
||||
|
||||
edit = (ImageView) view.findViewById(R.id.edit);
|
||||
edit.setOnClickListener(this);
|
||||
|
@ -176,6 +182,11 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
return;
|
||||
}
|
||||
|
||||
if (id == R.id.cancel) {
|
||||
quitEditMode();
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == R.id.delete) {
|
||||
final Dialog dialog = LinphoneActivity.instance().displayDialog(getString(R.string.delete_text));
|
||||
Button delete = (Button) dialog.findViewById(R.id.delete);
|
||||
|
@ -202,10 +213,8 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
}
|
||||
|
||||
if (id == R.id.edit) {
|
||||
edit.setVisibility(View.GONE);
|
||||
selectAll.setVisibility(View.VISIBLE);
|
||||
delete.setVisibility(View.VISIBLE);
|
||||
newContact.setVisibility(View.GONE);
|
||||
editList.setVisibility(View.VISIBLE);
|
||||
topbar.setVisibility(View.GONE);
|
||||
isEditMode = true;
|
||||
}
|
||||
|
||||
|
@ -215,11 +224,6 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
allContacts.setEnabled(false);
|
||||
linphoneContacts.setEnabled(true);
|
||||
linphoneContactsSelected.setVisibility(View.INVISIBLE);
|
||||
if (searchField.getText().toString().length() > 0) {
|
||||
searchContacts();
|
||||
} else {
|
||||
changeContactsAdapter();
|
||||
}
|
||||
}
|
||||
else if (id == R.id.linphone_contacts) {
|
||||
allContactsSelected.setVisibility(View.INVISIBLE);
|
||||
|
@ -227,11 +231,7 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
linphoneContacts.setEnabled(false);
|
||||
allContacts.setEnabled(true);
|
||||
onlyDisplayLinphoneContacts = true;
|
||||
if (searchField.getText().toString().length() > 0) {
|
||||
searchContacts();
|
||||
} else {
|
||||
changeContactsAdapter();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(isEditMode){
|
||||
|
@ -239,7 +239,13 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
selectAll.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
else if (id == R.id.newContact) {
|
||||
if (searchField.getText().toString().length() > 0) {
|
||||
searchContacts();
|
||||
} else {
|
||||
changeContactsAdapter();
|
||||
}
|
||||
|
||||
if (id == R.id.newContact) {
|
||||
editConsumed = true;
|
||||
LinphoneActivity.instance().addContact(null, sipAddressToAdd);
|
||||
}
|
||||
|
@ -266,10 +272,8 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
|
||||
public void quitEditMode(){
|
||||
isEditMode = false;
|
||||
selectAll.setVisibility(View.GONE);
|
||||
deselectAll.setVisibility(View.GONE);
|
||||
delete.setVisibility(View.GONE);
|
||||
edit.setVisibility(View.VISIBLE);
|
||||
editList.setVisibility(View.GONE);
|
||||
topbar.setVisibility(View.VISIBLE);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
|
@ -319,6 +323,7 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
contactsList.setVisibility(View.GONE);
|
||||
} else {
|
||||
indexer = new AlphabetIndexer(sipContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(sipContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
|
||||
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getSIPContacts(), sipContactsCursor));
|
||||
}
|
||||
} else {
|
||||
|
@ -327,6 +332,7 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
contactsList.setVisibility(View.GONE);
|
||||
} else {
|
||||
indexer = new AlphabetIndexer(allContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(allContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
|
||||
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getAllContacts(), allContactsCursor));
|
||||
}
|
||||
}
|
||||
|
@ -406,7 +412,7 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
cursor = c;
|
||||
|
||||
margin = LinphoneUtils.pixelsToDpi(LinphoneActivity.instance().getResources(), 10);
|
||||
bitmapUnknown = BitmapFactory.decodeResource(LinphoneActivity.instance().getResources(), R.drawable.unknown_small);
|
||||
bitmapUnknown = BitmapFactory.decodeResource(LinphoneActivity.instance().getResources(), R.drawable.avatar);
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
|
@ -442,16 +448,14 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
|
||||
TextView name = (TextView) view.findViewById(R.id.name);
|
||||
name.setText(contact.getName());
|
||||
|
||||
TextView separator = (TextView) view.findViewById(R.id.separator);
|
||||
LinearLayout layout = (LinearLayout) view.findViewById(R.id.layout);
|
||||
|
||||
LinearLayout separator = (LinearLayout) view.findViewById(R.id.separator);
|
||||
TextView separatorText = (TextView) view.findViewById(R.id.separator_text);
|
||||
if (getPositionForSection(getSectionForPosition(position)) != position) {
|
||||
separator.setVisibility(View.GONE);
|
||||
layout.setPadding(0, margin, 0, margin);
|
||||
} else {
|
||||
separator.setVisibility(View.VISIBLE);
|
||||
separator.setText(String.valueOf(contact.getName().charAt(0)));
|
||||
layout.setPadding(0, 0, 0, margin);
|
||||
separatorText.setText(String.valueOf(contact.getName().charAt(0)));
|
||||
}
|
||||
|
||||
ImageView icon = (ImageView) view.findViewById(R.id.contact_picture);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.linphone;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
|
@ -15,14 +14,7 @@ import android.content.ContentProviderOperation;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.BitmapShader;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Shader;
|
||||
import android.media.ExifInterface;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
|
@ -41,7 +33,7 @@ import android.view.ViewGroup;
|
|||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
public class EditContactFragment extends Fragment {
|
||||
private View view;
|
||||
|
@ -58,7 +50,7 @@ public class EditContactFragment extends Fragment {
|
|||
private List<NewOrUpdatedNumberOrAddress> numbersAndAddresses;
|
||||
private ArrayList<ContentProviderOperation> ops;
|
||||
private int firstSipAddressIndex = -1;
|
||||
private TableLayout sipAddresses, numbers;
|
||||
private LinearLayout sipAddresses, numbers;
|
||||
private String newSipOrNumberToAdd;
|
||||
private ContactsManager contactsManager;
|
||||
|
||||
|
@ -116,7 +108,7 @@ public class EditContactFragment extends Fragment {
|
|||
} else {
|
||||
contactsManager.updateExistingContact(ops, contact, firstName.getText().toString(), lastName.getText().toString());
|
||||
}
|
||||
|
||||
|
||||
for (NewOrUpdatedNumberOrAddress numberOrAddress : numbersAndAddresses) {
|
||||
numberOrAddress.save();
|
||||
}
|
||||
|
@ -199,7 +191,7 @@ public class EditContactFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
contactPicture = (ImageView) view.findViewById(R.id.contactPicture);
|
||||
contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
||||
if (contact != null && contact.getPhotoUri() != null) {
|
||||
InputStream input = Compatibility.getContactPictureInputStream(getActivity().getContentResolver(), contact.getID());
|
||||
contactPicture.setImageBitmap(BitmapFactory.decodeStream(input));
|
||||
|
@ -214,8 +206,17 @@ public class EditContactFragment extends Fragment {
|
|||
}
|
||||
});
|
||||
|
||||
numbers = initNumbersFields(contact);
|
||||
numbersAndAddresses = new ArrayList<NewOrUpdatedNumberOrAddress>();
|
||||
sipAddresses = initSipAddressFields(contact);
|
||||
numbers = initNumbersFields(contact);
|
||||
|
||||
addSipAddress = (ImageView) view.findViewById(R.id.add_address_field);
|
||||
addSipAddress.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
addEmptyRowToAllowNewNumberOrAddress(sipAddresses,true);
|
||||
}
|
||||
});
|
||||
|
||||
addNumber = (ImageView) view.findViewById(R.id.add_number_field);
|
||||
addNumber.setOnClickListener(new OnClickListener() {
|
||||
|
@ -224,13 +225,6 @@ public class EditContactFragment extends Fragment {
|
|||
addEmptyRowToAllowNewNumberOrAddress(numbers,false);
|
||||
}
|
||||
});
|
||||
addSipAddress = (ImageView) view.findViewById(R.id.add_address_field);
|
||||
addSipAddress.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
addEmptyRowToAllowNewNumberOrAddress(sipAddresses,true);
|
||||
}
|
||||
});
|
||||
|
||||
ops = new ArrayList<ContentProviderOperation>();
|
||||
lastName.requestFocus();
|
||||
|
@ -319,10 +313,9 @@ public class EditContactFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
private TableLayout initNumbersFields(final Contact contact) {
|
||||
TableLayout controls = (TableLayout) view.findViewById(R.id.controls_numbers);
|
||||
private LinearLayout initNumbersFields(final Contact contact) {
|
||||
LinearLayout controls = (LinearLayout) view.findViewById(R.id.controls_numbers);
|
||||
controls.removeAllViews();
|
||||
numbersAndAddresses = new ArrayList<NewOrUpdatedNumberOrAddress>();
|
||||
|
||||
if (contact != null) {
|
||||
for (String numberOrAddress : contact.getNumbersOrAddresses()) {
|
||||
|
@ -351,10 +344,9 @@ public class EditContactFragment extends Fragment {
|
|||
return controls;
|
||||
}
|
||||
|
||||
private TableLayout initSipAddressFields(final Contact contact) {
|
||||
TableLayout controls = (TableLayout) view.findViewById(R.id.controls_sip_address);
|
||||
private LinearLayout initSipAddressFields(final Contact contact) {
|
||||
LinearLayout controls = (LinearLayout) view.findViewById(R.id.controls_sip_address);
|
||||
controls.removeAllViews();
|
||||
numbersAndAddresses = new ArrayList<NewOrUpdatedNumberOrAddress>();
|
||||
|
||||
if (contact != null) {
|
||||
for (String numberOrAddress : contact.getNumbersOrAddresses()) {
|
||||
|
@ -383,12 +375,12 @@ public class EditContactFragment extends Fragment {
|
|||
return controls;
|
||||
}
|
||||
|
||||
private View displayNumberOrAddress(final TableLayout controls, String numberOrAddress) {
|
||||
private View displayNumberOrAddress(final LinearLayout controls, String numberOrAddress) {
|
||||
return displayNumberOrAddress(controls, numberOrAddress, false);
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
private View displayNumberOrAddress(final TableLayout controls, String numberOrAddress, boolean forceAddNumber) {
|
||||
private View displayNumberOrAddress(final LinearLayout controls, String numberOrAddress, boolean forceAddNumber) {
|
||||
boolean isSip = LinphoneUtils.isStrictSipAddress(numberOrAddress) || !LinphoneUtils.isNumberAddress(numberOrAddress);
|
||||
|
||||
if (isSip) {
|
||||
|
@ -418,7 +410,7 @@ public class EditContactFragment extends Fragment {
|
|||
numbersAndAddresses.add(nounoa);
|
||||
|
||||
final View view = inflater.inflate(R.layout.contact_edit_row, null);
|
||||
|
||||
|
||||
final EditText noa = (EditText) view.findViewById(R.id.numoraddr);
|
||||
noa.setInputType(isSip ? InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS : InputType.TYPE_CLASS_PHONE);
|
||||
noa.setText(numberOrAddress);
|
||||
|
@ -454,9 +446,8 @@ public class EditContactFragment extends Fragment {
|
|||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
private void addEmptyRowToAllowNewNumberOrAddress(final TableLayout controls, final boolean isSip) {
|
||||
private void addEmptyRowToAllowNewNumberOrAddress(final LinearLayout controls, final boolean isSip) {
|
||||
final View view = inflater.inflate(R.layout.contact_edit_row, null);
|
||||
|
||||
final NewOrUpdatedNumberOrAddress nounoa = new NewOrUpdatedNumberOrAddress(isSip);
|
||||
|
||||
final EditText noa = (EditText) view.findViewById(R.id.numoraddr);
|
||||
|
@ -489,22 +480,9 @@ public class EditContactFragment extends Fragment {
|
|||
}
|
||||
|
||||
});
|
||||
/*if (!isSip) {
|
||||
firstSipAddressIndex++;
|
||||
addEmptyRowToAllowNewNumberOrAddress(controls, false);
|
||||
} else {
|
||||
addEmptyRowToAllowNewNumberOrAddress(controls, true);
|
||||
}
|
||||
}*/
|
||||
|
||||
controls.addView(view, controls.getChildCount());
|
||||
|
||||
//if (firstSipAddressIndex != -1) {
|
||||
// controls.addView(view, firstSipAddressIndex);
|
||||
//} else {
|
||||
// controls.addView(view);
|
||||
//}
|
||||
//}
|
||||
controls.addView(view);
|
||||
}
|
||||
|
||||
private String findContactFirstName(String contactID) {
|
||||
|
@ -609,7 +587,7 @@ public class EditContactFragment extends Fragment {
|
|||
newNumberOrAddress = newN;
|
||||
}
|
||||
|
||||
public void save() {
|
||||
public void save() {;
|
||||
if (newNumberOrAddress == null || newNumberOrAddress.equals(oldNumberOrAddress))
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue