Rework Incall view/Chat view/Edit Contact view

This commit is contained in:
Margaux Clerc 2015-08-25 17:23:07 +02:00
parent 641a32cbfa
commit 3eca96e3c5
55 changed files with 1110 additions and 695 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 B

After

Width:  |  Height:  |  Size: 298 B

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" <item android:state_pressed="true"
android:drawable="@color/call_selected" /> android:drawable="@color/colorL" />
<item android:state_enabled="false" <item android:state_enabled="false"
android:drawable="@color/call_selected" /> android:drawable="@color/colorL" />
<item <item
android:drawable="@color/footer_select" /> android:drawable="@color/colorA" />
</selector> </selector>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/video_off_over" />
<item android:state_enabled="false"
android:drawable="@drawable/video_off_disabled" />
<item
android:drawable="@drawable/video_off_default" />
</selector>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" <item android:state_pressed="true"
android:drawable="@color/footer_select" /> android:drawable="@color/colorA" />
<item android:state_selected="true" <item android:state_selected="true"
android:drawable="@color/footer_button" /> android:drawable="@color/colorD" />
<item <item
android:drawable="@color/footer_button" /> android:drawable="@color/colorD" />
</selector> </selector>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" <item android:state_pressed="true"
android:drawable="@color/footer_select" /> android:drawable="@color/colorA" />
<item android:state_selected="true" <item android:state_selected="true"
android:drawable="@color/footer_button" /> android:drawable="@color/colorD" />
<item <item
android:drawable="@color/footer_button" /> android:drawable="@color/colorD" />
</selector> </selector>

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" <item android:state_pressed="true"
android:drawable="@color/footer_select" /> android:drawable="@color/colorA" />
<item android:state_selected="true" <item android:state_selected="true"
android:drawable="@color/footer_button" /> android:drawable="@color/colorC" />
<item <item
android:drawable="@color/footer_button" /> android:drawable="@color/colorC" />
</selector> </selector>

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" <item android:state_pressed="true"
android:drawable="@drawable/hangup_over" /> android:drawable="@color/colorI" />
<item <item android:state_enabled="false"
android:drawable="@drawable/hangup_default" /> android:drawable="@color/colorD" />
<item
android:drawable="@color/colorD" />
</selector> </selector>

View file

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" <item android:state_enabled="true"
android:drawable="@drawable/micro_off_over" /> android:drawable="@drawable/micro_selected" />
<item android:state_enabled="false"
android:drawable="@drawable/micro_off_disabled" />
<item <item
android:drawable="@drawable/micro_off_default" /> android:drawable="@drawable/micro_default" />
</selector> </selector>

View file

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" <item android:state_enabled="true"
android:drawable="@drawable/speaker_on_over" /> android:drawable="@drawable/speaker_selected" />
<item android:state_enabled="false"
android:drawable="@drawable/speaker_on_disabled" />
<item <item
android:drawable="@drawable/speaker_on_default" /> android:drawable="@drawable/speaker_default" />
</selector> </selector>

View file

@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/background" android:background="@color/colorH"
android:orientation="vertical"> android:orientation="vertical">
<org.linphone.ui.AddressText <org.linphone.ui.AddressText

View file

@ -2,6 +2,6 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/background"> android:background="@color/colorH">
</ScrollView> </ScrollView>

View file

@ -4,7 +4,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/top_layout" android:id="@+id/top_layout"
android:background="@drawable/background" > android:background="@color/colorH" >
<LinearLayout <LinearLayout
android:id="@+id/header" android:id="@+id/header"
@ -15,7 +15,6 @@
android:paddingRight="10dp" android:paddingRight="10dp"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_below="@+id/topbar"
android:layout_centerHorizontal="true"> android:layout_centerHorizontal="true">
<org.linphone.ui.AvatarWithShadow <org.linphone.ui.AvatarWithShadow

View file

@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:background="@color/background" android:background="@color/colorH"
android:gravity="center"> android:gravity="center">
<View android:layout_weight="30" android:layout_width="0dp" android:layout_height="0dp" /> <View android:layout_weight="30" android:layout_width="0dp" android:layout_height="0dp" />

View file

@ -2,41 +2,47 @@
<TableRow xmlns:android="http://schemas.android.com/apk/res/android" <TableRow xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:linphone="http://schemas.android.com/apk/res-auto" xmlns:linphone="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="75dp" android:layout_height="60dp"
android:layout_margin="2dp" android:layout_margin="2dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="10dp"> android:background="@color/colorA"
android:padding="2dp">
<ImageView
android:id="@+id/contactPicture"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/avatar" />
<TextView <TextView
android:id="@+id/contactNameOrNumber" android:id="@+id/contactNameOrNumber"
style="@style/font14"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|left" android:gravity="center_vertical|left"
android:paddingLeft="20dp" android:paddingLeft="20dp"
android:paddingRight="10dp" android:paddingRight="10dp"/>
android:textColor="@android:color/white"
android:textSize="22dp" /> <Chronometer
android:id="@+id/callTimer"
style="@style/font16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="20dp"
android:gravity="center_vertical|right"/>
<ImageView <ImageView
android:contentDescription="@string/content_description_pause" android:contentDescription="@string/content_description_pause"
android:src="@drawable/pause_small_over_selected"
android:id="@+id/callStatus" android:id="@+id/callStatus"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:src="@drawable/pause" /> />
<Chronometer
android:id="@+id/callTimer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="20dp"
android:gravity="center_vertical|right"
android:textColor="@android:color/white"
android:textSize="22dp" />
</TableRow> </TableRow>

View file

@ -8,7 +8,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="20dp" android:padding="20dp"
android:layout_above="@id/mark"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView

View file

@ -3,6 +3,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingTop="40dp" android:paddingTop="40dp"
android:background="@color/background"> android:background="@color/colorH">
</ScrollView> </ScrollView>

View file

@ -3,14 +3,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/top_layout" android:id="@+id/top_layout"
android:background="@color/background" > android:background="@color/colorH" >
<RelativeLayout <RelativeLayout
android:id="@+id/topBar"
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
@ -209,13 +209,15 @@
android:id="@+id/chatMessageList" android:id="@+id/chatMessageList"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="10dp"
android:divider="@android:color/transparent" android:divider="@android:color/transparent"
android:stackFromBottom="true" android:stackFromBottom="true"
android:transcriptMode="alwaysScroll" android:transcriptMode="alwaysScroll"
android:cacheColorHint="@color/transparent" android:cacheColorHint="@color/transparent"
android:dividerHeight="10dp" android:dividerHeight="10dp"
android:layout_above="@id/remoteComposing" android:layout_above="@id/remoteComposing"
android:layout_below="@+id/relativeLayout"/> android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:layout_below="@+id/topBar"/>
</RelativeLayout> </RelativeLayout>

View file

@ -1,16 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bubble" android:id="@+id/bubble"
android:padding="10dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="left" android:gravity="left"
android:background="@drawable/resizable_chat_bubble_incoming"
android:orientation="horizontal" > android:orientation="horizontal" >
<ImageView <ImageView
android:id="@+id/contact_picture" android:id="@+id/contact_picture"
android:layout_width="40dp" android:layout_width="50dp"
android:layout_height="40dp" android:layout_height="50dp"
android:paddingTop="10dp"
android:paddingLeft="10dp"
android:src="@drawable/avatar"/> android:src="@drawable/avatar"/>
<LinearLayout <LinearLayout
@ -25,6 +27,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:paddingRight="5dp" android:paddingRight="5dp"
android:paddingTop="10dp"
style="@style/font3"/> style="@style/font3"/>
<TextView <TextView
@ -33,6 +36,7 @@
android:visibility="gone" android:visibility="gone"
android:linksClickable="true" android:linksClickable="true"
android:autoLink="web" android:autoLink="web"
android:paddingBottom="10dp"
android:textColor="@android:color/black" android:textColor="@android:color/black"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />

View file

@ -1,15 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bubble" android:id="@+id/bubble"
android:padding="10dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/resizable_chat_bubble_outgoing"
android:orientation="horizontal" > android:orientation="horizontal" >
<ImageView <ImageView
android:id="@+id/contact_picture" android:id="@+id/contact_picture"
android:layout_width="40dp" android:layout_width="50dp"
android:layout_height="40dp" android:layout_height="50dp"
android:paddingTop="10dp"
android:paddingLeft="10dp"
android:src="@drawable/avatar"/> android:src="@drawable/avatar"/>
<LinearLayout <LinearLayout
@ -24,6 +26,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:paddingRight="5dp" android:paddingRight="5dp"
android:paddingTop="10dp"
style="@style/font3"/> style="@style/font3"/>
<TextView <TextView
@ -31,6 +34,7 @@
android:visibility="gone" android:visibility="gone"
android:linksClickable="true" android:linksClickable="true"
android:autoLink="web" android:autoLink="web"
android:paddingBottom="10dp"
android:textColor="@android:color/black" android:textColor="@android:color/black"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />

View file

@ -2,14 +2,13 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/background" android:background="@color/colorH"
android:orientation="vertical" > android:orientation="vertical" >
<RelativeLayout <RelativeLayout
android:id="@+id/toolbar"
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="top"
android:background="@color/colorF"> android:background="@color/colorF">
<ImageView <ImageView

View file

@ -5,7 +5,7 @@
android:layout_height="75dp" android:layout_height="75dp"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:background="@color/footer_select"> android:background="@color/colorF">
<TextView <TextView
android:layout_width="0dip" android:layout_width="0dip"

View file

@ -85,6 +85,7 @@
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:textAppearance="?android:attr/textAppearanceLarge"
android:paddingTop="10dp"
android:textColor="@color/colorC" /> android:textColor="@color/colorC" />
<TextView <TextView

View file

@ -1,27 +1,34 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android" <TableRow 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:layout_margin="2dp"
android:gravity="center_vertical"
android:padding="10dp">
<EditText <LinearLayout
android:textCursorDrawable="@null" android:layout_width="match_parent"
android:id="@+id/numoraddr"
android:layout_width="331dp"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:background="@drawable/resizable_textfield"
android:inputType="textEmailAddress"/>
<ImageView
android:contentDescription="@string/content_description_delete"
android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/list_delete" android:orientation="horizontal">
android:paddingLeft="5dp"
android:gravity="right" /> <EditText
android:textCursorDrawable="@null"
android:id="@+id/numoraddr"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:background="@drawable/resizable_textfield"
android:inputType="textEmailAddress"
android:layout_weight="0.9"/>
<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_height="30dp"
android:layout_weight="0.1"
android:paddingLeft="10dp"/>
</LinearLayout>
</TableRow> </TableRow>

View file

@ -42,7 +42,7 @@
android:id="@+id/controls" android:id="@+id/controls"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp"> android:layout_height="70dp">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -1,27 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:id="@android:id/text1"
android:layout_height="48dp" android:layout_width="match_parent"
android:background="@color/colorH">
<ImageView
android:id="@+id/icon"
android:layout_width="25dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:layout_marginLeft="12dp" android:gravity="center_vertical"
android:layout_marginRight="12dp" android:paddingLeft="16dp"
android:src="@drawable/options_default" android:paddingRight="16dp"
android:layout_centerVertical="true" /> android:textColor="@color/text_contrast"
android:background="?android:attr/activatedBackgroundIndicator"
<TextView android:minHeight="?android:attr/listPreferredItemHeightSmall"/>
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@id/icon"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:paddingRight="40dp"/>
</RelativeLayout>

View file

