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"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@color/call_selected" />
android:drawable="@color/colorL" />
<item android:state_enabled="false"
android:drawable="@color/call_selected" />
android:drawable="@color/colorL" />
<item
android:drawable="@color/footer_select" />
android:drawable="@color/colorA" />
</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"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@color/footer_select" />
android:drawable="@color/colorA" />
<item android:state_selected="true"
android:drawable="@color/footer_button" />
android:drawable="@color/colorD" />
<item
android:drawable="@color/footer_button" />
android:drawable="@color/colorD" />
</selector>

View file

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

View file

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

View file

@ -1,8 +1,10 @@
<?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/hangup_over" />
<item
android:drawable="@drawable/hangup_default" />
<item android:state_pressed="true"
android:drawable="@color/colorI" />
<item android:state_enabled="false"
android:drawable="@color/colorD" />
<item
android:drawable="@color/colorD" />
</selector>

View file

@ -1,9 +1,7 @@
<?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/micro_off_over" />
<item android:state_enabled="false"
android:drawable="@drawable/micro_off_disabled" />
<item android:state_enabled="true"
android:drawable="@drawable/micro_selected" />
<item
android:drawable="@drawable/micro_off_default" />
android:drawable="@drawable/micro_default" />
</selector>

View file

@ -1,9 +1,7 @@
<?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/speaker_on_over" />
<item android:state_enabled="false"
android:drawable="@drawable/speaker_on_disabled" />
<item android:state_enabled="true"
android:drawable="@drawable/speaker_selected" />
<item
android:drawable="@drawable/speaker_on_default" />
android:drawable="@drawable/speaker_default" />
</selector>

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/background"
android:background="@color/colorH"
android:gravity="center">
<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"
xmlns:linphone="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_height="60dp"
android:layout_margin="2dp"
android:gravity="center_vertical"
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
android:id="@+id/contactNameOrNumber"
style="@style/font14"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical|left"
android:paddingLeft="20dp"
android:paddingRight="10dp"
android:textColor="@android:color/white"
android:textSize="22dp" />
android:paddingRight="10dp"/>
<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
android:contentDescription="@string/content_description_pause"
android:src="@drawable/pause_small_over_selected"
android:id="@+id/callStatus"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center_vertical"
android:scaleType="fitCenter"
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>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -85,6 +85,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:paddingTop="10dp"
android:textColor="@color/colorC" />
<TextView

View file

@ -1,27 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:gravity="center_vertical"
android:padding="10dp">
android:layout_height="wrap_content">
<EditText
android:textCursorDrawable="@null"
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"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/list_delete"
android:paddingLeft="5dp"
android:gravity="right" />
android:orientation="horizontal">
<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>

View file

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

View file

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

View file

@ -69,6 +69,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:gravity="center">
<ImageView
@ -78,46 +79,135 @@
android:src="@drawable/avatar" />
</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
android:textCursorDrawable="@null"
android:id="@+id/contactLastName"
android:background="@drawable/resizable_textfield"
style="@style/font9"
android:textCursorDrawable="@null"
android:layout_width="match_parent"
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:paddingRight="5dp"
android:inputType="textPersonName|textCapWords"
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
android:textCursorDrawable="@null"
android:id="@+id/contactFirstName"
android:textCursorDrawable="@null"
android:background="@drawable/resizable_textfield"
style="@style/font9"
android:layout_width="match_parent"
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:paddingRight="5dp"
android:inputType="textPersonName|textCapWords"
android:layout_column="1"/>
</LinearLayout>
<TableLayout
android:id="@+id/controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="20dp">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
</TableRow>
</TableLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/sip_address"
style="@style/font13"
android:textAllCaps="true"
android:paddingTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<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>

View file

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

View file

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

View file

