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