@ -69,6 +69,7 @@
<RelativeLayout <RelativeLayout
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
@ -78,27 +79,42 @@
android:src="@drawable/avatar" /> android:src="@drawable/avatar" />
</RelativeLayout> </RelativeLayout>
<TextView
android:text="@string/contact_last_name"
style="@style/font13"
android:textAllCaps="true"
android:paddingTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<EditText <EditText
android:textCursorDrawable="@null"
android:id="@+id/contactLastName" android:id="@+id/contactLastName"
android:background="@drawable/resizable_textfield"
style="@style/font9"
android:textCursorDrawable="@null"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/contact_last_name"
android:textColor="@color/text_contrast"
android:background="@drawable/resizable_textfield"
android:gravity="left" android:gravity="left"
android:paddingRight="5dp" android:paddingRight="5dp"
android:inputType="textPersonName|textCapWords" android:inputType="textPersonName|textCapWords"
android:layout_column="0"/> android:layout_column="0"/>
<TextView
android:text="@string/contact_first_name"
style="@style/font13"
android:textAllCaps="true"
android:paddingTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<EditText <EditText
android:textCursorDrawable="@null"
android:id="@+id/contactFirstName" android:id="@+id/contactFirstName"
android:textCursorDrawable="@null"
android:background="@drawable/resizable_textfield"
style="@style/font9"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/contact_first_name"
android:textColor="@color/text_contrast"
android:background="@drawable/resizable_textfield"
android:gravity="left" android:gravity="left"
android:paddingRight="5dp" android:paddingRight="5dp"
android:inputType="textPersonName|textCapWords" android:inputType="textPersonName|textCapWords"
@ -106,18 +122,92 @@
</LinearLayout> </LinearLayout>
<TableLayout <LinearLayout
android:id="@+id/controls" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:padding="10dp"
android:paddingTop="20dp"> android:orientation="vertical">
<TableRow <RelativeLayout
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="fill_parent"> android:layout_height="wrap_content">
</TableRow> <TextView
</TableLayout> android:text="@string/sip_address"
style="@style/font13"
android:textAllCaps="true"
android:paddingTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView
android:id="@+id/add_address_field"
android:src="@drawable/add_field_default"
android:contentDescription="@string/content_description_add"
android:layout_alignParentRight="true"
android:layout_width="30dp"
android:layout_height="30dp"
android:paddingLeft="5dp"/>
</RelativeLayout>
<TableLayout
android:id="@+id/controls_sip_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="20dp">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
</TableRow>
</TableLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<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"/>
<ImageView
android:id="@+id/add_number_field"
android:src="@drawable/add_field_default"
android:contentDescription="@string/content_description_add"
android:layout_alignParentRight="true"
android:layout_width="30dp"
android:layout_height="30dp"
android:paddingLeft="5dp"/>
</RelativeLayout>
<TableLayout
android:id="@+id/controls_numbers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="20dp">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
</TableRow>
</TableLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -8,7 +8,7 @@
<RelativeLayout <RelativeLayout
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="top"
android:background="@color/colorF"> android:background="@color/colorF">
<RelativeLayout <RelativeLayout
@ -67,36 +67,51 @@
</RelativeLayout> </RelativeLayout>
<ImageView <ImageView
android:contentDescription="@string/content_description_delete" android:id="@+id/delete"
android:id="@+id/deleteAll" android:contentDescription="@string/content_description_valid"
android:src="@drawable/delete" android:src="@drawable/delete"
android:gravity="center" android:background="@drawable/toolbar_button"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="center" android:layout_alignParentRight="true"
android:padding="10dp"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:visibility="gone"/> android:visibility="gone"/>
<ImageView <ImageView
android:contentDescription="@string/content_description_edit" android:id="@+id/select_all"
android:id="@+id/edit" android:contentDescription="@string/content_description_valid"
android:layout_alignParentRight="true" android:src="@drawable/select_all"
android:padding="10dp" android:background="@drawable/toolbar_button"
android:src="@drawable/edit_list"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:adjustViewBounds="true"/> android:layout_toLeftOf="@id/delete"
android:padding="10dp"
android:adjustViewBounds="true"
android:visibility="gone"/>
<ImageView <ImageView
android:id="@+id/deselect_all"
android:contentDescription="@string/content_description_valid" android:contentDescription="@string/content_description_valid"
android:id="@+id/ok" android:src="@drawable/deselect_all"
android:background="@drawable/valid" android:background="@drawable/toolbar_button"
android:gravity="center" android:layout_width="wrap_content"
android:paddingTop="20dp"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop" android:layout_toLeftOf="@id/delete"
android:padding="10dp"
android:adjustViewBounds="true"
android:visibility="gone"/>
<ImageView
android:id="@+id/edit"
android:contentDescription="@string/content_description_edit"
android:src="@drawable/edit_list"
android:background="@drawable/toolbar_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:padding="10dp"
android:adjustViewBounds="true"/> android:adjustViewBounds="true"/>
</RelativeLayout> </RelativeLayout>

View file

@ -12,7 +12,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" android:layout_height="30dp"
android:textSize="20sp" android:textSize="20sp"
android:background="@color/background" android:background="@color/colorH"
android:textColor="@color/colorA" android:textColor="@color/colorA"
android:textStyle="bold" android:textStyle="bold"
android:textAllCaps="true" android:textAllCaps="true"
@ -72,16 +72,15 @@
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:paddingRight="5dp"/> android:paddingRight="5dp"/>
<ImageView <CheckBox
android:id="@+id/delete" android:id="@+id/delete"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:adjustViewBounds="true" android:layout_alignParentRight="true"
android:contentDescription="@string/content_description_delete" android:contentDescription="@string/content_description_delete"
android:visibility="gone"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:paddingRight="5dp" android:paddingRight="5dp" />
android:src="@drawable/list_delete"
android:visibility="gone" />
</RelativeLayout> </RelativeLayout>

View file

@ -5,10 +5,17 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:layout_width="match_parent"
android:layout_height="40dp"
tools:layout="@layout/status" />
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_alignParentTop="true"> android:layout_below="@id/status">
<LinearLayout <LinearLayout
android:id="@+id/fragmentContainer" android:id="@+id/fragmentContainer"
@ -16,21 +23,68 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" /> android:orientation="horizontal" />
<TableLayout <RelativeLayout
android:id="@+id/calls" android:id="@+id/callsList"
android:paddingTop="40dp" android:paddingBottom="140dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:gravity="top" /> android:orientation="vertical">
<fragment <RelativeLayout
android:id="@+id/status" android:id="@+id/activeCallHeader"
android:name="org.linphone.StatusFragment" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_height="40dp" android:gravity="center_vertical"
tools:layout="@layout/status" /> android:layout_gravity="center_vertical">
</FrameLayout> <ImageView
android:id="@+id/contactPicture"
android:src="@drawable/avatar"
android:layout_width="220dp"
android:layout_height="220dp"
android:layout_centerHorizontal="true"
android:paddingBottom="10dp"/>
<TextView
android:id="@+id/contactNameOrNumber"
style="@style/font5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:layout_below="@id/contactPicture"
android:layout_centerHorizontal="true"/>
<Chronometer
android:id="@+id/callTimer"
style="@style/font2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/contactNameOrNumber"
android:layout_centerHorizontal="true"/>
<ImageView
android:id="@+id/pause"
android:contentDescription="@string/content_description_pause"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/pause_big_default"
android:layout_marginRight="20dp"
android:layout_above="@+id/contactNameOrNumber"
android:layout_toRightOf="@+id/contactPicture"
android:layout_toEndOf="@+id/contactPicture"/>
</RelativeLayout>
<TableLayout
android:id="@+id/calls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/activeCallHeader"
android:layout_gravity="bottom"/>
</RelativeLayout>
</FrameLayout>
<ImageView <ImageView
android:id="@+id/switchCamera" android:id="@+id/switchCamera"
@ -46,10 +100,10 @@
<org.linphone.ui.Numpad <org.linphone.ui.Numpad
android:contentDescription="@string/content_description_numpad" android:contentDescription="@string/content_description_numpad"
android:id="@+id/numpad" android:id="@+id/numpad"
android:background="@drawable/dialer_alt_background" android:background="@color/colorF"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="invisible" android:visibility="gone"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/> android:layout_centerVertical="true"/>
@ -57,13 +111,12 @@
android:id="@+id/menu" android:id="@+id/menu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:gravity="right"
android:orientation="vertical" > android:orientation="vertical" >
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="70dp"
android:orientation="horizontal" > android:orientation="horizontal" >
<TextView <TextView
@ -83,61 +136,67 @@
android:visibility="invisible" android:visibility="invisible"
android:text="@string/button_bluetooth" android:text="@string/button_bluetooth"
android:gravity="center" android:gravity="center"
android:paddingTop="40dp"
android:textColor="@drawable/text_incall_button_color" android:textColor="@drawable/text_incall_button_color"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.5" /> android:layout_weight="0.5" />
<TextView <ImageView
android:layout_width="match_parent" android:id="@+id/conference"
android:layout_height="wrap_content" android:src="@drawable/options_start_conference"
android:visibility="invisible" android:background="@drawable/button_background"
android:layout_weight="0.5"/> android:adjustViewBounds="true"
android:scaleType="center"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="70dp"
android:orientation="horizontal" > android:orientation="horizontal" >
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="invisible" android:visibility="invisible"
android:layout_weight="0.5"/> android:layout_weight="0.5"/>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="invisible" android:visibility="invisible"
android:layout_weight="0.5"/> android:layout_weight="0.5"/>
<TextView <TextView
android:id="@+id/routeReceiver" android:id="@+id/routeReceiver"
android:visibility="invisible" android:visibility="invisible"
android:text="@string/button_receiver" android:gravity="center"
android:gravity="center" android:layout_width="match_parent"
android:paddingTop="40dp" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_weight="0.5" />
android:layout_height="wrap_content"
android:layout_weight="0.5" />
<ImageView <ImageView
android:id="@+id/transfer" android:id="@+id/transfer"
android:visibility="invisible" android:src="@drawable/options_transfer_call"
android:gravity="center" android:background="@drawable/button_background"
android:paddingTop="40dp" android:adjustViewBounds="true"
android:layout_width="match_parent" android:scaleType="center"
android:layout_height="wrap_content" android:visibility="invisible"
android:layout_weight="0.5" /> android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
</LinearLayout> </LinearLayout>
<LinearLayout
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="70dp"
android:orientation="horizontal" > android:orientation="horizontal" >
<TextView <TextView
@ -152,45 +211,47 @@
android:visibility="invisible" android:visibility="invisible"
android:layout_weight="0.5"/> android:layout_weight="0.5"/>
<TextView <TextView
android:id="@+id/routeSpeaker" android:id="@+id/routeSpeaker"
android:visibility="invisible" android:visibility="invisible"
android:gravity="center" android:gravity="center"
android:paddingTop="40dp" android:paddingTop="40dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.5" /> android:layout_weight="0.5" />
<ImageView <ImageView
android:id="@+id/addCall" android:id="@+id/addCall"
android:visibility="invisible" android:src="@drawable/options_add_call"
android:gravity="center" android:background="@drawable/button_background"
android:paddingTop="40dp" android:adjustViewBounds="true"
android:layout_width="match_parent" android:scaleType="center"
android:layout_height="wrap_content" android:visibility="invisible"
android:layout_weight="0.5" /> android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="70dp"
android:background="@color/colorF" android:background="@color/colorF"
android:orientation="horizontal"> android:orientation="horizontal">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1">
android:layout_gravity="center">
<ImageView <ImageView
android:id="@+id/video" android:id="@+id/video"
android:src="@drawable/camera_default" android:src="@drawable/camera_default"
android:background="@drawable/button_background"
android:adjustViewBounds="true"
android:scaleType="center"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="@color/button_addContact" android:layout_height="match_parent"/>
android:layout_height="wrap_content"/>
<ProgressBar <ProgressBar
android:id="@+id/videoInProgress" android:id="@+id/videoInProgress"
@ -206,20 +267,21 @@
<ImageView <ImageView
android:id="@+id/micro" android:id="@+id/micro"
android:src="@drawable/micro_default" android:src="@drawable/micro_default"
android:layout_gravity="center" android:background="@drawable/button_background"
android:adjustViewBounds="true"
android:scaleType="center"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/button_addContact"
android:layout_weight="1" /> android:layout_weight="1" />
<ImageView <ImageView
android:id="@+id/speaker" android:id="@+id/speaker"
android:layout_gravity="center"
android:src="@drawable/speaker_default" android:src="@drawable/speaker_default"
android:background="@color/button_addContact" android:background="@drawable/button_background"
android:adjustViewBounds="true"
android:scaleType="center"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="1" /> android:layout_weight="1" />
<ImageView <ImageView
@ -232,16 +294,19 @@
<ImageView <ImageView
android:id="@+id/options" android:id="@+id/options"
android:src="@drawable/options_default" android:src="@drawable/options_default"
android:layout_gravity="center" android:background="@drawable/button_background"
android:background="@color/button_addContact" android:adjustViewBounds="true"
android:scaleType="center"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/main_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="70dp"
android:layout_alignParentBottom="true"
android:layout_gravity="center" android:layout_gravity="center"
android:orientation="horizontal" > android:orientation="horizontal" >
@ -258,6 +323,7 @@
<ImageView <ImageView
android:id="@+id/hangUp" android:id="@+id/hangUp"
android:scaleType="center"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -3,7 +3,7 @@
android:id="@+id/topLayout" android:id="@+id/topLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/background"> android:background="@color/colorH">
<include layout="@layout/status" android:id="@+id/statusBar" /> <include layout="@layout/status" android:id="@+id/statusBar" />
@ -15,12 +15,10 @@
android:background="@color/colorF"> android:background="@color/colorF">
<TextView <TextView
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/colorA"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/incoming" style="@style/font1"
android:textAllCaps="true" android:text="@string/incoming_call"
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:gravity="center"/> android:gravity="center"/>
@ -31,26 +29,24 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/toolbar" android:layout_below="@id/toolbar"
android:orientation="vertical" android:orientation="vertical"
android:gravity="center"
android:layout_above="@id/menu"> android:layout_above="@id/menu">
<LinearLayout <LinearLayout
android:id="@+id/incoming_caller_profile" android:id="@+id/incoming_caller_profile"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="10dp" android:paddingTop="10dp">
android:weightSum="1">
<ImageView <ImageView
android:id="@+id/incoming_picture" android:id="@+id/incoming_picture"
android:layout_width="259dp" android:layout_width="220dp"
android:layout_height="207dp" android:layout_height="220dp"
android:src="@drawable/avatar" android:src="@drawable/avatar"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"/>
android:layout_weight="1.30"/>
<TextView <TextView
android:id="@+id/incoming_caller_name" android:id="@+id/incoming_caller_name"
@ -58,17 +54,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:textAlignment="center" android:textAlignment="center"
android:layout_marginBottom="20dp" style="@style/font5"/>
android:textColor="@android:color/black"
android:textSize="28sp" />
<TextView <TextView
android:id="@+id/incoming_caller_number" android:id="@+id/incoming_caller_number"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_height="wrap_content"
android:textColor="@android:color/black" style="@style/font2"
android:textSize="28sp" android:layout_gravity="center"/>
android:layout_gravity="center_horizontal"/>
</LinearLayout> </LinearLayout>
@ -85,33 +78,35 @@
<LinearLayout <LinearLayout
android:id="@+id/menu" android:id="@+id/menu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="70dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:orientation="horizontal" > android:orientation="horizontal" >
<ImageView
android:id="@+id/accept"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorD"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_pause"
android:scaleType="center"
android:src="@drawable/call_audio_start" />
<ImageView <ImageView
android:id="@+id/decline" android:id="@+id/decline"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/footer_select" android:background="@drawable/hangup"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/content_description_pause" android:contentDescription="@string/content_description_pause"
android:scaleType="center" android:scaleType="center"
android:src="@drawable/call_hangup" /> android:src="@drawable/call_hangup" />
<ImageView
android:id="@+id/accept"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/call"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_pause"
android:scaleType="center"
android:src="@drawable/call_audio_start" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>