@ -4,33 +4,87 @@
android:id="@+id/topLayout"
android:layout_width="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
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true">
android:layout_below="@id/status">
<LinearLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" />
<TableLayout
android:id="@+id/calls"
android:paddingTop="40dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top" />
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:layout_width="match_parent"
android:layout_height="40dp"
tools:layout="@layout/status" />
</FrameLayout>
<RelativeLayout
android:id="@+id/callsList"
android:paddingBottom="140dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/activeCallHeader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_gravity="center_vertical">
<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
android:id="@+id/switchCamera"
@ -42,14 +96,14 @@
android:layout_marginTop="40dp"
android:visibility="invisible"
android:src="@drawable/switch_camera" />
<org.linphone.ui.Numpad
android:contentDescription="@string/content_description_numpad"
android:id="@+id/numpad"
android:background="@drawable/dialer_alt_background"
android:layout_width="wrap_content"
android:background="@color/colorF"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:visibility="gone"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
@ -57,13 +111,12 @@
android:id="@+id/menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="right"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="70dp"
android:orientation="horizontal" >
<TextView
@ -77,67 +130,73 @@
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
<TextView
android:id="@+id/routeBluetooth"
android:visibility="invisible"
android:text="@string/button_bluetooth"
android:gravity="center"
android:paddingTop="40dp"
android:textColor="@drawable/text_incall_button_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
<ImageView
android:id="@+id/conference"
android:src="@drawable/options_start_conference"
android:background="@drawable/button_background"
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
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
<TextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:orientation="horizontal" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
<TextView
android:id="@+id/routeReceiver"
android:visibility="invisible"
android:text="@string/button_receiver"
android:gravity="center"
android:paddingTop="40dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
android:visibility="invisible"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
<ImageView
android:id="@+id/transfer"
android:visibility="invisible"
android:gravity="center"
android:paddingTop="40dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
</LinearLayout>
<ImageView
android:id="@+id/transfer"
android:src="@drawable/options_transfer_call"
android:background="@drawable/button_background"
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
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="70dp"
android:orientation="horizontal" >
<TextView
@ -151,46 +210,48 @@
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
<TextView
<TextView
android:id="@+id/routeSpeaker"
android:visibility="invisible"
android:gravity="center"
android:paddingTop="40dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
<ImageView
android:visibility="invisible"
android:gravity="center"
android:paddingTop="40dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
<ImageView
android:id="@+id/addCall"
android:visibility="invisible"
android:gravity="center"
android:paddingTop="40dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
android:src="@drawable/options_add_call"
android:background="@drawable/button_background"
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
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_height="70dp"
android:background="@color/colorF"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center">
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/video"
android:src="@drawable/camera_default"
android:background="@drawable/button_background"
android:adjustViewBounds="true"
android:scaleType="center"
android:layout_width="match_parent"
android:background="@color/button_addContact"
android:layout_height="wrap_content"/>
android:layout_height="match_parent"/>
<ProgressBar
android:id="@+id/videoInProgress"
@ -206,20 +267,21 @@
<ImageView
android:id="@+id/micro"
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_height="wrap_content"
android:background="@color/button_addContact"
android:layout_weight="1" />
<ImageView
android:id="@+id/speaker"
android:layout_gravity="center"
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_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
@ -232,16 +294,19 @@
<ImageView
android:id="@+id/options"
android:src="@drawable/options_default"
android:layout_gravity="center"
android:background="@color/button_addContact"
android:background="@drawable/button_background"
android:adjustViewBounds="true"
android:scaleType="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/main_bar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_height="70dp"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:orientation="horizontal" >
@ -258,6 +323,7 @@
<ImageView
android:id="@+id/hangUp"
android:scaleType="center"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,6 +3,17 @@
<!-- 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 -->
<string name="app_description">free SIP VOIP client</string>
@ -39,16 +50,6 @@
<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 -->
<string name="content_description_edit">Edit 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_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="delete">Delete</string>
<string name="chat">Chat</string>
<string name="call">Call</string>
<string name="add_to_contacts">Add to contacts</string>

View file

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

View file

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

View file

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

View file

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

View file