View file

@ -1,23 +1,27 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<!-- The main content view -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/status" android:id="@+id/statusBar" /> <include layout="@layout/status" android:id="@+id/statusBar" />
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/statusBar">
<!-- The main content view -->
<RelativeLayout
android:id="@+id/topLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:layout_below="@id/statusBar"
android:layout_above="@id/footer"> android:layout_above="@id/footer">
<FrameLayout <FrameLayout
@ -59,22 +63,22 @@
android:src="@drawable/footer_history" /> android:src="@drawable/footer_history" />
<RelativeLayout <RelativeLayout
android:visibility="gone"
android:id="@+id/history_select" android:id="@+id/history_select"
android:background="@color/colorA"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="5dp" android:layout_height="5dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:background="@color/footer_select" /> android:visibility="gone" />
<TextView <TextView
android:id="@+id/missedCalls" android:id="@+id/missedCalls"
style="@style/font18"
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:background="@drawable/missed_calls_bg" android:background="@drawable/history_chat_indicator"
android:gravity="center" android:gravity="center"
android:textSize="20sp"
android:visibility="gone" /> android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
@ -88,22 +92,21 @@
android:adjustViewBounds="true"> android:adjustViewBounds="true">
<ImageView <ImageView
android:src="@drawable/footer_contacts"
android:contentDescription="@string/content_description_contacts"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_margin="10dp" android:layout_margin="10dp"
android:scaleType="center" android:scaleType="center" />
android:contentDescription="@string/content_description_contacts"
android:src="@drawable/footer_contacts" />
<RelativeLayout <RelativeLayout
android:visibility="gone"
android:id="@+id/contacts_select" android:id="@+id/contacts_select"
android:background="@color/colorA"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="5dp" android:layout_height="5dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:contentDescription="@string/content_description_contacts" android:visibility="gone" />
android:background="@color/footer_select" />
</RelativeLayout> </RelativeLayout>
@ -116,59 +119,57 @@
android:adjustViewBounds="true"> android:adjustViewBounds="true">
<ImageView <ImageView
android:id="@+id/image" android:src="@drawable/footer_dialer"
android:contentDescription="@string/content_description_dialer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_margin="10dp" android:layout_margin="10dp"
android:scaleType="center" android:scaleType="center"/>
android:contentDescription="@string/content_description_contacts"
android:src="@drawable/footer_dialer" />
<RelativeLayout <RelativeLayout
android:id="@+id/dialer_select" android:id="@+id/dialer_select"
android:background="@color/colorA"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="5dp" android:layout_height="5dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"/>
android:contentDescription="@string/content_description_contacts"
android:background="@color/footer_select" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/chat" android:id="@+id/chat"
android:background="@drawable/footer_button"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/footer_button"
android:adjustViewBounds="true"> android:adjustViewBounds="true">
<ImageView <ImageView
android:src="@drawable/footer_chat"
android:contentDescription="@string/content_description_chat"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_margin="10dp" android:layout_margin="10dp"
android:scaleType="center" android:scaleType="center" />
android:contentDescription="@string/content_description_contacts"
android:src="@drawable/footer_chat" />
<RelativeLayout <RelativeLayout
android:visibility="gone"
android:id="@+id/chat_select" android:id="@+id/chat_select"
android:background="@color/colorA"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="5dp" android:layout_height="5dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:contentDescription="@string/content_description_contacts" android:visibility="gone"/>
android:background="@color/footer_select" />
<TextView <TextView
android:id="@+id/missedChats" android:id="@+id/missedChats"
style="@style/font18"
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:background="@drawable/history_chat_indicator" android:background="@drawable/history_chat_indicator"
android:gravity="center" android:gravity="center"
android:textSize="20sp"
android:visibility="gone" /> android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
@ -203,7 +204,6 @@
android:id="@+id/icon" android:id="@+id/icon"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_marginRight="12dp" android:layout_marginRight="12dp"
android:src="@drawable/avatar" android:src="@drawable/avatar"
@ -217,38 +217,34 @@
android:layout_toRightOf="@+id/icon"> android:layout_toRightOf="@+id/icon">
<TextView <TextView
android:id="@+id/title" android:id="@+id/display_name"
android:text="CLERC Margaux"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/font7" style="@style/font7"
android:minHeight="?android:attr/listPreferredItemHeightSmall" android:gravity="bottom"
android:textAppearance="?android:attr/textAppearanceListItemSmall" android:editable="false"/>
android:gravity="bottom"/>
<TextView <TextView
android:id="@+id/subtitle" android:id="@+id/address"
android:gravity="top" android:gravity="top"
android:text="margaux-mac@sip.linphone.org"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@id/icon" android:layout_toRightOf="@id/icon"
style="@style/font3" style="@style/font3"
android:minHeight="?android:attr/listPreferredItemHeightSmall" android:editable="false"/>
android:textAppearance="?android:attr/textAppearanceListItemSmall"/>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
<ListView android:id="@+id/list_drawer" <ListView android:id="@+id/list_drawer"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="fill_parent" android:layout_height="match_parent"
android:layout_gravity="start" android:layout_below="@id/headerLayout"
android:choiceMode="singleChoice" android:choiceMode="singleChoice"
android:divider="@android:color/transparent" android:divider="@android:color/transparent"
android:dividerHeight="0dp" android:dividerHeight="0dp"
android:background="@color/background"/> android:background="@color/colorH"/>
@ -285,5 +281,6 @@
</RelativeLayout> </RelativeLayout>
</android.support.v4.widget.DrawerLayout> </android.support.v4.widget.DrawerLayout>
</RelativeLayout>

View file

@ -2,7 +2,7 @@
<RelativeLayout <RelativeLayout
android:id="@+id/chat" android:id="@+id/chat"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/footer_button" android:background="@color/colorD"
android:layout_weight="1" android:layout_weight="1"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent"> android:layout_height="match_parent">

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout
android:id="@+id/contacts" android:id="@+id/contacts"
android:background="@color/footer_button" android:background="@color/colorD"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_weight="1" android:layout_weight="1"
android:layout_width="0dp" android:layout_width="0dp"
@ -24,5 +24,5 @@
android:layout_height="8dp" android:layout_height="8dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:contentDescription="@string/content_description_contacts" android:contentDescription="@string/content_description_contacts"
android:background="@color/footer_select" /> android:background="@color/colorD" />
</RelativeLayout> </RelativeLayout>

View file

@ -2,7 +2,7 @@
<RelativeLayout <RelativeLayout
android:id="@+id/history" android:id="@+id/history"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/footer_button" android:background="@color/colorD"
android:layout_weight="1" android:layout_weight="1"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -24,6 +24,6 @@
android:layout_height="8dp" android:layout_height="8dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:contentDescription="@string/content_description_contacts" android:contentDescription="@string/content_description_contacts"
android:background="@color/footer_select" /> android:background="@color/colorD" />
</RelativeLayout> </RelativeLayout>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout" android:id="@+id/topLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/colorH"> android:background="@color/colorH">
<include layout="@layout/status" android:id="@+id/statusBar" /> <include layout="@layout/status" android:id="@+id/statusBar" />
@ -29,6 +29,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/toolbar" android:layout_below="@id/toolbar"
android:orientation="vertical" android:orientation="vertical"
android:gravity="center"
android:layout_above="@id/menu"> android:layout_above="@id/menu">
<LinearLayout <LinearLayout
@ -41,8 +42,8 @@
<ImageView <ImageView
android:id="@+id/incoming_picture" android:id="@+id/incoming_picture"
android:layout_width="300dp" android:layout_width="220dp"
android:layout_height="300dp" android:layout_height="220dp"
android:src="@drawable/avatar" android:src="@drawable/avatar"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:layout_marginTop="10dp"/> android:layout_marginTop="10dp"/>
@ -84,38 +85,36 @@
<ImageView <ImageView
android:id="@+id/micro" android:id="@+id/micro"
android:src="@drawable/micro_default"
android:background="@drawable/button_background"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/colorF"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/content_description_pause" android:contentDescription="@string/content_description_pause"
android:scaleType="center" android:scaleType="center"/>
android:src="@drawable/micro_default" />
<ImageView <ImageView
android:id="@+id/speaker" android:id="@+id/speaker"
android:src="@drawable/speaker_default"
android:background="@drawable/button_background"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/colorF"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/content_description_pause" android:contentDescription="@string/content_description_pause"
android:scaleType="center" android:scaleType="center"/>
android:src="@drawable/speaker_default" />
<ImageView <ImageView
android:id="@+id/hangUp" android:id="@+id/hang_up"
android:src="@drawable/call_hangup"
android:background="@drawable/hangup"
android:contentDescription="@string/content_description_hang_up"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.7" android:layout_weight="0.7"
android:background="@drawable/call"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/content_description_pause" android:scaleType="center"/>
android:scaleType="center"
android:src="@drawable/call_hangup" />
</LinearLayout> </LinearLayout>

View file

@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/background" android:background="@color/colorH"
android:orientation="vertical" > android:orientation="vertical" >
<ImageView <ImageView

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout
android:id="@+id/status" android:id="@+id/status"
android:background="@color/footer_select" android:background="@color/colorA"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"

View file

@ -1,6 +1,9 @@
[net] [net]
mtu=1300 mtu=1300
[app]
animations=0
[sip] [sip]
guess_hostname=1 guess_hostname=1
inc_timeout=15 inc_timeout=15

View file

@ -3,6 +3,17 @@
<!-- NEW STRINGS --> <!-- NEW STRINGS -->
<!-- Common -->
<string name="username">Username</string>
<string name="display_name">Display name</string>
<string name="password">Password</string>
<string name="domain">Domain</string>
<string name="remote_provisioning_url">Provisioning url</string>
<string name="email">Email</string>
<string name="delete_text">Are you sure you want to delete all your selection ?</string>
<string name="delete">Delete</string>
<string name="cancel">Cancel</string>
<!-- splashscreen --> <!-- splashscreen -->
<string name="app_description">free SIP VOIP client</string> <string name="app_description">free SIP VOIP client</string>
@ -39,16 +50,6 @@
<string name="outgoing_call">outgoing call</string> <string name="outgoing_call">outgoing call</string>
<!-- Common -->
<string name="username">Username</string>
<string name="display_name">Display name</string>
<string name="password">Password</string>
<string name="domain">Domain</string>
<string name="remote_provisioning_url">Provisioning url</string>
<string name="email">Email</string>
<!-- Content description --> <!-- Content description -->
<string name="content_description_edit">Edit button</string> <string name="content_description_edit">Edit button</string>
<string name="content_description_valid">Valid button</string> <string name="content_description_valid">Valid button</string>
@ -316,7 +317,7 @@
<string name="pref_help_username">Example: john if your account is john@sip.example.org</string> <string name="pref_help_username">Example: john if your account is john@sip.example.org</string>
<string name="pref_help_domain">sip.example.org if your account is john@sip.example.org</string> <string name="pref_help_domain">sip.example.org if your account is john@sip.example.org</string>
<string name="pref_help_password">You have to re-enter your password if you edit your username and/or the domain</string> <string name="pref_help_password">You have to re-enter your password if you edit your username and/or the domain</string>
<string name="delete">Delete</string>
<string name="chat">Chat</string> <string name="chat">Chat</string>
<string name="call">Call</string> <string name="call">Call</string>
<string name="add_to_contacts">Add to contacts</string> <string name="add_to_contacts">Add to contacts</string>

View file

@ -48,7 +48,7 @@
<style name="font8" parent="@android:style/TextAppearance.Medium"> <style name="font8" parent="@android:style/TextAppearance.Medium">
<item name="android:textColor">@color/colorC</item> <item name="android:textColor">@color/colorC</item>
<item name="android:textAllCaps">true</item> <item name="android:textAllCaps">true</item>
<item name="android:textSize">25sp</item> <item name="android:textSize">20sp</item>
</style> </style>
<style name="font9" parent="@android:style/TextAppearance.Small"> <style name="font9" parent="@android:style/TextAppearance.Small">
@ -73,18 +73,18 @@
<style name="font13" parent="@android:style/TextAppearance.Small"> <style name="font13" parent="@android:style/TextAppearance.Small">
<item name="android:textColor">@color/colorD</item> <item name="android:textColor">@color/colorD</item>
<item name="android:textSize">20sp</item> <item name="android:textSize">18sp</item>
</style> </style>
<style name="font14" parent="@android:style/TextAppearance.Small"> <style name="font14" parent="@android:style/TextAppearance.Small">
<item name="android:textColor">@color/colorH</item> <item name="android:textColor">@color/colorH</item>
<item name="android:textSize">32sp</item> <item name="android:textSize">30sp</item>
</style> </style>
<style name="font15" parent="@android:style/TextAppearance.Small"> <style name="font15" parent="@android:style/TextAppearance.Small">
<item name="android:textColor">@color/colorH</item> <item name="android:textColor">@color/colorH</item>
<item name="android:textAllCaps">true</item> <item name="android:textAllCaps">true</item>
<item name="android:textSize">25sp</item> <item name="android:textSize">20sp</item>
</style> </style>
<style name="font16" parent="@android:style/TextAppearance.Small"> <style name="font16" parent="@android:style/TextAppearance.Small">
@ -109,4 +109,5 @@
<item name="android:textAllCaps">true</item> <item name="android:textAllCaps">true</item>
<item name="android:textSize">22sp</item> <item name="android:textSize">22sp</item>
</style> </style>
</resources> </resources>

View file