@ -89,14 +89,23 @@ public class ContactsManager {
}
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);
if(accountManager.addAccountExplicitly(newAccount, null, null)){
mAccount = newAccount;
Account[] accounts = accountManager.getAccountsByType(context.getPackageName());
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 {
mAccount = null;
Log.w("Get Account");
mAccount = accounts[0];
}
initializeContactManager(context,contentResolver);
}
public String getDisplayName(String firstName, String lastName) {
@ -524,6 +533,8 @@ public class ContactsManager {
sipContactCursor.close();
}
if(mAccount == null) return;
contactCursor = Compatibility.getContactsCursor(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.core.LinphoneProxyConfig;
import org.linphone.mediastream.Version;
import org.linphone.mediastream.Log;
import android.annotation.SuppressLint;
import android.content.ContentProviderOperation;
import android.content.Context;
@ -25,11 +26,11 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TableLayout;
import android.widget.TextView;
public class EditContactFragment extends Fragment {
private View view;
private ImageView back, edit, ok;
private ImageView addNumber, addSipAddress;
private EditText firstName, lastName;
private LayoutInflater inflater;
@ -39,6 +40,7 @@ public class EditContactFragment extends Fragment {
private List<NewOrUpdatedNumberOrAddress> numbersAndAddresses;
private ArrayList<ContentProviderOperation> ops;
private int firstSipAddressIndex = -1;
private TableLayout sipAddresses, numbers;
private String newSipOrNumberToAdd;
private ContactsManager contactsManager;
@ -181,14 +183,30 @@ public class EditContactFragment extends Fragment {
ImageView contactPicture = (ImageView) view.findViewById(R.id.contactPicture);
if (contact != null && contact.getPhotoUri() != null) {
//InputStream input = Compatibility.getContactPictureInputStream(getActivity().getContentResolver(), contact.getID());
//contactPicture.setImageBitmap(BitmapFactory.decodeStream(input));
InputStream input = Compatibility.getContactPictureInputStream(getActivity().getContentResolver(), contact.getID());
contactPicture.setImageBitmap(BitmapFactory.decodeStream(input));
} else {
//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>();
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();
numbersAndAddresses = new ArrayList<NewOrUpdatedNumberOrAddress>();
if (contact != null) {
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)
controls.addView(view);
}
}
if (newSipOrNumberToAdd != null) {
View view = displayNumberOrAddress(controls, newSipOrNumberToAdd);
if (view != null)
controls.addView(view);
if (controls.getChildCount() == 0) {
addEmptyRowToAllowNewNumberOrAddress(controls,false);
}
// Add one for phone numbers, one for SIP address
if (!getResources().getBoolean(R.bool.hide_phone_numbers_in_editor)) {
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 (!getResources().getBoolean(R.bool.hide_sip_addresses_in_editor)) {
firstSipAddressIndex = controls.getChildCount() - 2; // Update the value to always display phone numbers before SIP accounts
addEmptyRowToAllowNewNumberOrAddress(controls, true);
if (newSipOrNumberToAdd != null) {
boolean isSip = LinphoneUtils.isStrictSipAddress(newSipOrNumberToAdd) || !LinphoneUtils.isNumberAddress(newSipOrNumberToAdd);
if(isSip) {
View view = displayNumberOrAddress(controls, newSipOrNumberToAdd);
if (view != null)
controls.addView(view);
}
}
if (controls.getChildCount() == 0) {
addEmptyRowToAllowNewNumberOrAddress(controls,true);
}
return controls;
}
private View displayNumberOrAddress(final TableLayout controls, String numberOrAddress) {
@ -306,7 +360,7 @@ public class EditContactFragment extends Fragment {
@SuppressLint("InflateParams")
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);
@ -330,39 +384,32 @@ public class EditContactFragment extends Fragment {
}
});
final ImageView add = (ImageView) view.findViewById(R.id.add);
add.setOnClickListener(new OnClickListener() {
final ImageView delete = (ImageView) view.findViewById(R.id.delete);
delete.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// Add a line, and change add button for a delete button
add.setImageResource(R.drawable.list_delete);
ImageView delete = add;
delete.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
nounoa.delete();
numbersAndAddresses.remove(nounoa);
view.setVisibility(View.GONE);
}
});
if (!isSip) {
nounoa.delete();
numbersAndAddresses.remove(nounoa);
view.setVisibility(View.GONE);
}
});
/*if (!isSip) {
firstSipAddressIndex++;
addEmptyRowToAllowNewNumberOrAddress(controls, false);
} else {
addEmptyRowToAllowNewNumberOrAddress(controls, true);
}
}
});
if (isSip) {
controls.addView(view, controls.getChildCount());
} else {
if (firstSipAddressIndex != -1) {
controls.addView(view, firstSipAddressIndex);
} else {
controls.addView(view);
}
}
}*/
controls.addView(view, controls.getChildCount());
//if (firstSipAddressIndex != -1) {
// controls.addView(view, firstSipAddressIndex);
//} else {
// controls.addView(view);
//}
//}
}
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.LinphoneCallLog;
import org.linphone.core.LinphoneCallLog.CallStatus;
import org.linphone.mediastream.Log;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.app.Fragment;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
@ -44,10 +48,14 @@ import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
@ -60,9 +68,9 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
private ListView historyList;
private LayoutInflater mInflater;
private TextView noCallHistory, noMissedCallHistory;
private ImageView missedCalls, allCalls, edit, ok, deleteAll;
private ImageView missedCalls, allCalls, edit, selectAll, deselectAll, deleteAll;
private RelativeLayout allCallsSelected, missedCallsSelected;
private boolean onlyDisplayMissedCalls, isEditMode;
private boolean onlyDisplayMissedCalls, isEditMode, isSelectAll, isDeselectAll;
private List<LinphoneCallLog> mLogs;
@Override
@ -78,7 +86,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
historyList.setOnItemClickListener(this);
registerForContextMenu(historyList);
deleteAll = (ImageView) view.findViewById(R.id.deleteAll);
deleteAll = (ImageView) view.findViewById(R.id.delete);
deleteAll.setOnClickListener(this);
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.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);
onlyDisplayMissedCalls = false;
edit = (ImageView) view.findViewById(R.id.edit);
edit.setOnClickListener(this);
ok = (ImageView) view.findViewById(R.id.ok);
ok.setOnClickListener(this);
isSelectAll = false;
isDeselectAll = false;
return view;
}
public void refresh() {
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
}
private void removeNotMissedCallsFromLogs() {
if (onlyDisplayMissedCalls) {
List<LinphoneCallLog> missedCalls = new ArrayList<LinphoneCallLog>();
@ -125,12 +144,14 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
noMissedCallHistory.setVisibility(View.VISIBLE);
} else {
noCallHistory.setVisibility(View.VISIBLE);
edit.setEnabled(false);
}
historyList.setVisibility(View.GONE);
return true;
} else {
noCallHistory.setVisibility(View.GONE);
noMissedCallHistory.setVisibility(View.GONE);
edit.setEnabled(true);
historyList.setVisibility(View.VISIBLE);
return false;
}
@ -150,6 +171,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
historyList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
historyList.setAdapter(new CallHistoryAdapter(getActivity()));
}
}
@ -166,9 +188,6 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
LinphoneCallLog log = mLogs.get(info.position);
LinphoneManager.getLc().removeCallLog(log);
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
historyList.setAdapter(new CallHistoryAdapter(getActivity()));
}
return true;
}
@ -176,6 +195,51 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
public void onClick(View v) {
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) {
allCalls.setEnabled(false);
allCallsSelected.setVisibility(View.VISIBLE);
@ -191,26 +255,23 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
missedCallsSelected.setVisibility(View.VISIBLE);
missedCalls.setEnabled(false);
onlyDisplayMissedCalls = true;
}
else if (id == R.id.ok) {
edit.setVisibility(View.VISIBLE);
ok.setVisibility(View.GONE);
hideDeleteAllButton();
isEditMode = false;
}
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>();
}
}else if (id == R.id.select_all) {
deselectAll.setVisibility(View.VISIBLE);
selectAll.setVisibility(View.GONE);
int size = historyList.getAdapter().getCount();
for(int i=0; i<size; i++) {
historyList.setItemChecked(i, true);
}
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
isSelectAll = true;
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);
LinphoneManager.getLc().removeCallLog(log);
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
}
} else {
if (LinphoneActivity.isInstanciated()) {
LinphoneCallLog log = mLogs.get(position);
@ -354,7 +412,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
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;
if (convertView != null) {
view = convertView;
@ -370,7 +428,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
contact.setSelected(true); // For automated horizontal scrolling of long texts
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);
TextView separator = (TextView) view.findViewById(R.id.separator);
@ -429,7 +487,18 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem
if (isEditMode) {
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);
if(historyList.isItemChecked(position)) {
delete.setChecked(true);
} else {
delete.setChecked(false);
}
} else {
delete.setVisibility(View.GONE);
detail.setVisibility(View.VISIBLE);

View file

@ -61,6 +61,7 @@ import android.widget.Chronometer;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;
@ -77,6 +78,7 @@ public class InCallActivity extends Activity implements OnClickListener {
private Handler mControlsHandler = new Handler();
private Runnable mControls;
private ImageView switchCamera;
private RelativeLayout mActiveCallHeader;
private ImageView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference;
private TextView audioRoute, routeSpeaker, routeReceiver, routeBluetooth;
private LinearLayout routeLayout;
@ -85,7 +87,7 @@ public class InCallActivity extends Activity implements OnClickListener {
private AudioCallFragment audioCallFragment;
private VideoCallFragment videoCallFragment;
private boolean isSpeakerEnabled = false, isMicMuted = false, isTransferAllowed, isAnimationDisabled;
private ViewGroup mControlsLayout;
private LinearLayout mControlsLayout;
private Numpad numpad;
private int cameraNumber;
private Animation slideOutLeftToRight, slideInRightToLeft, slideInBottomToTop, slideInTopToBottom, slideOutBottomToTop, slideOutTopToBottom;
@ -97,7 +99,6 @@ public class InCallActivity extends Activity implements OnClickListener {
private LayoutInflater inflater;
private ViewGroup container;
private boolean isConferenceRunning = false;
private boolean showCallListInVideo = false;
private LinphoneCoreListenerBase mListener;
public static InCallActivity instance() {
@ -117,15 +118,9 @@ public class InCallActivity extends Activity implements OnClickListener {
setContentView(R.layout.incall);
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()) {
BluetoothManager.getInstance().initBluetooth();
} else {
isSpeakerEnabled = false;
}
if(!BluetoothManager.getInstance().isBluetoothHeadsetAvailable()) {
BluetoothManager.getInstance().initBluetooth();
}
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) {
video.setEnabled(false);
enabledVideoButton(false);
if(isVideoEnabled(call)){
showAudioView();
}
@ -153,7 +148,7 @@ public class InCallActivity extends Activity implements OnClickListener {
if (state == State.Resuming) {
if(LinphonePreferences.instance().isVideoEnabled()){
status.refreshStatusItems(call, isVideoEnabled(call));
//status.refreshStatusItems(call, isVideoEnabled(call));
if(call.getCurrentParamsCopy().getVideoEnabled()){
showVideoView();
}
@ -162,26 +157,24 @@ public class InCallActivity extends Activity implements OnClickListener {
if (state == State.StreamsRunning) {
switchVideo(isVideoEnabled(call));
//Check media in progress
if(LinphonePreferences.instance().isVideoEnabled() && !call.mediaInProgress()){
video.setEnabled(true);
enabledVideoButton(true);
}
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
isMicMuted = LinphoneManager.getLc().isMicMuted();
//enableAndRefreshInCallActions();
enableAndRefreshInCallActions();
if (status != null) {
videoProgress.setVisibility(View.GONE);
status.refreshStatusItems(call, isVideoEnabled(call));
//status.refreshStatusItems(call, isVideoEnabled(call));
}
}
//refreshInCallActions();
//refreshCallList(getResources());
refreshInCallActions();
refreshCallList(getResources());
if (state == State.CallUpdatedByRemote) {
// 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) {
initUI();
if (LinphoneManager.getLc().getCallsNb() > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
if (LinphoneUtils.isCallEstablished(call)) {
//enableAndRefreshInCallActions();
enableAndRefreshInCallActions();
}
}
@ -298,45 +290,63 @@ public class InCallActivity extends Activity implements OnClickListener {
inflater = LayoutInflater.from(this);
container = (ViewGroup) findViewById(R.id.topLayout);
callsList = (TableLayout) findViewById(R.id.calls);
if (!showCallListInVideo) {
callsList.setVisibility(View.GONE);
}
//TopBar
video = (ImageView) findViewById(R.id.video);
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.setOnClickListener(this);
// micro.setEnabled(false);
speaker = (ImageView) findViewById(R.id.speaker);
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.setOnClickListener(this);
options.setEnabled(false);
//pause = (ImageView) findViewById(R.id.pause);
//pause.setOnClickListener(this);
//pause.setEnabled(false);
//BottonBar
hangUp = (ImageView) findViewById(R.id.hangUp);
hangUp.setOnClickListener(this);
//conference = (ImageView) findViewById(R.id.conference);
//conference.setOnClickListener(this);
dialer = (ImageView) findViewById(R.id.dialer);
dialer.setOnClickListener(this);
dialer.setEnabled(false);
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 {
@ -356,7 +366,7 @@ public class InCallActivity extends Activity implements OnClickListener {
switchCamera = (ImageView) findViewById(R.id.switchCamera);
switchCamera.setOnClickListener(this);
mControlsLayout = (ViewGroup) findViewById(R.id.menu);
mControlsLayout = (LinearLayout) findViewById(R.id.menu);
if (!isTransferAllowed) {
addCall.setBackgroundResource(R.drawable.options_add_call);
@ -392,23 +402,40 @@ public class InCallActivity extends Activity implements OnClickListener {
private void refreshInCallActions() {
if (!LinphonePreferences.instance().isVideoEnabled()) {
video.setEnabled(false);
enabledVideoButton(false);
} else {
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
video.setBackgroundResource(R.drawable.video_on);
} else {
video.setBackgroundResource(R.drawable.video_off);
if(video.isEnabled()) {
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
video.setImageResource(R.drawable.camera_selected);
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 {
if (isSpeakerEnabled) {
speaker.setBackgroundResource(R.drawable.speaker_on);
/*routeSpeaker.setBackgroundResource(R.drawable.route_speaker_on);
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);*/
} else {
speaker.setBackgroundResource(R.drawable.speaker_off);
/*routeSpeaker.setBackgroundResource(R.drawable.route_speaker_off);
if (BluetoothManager.getInstance().isUsingBluetoothAudioRoute()) {
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);
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
}*/
}
} catch (NullPointerException npe) {
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) {
conference.setVisibility(View.VISIBLE);
pause.setVisibility(View.GONE);
//pause.setVisibility(View.GONE);
} else {
conference.setVisibility(View.GONE);
pause.setVisibility(View.VISIBLE);
/*pause.setVisibility(View.VISIBLE);
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(LinphoneManager.getLc(), Arrays.asList(State.Paused));
if (pausedCalls.size() == 1) {
pause.setBackgroundResource(R.drawable.pause_on);
} else {
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()));
if(LinphoneManager.getLc().getCurrentCall() != null && LinphonePreferences.instance().isVideoEnabled() && !LinphoneManager.getLc().getCurrentCall().mediaInProgress()) {
video.setEnabled(true);
enabledVideoButton(true);
}
micro.setEnabled(true);
if(!isTablet()){
speaker.setEnabled(true);
}
transfer.setEnabled(true);
//pause.setEnabled(true);
pause.setEnabled(true);
dialer.setEnabled(true);
conference.setEnabled(true);
refreshInCallActions();
}
@ -476,8 +495,8 @@ public class InCallActivity extends Activity implements OnClickListener {
displayVideoCallControlsIfHidden();
}
if (id == R.id.video) {
enabledOrDisabledVideo(isVideoEnabled(LinphoneManager.getLc().getCurrentCall()));
if (id == R.id.video) {
enabledOrDisabledVideo(isVideoEnabled(LinphoneManager.getLc().getCurrentCall()));
}
else if (id == R.id.micro) {
toggleMicro();
@ -490,7 +509,7 @@ public class InCallActivity extends Activity implements OnClickListener {
}
else if (id == R.id.pause) {
pauseOrResumeCall();
}
}
else if (id == R.id.hangUp) {
hangUp();
}
@ -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) {
final LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
if (call == null) {
@ -556,12 +585,10 @@ public class InCallActivity extends Activity implements OnClickListener {
}
if (isVideoEnabled) {
video.setEnabled(true);
LinphoneCallParams params = call.getCurrentParamsCopy();
params.setVideoEnabled(false);
LinphoneManager.getLc().updateCall(call, params);
} else {
video.setEnabled(false);
videoProgress.setVisibility(View.VISIBLE);
if (!call.getRemoteParams().isLowBandwidthEnabled()) {
LinphoneManager.getInstance().addVideo();
@ -608,7 +635,6 @@ public class InCallActivity extends Activity implements OnClickListener {
}
private void showAudioView() {
video.setBackgroundResource(R.drawable.video_on);
LinphoneManager.startProximitySensorForActivity(InCallActivity.this);
replaceFragmentVideoByAudio();
setCallControlsVisibleAndRemoveCallbacks();
@ -619,11 +645,8 @@ public class InCallActivity extends Activity implements OnClickListener {
Log.w("Bluetooth not available, using speaker");
LinphoneManager.getInstance().routeAudioToSpeaker();
isSpeakerEnabled = true;
speaker.setBackgroundResource(R.drawable.speaker_on);
}
video.setBackgroundResource(R.drawable.video_off);
video.setEnabled(true);
videoProgress.setVisibility(View.INVISIBLE);
refreshInCallActions();
LinphoneManager.stopProximitySensorForActivity(InCallActivity.this);
replaceFragmentAudioByVideo();
@ -632,7 +655,6 @@ public class InCallActivity extends Activity implements OnClickListener {
private void replaceFragmentVideoByAudio() {
audioCallFragment = new AudioCallFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.fragmentContainer, audioCallFragment);
try {
@ -645,7 +667,6 @@ public class InCallActivity extends Activity implements OnClickListener {
// Hiding controls to let displayVideoCallControlsIfHidden add them plus the callback
mControlsLayout.setVisibility(View.GONE);
switchCamera.setVisibility(View.INVISIBLE);
videoCallFragment = new VideoCallFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
@ -661,9 +682,9 @@ public class InCallActivity extends Activity implements OnClickListener {
isMicMuted = !isMicMuted;
lc.muteMic(isMicMuted);
if (isMicMuted) {
micro.setBackgroundResource(R.drawable.micro_off);
micro.setImageResource(R.drawable.micro_selected);
} 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;
if (isSpeakerEnabled) {
LinphoneManager.getInstance().routeAudioToSpeaker();
speaker.setBackgroundResource(R.drawable.speaker_on);
speaker.setImageResource(R.drawable.speaker_selected);
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
} else {
Log.d("Toggle speaker off, routing back to earpiece");
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;
showAudioView();
}
pause.setBackgroundResource(R.drawable.pause_on);
pause.setImageResource(R.drawable.pause_big_over_selected);
}
} else if (call != null) {
if (call.getState() == State.Paused) {
@ -711,7 +732,7 @@ public class InCallActivity extends Activity implements OnClickListener {
isVideoCallPaused = false;
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 (isAnimationDisabled) {
mControlsLayout.setVisibility(View.VISIBLE);
callsList.setVisibility(showCallListInVideo ? View.VISIBLE : View.GONE);
callsList.setVisibility(View.GONE);
mActiveCallHeader.setVisibility(View.GONE);
if (cameraNumber > 1) {
switchCamera.setVisibility(View.VISIBLE);
}
@ -757,7 +779,8 @@ public class InCallActivity extends Activity implements OnClickListener {
@Override
public void onAnimationStart(Animation animation) {
mControlsLayout.setVisibility(View.VISIBLE);
callsList.setVisibility(showCallListInVideo ? View.VISIBLE : View.GONE);
callsList.setVisibility(View.GONE);
mActiveCallHeader.setVisibility(View.GONE);
if (cameraNumber > 1) {
switchCamera.setVisibility(View.VISIBLE);
}
@ -797,10 +820,11 @@ public class InCallActivity extends Activity implements OnClickListener {
transfer.setVisibility(View.INVISIBLE);
addCall.setVisibility(View.INVISIBLE);
mControlsLayout.setVisibility(View.GONE);
callsList.setVisibility(View.GONE);
mActiveCallHeader.setVisibility(View.GONE);
// callsList.setVisibility(View.GONE);
switchCamera.setVisibility(View.INVISIBLE);
numpad.setVisibility(View.GONE);
options.setBackgroundResource(R.drawable.options);
options.setImageResource(R.drawable.options_default);
} else {
Animation animation = slideOutTopToBottom;
animation.setAnimationListener(new AnimationListener() {
@ -819,10 +843,11 @@ public class InCallActivity extends Activity implements OnClickListener {
transfer.setVisibility(View.INVISIBLE);
addCall.setVisibility(View.INVISIBLE);
mControlsLayout.setVisibility(View.GONE);
callsList.setVisibility(View.GONE);
// callsList.setVisibility(View.GONE);
mActiveCallHeader.setVisibility(View.GONE);
switchCamera.setVisibility(View.INVISIBLE);
numpad.setVisibility(View.GONE);
options.setBackgroundResource(R.drawable.options);
options.setImageResource(R.drawable.options_default);
animation.setAnimationListener(null);
}
@ -845,6 +870,7 @@ public class InCallActivity extends Activity implements OnClickListener {
mControlsLayout.setVisibility(View.VISIBLE);
callsList.setVisibility(View.VISIBLE);
mActiveCallHeader.setVisibility(View.VISIBLE);
switchCamera.setVisibility(View.INVISIBLE);
}
@ -852,8 +878,8 @@ public class InCallActivity extends Activity implements OnClickListener {
if (numpad == null || numpad.getVisibility() != View.VISIBLE) {
return;
}
dialer.setBackgroundResource(R.drawable.dialer_alt);
dialer.setImageResource(R.drawable.footer_dialer);
if (isAnimationDisabled) {
numpad.setVisibility(View.GONE);
} else {
@ -887,7 +913,7 @@ public class InCallActivity extends Activity implements OnClickListener {
if (numpad.getVisibility() == View.VISIBLE) {
hideNumpad();
} else {
dialer.setBackgroundResource(R.drawable.dialer_alt_back);
dialer.setImageResource(R.drawable.dialer_alt_back);
if (isAnimationDisabled) {
numpad.setVisibility(View.VISIBLE);
} else {
@ -1076,14 +1102,16 @@ public class InCallActivity extends Activity implements OnClickListener {
private void hideOrDisplayCallOptions() {
boolean isOrientationLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
//Hide options
if (addCall.getVisibility() == View.VISIBLE) {
options.setBackgroundResource(R.drawable.options);
options.setImageResource(R.drawable.options_default);
if (isAnimationDisabled) {
if (isTransferAllowed) {
transfer.setVisibility(View.INVISIBLE);
}
addCall.setVisibility(View.INVISIBLE);
conference.setVisibility(View.INVISIBLE);
} else {
if (isOrientationLandscape) {
hideAnimatedLandscapeCallOptions();
@ -1091,14 +1119,15 @@ public class InCallActivity extends Activity implements OnClickListener {
hideAnimatedPortraitCallOptions();
}
}
options.setSelected(false);
//Display options
} else {
if (isAnimationDisabled) {
if (isTransferAllowed) {
transfer.setVisibility(View.VISIBLE);
}
addCall.setVisibility(View.VISIBLE);
options.setBackgroundResource(R.drawable.options_alt);
conference.setVisibility(View.VISIBLE);
options.setImageResource(R.drawable.options_selected);
} else {
if (isOrientationLandscape) {
showAnimatedLandscapeCallOptions();
@ -1106,7 +1135,6 @@ public class InCallActivity extends Activity implements OnClickListener {
showAnimatedPortraitCallOptions();
}
}
options.setSelected(true);
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
}
}
@ -1178,8 +1206,10 @@ public class InCallActivity extends Activity implements OnClickListener {
lc.addListener(mListener);
}
refreshCallList(getResources());
displayActiveCall(LinphoneManager.getLc().getCurrentCall());
if (LinphoneManager.getLc().getCalls().length > 1) {
refreshCallList(getResources());
}
handleViewIntent();
}
@ -1293,8 +1323,47 @@ public class InCallActivity extends Activity implements OnClickListener {
callsList.addView(conferenceHeader);
}
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 displayCall(Resources resources, LinphoneCall call, int index) {
private void displayOtherCalls(Resources resources, LinphoneCall call, int index) {
String sipUri = call.getRemoteAddress().asStringUriOnly();
LinphoneAddress lAddress;
try {
@ -1307,24 +1376,48 @@ public class InCallActivity extends Activity implements OnClickListener {
// Control Row
LinearLayout callView = (LinearLayout) inflater.inflate(R.layout.active_call_control_row, container, false);
callView.setId(index+1);
setContactName(callView, lAddress, sipUri, resources);
displayCallStatusIconAndReturnCallPaused(callView, call);
setRowBackground(callView, index);
TextView contact = (TextView) callView.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());
}
//displayCallStatusIconAndReturnCallPaused(callView, call);
registerCallDurationTimer(callView, call);
callsList.addView(callView);
// Image Row
LinearLayout imageView = (LinearLayout) inflater.inflate(R.layout.active_call_image_row, container, false);
Contact contact = ContactsManager.getInstance().findContactWithAddress(imageView.getContext().getContentResolver(), lAddress);
if(contact != null) {
//Contact contact = ContactsManager.getInstance().findContactWithAddress(imageView.getContext().getContentResolver(), lAddress);
/*if(contact != null) {
displayOrHideContactPicture(imageView, contact.getPhotoUri(), contact.getThumbnailUri(), false);
} else {
displayOrHideContactPicture(imageView, null, null, false);
}
callsList.addView(imageView);
callsList.addView(imageView);*/
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();
callView.setTag(imageView);
callView.setOnClickListener(new OnClickListener() {
// callView.setTag(imageView);
/* callView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (v.getTag() != null) {
@ -1336,7 +1429,7 @@ public class InCallActivity extends Activity implements OnClickListener {
callsList.invalidate();
}
}
});
});*/
}
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);*/
}
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) {
int callDuration = call.getDuration();
if (callDuration == 0 && call.getState() != State.StreamsRunning) {
@ -1418,33 +1499,41 @@ public class InCallActivity extends Activity implements OnClickListener {
}
public void refreshCallList(Resources resources) {
if (callsList == null) {
if(LinphoneManager.getLc().getCalls().length == 1) {
displayActiveCall(LinphoneManager.getLc().getCalls()[0]);
return;
}
callsList.removeAllViews();
int index = 0;
if (LinphoneManager.getLc().getCallsNb() == 0) {
goBackToDialer();
return;
}
isConferenceRunning = LinphoneManager.getLc().getConferenceSize() > 1;
if (isConferenceRunning) {
displayConferenceHeader();
index++;
}
for (LinphoneCall call : LinphoneManager.getLc().getCalls()) {
displayCall(resources, call, index);
index++;
}
if(LinphoneManager.getLc().getCurrentCall() == null){
showAudioView();
video.setEnabled(false);
}
callsList.invalidate();
if(callsList != null) {
callsList.removeAllViews();
int index = 0;
if (LinphoneManager.getLc().getCallsNb() == 0) {
goBackToDialer();
return;
}
isConferenceRunning = LinphoneManager.getLc().getConferenceSize() > 1;
if (isConferenceRunning) {
displayConferenceHeader();
index++;
}
for (LinphoneCall call : LinphoneManager.getLc().getCalls()) {
if (call != LinphoneManager.getLc().getCurrentCall()) {
displayOtherCalls(resources, call, index);
index++;
} else {
displayActiveCall(call);
}
}
if (LinphoneManager.getLc().getCurrentCall() == null) {
showAudioView();
video.setEnabled(false);
}
callsList.invalidate();
}
}
}

View file

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

View file

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

View file

@ -27,18 +27,19 @@ import org.linphone.core.LinphoneCallParams;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCoreListenerBase;
import org.linphone.mediastream.Log;
import org.linphone.ui.LinphoneSliders;
import org.linphone.ui.LinphoneSliders.LinphoneSliderTriggered;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import de.timroes.axmlrpc.Call;
/**
* Activity displayed when a call comes in.
* It should bypass the screen lock mechanism.
@ -49,11 +50,11 @@ public class OutgoingCallActivity extends Activity {
private static OutgoingCallActivity instance;
private TextView mNameView;
private TextView mNumberView;
private ImageView mPictureView;
private TextView mNameView, mNumberView;
private ImageView mPictureView, micro, speaker, decline;
private LinphoneCall mCall;
private LinphoneCoreListenerBase mListener;
private boolean isMicMuted, isSpeakerEnabled;
public static OutgoingCallActivity instance() {
return instance;
@ -66,27 +67,85 @@ public class OutgoingCallActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
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);
mNumberView = (TextView) findViewById(R.id.incoming_caller_number);
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
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
getWindow().addFlags(flags);
// "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(){
@Override
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) {
finish();
}
if (state == State.StreamsRunning) {
// The following should not be needed except some devices need it (e.g. Galaxy S).
LinphoneManager.getLc().enableSpeaker(LinphoneManager.getLc().isSpeakerEnabled());
if (call == mCall && State.Connected == state || State.StreamsRunning == state){
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) {
List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc());
for (LinphoneCall call : calls) {
if (State.IncomingReceived == call.getState()) {
if (State.OutgoingInit == call.getState() || State.OutgoingProgress == call.getState()) {
mCall = call;
break;
}
@ -126,12 +185,9 @@ public class OutgoingCallActivity extends Activity {
// contact != null ? contact.getThumbnailUri() : null, R.drawable.unknown_small);
// To be done after findUriPictureOfContactAndSetDisplayName called
mNameView.setText(contact != null ? contact.getName() : "");
if (getResources().getBoolean(R.bool.only_display_username_if_unknown)) {
mNumberView.setText(address.getUserName());
} else {
mNumberView.setText(address.asStringUriOnly());
}
mNameView.setText(contact != null ? contact.getName() : address.getUserName());
mNumberView.setText(address.asStringUriOnly());
}
@Override
@ -158,35 +214,8 @@ public class OutgoingCallActivity extends Activity {
return super.onKeyDown(keyCode, event);
}
private void decline() {
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.List;
import org.linphone.assistant.AssistantActivity;
import org.linphone.core.LinphoneAddress;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCore.AdaptiveRateAlgorithm;
@ -35,7 +36,6 @@ import org.linphone.core.PayloadType;
import org.linphone.mediastream.Log;
import org.linphone.mediastream.Version;
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
import org.linphone.setup.SetupActivity;
import org.linphone.ui.LedPreference;
import org.linphone.ui.PreferencesListFragment;
@ -124,7 +124,7 @@ public class SettingsFragment extends PreferencesListFragment {
findPreference(getString(R.string.setup_key)).setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
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);
return true;
}

View file

@ -87,10 +87,10 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
if (message.isOutgoing()) {
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 {
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());