@ -98,10 +98,9 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
private String pictureUri; private String pictureUri;
private EditText message; private EditText message;
private ImageView cancelUpload, edit, selectAll, deselectAll, startCall, delete, sendImage, sendMessage; private ImageView cancelUpload, edit, selectAll, deselectAll, startCall, delete, sendImage, sendMessage;
private LinearLayout topBar;
private TextView contactName, remoteComposing; private TextView contactName, remoteComposing;
private ImageView back; private ImageView back;
private RelativeLayout uploadLayout, textLayout; private RelativeLayout uploadLayout, textLayout, topBar;
private ListView messagesList; private ListView messagesList;
private ProgressBar progressBar; private ProgressBar progressBar;
@ -139,7 +138,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
messagesList = (ListView) view.findViewById(R.id.chatMessageList); messagesList = (ListView) view.findViewById(R.id.chatMessageList);
textLayout = (RelativeLayout) view.findViewById(R.id.messageLayout); textLayout = (RelativeLayout) view.findViewById(R.id.messageLayout);
progressBar = (ProgressBar) view.findViewById(R.id.progressbar); progressBar = (ProgressBar) view.findViewById(R.id.progressbar);
topBar = (LinearLayout) view.findViewById(R.id.topbar); topBar = (RelativeLayout) view.findViewById(R.id.topBar);
sendMessage = (ImageView) view.findViewById(R.id.sendMessage); sendMessage = (ImageView) view.findViewById(R.id.sendMessage);
sendMessage.setOnClickListener(this); sendMessage.setOnClickListener(this);
@ -572,6 +571,9 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
else if (id == R.id.new_discussion) { else if (id == R.id.new_discussion) {
//TODO call sipUri //TODO call sipUri
} }
else if(id == R.id.start_call){
LinphoneActivity.instance().setAddresGoToDialerAndCall(sipUri, LinphoneUtils.getUsernameFromAddress(sipUri), null);
}
} }
private void sendTextMessage() { private void sendTextMessage() {

View file

@ -52,10 +52,8 @@ import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
/** /**

View file

@ -362,7 +362,7 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
} else if (contact.getPhotoUri() != null) { } else if (contact.getPhotoUri() != null) {
icon.setImageURI(contact.getPhotoUri()); icon.setImageURI(contact.getPhotoUri());
} else { } else {
icon.setImageBitmap(bitmapUnknown); icon.setImageResource(R.drawable.avatar);
} }
ImageView friendStatus = (ImageView) view.findViewById(R.id.friendStatus); ImageView friendStatus = (ImageView) view.findViewById(R.id.friendStatus);

View file

@ -89,14 +89,23 @@ public class ContactsManager {
} }
public void initializeSyncAccount(Context context, ContentResolver contentResolver) { public void initializeSyncAccount(Context context, ContentResolver contentResolver) {
initializeContactManager(context,contentResolver);
Account newAccount = new Account(context.getString(R.string.sync_account_name), context.getString(R.string.sync_account_type));
AccountManager accountManager = (AccountManager) context.getSystemService(context.ACCOUNT_SERVICE); AccountManager accountManager = (AccountManager) context.getSystemService(context.ACCOUNT_SERVICE);
if(accountManager.addAccountExplicitly(newAccount, null, null)){ Account[] accounts = accountManager.getAccountsByType(context.getPackageName());
mAccount = newAccount;
if(accounts != null && accounts.length == 0) {
Account newAccount = new Account(context.getString(R.string.sync_account_name), context.getString(R.string.sync_account_type));
try {
accountManager.addAccountExplicitly(newAccount, null, null);
mAccount = newAccount;
} catch (Exception e) {
Log.w("Catch " + e);
mAccount = null;
}
} else { } else {
mAccount = null; Log.w("Get Account");
mAccount = accounts[0];
} }
initializeContactManager(context,contentResolver);
} }
public String getDisplayName(String firstName, String lastName) { public String getDisplayName(String firstName, String lastName) {
@ -524,6 +533,8 @@ public class ContactsManager {
sipContactCursor.close(); sipContactCursor.close();
} }
if(mAccount == null) return;
contactCursor = Compatibility.getContactsCursor(contentResolver, getContactsId()); contactCursor = Compatibility.getContactsCursor(contentResolver, getContactsId());
sipContactCursor = Compatibility.getSIPContactsCursor(contentResolver, getContactsId()); sipContactCursor = Compatibility.getSIPContactsCursor(contentResolver, getContactsId());

View file

@ -6,6 +6,7 @@ import java.util.List;
import org.linphone.compatibility.Compatibility; import org.linphone.compatibility.Compatibility;
import org.linphone.core.LinphoneProxyConfig; import org.linphone.core.LinphoneProxyConfig;
import org.linphone.mediastream.Version; import org.linphone.mediastream.Version;
import org.linphone.mediastream.Log;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.ContentProviderOperation; import android.content.ContentProviderOperation;
import android.content.Context; import android.content.Context;
@ -25,11 +26,11 @@ 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.TableLayout;
import android.widget.TextView;
public class EditContactFragment extends Fragment { public class EditContactFragment extends Fragment {
private View view; private View view;
private ImageView back, edit, ok; private ImageView back, edit, ok;
private ImageView addNumber, addSipAddress;
private EditText firstName, lastName; private EditText firstName, lastName;
private LayoutInflater inflater; private LayoutInflater inflater;
@ -39,6 +40,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 String newSipOrNumberToAdd; private String newSipOrNumberToAdd;
private ContactsManager contactsManager; private ContactsManager contactsManager;
@ -181,13 +183,29 @@ public class EditContactFragment extends Fragment {
ImageView contactPicture = (ImageView) view.findViewById(R.id.contactPicture); ImageView contactPicture = (ImageView) view.findViewById(R.id.contactPicture);
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));
} else { } else {
//contactPicture.setImageResource(R.drawable.unknown_small); //contactPicture.setImageResource(R.drawable.unknown_small);
} }
initNumbersFields((TableLayout) view.findViewById(R.id.controls), contact); numbers = initNumbersFields(contact);
sipAddresses = initSipAddressFields(contact);
addNumber = (ImageView) view.findViewById(R.id.add_number_field);
addNumber.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
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();
@ -206,32 +224,68 @@ public class EditContactFragment extends Fragment {
} }
} }
private void initNumbersFields(final TableLayout controls, final Contact contact) { private TableLayout initNumbersFields(final Contact contact) {
TableLayout controls = (TableLayout) view.findViewById(R.id.controls_numbers);
controls.removeAllViews(); controls.removeAllViews();
numbersAndAddresses = new ArrayList<NewOrUpdatedNumberOrAddress>(); numbersAndAddresses = new ArrayList<NewOrUpdatedNumberOrAddress>();
if (contact != null) { if (contact != null) {
for (String numberOrAddress : contact.getNumbersOrAddresses()) { for (String numberOrAddress : contact.getNumbersOrAddresses()) {
View view = displayNumberOrAddress(controls, numberOrAddress); boolean isSip = LinphoneUtils.isStrictSipAddress(numberOrAddress) || !LinphoneUtils.isNumberAddress(numberOrAddress);
if(!isSip) {
View view = displayNumberOrAddress(controls, numberOrAddress);
if (view != null)
controls.addView(view);
}
}
}
if (newSipOrNumberToAdd != null) {
boolean isSip = LinphoneUtils.isStrictSipAddress(newSipOrNumberToAdd) || !LinphoneUtils.isNumberAddress(newSipOrNumberToAdd);
if(!isSip) {
View view = displayNumberOrAddress(controls, newSipOrNumberToAdd);
if (view != null) if (view != null)
controls.addView(view); controls.addView(view);
} }
} }
if (controls.getChildCount() == 0) {
addEmptyRowToAllowNewNumberOrAddress(controls,false);
}
return controls;
}
private TableLayout initSipAddressFields(final Contact contact) {
TableLayout controls = (TableLayout) view.findViewById(R.id.controls_sip_address);
controls.removeAllViews();
numbersAndAddresses = new ArrayList<NewOrUpdatedNumberOrAddress>();
if (contact != null) {
for (String numberOrAddress : contact.getNumbersOrAddresses()) {
boolean isSip = LinphoneUtils.isStrictSipAddress(numberOrAddress) || !LinphoneUtils.isNumberAddress(numberOrAddress);
if(isSip) {
View view = displayNumberOrAddress(controls, numberOrAddress);
if (view != null)
controls.addView(view);
}
}
}
if (newSipOrNumberToAdd != null) { if (newSipOrNumberToAdd != null) {
View view = displayNumberOrAddress(controls, newSipOrNumberToAdd); boolean isSip = LinphoneUtils.isStrictSipAddress(newSipOrNumberToAdd) || !LinphoneUtils.isNumberAddress(newSipOrNumberToAdd);
if (view != null) if(isSip) {
controls.addView(view); View view = displayNumberOrAddress(controls, newSipOrNumberToAdd);
if (view != null)
controls.addView(view);
}
} }
// Add one for phone numbers, one for SIP address if (controls.getChildCount() == 0) {
if (!getResources().getBoolean(R.bool.hide_phone_numbers_in_editor)) { addEmptyRowToAllowNewNumberOrAddress(controls,true);
addEmptyRowToAllowNewNumberOrAddress(controls, false);
} }
if (!getResources().getBoolean(R.bool.hide_sip_addresses_in_editor)) { return controls;
firstSipAddressIndex = controls.getChildCount() - 2; // Update the value to always display phone numbers before SIP accounts
addEmptyRowToAllowNewNumberOrAddress(controls, true);
}
} }
private View displayNumberOrAddress(final TableLayout controls, String numberOrAddress) { private View displayNumberOrAddress(final TableLayout controls, String numberOrAddress) {
@ -306,7 +360,7 @@ public class EditContactFragment extends Fragment {
@SuppressLint("InflateParams") @SuppressLint("InflateParams")
private void addEmptyRowToAllowNewNumberOrAddress(final TableLayout controls, final boolean isSip) { private void addEmptyRowToAllowNewNumberOrAddress(final TableLayout controls, final boolean isSip) {
final View view = inflater.inflate(R.layout.contact_add_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);
@ -330,39 +384,32 @@ public class EditContactFragment extends Fragment {
} }
}); });
final ImageView add = (ImageView) view.findViewById(R.id.add); final ImageView delete = (ImageView) view.findViewById(R.id.delete);
add.setOnClickListener(new OnClickListener() { delete.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
// Add a line, and change add button for a delete button nounoa.delete();
add.setImageResource(R.drawable.list_delete); numbersAndAddresses.remove(nounoa);
ImageView delete = add; view.setVisibility(View.GONE);
delete.setOnClickListener(new OnClickListener() { }
@Override
public void onClick(View v) { });
nounoa.delete(); /*if (!isSip) {
numbersAndAddresses.remove(nounoa);
view.setVisibility(View.GONE);
}
});
if (!isSip) {
firstSipAddressIndex++; firstSipAddressIndex++;
addEmptyRowToAllowNewNumberOrAddress(controls, false); addEmptyRowToAllowNewNumberOrAddress(controls, false);
} else { } else {
addEmptyRowToAllowNewNumberOrAddress(controls, true); addEmptyRowToAllowNewNumberOrAddress(controls, true);
} }
} }*/
});
if (isSip) { controls.addView(view, controls.getChildCount());
controls.addView(view, controls.getChildCount());
} else { //if (firstSipAddressIndex != -1) {
if (firstSipAddressIndex != -1) { // controls.addView(view, firstSipAddressIndex);
controls.addView(view, firstSipAddressIndex); //} else {
} else { // controls.addView(view);
controls.addView(view); //}
} //}
}
} }
private String findContactFirstName(String contactID) { private String findContactFirstName(String contactID) {

View file

@ -27,15 +27,19 @@ import org.linphone.core.CallDirection;
import org.linphone.core.LinphoneAddress; import org.linphone.core.LinphoneAddress;
import org.linphone.core.LinphoneCallLog; import org.linphone.core.LinphoneCallLog;
import org.linphone.core.LinphoneCallLog.CallStatus; import org.linphone.core.LinphoneCallLog.CallStatus;
import org.linphone.mediastream.Log;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.os.Bundle; import android.os.Bundle;
import android.app.Fragment; import android.app.Fragment;
import android.view.ContextMenu; import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo; import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@ -44,10 +48,14 @@ import android.view.ViewGroup;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener; import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import android.widget.AbsListView;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
@ -60,9 +68,9 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
private ListView historyList; private ListView historyList;
private LayoutInflater mInflater; private LayoutInflater mInflater;
private TextView noCallHistory, noMissedCallHistory; private TextView noCallHistory, noMissedCallHistory;
private ImageView missedCalls, allCalls, edit, ok, deleteAll; private ImageView missedCalls, allCalls, edit, selectAll, deselectAll, deleteAll;
private RelativeLayout allCallsSelected, missedCallsSelected; private RelativeLayout allCallsSelected, missedCallsSelected;
private boolean onlyDisplayMissedCalls, isEditMode; private boolean onlyDisplayMissedCalls, isEditMode, isSelectAll, isDeselectAll;
private List<LinphoneCallLog> mLogs; private List<LinphoneCallLog> mLogs;
@Override @Override
@ -78,7 +86,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
historyList.setOnItemClickListener(this); historyList.setOnItemClickListener(this);
registerForContextMenu(historyList); registerForContextMenu(historyList);
deleteAll = (ImageView) view.findViewById(R.id.deleteAll); deleteAll = (ImageView) view.findViewById(R.id.delete);
deleteAll.setOnClickListener(this); deleteAll.setOnClickListener(this);
deleteAll.setVisibility(View.INVISIBLE); deleteAll.setVisibility(View.INVISIBLE);
@ -94,18 +102,29 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
missedCallsSelected = (RelativeLayout) view.findViewById(R.id.missed_calls_select); missedCallsSelected = (RelativeLayout) view.findViewById(R.id.missed_calls_select);
missedCallsSelected.setOnClickListener(this); missedCallsSelected.setOnClickListener(this);
selectAll = (ImageView) view.findViewById(R.id.select_all);
selectAll.setOnClickListener(this);
deselectAll = (ImageView) view.findViewById(R.id.deselect_all);
deselectAll.setOnClickListener(this);
allCalls.setEnabled(false); allCalls.setEnabled(false);
onlyDisplayMissedCalls = false; onlyDisplayMissedCalls = false;
edit = (ImageView) view.findViewById(R.id.edit); edit = (ImageView) view.findViewById(R.id.edit);
edit.setOnClickListener(this); edit.setOnClickListener(this);
ok = (ImageView) view.findViewById(R.id.ok); isSelectAll = false;
ok.setOnClickListener(this); isDeselectAll = false;
return view; return view;
} }
public void refresh() {
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
}
private void removeNotMissedCallsFromLogs() { private void removeNotMissedCallsFromLogs() {
if (onlyDisplayMissedCalls) { if (onlyDisplayMissedCalls) {
List<LinphoneCallLog> missedCalls = new ArrayList<LinphoneCallLog>(); List<LinphoneCallLog> missedCalls = new ArrayList<LinphoneCallLog>();
@ -125,12 +144,14 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
noMissedCallHistory.setVisibility(View.VISIBLE); noMissedCallHistory.setVisibility(View.VISIBLE);
} else { } else {
noCallHistory.setVisibility(View.VISIBLE); noCallHistory.setVisibility(View.VISIBLE);
edit.setEnabled(false);
} }
historyList.setVisibility(View.GONE); historyList.setVisibility(View.GONE);
return true; return true;
} else { } else {
noCallHistory.setVisibility(View.GONE); noCallHistory.setVisibility(View.GONE);
noMissedCallHistory.setVisibility(View.GONE); noMissedCallHistory.setVisibility(View.GONE);
edit.setEnabled(true);
historyList.setVisibility(View.VISIBLE); historyList.setVisibility(View.VISIBLE);
return false; return false;
} }
@ -150,6 +171,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs()); mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
if (!hideHistoryListAndDisplayMessageIfEmpty()) { if (!hideHistoryListAndDisplayMessageIfEmpty()) {
historyList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
historyList.setAdapter(new CallHistoryAdapter(getActivity())); historyList.setAdapter(new CallHistoryAdapter(getActivity()));
} }
} }
@ -166,9 +188,6 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
LinphoneCallLog log = mLogs.get(info.position); LinphoneCallLog log = mLogs.get(info.position);
LinphoneManager.getLc().removeCallLog(log); LinphoneManager.getLc().removeCallLog(log);
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs()); mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
historyList.setAdapter(new CallHistoryAdapter(getActivity()));
}
return true; return true;
} }
@ -176,6 +195,51 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
public void onClick(View v) { public void onClick(View v) {
int id = v.getId(); int id = v.getId();
if (id == R.id.delete) {
final Dialog dialog = LinphoneActivity.instance().displayDialog(getString(R.string.delete_text));
Button delete = (Button) dialog.findViewById(R.id.delete);
Button cancel = (Button) dialog.findViewById(R.id.cancel);
delete.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
int size = historyList.getAdapter().getCount();
for(int i=0; i<size; i++) {
if(historyList.isItemChecked(i)){
LinphoneCallLog log = mLogs.get(i);
LinphoneManager.getLc().removeCallLog(log);
}
}
isEditMode = false;
refresh();
historyList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
historyList.setAdapter(new CallHistoryAdapter(getActivity()));
dialog.dismiss();
}
});
cancel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
dialog.show();
edit.setVisibility(View.VISIBLE);
selectAll.setVisibility(View.GONE);
deselectAll.setVisibility(View.GONE);
deleteAll.setVisibility(View.GONE);
}
else if (id == R.id.edit) {
edit.setVisibility(View.GONE);
selectAll.setVisibility(View.VISIBLE);
deleteAll.setVisibility(View.VISIBLE);
isEditMode = true;
historyList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
historyList.setAdapter(new CallHistoryAdapter(getActivity()));
}
if (id == R.id.all_calls) { if (id == R.id.all_calls) {
allCalls.setEnabled(false); allCalls.setEnabled(false);
allCallsSelected.setVisibility(View.VISIBLE); allCallsSelected.setVisibility(View.VISIBLE);
@ -191,26 +255,23 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
missedCallsSelected.setVisibility(View.VISIBLE); missedCallsSelected.setVisibility(View.VISIBLE);
missedCalls.setEnabled(false); missedCalls.setEnabled(false);
onlyDisplayMissedCalls = true; onlyDisplayMissedCalls = true;
} }else if (id == R.id.select_all) {
else if (id == R.id.ok) { deselectAll.setVisibility(View.VISIBLE);
edit.setVisibility(View.VISIBLE); selectAll.setVisibility(View.GONE);
ok.setVisibility(View.GONE); int size = historyList.getAdapter().getCount();
hideDeleteAllButton(); for(int i=0; i<size; i++) {
isEditMode = false; historyList.setItemChecked(i, true);
} }
else if (id == R.id.edit) {
edit.setVisibility(View.GONE);
ok.setVisibility(View.VISIBLE);
showDeleteAllButton();
isEditMode = true;
}
else if (id == R.id.deleteAll) {
LinphoneManager.getLc().clearCallLogs();
mLogs = new ArrayList<LinphoneCallLog>();
}
if (!hideHistoryListAndDisplayMessageIfEmpty()) { isSelectAll = true;
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext())); isDeselectAll = false;
} else if (id == R.id.deselect_all) {
deselectAll.setVisibility(View.GONE);
selectAll.setVisibility(View.VISIBLE);
int size = historyList.getAdapter().getCount();
for(int i=0; i<size; i++) {
historyList.setItemChecked(i, false);
}
} }
} }
@ -220,9 +281,6 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
LinphoneCallLog log = mLogs.get(position); LinphoneCallLog log = mLogs.get(position);
LinphoneManager.getLc().removeCallLog(log); LinphoneManager.getLc().removeCallLog(log);
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs()); mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
}
} else { } else {
if (LinphoneActivity.isInstanciated()) { if (LinphoneActivity.isInstanciated()) {
LinphoneCallLog log = mLogs.get(position); LinphoneCallLog log = mLogs.get(position);
@ -354,7 +412,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
return isSameDay(cal, yesterday); return isSameDay(cal, yesterday);
} }
public View getView(int position, View convertView, ViewGroup parent) { public View getView(final int position, View convertView, ViewGroup parent) {
View view = null; View view = null;
if (convertView != null) { if (convertView != null) {
view = convertView; view = convertView;
@ -370,7 +428,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
contact.setSelected(true); // For automated horizontal scrolling of long texts contact.setSelected(true); // For automated horizontal scrolling of long texts
ImageView detail = (ImageView) view.findViewById(R.id.detail); ImageView detail = (ImageView) view.findViewById(R.id.detail);
ImageView delete = (ImageView) view.findViewById(R.id.delete); CheckBox delete = (CheckBox) view.findViewById(R.id.delete);
ImageView callDirection = (ImageView) view.findViewById(R.id.icon); ImageView callDirection = (ImageView) view.findViewById(R.id.icon);
TextView separator = (TextView) view.findViewById(R.id.separator); TextView separator = (TextView) view.findViewById(R.id.separator);
@ -429,7 +487,18 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
if (isEditMode) { if (isEditMode) {
delete.setVisibility(View.VISIBLE); delete.setVisibility(View.VISIBLE);
delete.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
historyList.setItemChecked(position, b);
}
});
detail.setVisibility(View.GONE); detail.setVisibility(View.GONE);
if(historyList.isItemChecked(position)) {
delete.setChecked(true);
} else {
delete.setChecked(false);
}
} else { } else {
delete.setVisibility(View.GONE); delete.setVisibility(View.GONE);
detail.setVisibility(View.VISIBLE); detail.setVisibility(View.VISIBLE);

View file

@ -61,6 +61,7 @@ import android.widget.Chronometer;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TableLayout; import android.widget.TableLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -77,6 +78,7 @@ public class InCallActivity extends Activity implements OnClickListener {
private Handler mControlsHandler = new Handler(); private Handler mControlsHandler = new Handler();
private Runnable mControls; private Runnable mControls;
private ImageView switchCamera; private ImageView switchCamera;
private RelativeLayout mActiveCallHeader;
private ImageView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference; private ImageView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference;
private TextView audioRoute, routeSpeaker, routeReceiver, routeBluetooth; private TextView audioRoute, routeSpeaker, routeReceiver, routeBluetooth;
private LinearLayout routeLayout; private LinearLayout routeLayout;
@ -85,7 +87,7 @@ public class InCallActivity extends Activity implements OnClickListener {
private AudioCallFragment audioCallFragment; private AudioCallFragment audioCallFragment;
private VideoCallFragment videoCallFragment; private VideoCallFragment videoCallFragment;
private boolean isSpeakerEnabled = false, isMicMuted = false, isTransferAllowed, isAnimationDisabled; private boolean isSpeakerEnabled = false, isMicMuted = false, isTransferAllowed, isAnimationDisabled;
private ViewGroup mControlsLayout; private LinearLayout mControlsLayout;
private Numpad numpad; private Numpad numpad;
private int cameraNumber; private int cameraNumber;
private Animation slideOutLeftToRight, slideInRightToLeft, slideInBottomToTop, slideInTopToBottom, slideOutBottomToTop, slideOutTopToBottom; private Animation slideOutLeftToRight, slideInRightToLeft, slideInBottomToTop, slideInTopToBottom, slideOutBottomToTop, slideOutTopToBottom;
@ -97,7 +99,6 @@ public class InCallActivity extends Activity implements OnClickListener {
private LayoutInflater inflater; private LayoutInflater inflater;
private ViewGroup container; private ViewGroup container;
private boolean isConferenceRunning = false; private boolean isConferenceRunning = false;
private boolean showCallListInVideo = false;
private LinphoneCoreListenerBase mListener; private LinphoneCoreListenerBase mListener;
public static InCallActivity instance() { public static InCallActivity instance() {
@ -117,15 +118,9 @@ public class InCallActivity extends Activity implements OnClickListener {
setContentView(R.layout.incall); setContentView(R.layout.incall);
isTransferAllowed = getApplicationContext().getResources().getBoolean(R.bool.allow_transfers); isTransferAllowed = getApplicationContext().getResources().getBoolean(R.bool.allow_transfers);
showCallListInVideo = getApplicationContext().getResources().getBoolean(R.bool.show_current_calls_above_video);
isSpeakerEnabled = LinphoneManager.getLcIfManagerNotDestroyedOrNull().isSpeakerEnabled();
if (Version.sdkAboveOrEqual(Version.API11_HONEYCOMB_30)) { if(!BluetoothManager.getInstance().isBluetoothHeadsetAvailable()) {
if(!BluetoothManager.getInstance().isBluetoothHeadsetAvailable()) { BluetoothManager.getInstance().initBluetooth();
BluetoothManager.getInstance().initBluetooth();
} else {
isSpeakerEnabled = false;
}
} }
isAnimationDisabled = getApplicationContext().getResources().getBoolean(R.bool.disable_animations) || !LinphonePreferences.instance().areAnimationsEnabled(); isAnimationDisabled = getApplicationContext().getResources().getBoolean(R.bool.disable_animations) || !LinphonePreferences.instance().areAnimationsEnabled();
@ -145,7 +140,7 @@ public class InCallActivity extends Activity implements OnClickListener {
} }
if (state == State.Paused || state == State.PausedByRemote || state == State.Pausing) { if (state == State.Paused || state == State.PausedByRemote || state == State.Pausing) {
video.setEnabled(false); enabledVideoButton(false);
if(isVideoEnabled(call)){ if(isVideoEnabled(call)){
showAudioView(); showAudioView();
} }
@ -153,7 +148,7 @@ public class InCallActivity extends Activity implements OnClickListener {
if (state == State.Resuming) { if (state == State.Resuming) {
if(LinphonePreferences.instance().isVideoEnabled()){ if(LinphonePreferences.instance().isVideoEnabled()){
status.refreshStatusItems(call, isVideoEnabled(call)); //status.refreshStatusItems(call, isVideoEnabled(call));
if(call.getCurrentParamsCopy().getVideoEnabled()){ if(call.getCurrentParamsCopy().getVideoEnabled()){
showVideoView(); showVideoView();
} }
@ -162,26 +157,24 @@ public class InCallActivity extends Activity implements OnClickListener {
if (state == State.StreamsRunning) { if (state == State.StreamsRunning) {
switchVideo(isVideoEnabled(call)); switchVideo(isVideoEnabled(call));
//Check media in progress //Check media in progress
if(LinphonePreferences.instance().isVideoEnabled() && !call.mediaInProgress()){ if(LinphonePreferences.instance().isVideoEnabled() && !call.mediaInProgress()){
video.setEnabled(true); enabledVideoButton(true);
} }
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled); LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
isMicMuted = LinphoneManager.getLc().isMicMuted(); isMicMuted = LinphoneManager.getLc().isMicMuted();
//enableAndRefreshInCallActions(); enableAndRefreshInCallActions();
if (status != null) { if (status != null) {
videoProgress.setVisibility(View.GONE); videoProgress.setVisibility(View.GONE);
status.refreshStatusItems(call, isVideoEnabled(call)); //status.refreshStatusItems(call, isVideoEnabled(call));
} }
} }
//refreshInCallActions(); refreshInCallActions();
refreshCallList(getResources());
//refreshCallList(getResources());
if (state == State.CallUpdatedByRemote) { if (state == State.CallUpdatedByRemote) {
// If the correspondent proposes video while audio call // If the correspondent proposes video while audio call
@ -229,14 +222,13 @@ public class InCallActivity extends Activity implements OnClickListener {
}; };
if (findViewById(R.id.fragmentContainer) != null) { if (findViewById(R.id.fragmentContainer) != null) {
initUI(); initUI();
if (LinphoneManager.getLc().getCallsNb() > 0) { if (LinphoneManager.getLc().getCallsNb() > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0]; LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
if (LinphoneUtils.isCallEstablished(call)) { if (LinphoneUtils.isCallEstablished(call)) {
//enableAndRefreshInCallActions(); enableAndRefreshInCallActions();
} }
} }
@ -298,45 +290,63 @@ public class InCallActivity extends Activity implements OnClickListener {
inflater = LayoutInflater.from(this); inflater = LayoutInflater.from(this);
container = (ViewGroup) findViewById(R.id.topLayout); container = (ViewGroup) findViewById(R.id.topLayout);
callsList = (TableLayout) findViewById(R.id.calls); callsList = (TableLayout) findViewById(R.id.calls);
if (!showCallListInVideo) {
callsList.setVisibility(View.GONE);
}
//TopBar
video = (ImageView) findViewById(R.id.video); video = (ImageView) findViewById(R.id.video);
video.setOnClickListener(this); video.setOnClickListener(this);
video.setEnabled(false); enabledVideoButton(false);
videoProgress = (ProgressBar) findViewById(R.id.videoInProgress);
videoProgress.setVisibility(View.GONE);
micro = (ImageView) findViewById(R.id.micro); micro = (ImageView) findViewById(R.id.micro);
micro.setOnClickListener(this); micro.setOnClickListener(this);
// micro.setEnabled(false);
speaker = (ImageView) findViewById(R.id.speaker); speaker = (ImageView) findViewById(R.id.speaker);
speaker.setOnClickListener(this); speaker.setOnClickListener(this);
if(isTablet()){
speaker.setEnabled(false);
}
// speaker.setEnabled(false);
addCall = (ImageView) findViewById(R.id.addCall);
addCall.setOnClickListener(this);
addCall.setEnabled(false);
transfer = (ImageView) findViewById(R.id.transfer);
transfer.setOnClickListener(this);
transfer.setEnabled(false);
options = (ImageView) findViewById(R.id.options); options = (ImageView) findViewById(R.id.options);
options.setOnClickListener(this); options.setOnClickListener(this);
options.setEnabled(false); options.setEnabled(false);
//pause = (ImageView) findViewById(R.id.pause);
//pause.setOnClickListener(this); //BottonBar
//pause.setEnabled(false);
hangUp = (ImageView) findViewById(R.id.hangUp); hangUp = (ImageView) findViewById(R.id.hangUp);
hangUp.setOnClickListener(this); hangUp.setOnClickListener(this);
//conference = (ImageView) findViewById(R.id.conference);
//conference.setOnClickListener(this);
dialer = (ImageView) findViewById(R.id.dialer); dialer = (ImageView) findViewById(R.id.dialer);
dialer.setOnClickListener(this); dialer.setOnClickListener(this);
dialer.setEnabled(false);
numpad = (Numpad) findViewById(R.id.numpad); numpad = (Numpad) findViewById(R.id.numpad);
videoProgress = (ProgressBar) findViewById(R.id.videoInProgress);
videoProgress.setVisibility(View.GONE); //Others
//Active Call
pause = (ImageView) findViewById(R.id.pause);
pause.setOnClickListener(this);
pause.setEnabled(false);
mActiveCallHeader = (RelativeLayout) findViewById(R.id.activeCallHeader);
/*if(isTablet()){
speaker.setEnabled(false);
}*/
// speaker.setEnabled(false);
//Options
addCall = (ImageView) findViewById(R.id.addCall);
addCall.setOnClickListener(this);
addCall.setEnabled(false);
transfer = (ImageView) findViewById(R.id.transfer);
transfer.setOnClickListener(this);
transfer.setEnabled(false);
conference = (ImageView) findViewById(R.id.conference);
conference.setOnClickListener(this);
/*try { /*try {
@ -356,7 +366,7 @@ public class InCallActivity extends Activity implements OnClickListener {
switchCamera = (ImageView) findViewById(R.id.switchCamera); switchCamera = (ImageView) findViewById(R.id.switchCamera);
switchCamera.setOnClickListener(this); switchCamera.setOnClickListener(this);
mControlsLayout = (ViewGroup) findViewById(R.id.menu); mControlsLayout = (LinearLayout) findViewById(R.id.menu);
if (!isTransferAllowed) { if (!isTransferAllowed) {
addCall.setBackgroundResource(R.drawable.options_add_call); addCall.setBackgroundResource(R.drawable.options_add_call);
@ -392,23 +402,40 @@ public class InCallActivity extends Activity implements OnClickListener {
private void refreshInCallActions() { private void refreshInCallActions() {
if (!LinphonePreferences.instance().isVideoEnabled()) { if (!LinphonePreferences.instance().isVideoEnabled()) {
video.setEnabled(false); enabledVideoButton(false);
} else { } else {
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) { if(video.isEnabled()) {
video.setBackgroundResource(R.drawable.video_on); if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
} else { video.setImageResource(R.drawable.camera_selected);
video.setBackgroundResource(R.drawable.video_off); videoProgress.setVisibility(View.INVISIBLE);
} else {
video.setImageResource(R.drawable.camera_default);
}
} }
} }
if (isSpeakerEnabled) {
speaker.setImageResource(R.drawable.speaker_selected);
} else {
speaker.setImageResource(R.drawable.speaker_default);
}
if (isMicMuted) {
micro.setImageResource(R.drawable.micro_selected);
} else {
micro.setImageResource(R.drawable.micro_default);
}
try { try {
if (isSpeakerEnabled) {
speaker.setBackgroundResource(R.drawable.speaker_on);
/*routeSpeaker.setBackgroundResource(R.drawable.route_speaker_on); /*routeSpeaker.setBackgroundResource(R.drawable.route_speaker_on);
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off); routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);*/ routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);*/
} else {
speaker.setBackgroundResource(R.drawable.speaker_off);
/*routeSpeaker.setBackgroundResource(R.drawable.route_speaker_off); /*routeSpeaker.setBackgroundResource(R.drawable.route_speaker_off);
if (BluetoothManager.getInstance().isUsingBluetoothAudioRoute()) { if (BluetoothManager.getInstance().isUsingBluetoothAudioRoute()) {
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off); routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
@ -417,30 +444,23 @@ public class InCallActivity extends Activity implements OnClickListener {
routeReceiver.setBackgroundResource(R.drawable.route_receiver_on); routeReceiver.setBackgroundResource(R.drawable.route_receiver_on);
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off); routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
}*/ }*/
}
} catch (NullPointerException npe) { } catch (NullPointerException npe) {
Log.e("Bluetooth: Audio routes menu disabled on tablets for now (4)"); Log.e("Bluetooth: Audio routes menu disabled on tablets for now (4)");
} }
if (isMicMuted) {
micro.setBackgroundResource(R.drawable.micro_off);
} else {
micro.setBackgroundResource(R.drawable.micro_on);
}
if (LinphoneManager.getLc().getCallsNb() > 1) { if (LinphoneManager.getLc().getCallsNb() > 1) {
conference.setVisibility(View.VISIBLE); //pause.setVisibility(View.GONE);
pause.setVisibility(View.GONE);
} else { } else {
conference.setVisibility(View.GONE); /*pause.setVisibility(View.VISIBLE);
pause.setVisibility(View.VISIBLE);
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(LinphoneManager.getLc(), Arrays.asList(State.Paused)); List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(LinphoneManager.getLc(), Arrays.asList(State.Paused));
if (pausedCalls.size() == 1) { if (pausedCalls.size() == 1) {
pause.setBackgroundResource(R.drawable.pause_on); pause.setBackgroundResource(R.drawable.pause_on);
} else { } else {
pause.setBackgroundResource(R.drawable.pause_off); pause.setBackgroundResource(R.drawable.pause_off);
} }*/
} }
} }
@ -450,17 +470,16 @@ public class InCallActivity extends Activity implements OnClickListener {
options.setEnabled(!getResources().getBoolean(R.bool.disable_options_in_call) && (addCall.isEnabled() || transfer.isEnabled())); options.setEnabled(!getResources().getBoolean(R.bool.disable_options_in_call) && (addCall.isEnabled() || transfer.isEnabled()));
if(LinphoneManager.getLc().getCurrentCall() != null && LinphonePreferences.instance().isVideoEnabled() && !LinphoneManager.getLc().getCurrentCall().mediaInProgress()) { if(LinphoneManager.getLc().getCurrentCall() != null && LinphonePreferences.instance().isVideoEnabled() && !LinphoneManager.getLc().getCurrentCall().mediaInProgress()) {
video.setEnabled(true); enabledVideoButton(true);
} }
micro.setEnabled(true); micro.setEnabled(true);
if(!isTablet()){ if(!isTablet()){
speaker.setEnabled(true); speaker.setEnabled(true);
} }
transfer.setEnabled(true); transfer.setEnabled(true);
//pause.setEnabled(true); pause.setEnabled(true);
dialer.setEnabled(true); dialer.setEnabled(true);
conference.setEnabled(true); conference.setEnabled(true);
refreshInCallActions(); refreshInCallActions();
} }
@ -549,6 +568,16 @@ public class InCallActivity extends Activity implements OnClickListener {
} }
} }
private void enabledVideoButton(boolean enabled){
if(enabled) {
video.setEnabled(true);
video.setImageResource(R.drawable.camera_default);
} else {
video.setEnabled(false);
video.setImageResource(R.drawable.camera_disabled);
}
}
private void enabledOrDisabledVideo(final boolean isVideoEnabled) { private void enabledOrDisabledVideo(final boolean isVideoEnabled) {
final LinphoneCall call = LinphoneManager.getLc().getCurrentCall(); final LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
if (call == null) { if (call == null) {
@ -556,12 +585,10 @@ public class InCallActivity extends Activity implements OnClickListener {
} }
if (isVideoEnabled) { if (isVideoEnabled) {
video.setEnabled(true);
LinphoneCallParams params = call.getCurrentParamsCopy(); LinphoneCallParams params = call.getCurrentParamsCopy();
params.setVideoEnabled(false); params.setVideoEnabled(false);
LinphoneManager.getLc().updateCall(call, params); LinphoneManager.getLc().updateCall(call, params);
} else { } else {
video.setEnabled(false);
videoProgress.setVisibility(View.VISIBLE); videoProgress.setVisibility(View.VISIBLE);
if (!call.getRemoteParams().isLowBandwidthEnabled()) { if (!call.getRemoteParams().isLowBandwidthEnabled()) {
LinphoneManager.getInstance().addVideo(); LinphoneManager.getInstance().addVideo();
@ -608,7 +635,6 @@ public class InCallActivity extends Activity implements OnClickListener {
} }
private void showAudioView() { private void showAudioView() {
video.setBackgroundResource(R.drawable.video_on);
LinphoneManager.startProximitySensorForActivity(InCallActivity.this); LinphoneManager.startProximitySensorForActivity(InCallActivity.this);
replaceFragmentVideoByAudio(); replaceFragmentVideoByAudio();
setCallControlsVisibleAndRemoveCallbacks(); setCallControlsVisibleAndRemoveCallbacks();
@ -619,11 +645,8 @@ public class InCallActivity extends Activity implements OnClickListener {
Log.w("Bluetooth not available, using speaker"); Log.w("Bluetooth not available, using speaker");
LinphoneManager.getInstance().routeAudioToSpeaker(); LinphoneManager.getInstance().routeAudioToSpeaker();
isSpeakerEnabled = true; isSpeakerEnabled = true;
speaker.setBackgroundResource(R.drawable.speaker_on);
} }
video.setBackgroundResource(R.drawable.video_off); refreshInCallActions();
video.setEnabled(true);
videoProgress.setVisibility(View.INVISIBLE);
LinphoneManager.stopProximitySensorForActivity(InCallActivity.this); LinphoneManager.stopProximitySensorForActivity(InCallActivity.this);
replaceFragmentAudioByVideo(); replaceFragmentAudioByVideo();
@ -632,7 +655,6 @@ public class InCallActivity extends Activity implements OnClickListener {
private void replaceFragmentVideoByAudio() { private void replaceFragmentVideoByAudio() {
audioCallFragment = new AudioCallFragment(); audioCallFragment = new AudioCallFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction(); FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.fragmentContainer, audioCallFragment); transaction.replace(R.id.fragmentContainer, audioCallFragment);
try { try {
@ -645,7 +667,6 @@ public class InCallActivity extends Activity implements OnClickListener {
// Hiding controls to let displayVideoCallControlsIfHidden add them plus the callback // Hiding controls to let displayVideoCallControlsIfHidden add them plus the callback
mControlsLayout.setVisibility(View.GONE); mControlsLayout.setVisibility(View.GONE);
switchCamera.setVisibility(View.INVISIBLE); switchCamera.setVisibility(View.INVISIBLE);
videoCallFragment = new VideoCallFragment(); videoCallFragment = new VideoCallFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction(); FragmentTransaction transaction = getFragmentManager().beginTransaction();
@ -661,9 +682,9 @@ public class InCallActivity extends Activity implements OnClickListener {
isMicMuted = !isMicMuted; isMicMuted = !isMicMuted;
lc.muteMic(isMicMuted); lc.muteMic(isMicMuted);
if (isMicMuted) { if (isMicMuted) {
micro.setBackgroundResource(R.drawable.micro_off); micro.setImageResource(R.drawable.micro_selected);
} else { } else {
micro.setBackgroundResource(R.drawable.micro_on); micro.setImageResource(R.drawable.micro_default);
} }
} }
@ -671,12 +692,12 @@ public class InCallActivity extends Activity implements OnClickListener {
isSpeakerEnabled = !isSpeakerEnabled; isSpeakerEnabled = !isSpeakerEnabled;
if (isSpeakerEnabled) { if (isSpeakerEnabled) {
LinphoneManager.getInstance().routeAudioToSpeaker(); LinphoneManager.getInstance().routeAudioToSpeaker();
speaker.setBackgroundResource(R.drawable.speaker_on); speaker.setImageResource(R.drawable.speaker_selected);
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled); LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
} else { } else {
Log.d("Toggle speaker off, routing back to earpiece"); Log.d("Toggle speaker off, routing back to earpiece");
LinphoneManager.getInstance().routeAudioToReceiver(); LinphoneManager.getInstance().routeAudioToReceiver();
speaker.setBackgroundResource(R.drawable.speaker_off); speaker.setImageResource(R.drawable.speaker_default);
} }
} }
@ -702,7 +723,7 @@ public class InCallActivity extends Activity implements OnClickListener {
isVideoCallPaused = true; isVideoCallPaused = true;
showAudioView(); showAudioView();
} }
pause.setBackgroundResource(R.drawable.pause_on); pause.setImageResource(R.drawable.pause_big_over_selected);
} }
} else if (call != null) { } else if (call != null) {
if (call.getState() == State.Paused) { if (call.getState() == State.Paused) {
@ -711,7 +732,7 @@ public class InCallActivity extends Activity implements OnClickListener {
isVideoCallPaused = false; isVideoCallPaused = false;
showVideoView(); showVideoView();
} }
pause.setBackgroundResource(R.drawable.pause_off); pause.setImageResource(R.drawable.pause_big_default);
} }
} }
} }
@ -747,7 +768,8 @@ public class InCallActivity extends Activity implements OnClickListener {
if (mControlsLayout.getVisibility() != View.VISIBLE) { if (mControlsLayout.getVisibility() != View.VISIBLE) {
if (isAnimationDisabled) { if (isAnimationDisabled) {
mControlsLayout.setVisibility(View.VISIBLE); mControlsLayout.setVisibility(View.VISIBLE);
callsList.setVisibility(showCallListInVideo ? View.VISIBLE : View.GONE); callsList.setVisibility(View.GONE);
mActiveCallHeader.setVisibility(View.GONE);
if (cameraNumber > 1) { if (cameraNumber > 1) {
switchCamera.setVisibility(View.VISIBLE); switchCamera.setVisibility(View.VISIBLE);
} }
@ -757,7 +779,8 @@ public class InCallActivity extends Activity implements OnClickListener {
@Override @Override
public void onAnimationStart(Animation animation) { public void onAnimationStart(Animation animation) {
mControlsLayout.setVisibility(View.VISIBLE); mControlsLayout.setVisibility(View.VISIBLE);
callsList.setVisibility(showCallListInVideo ? View.VISIBLE : View.GONE); callsList.setVisibility(View.GONE);
mActiveCallHeader.setVisibility(View.GONE);
if (cameraNumber > 1) { if (cameraNumber > 1) {
switchCamera.setVisibility(View.VISIBLE); switchCamera.setVisibility(View.VISIBLE);
} }
@ -797,10 +820,11 @@ public class InCallActivity extends Activity implements OnClickListener {
transfer.setVisibility(View.INVISIBLE); transfer.setVisibility(View.INVISIBLE);
addCall.setVisibility(View.INVISIBLE); addCall.setVisibility(View.INVISIBLE);
mControlsLayout.setVisibility(View.GONE); mControlsLayout.setVisibility(View.GONE);
callsList.setVisibility(View.GONE); mActiveCallHeader.setVisibility(View.GONE);
// callsList.setVisibility(View.GONE);
switchCamera.setVisibility(View.INVISIBLE); switchCamera.setVisibility(View.INVISIBLE);
numpad.setVisibility(View.GONE); numpad.setVisibility(View.GONE);
options.setBackgroundResource(R.drawable.options); options.setImageResource(R.drawable.options_default);
} else { } else {
Animation animation = slideOutTopToBottom; Animation animation = slideOutTopToBottom;
animation.setAnimationListener(new AnimationListener() { animation.setAnimationListener(new AnimationListener() {
@ -819,10 +843,11 @@ public class InCallActivity extends Activity implements OnClickListener {
transfer.setVisibility(View.INVISIBLE); transfer.setVisibility(View.INVISIBLE);
addCall.setVisibility(View.INVISIBLE); addCall.setVisibility(View.INVISIBLE);
mControlsLayout.setVisibility(View.GONE); mControlsLayout.setVisibility(View.GONE);
callsList.setVisibility(View.GONE); // callsList.setVisibility(View.GONE);
mActiveCallHeader.setVisibility(View.GONE);
switchCamera.setVisibility(View.INVISIBLE); switchCamera.setVisibility(View.INVISIBLE);
numpad.setVisibility(View.GONE); numpad.setVisibility(View.GONE);
options.setBackgroundResource(R.drawable.options); options.setImageResource(R.drawable.options_default);
animation.setAnimationListener(null); animation.setAnimationListener(null);
} }
@ -845,6 +870,7 @@ public class InCallActivity extends Activity implements OnClickListener {
mControlsLayout.setVisibility(View.VISIBLE); mControlsLayout.setVisibility(View.VISIBLE);
callsList.setVisibility(View.VISIBLE); callsList.setVisibility(View.VISIBLE);
mActiveCallHeader.setVisibility(View.VISIBLE);
switchCamera.setVisibility(View.INVISIBLE); switchCamera.setVisibility(View.INVISIBLE);
} }
@ -853,7 +879,7 @@ public class InCallActivity extends Activity implements OnClickListener {
return; return;
} }
dialer.setBackgroundResource(R.drawable.dialer_alt); dialer.setImageResource(R.drawable.footer_dialer);
if (isAnimationDisabled) { if (isAnimationDisabled) {
numpad.setVisibility(View.GONE); numpad.setVisibility(View.GONE);
} else { } else {
@ -887,7 +913,7 @@ public class InCallActivity extends Activity implements OnClickListener {
if (numpad.getVisibility() == View.VISIBLE) { if (numpad.getVisibility() == View.VISIBLE) {
hideNumpad(); hideNumpad();
} else { } else {
dialer.setBackgroundResource(R.drawable.dialer_alt_back); dialer.setImageResource(R.drawable.dialer_alt_back);
if (isAnimationDisabled) { if (isAnimationDisabled) {
numpad.setVisibility(View.VISIBLE); numpad.setVisibility(View.VISIBLE);
} else { } else {
@ -1077,13 +1103,15 @@ public class InCallActivity extends Activity implements OnClickListener {
private void hideOrDisplayCallOptions() { private void hideOrDisplayCallOptions() {
boolean isOrientationLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; boolean isOrientationLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
//Hide options
if (addCall.getVisibility() == View.VISIBLE) { if (addCall.getVisibility() == View.VISIBLE) {
options.setBackgroundResource(R.drawable.options); options.setImageResource(R.drawable.options_default);
if (isAnimationDisabled) { if (isAnimationDisabled) {
if (isTransferAllowed) { if (isTransferAllowed) {
transfer.setVisibility(View.INVISIBLE); transfer.setVisibility(View.INVISIBLE);
} }
addCall.setVisibility(View.INVISIBLE); addCall.setVisibility(View.INVISIBLE);
conference.setVisibility(View.INVISIBLE);
} else { } else {
if (isOrientationLandscape) { if (isOrientationLandscape) {
hideAnimatedLandscapeCallOptions(); hideAnimatedLandscapeCallOptions();
@ -1091,14 +1119,15 @@ public class InCallActivity extends Activity implements OnClickListener {
hideAnimatedPortraitCallOptions(); hideAnimatedPortraitCallOptions();
} }
} }
options.setSelected(false); //Display options
} else { } else {
if (isAnimationDisabled) { if (isAnimationDisabled) {
if (isTransferAllowed) { if (isTransferAllowed) {
transfer.setVisibility(View.VISIBLE); transfer.setVisibility(View.VISIBLE);
} }
addCall.setVisibility(View.VISIBLE); addCall.setVisibility(View.VISIBLE);
options.setBackgroundResource(R.drawable.options_alt); conference.setVisibility(View.VISIBLE);
options.setImageResource(R.drawable.options_selected);
} else { } else {
if (isOrientationLandscape) { if (isOrientationLandscape) {
showAnimatedLandscapeCallOptions(); showAnimatedLandscapeCallOptions();
@ -1106,7 +1135,6 @@ public class InCallActivity extends Activity implements OnClickListener {
showAnimatedPortraitCallOptions(); showAnimatedPortraitCallOptions();
} }
} }
options.setSelected(true);
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null); transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
} }
} }
@ -1178,8 +1206,10 @@ public class InCallActivity extends Activity implements OnClickListener {
lc.addListener(mListener); lc.addListener(mListener);
} }
refreshCallList(getResources()); displayActiveCall(LinphoneManager.getLc().getCurrentCall());
if (LinphoneManager.getLc().getCalls().length > 1) {
refreshCallList(getResources());
}
handleViewIntent(); handleViewIntent();
} }
@ -1294,7 +1324,46 @@ public class InCallActivity extends Activity implements OnClickListener {
callsList.addView(conferenceHeader); callsList.addView(conferenceHeader);
} }
private void displayCall(Resources resources, LinphoneCall call, int index) { private void displayActiveCall(LinphoneCall call){
if(call == null) return;
String sipUri = call.getRemoteAddress().asStringUriOnly();
LinphoneAddress lAddress;
try {
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
} catch (LinphoneCoreException e) {
Log.e("Incall activity cannot parse remote address",e);
lAddress= LinphoneCoreFactory.instance().createLinphoneAddress("uknown","unknown","unkonown");
}
TextView contact = (TextView) findViewById(R.id.contactNameOrNumber);
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), lAddress);
if (lContact == null) {
if (getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
contact.setText(lAddress.getUserName());
} else {
contact.setText(sipUri);
}
} else {
contact.setText(lContact.getName());
}
int callDuration = call.getDuration();
if (callDuration == 0 && call.getState() != State.StreamsRunning) {
return;
}
Chronometer timer = (Chronometer) findViewById(R.id.callTimer);
if (timer == null) {
throw new IllegalArgumentException("no callee_duration view found");
}
timer.setBase(SystemClock.elapsedRealtime() - 1000 * callDuration);
timer.start();
}
private void displayOtherCalls(Resources resources, LinphoneCall call, int index) {
String sipUri = call.getRemoteAddress().asStringUriOnly(); String sipUri = call.getRemoteAddress().asStringUriOnly();
LinphoneAddress lAddress; LinphoneAddress lAddress;
try { try {
@ -1307,24 +1376,48 @@ public class InCallActivity extends Activity implements OnClickListener {
// Control Row // Control Row
LinearLayout callView = (LinearLayout) inflater.inflate(R.layout.active_call_control_row, container, false); LinearLayout callView = (LinearLayout) inflater.inflate(R.layout.active_call_control_row, container, false);
callView.setId(index+1); callView.setId(index+1);
setContactName(callView, lAddress, sipUri, resources);
displayCallStatusIconAndReturnCallPaused(callView, call); TextView contact = (TextView) callView.findViewById(R.id.contactNameOrNumber);
setRowBackground(callView, index);
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), lAddress);
if (lContact == null) {
if (getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
contact.setText(lAddress.getUserName());
} else {
contact.setText(sipUri);
}
} else {
contact.setText(lContact.getName());
}
//displayCallStatusIconAndReturnCallPaused(callView, call);
registerCallDurationTimer(callView, call); registerCallDurationTimer(callView, call);
callsList.addView(callView); callsList.addView(callView);
// Image Row // Image Row
LinearLayout imageView = (LinearLayout) inflater.inflate(R.layout.active_call_image_row, container, false); //Contact contact = ContactsManager.getInstance().findContactWithAddress(imageView.getContext().getContentResolver(), lAddress);
Contact contact = ContactsManager.getInstance().findContactWithAddress(imageView.getContext().getContentResolver(), lAddress); /*if(contact != null) {
if(contact != null) {
displayOrHideContactPicture(imageView, contact.getPhotoUri(), contact.getThumbnailUri(), false); displayOrHideContactPicture(imageView, contact.getPhotoUri(), contact.getThumbnailUri(), false);
} else { } else {
displayOrHideContactPicture(imageView, null, null, false); displayOrHideContactPicture(imageView, null, null, false);
} }
callsList.addView(imageView); callsList.addView(imageView);*/
callView.setTag(imageView); int callDuration = call.getDuration();
callView.setOnClickListener(new OnClickListener() { if (callDuration == 0 && call.getState() != State.StreamsRunning) {
return;
}
Chronometer timer = (Chronometer) findViewById(R.id.callTimer);
if (timer == null) {
throw new IllegalArgumentException("no callee_duration view found");
}
timer.setBase(SystemClock.elapsedRealtime() - 1000 * callDuration);
timer.start();
// callView.setTag(imageView);
/* callView.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (v.getTag() != null) { if (v.getTag() != null) {
@ -1336,7 +1429,7 @@ public class InCallActivity extends Activity implements OnClickListener {
callsList.invalidate(); callsList.invalidate();
} }
} }
}); });*/
} }
private void setContactName(LinearLayout callView, LinphoneAddress lAddress, String sipUri, Resources resources) { private void setContactName(LinearLayout callView, LinphoneAddress lAddress, String sipUri, Resources resources) {
@ -1390,18 +1483,6 @@ public class InCallActivity extends Activity implements OnClickListener {
callView.setVisibility(hide ? View.GONE : View.VISIBLE);*/ callView.setVisibility(hide ? View.GONE : View.VISIBLE);*/
} }
private void setRowBackground(LinearLayout callView, int index) {
int backgroundResource;
if (index == 0) {
// backgroundResource = active ? R.drawable.cell_call_first_highlight : R.drawable.cell_call_first;
//backgroundResource = R.drawable.cell_call_first;
} else {
// backgroundResource = active ? R.drawable.cell_call_highlight : R.drawable.cell_call;
// backgroundResource = R.drawable.cell_call;
}
// callView.setBackgroundResource(backgroundResource);
}
private void registerCallDurationTimer(View v, LinphoneCall call) { private void registerCallDurationTimer(View v, LinphoneCall call) {
int callDuration = call.getDuration(); int callDuration = call.getDuration();
if (callDuration == 0 && call.getState() != State.StreamsRunning) { if (callDuration == 0 && call.getState() != State.StreamsRunning) {
@ -1418,33 +1499,41 @@ public class InCallActivity extends Activity implements OnClickListener {
} }
public void refreshCallList(Resources resources) { public void refreshCallList(Resources resources) {
if (callsList == null) { if(LinphoneManager.getLc().getCalls().length == 1) {
displayActiveCall(LinphoneManager.getLc().getCalls()[0]);
return; return;
} }
callsList.removeAllViews(); if(callsList != null) {
int index = 0; callsList.removeAllViews();
int index = 0;
if (LinphoneManager.getLc().getCallsNb() == 0) { if (LinphoneManager.getLc().getCallsNb() == 0) {
goBackToDialer(); goBackToDialer();
return; return;
} }
isConferenceRunning = LinphoneManager.getLc().getConferenceSize() > 1; isConferenceRunning = LinphoneManager.getLc().getConferenceSize() > 1;
if (isConferenceRunning) { if (isConferenceRunning) {
displayConferenceHeader(); displayConferenceHeader();
index++; index++;
} }
for (LinphoneCall call : LinphoneManager.getLc().getCalls()) { for (LinphoneCall call : LinphoneManager.getLc().getCalls()) {
displayCall(resources, call, index); if (call != LinphoneManager.getLc().getCurrentCall()) {
index++; displayOtherCalls(resources, call, index);
} index++;
} else {
displayActiveCall(call);
}
}
if(LinphoneManager.getLc().getCurrentCall() == null){ if (LinphoneManager.getLc().getCurrentCall() == null) {
showAudioView(); showAudioView();
video.setEnabled(false); video.setEnabled(false);
} }
callsList.invalidate();
}
callsList.invalidate();
} }
} }

View file

@ -143,12 +143,8 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
// contact != null ? contact.getThumbnailUri() : null, R.drawable.unknown_small); // contact != null ? contact.getThumbnailUri() : null, R.drawable.unknown_small);
// To be done after findUriPictureOfContactAndSetDisplayName called // To be done after findUriPictureOfContactAndSetDisplayName called
mNameView.setText(contact != null ? contact.getName() : ""); mNameView.setText(contact != null ? contact.getName() : address.getUserName());
if (getResources().getBoolean(R.bool.only_display_username_if_unknown)) { mNumberView.setText(address.asStringUriOnly());
mNumberView.setText(address.getUserName());
} else {
mNumberView.setText(address.asStringUriOnly());
}
} }
@Override @Override

View file

@ -51,6 +51,8 @@ import org.linphone.ui.AddressText;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.Fragment; import android.app.Fragment;
import android.app.FragmentManager; import android.app.FragmentManager;
import android.app.FragmentTransaction; import android.app.FragmentTransaction;
@ -60,6 +62,9 @@ import android.content.Intent;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.view.Gravity; import android.view.Gravity;
@ -70,6 +75,7 @@ import android.view.Surface;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import android.widget.AdapterView; import android.widget.AdapterView;
@ -165,11 +171,6 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
ContactsManager.getInstance().initializeContactManager(getApplicationContext(), getContentResolver()); ContactsManager.getInstance().initializeContactManager(getApplicationContext(), getContentResolver());
} }
if(!LinphonePreferences.instance().isContactsMigrationDone()){
ContactsManager.getInstance().migrateContacts();
LinphonePreferences.instance().contactsMigrationDone();
}
setContentView(R.layout.main); setContentView(R.layout.main);
instance = this; instance = this;
fragmentsHistory = new ArrayList<FragmentsAvailable>(); fragmentsHistory = new ArrayList<FragmentsAvailable>();
@ -532,7 +533,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
break; break;
case CHATLIST: case CHATLIST:
newFragment = new ChatListFragment(); newFragment = new ChatListFragment();
messageListFragment = new Fragment(); messageListFragment = newFragment;
break; break;
case CHAT: case CHAT:
newFragment = new ChatFragment(); newFragment = new ChatFragment();
@ -1024,6 +1025,18 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
toast.show(); toast.show();
} }
public Dialog displayDialog(String text){
Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
Drawable d = new ColorDrawable(Color.BLACK);
d.setAlpha(0);
dialog.getWindow().setBackgroundDrawable(d);
dialog.setContentView(R.layout.dialog);
TextView customText = (TextView) dialog.findViewById(R.id.customText);
customText.setText(text);
return dialog;
}
@Override @Override
public void setAddresGoToDialerAndCall(String number, String name, Uri photo) { public void setAddresGoToDialerAndCall(String number, String name, Uri photo) {
// Bundle extras = new Bundle(); // Bundle extras = new Bundle();

View file

@ -27,18 +27,19 @@ import org.linphone.core.LinphoneCallParams;
import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCoreListenerBase; import org.linphone.core.LinphoneCoreListenerBase;
import org.linphone.mediastream.Log; import org.linphone.mediastream.Log;
import org.linphone.ui.LinphoneSliders;
import org.linphone.ui.LinphoneSliders.LinphoneSliderTriggered;
import android.app.Activity; import android.app.Activity;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import de.timroes.axmlrpc.Call;
/** /**
* Activity displayed when a call comes in. * Activity displayed when a call comes in.
* It should bypass the screen lock mechanism. * It should bypass the screen lock mechanism.
@ -49,11 +50,11 @@ public class OutgoingCallActivity extends Activity {
private static OutgoingCallActivity instance; private static OutgoingCallActivity instance;
private TextView mNameView; private TextView mNameView, mNumberView;
private TextView mNumberView; private ImageView mPictureView, micro, speaker, decline;
private ImageView mPictureView;
private LinphoneCall mCall; private LinphoneCall mCall;
private LinphoneCoreListenerBase mListener; private LinphoneCoreListenerBase mListener;
private boolean isMicMuted, isSpeakerEnabled;
public static OutgoingCallActivity instance() { public static OutgoingCallActivity instance() {
return instance; return instance;
@ -66,27 +67,85 @@ public class OutgoingCallActivity extends Activity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.incoming); setContentView(R.layout.outgoing_call);
mNameView = (TextView) findViewById(R.id.incoming_caller_name); mNameView = (TextView) findViewById(R.id.incoming_caller_name);
mNumberView = (TextView) findViewById(R.id.incoming_caller_number); mNumberView = (TextView) findViewById(R.id.incoming_caller_number);
mPictureView = (ImageView) findViewById(R.id.incoming_picture); mPictureView = (ImageView) findViewById(R.id.incoming_picture);
micro = (ImageView) findViewById(R.id.micro);
micro.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
}
});
speaker = (ImageView) findViewById(R.id.speaker);
isMicMuted = false;
isSpeakerEnabled = false;
micro.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
isMicMuted = !isMicMuted;
if(isMicMuted) {
micro.setImageResource(R.drawable.micro_selected);
} else {
micro.setImageResource(R.drawable.micro_default);
}
LinphoneManager.getLc().muteMic(isMicMuted);
}
});
speaker.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
isSpeakerEnabled = !isSpeakerEnabled;
if(isSpeakerEnabled) {
speaker.setImageResource(R.drawable.speaker_selected);
} else {
speaker.setImageResource(R.drawable.speaker_default);
}
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
}
});
// set this flag so this activity will stay in front of the keyguard // set this flag so this activity will stay in front of the keyguard
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON; int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
getWindow().addFlags(flags); getWindow().addFlags(flags);
// "Dial-to-answer" widget for incoming calls. // "Dial-to-answer" widget for incoming calls.
ImageView decline = (ImageView) findViewById(R.id.hang_up);
decline.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
decline();
}
});
mListener = new LinphoneCoreListenerBase(){ mListener = new LinphoneCoreListenerBase(){
@Override @Override
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) { public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
if (LinphoneManager.getLc().getCallsNb() == 0) {
finish();
return;
}
if (call == mCall && State.CallEnd == state) { if (call == mCall && State.CallEnd == state) {
finish(); finish();
} }
if (state == State.StreamsRunning) {
// The following should not be needed except some devices need it (e.g. Galaxy S). if (call == mCall && State.Connected == state || State.StreamsRunning == state){
LinphoneManager.getLc().enableSpeaker(LinphoneManager.getLc().isSpeakerEnabled()); if (!LinphoneActivity.isInstanciated()) {
return;
}
final LinphoneCallParams remoteParams = mCall.getRemoteParams();
if (remoteParams != null && remoteParams.getVideoEnabled() && LinphonePreferences.instance().shouldAutomaticallyAcceptVideoRequests()) {
LinphoneActivity.instance().startVideoActivity(mCall);
} else {
LinphoneActivity.instance().startIncallActivity(mCall);
}
} }
} }
}; };
@ -108,7 +167,7 @@ public class OutgoingCallActivity extends Activity {
if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() != null) { if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() != null) {
List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc()); List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc());
for (LinphoneCall call : calls) { for (LinphoneCall call : calls) {
if (State.IncomingReceived == call.getState()) { if (State.OutgoingInit == call.getState() || State.OutgoingProgress == call.getState()) {
mCall = call; mCall = call;
break; break;
} }
@ -126,12 +185,9 @@ public class OutgoingCallActivity extends Activity {
// contact != null ? contact.getThumbnailUri() : null, R.drawable.unknown_small); // contact != null ? contact.getThumbnailUri() : null, R.drawable.unknown_small);
// To be done after findUriPictureOfContactAndSetDisplayName called // To be done after findUriPictureOfContactAndSetDisplayName called
mNameView.setText(contact != null ? contact.getName() : ""); mNameView.setText(contact != null ? contact.getName() : address.getUserName());
if (getResources().getBoolean(R.bool.only_display_username_if_unknown)) { mNumberView.setText(address.asStringUriOnly());
mNumberView.setText(address.getUserName());
} else {
mNumberView.setText(address.asStringUriOnly());
}
} }
@Override @Override
@ -158,35 +214,8 @@ public class OutgoingCallActivity extends Activity {
return super.onKeyDown(keyCode, event); return super.onKeyDown(keyCode, event);
} }
private void decline() { private void decline() {
LinphoneManager.getLc().terminateCall(mCall); LinphoneManager.getLc().terminateCall(mCall);
} }
private void answer() {
LinphoneCallParams params = LinphoneManager.getLc().createDefaultCallParameters();
boolean isLowBandwidthConnection = !LinphoneUtils.isHighBandwidthConnection(this);
if (isLowBandwidthConnection) {
params.enableLowBandwidth(true);
Log.d("Low bandwidth enabled in call params");
}
if (!LinphoneManager.getInstance().acceptCallWithParams(mCall, params)) {
// the above method takes care of Samsung Galaxy S
Toast.makeText(this, R.string.couldnt_accept_call, Toast.LENGTH_LONG).show();
} else {
if (!LinphoneActivity.isInstanciated()) {
return;
}
final LinphoneCallParams remoteParams = mCall.getRemoteParams();
if (remoteParams != null && remoteParams.getVideoEnabled() && LinphonePreferences.instance().shouldAutomaticallyAcceptVideoRequests()) {
LinphoneActivity.instance().startVideoActivity(mCall);
} else {
LinphoneActivity.instance().startIncallActivity(mCall);
}
}
}
} }

View file

@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.linphone.assistant.AssistantActivity;
import org.linphone.core.LinphoneAddress; import org.linphone.core.LinphoneAddress;
import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCore.AdaptiveRateAlgorithm; import org.linphone.core.LinphoneCore.AdaptiveRateAlgorithm;
@ -35,7 +36,6 @@ import org.linphone.core.PayloadType;
import org.linphone.mediastream.Log; import org.linphone.mediastream.Log;
import org.linphone.mediastream.Version; import org.linphone.mediastream.Version;
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration; import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
import org.linphone.setup.SetupActivity;
import org.linphone.ui.LedPreference; import org.linphone.ui.LedPreference;
import org.linphone.ui.PreferencesListFragment; import org.linphone.ui.PreferencesListFragment;
@ -124,7 +124,7 @@ public class SettingsFragment extends PreferencesListFragment {
findPreference(getString(R.string.setup_key)).setOnPreferenceClickListener(new OnPreferenceClickListener() { findPreference(getString(R.string.setup_key)).setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override @Override
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference preference) {
Intent intent = new Intent(LinphoneService.instance(), SetupActivity.class); Intent intent = new Intent(LinphoneService.instance(), AssistantActivity.class);
startActivityForResult(intent, WIZARD_INTENT); startActivityForResult(intent, WIZARD_INTENT);
return true; return true;
} }

View file

@ -87,10 +87,10 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
if (message.isOutgoing()) { if (message.isOutgoing()) {
view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_outgoing, null); view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_outgoing, null);
view.setBackgroundResource(R.drawable.resizable_chat_bubble_outgoing); //view.setBackgroundResource(R.drawable.resizable_chat_bubble_outgoing);
} else { } else {
view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_incoming, null); view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_incoming, null);
view.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming); //view.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming);
} }
view.setId(message.getStorageId()); view.setId(message.getStorageId());