Change call and chat view

This commit is contained in:
Erwan Croze 2018-06-15 11:09:01 +02:00
parent b15fc21de7
commit 73abcd78ac
15 changed files with 479 additions and 423 deletions

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/colorL" />
<item android:state_enabled="false"
android:drawable="@color/colorL" />
<item android:drawable="@color/colorN"
android:state_pressed="true"/>
<item android:drawable="@color/colorN"
android:state_enabled="false"/>
<item
android:drawable="@color/colorH"/>
android:drawable="@color/colorN"/>
</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/colorI" />
<item android:state_enabled="false"
android:drawable="@color/colorD" />
<item android:drawable="@color/colorB"
android:state_pressed="true"/>
<item android:drawable="@color/colorB"
android:state_enabled="false"/>
<item
android:drawable="@color/colorD" />
android:drawable="@color/colorB"/>
</selector>

View file

@ -24,15 +24,15 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="40dp"
android:layout_above="@+id/menu">
android:layout_above="@+id/menu"
android:layout_marginTop="30dp">
<LinearLayout
android:id="@+id/conference_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_alignParentTop="true"
android:layout_gravity="top"
android:orientation="vertical"
android:visibility="gone">
</LinearLayout>
@ -43,34 +43,48 @@
android:layout_height="wrap_content"
android:visibility="visible">
<ImageView
android:id="@+id/pause"
android:layout_width="80dp"
<RelativeLayout
android:id="@+id/action_menu"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:contentDescription="@string/content_description_pause"
android:paddingRight="20dp"
android:src="@drawable/pause_big_default"/>
android:layout_marginTop="10dp">
<ImageView
android:id="@+id/switchCamera"
android:src="@drawable/switch_camera"
android:layout_width="80dp"
android:layout_height="80dp"
android:padding="10dp"
android:contentDescription="@string/content_description_switch_camera"
android:visibility="invisible"
android:layout_below="@+id/active_call_info"
android:layout_alignParentLeft="true"/>
<ImageView
android:id="@+id/switchCamera"
android:layout_width="70dp"
android:layout_height="60dp"
android:layout_alignParentLeft="true"
android:contentDescription="@string/content_description_switch_camera"
android:src="@drawable/switch_camera"
android:visibility="invisible"/>
<ImageView
android:id="@+id/encryption"
android:layout_width="70dp"
android:layout_height="60dp"
android:layout_toLeftOf="@+id/pause"
android:layout_toStartOf="@+id/pause"
android:contentDescription="@string/content_description_encryption"
android:src="@drawable/security_button1_over"
android:visibility="visible"/>
<ImageView
android:id="@+id/pause"
android:layout_width="70dp"
android:layout_height="60dp"
android:layout_alignParentRight="true"
android:contentDescription="@string/content_description_pause"
android:src="@drawable/pause_big_default"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/avatar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/action_menu"
android:layout_margin="5dp"
android:paddingTop="10dp"
android:layout_below="@id/pause"
android:gravity="center_horizontal">
android:gravity="center_horizontal"
android:paddingTop="10dp">
<ImageView
android:id="@+id/contact_picture"
@ -93,51 +107,52 @@
<LinearLayout
android:id="@+id/remote_pause"
android:background="@color/colorC"
android:alpha="0.9"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorN"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:src="@drawable/waiting_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
android:layout_width="115dp"
android:layout_height="115dp"
android:layout_gravity="center"
android:src="@drawable/waiting_time"/>
<TextView
android:text="@string/call_paused_by_remote"
style="@style/font16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
android:layout_gravity="center"
android:text="@string/call_paused_by_remote"/>
</LinearLayout>
<LinearLayout
android:id="@+id/active_call_info"
android:background="@color/colorH"
android:alpha="0.8"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_below="@id/avatar_layout"
android:layout_centerHorizontal="true"
android:orientation="vertical">
android:background="@color/colorH"
android:orientation="vertical"
>
<TextView
android:id="@+id/current_contact_name"
style="@style/font5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:layout_gravity="center"
android:gravity="center"
android:layout_gravity="center"/>
android:background="@color/colorH"
android:paddingTop="5dp"/>
<Chronometer
android:id="@+id/current_call_timer"
style="@style/font2"
android:background="@color/colorH"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
@ -146,36 +161,36 @@
<LinearLayout
android:id="@+id/calls_list"
android:background="@color/colorH"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:background="@color/colorH"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/no_current_call"
android:background="@color/colorC"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_above="@id/calls_list"
android:background="@color/colorN"
android:gravity="center_vertical"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:src="@drawable/waiting_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
android:layout_width="115dp"
android:layout_height="115dp"
android:layout_gravity="center"
android:src="@drawable/waiting_time"/>
<TextView
android:text="@string/no_current_call"
style="@style/font16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
android:layout_gravity="center"
android:text="@string/no_current_call"/>
</LinearLayout>
</RelativeLayout>
@ -189,7 +204,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_height="50dp"
android:background=" #595959 "
android:orientation="horizontal">
@ -201,9 +216,9 @@
<ImageView
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:contentDescription="@string/content_description_switch_video"
android:padding="20dp"
android:padding="15dp"
android:src="@drawable/camera_button"/>
<ProgressBar
@ -223,7 +238,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:contentDescription="@string/content_description_toggle_micro"
android:padding="10dp"
android:padding="7dp"
android:src="@drawable/micro_default"/>
<ImageView
@ -232,8 +247,9 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:contentDescription="@string/content_description_toggle_speaker"
android:padding="15dp"
android:src="@drawable/speaker_default"/>
android:padding="10dp"
android:src="@drawable/speaker_default"
/>
<ImageView
android:id="@+id/audio_route"
@ -241,8 +257,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:contentDescription="@string/content_description_audio_route"
android:padding="15dp"
android:src="@drawable/routes_default"
android:src="@drawable/routes"
android:visibility="gone"/>
<ImageView
@ -251,7 +266,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:contentDescription="@string/content_description_call_options"
android:padding="15dp"
android:padding="10dp"
android:src="@drawable/options_default"/>
</LinearLayout>
@ -316,128 +331,128 @@
<LinearLayout
android:id="@+id/menu_bottom"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_height="50dp"
android:layout_above="@id/menu"
android:orientation="horizontal" >
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
android:layout_weight="0.5"
android:visibility="invisible"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
android:layout_weight="0.5"
android:visibility="invisible"/>
<ImageView
android:id="@+id/route_bluetooth"
android:src="@drawable/route_bluetooth"
android:background="@drawable/button_background"
android:contentDescription="@string/content_description_bluetooth"
android:padding="15dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
android:layout_weight="0.5"
android:background="#aeaeae"
android:contentDescription="@string/content_description_bluetooth"
android:padding="15dp"
android:src="@drawable/route_bluetooth"
android:visibility="invisible"/>
<ImageView
android:id="@+id/add_call"
android:src="@drawable/options_add_call_button"
android:background="@drawable/button_background"
android:contentDescription="@string/content_description_add_call"
android:padding="15dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
android:layout_weight="0.5"
android:background="#aeaeae"
android:contentDescription="@string/content_description_add_call"
android:padding="15dp"
android:src="@drawable/options_add_call_button"
android:visibility="invisible"/>
</LinearLayout>
<LinearLayout
android:id="@+id/menu_middle"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_height="50dp"
android:layout_above="@id/menu_bottom"
android:orientation="horizontal" >
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
android:layout_weight="0.5"
android:visibility="invisible"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
android:layout_weight="0.5"
android:visibility="invisible"/>
<ImageView
android:id="@+id/route_earpiece"
android:src="@drawable/route_earpiece"
android:background="@drawable/button_background"
android:contentDescription="@string/content_description_earpiece"
android:padding="15dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
android:layout_weight="0.5"
android:background="#aeaeae"
android:contentDescription="@string/content_description_earpiece"
android:padding="15dp"
android:src="@drawable/route_earpiece"
android:visibility="invisible"/>
<ImageView
android:id="@+id/transfer"
android:src="@drawable/options_transfer_call_button"
android:background="@drawable/button_background"
android:contentDescription="@string/content_description_transfer"
android:padding="15dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
android:layout_weight="0.5"
android:background="#aeaeae"
android:contentDescription="@string/content_description_transfer"
android:padding="15dp"
android:src="@drawable/options_transfer_call_button"
android:visibility="invisible"/>
</LinearLayout>
<LinearLayout
android:layout_above="@id/menu_middle"
android:layout_width="match_parent"
android:layout_height="60dp"
android:orientation="horizontal" >
android:layout_height="50dp"
android:layout_above="@id/menu_middle"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
android:layout_weight="0.5"
android:visibility="invisible"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0.5"/>
android:layout_weight="0.5"
android:visibility="invisible"/>
<ImageView
android:id="@+id/route_speaker"
android:src="@drawable/route_speaker"
android:background="@drawable/button_background"
android:contentDescription="@string/content_description_toggle_speaker"
android:visibility="invisible"
android:padding="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
android:layout_weight="0.5"
android:background="#aeaeae"
android:contentDescription="@string/content_description_toggle_speaker"
android:padding="15dp"
android:src="@drawable/route_speaker"
android:visibility="invisible"/>
<ImageView
android:id="@+id/conference"
android:src="@drawable/options_start_conference_button"
android:background="@drawable/button_background"
android:contentDescription="@string/content_description_conference"
android:visibility="invisible"
android:padding="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
android:layout_weight="0.5"
android:background="#aeaeae"
android:contentDescription="@string/content_description_conference"
android:padding="10dp"
android:src="@drawable/options_start_conference_button"
android:visibility="invisible"/>
</LinearLayout>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/topLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -15,17 +16,30 @@
<RelativeLayout
android:id="@+id/top_bar"
android:background="@color/colorF"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="@id/status">
android:layout_below="@id/status"
android:layout_gravity="center"
android:background="@color/colorH"
android:gravity="center">
<ImageView
android:id="@+id/imageView2"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_centerInParent="false"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:src="@drawable/call_incoming"/>
<TextView
android:text="@string/incoming_call"
style="@style/font1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/imageView2"
android:gravity="center"
android:text="@string/incoming_call"/>
</RelativeLayout>
@ -42,7 +56,7 @@
style="@style/font5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_below="@+id/avatar_layout"
android:layout_centerHorizontal="true"
android:gravity="center_vertical|center_horizontal"
android:paddingTop="5dp"/>
@ -61,24 +75,26 @@
android:id="@+id/avatar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/contact_number"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:gravity="center">
android:gravity="center"
android:paddingTop="10dp">
<ImageView
android:id="@+id/contact_picture"
android:src="@drawable/avatar"
android:contentDescription="@string/content_description_contact_picture"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"/>
<ImageView
android:src="@drawable/avatar_mask_border"
android:layout_width="200dp"
android:layout_width="225dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:layout_alignParentTop="true"/>
android:contentDescription="@string/content_description_contact_picture"
android:src="@drawable/avatar_big_secure1"/>
<ImageView
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:src="@drawable/avatar_mask_border"
android:visibility="gone"/>
</RelativeLayout>
@ -98,7 +114,6 @@
android:layout_weight="1"
android:background="@drawable/hangup"
android:contentDescription="@string/content_description_decline"
android:padding="12dp"
android:src="@drawable/call_hangup"/>
<LinearLayout
@ -139,7 +154,6 @@
android:layout_weight="1"
android:background="@drawable/call"
android:contentDescription="@string/content_description_accept"
android:padding="12dp"
android:src="@drawable/call_audio_start"/>
<LinearLayout
@ -147,7 +161,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/colorD"
android:background="@color/colorB"
android:orientation="horizontal"
android:paddingBottom="15dp"
android:paddingLeft="15dp"

View file

@ -15,19 +15,30 @@
<RelativeLayout
android:id="@+id/top_bar"
android:background="@color/colorF"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="@id/status">
android:layout_below="@id/status"
android:layout_gravity="center"
android:background="@color/colorH"
android:gravity="center">
<ImageView
android:id="@+id/imageView2"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_centerInParent="false"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:src="@drawable/call_outgoing"/>
<TextView
android:text="@string/outgoing_call"
style="@style/font1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="10dp"
android:gravity="center"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/imageView2"
android:gravity="center"
android:text="@string/outgoing_call"/>
</RelativeLayout>
<RelativeLayout
@ -43,7 +54,7 @@
style="@style/font5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_below="@id/avatar_layout"
android:layout_centerHorizontal="true"
android:paddingTop="5dp"
android:gravity="center_vertical|center_horizontal" />
@ -62,24 +73,25 @@
android:id="@+id/avatar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/contact_number"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:gravity="center">
<ImageView
android:id="@+id/contact_picture"
android:src="@drawable/avatar"
android:contentDescription="@string/content_description_contact_picture"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"/>
<ImageView
android:src="@drawable/avatar_mask_border"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:layout_alignParentTop="true"/>
android:contentDescription="@string/content_description_contact_picture"
android:src="@drawable/avatar_big_secure1"/>
<ImageView
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:src="@drawable/avatar_mask_border"
android:visibility="gone"/>
</RelativeLayout>
@ -105,7 +117,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_background"
android:background=" #595959 "
android:contentDescription="@string/content_description_toggle_micro"
android:padding="10dp"
android:src="@drawable/micro_default"/>
@ -115,9 +127,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_background"
android:background=" #595959 "
android:contentDescription="@string/content_description_toggle_speaker"
android:padding="15dp"
android:padding="10dp"
android:src="@drawable/speaker_default"/>
<ImageView
@ -127,7 +139,6 @@
android:layout_weight="0.7"
android:background="@drawable/hangup"
android:contentDescription="@string/content_description_hang_up"
android:padding="12dp"
android:src="@drawable/call_hangup"/>
</LinearLayout>

View file

@ -7,14 +7,14 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorG"
android:background="@color/colorH"
android:orientation="vertical">
<LinearLayout
android:id="@+id/top_bar"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/colorF"
android:background="@color/colorH"
android:orientation="horizontal">
<ImageView
@ -25,13 +25,13 @@
android:layout_weight="0.2"
android:background="@drawable/toolbar_button"
android:contentDescription="@string/content_description_back"
android:padding="18dp"
android:src="@drawable/back"/>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2">
android:layout_weight="0.2"
android:visibility="invisible">
<ImageView
android:id="@+id/all_contacts"
@ -53,7 +53,8 @@
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2">
android:layout_weight="0.2"
android:visibility="invisible">
<ImageView
android:id="@+id/linphone_contacts"
@ -82,7 +83,6 @@
android:layout_weight="0.2"
android:background="@drawable/toolbar_button"
android:contentDescription="@string/content_description_valid"
android:padding="18dp"
android:src="@drawable/chat_room_creation_next"/>
</LinearLayout>
@ -96,32 +96,30 @@
<RelativeLayout
android:id="@+id/layoutSearchField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="33dp"
android:layout_margin="10dp"
android:background="@color/colorG">
android:background="#f5f5f5">
<EditText
android:id="@+id/searchField"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/resizable_textfield"
android:layout_height="34dp"
android:layout_gravity="center"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/clearSearchField"
android:background=" #f3f3f3 "
android:contentDescription="@string/content_description_search_contact"
android:gravity="center"
android:hint="@string/chat_room_creation_filter_hint"
android:inputType="textPersonName"
android:paddingRight="5dp"
android:textColor="@android:color/black"
android:textCursorDrawable="@null"/>
<ImageView
android:id="@+id/clearSearchField"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:src="@drawable/clean_field"/>
android:src="@drawable/clean_field_default"/>
</RelativeLayout>
@ -130,7 +128,7 @@
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="5dp"
android:background="@drawable/resizable_textfield"
android:background="@color/colorG"
android:fadeScrollbars="false"
android:lines="1">
@ -155,7 +153,7 @@
android:id="@+id/contactsList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@color/colorE"
android:divider="@color/colorM"
android:dividerHeight="1dp"
android:fastScrollAlwaysVisible="true"
android:fastScrollEnabled="true"/>

View file

@ -11,39 +11,46 @@
<LinearLayout
android:id="@+id/top_bar"
android:orientation="horizontal"
android:background="@color/colorF"
android:layout_width="match_parent"
android:layout_height="60dp">
android:layout_height="60dp"
android:background="@color/colorH"
android:orientation="horizontal">
<ImageView
android:id="@+id/back"
android:src="@drawable/back"
android:background="@drawable/toolbar_button"
android:contentDescription="@string/content_description_back"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:padding="18dp"/>
android:background="@drawable/toolbar_button"
android:contentDescription="@string/content_description_back"
android:src="@drawable/back"
/>
<TextView
android:text="@string/imdn_info"
style="@style/font6"
android:gravity="center"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.6"
android:padding="15dp"/>
android:gravity="center"
android:padding="15dp"
android:text="@string/imdn_info"/>
<ImageView
android:visibility="invisible"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:padding="15dp"/>
android:padding="15dp"
android:visibility="invisible"/>
</LinearLayout>
<View
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@id/top_bar"
android:background="@color/colorE"/>
</RelativeLayout>
<LinearLayout
@ -73,14 +80,14 @@
android:id="@+id/read_layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/colorH"
android:gravity="center"
android:background="@color/colorG">
android:orientation="horizontal">
<TextView
style="@style/font27"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/font27"
android:text="@string/displayed"/>
<ImageView
@ -101,14 +108,14 @@
android:id="@+id/delivered_layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/colorH"
android:gravity="center"
android:background="@color/colorG">
android:orientation="horizontal">
<TextView
style="@style/font28"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/font28"
android:text="@string/delivered"/>
<ImageView
@ -129,22 +136,22 @@
android:id="@+id/sent_layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/colorH"
android:gravity="center"
android:background="@color/colorG">
android:orientation="horizontal">
<TextView
style="@style/font28"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/font28"
android:text="@string/sent"/>
<ImageView
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:src="@drawable/message_delivered"/>
android:src="@drawable/message_delivered"
android:visibility="invisible"/>
</LinearLayout>
@ -158,14 +165,14 @@
android:id="@+id/undelivered_layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/colorH"
android:gravity="center"
android:background="@color/colorG">
android:orientation="horizontal">
<TextView
style="@style/font29"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/font29"
android:text="@string/error"/>
<ImageView

View file

@ -93,7 +93,7 @@
android:layout_gravity="center"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/call"
android:background="@color/colorH"
android:scaleType="center"
android:src="@drawable/call_alt_start_over"/>

View file

@ -15,22 +15,23 @@
<ImageView
android:id="@+id/contact_picture"
android:src="@drawable/avatar"
android:contentDescription="@string/content_description_contact_picture"
android:layout_width="35dp"
android:layout_height="35dp"
android:adjustViewBounds="true"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"/>
android:layout_marginLeft="5dp"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_contact_picture"
android:src="@drawable/avatar_big_secure1"/>
<ImageView
android:id="@+id/mask"
android:src="@drawable/avatar_mask"
android:layout_width="35dp"
android:layout_height="35dp"
android:adjustViewBounds="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"/>
android:layout_marginLeft="5dp"
android:adjustViewBounds="true"
android:src="@drawable/avatar_mask"
android:visibility="gone"/>
</RelativeLayout>
@ -53,6 +54,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:gravity="top|left"
android:lines="1"/>
@ -64,7 +66,8 @@
android:layout_centerVertical="true"
android:ellipsize="end"
android:gravity="bottom|left"
android:lines="1"/>
android:lines="1"
android:visibility="gone"/>
</LinearLayout>
@ -72,12 +75,13 @@
android:id="@id/contact_linphone"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:layout_gravity="right"
android:layout_toLeftOf="@+id/contact_is_select"
android:layout_toStartOf="@+id/contact_is_select"
android:paddingRight="10dp"
android:src="@drawable/linphone_user"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/contact_is_select"
android:layout_toStartOf="@+id/contact_is_select"/>
android:visibility="gone"/>
<ImageView
android:id="@+id/contact_is_select"

View file

@ -31,7 +31,6 @@
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"
android:contentDescription="@string/content_description_call_quality"
android:padding="10dp"
android:src="@drawable/call_quality_indicator_0"
android:visibility="invisible"/>
@ -57,12 +56,13 @@
<ImageView
android:id="@+id/status_led"
android:layout_width="30dp"
android:layout_width="45dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:gravity="end"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:gravity="end"
android:paddingRight="15dp"
android:src="@drawable/led_disconnected"/>
<ImageView
@ -84,17 +84,5 @@
android:paddingLeft="5dp"
android:paddingRight="10dp"
android:visibility="gone"/>
<ImageView
android:id="@+id/encryption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_encryption"
android:padding="5dp"
android:src="@drawable/security_ko"
android:visibility="gone"/>
</RelativeLayout>
</RelativeLayout>

View file

@ -26,6 +26,7 @@ import java.util.HashMap;
import java.util.Map;
import org.linphone.activities.LinphoneActivity;
import org.linphone.call.CallActivity;
import org.linphone.compatibility.Compatibility;
import org.linphone.contacts.ContactsManager;
import org.linphone.contacts.LinphoneContact;
@ -353,7 +354,8 @@ public final class LinphoneService extends Service {
}
mNotif = Compatibility.createNotification(this, mNotificationTitle, "", R.drawable.linphone_notification_icon, R.mipmap.ic_launcher, bm, mNotifContentIntent, true,notifcationsPriority);
LinphoneManager.createAndStart(LinphoneService.this);
if (!LinphoneManager.isInstanciated())
LinphoneManager.createAndStart(LinphoneService.this);
instance = this; // instance is ready once linphone manager has been created
incomingReceivedActivityName = LinphonePreferences.instance().getActivityToLaunchOnIncomingReceived();
@ -378,9 +380,9 @@ public final class LinphoneService extends Service {
if (state == State.End || state == State.Released || state == State.Error) {
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc() != null && LinphoneManager.getLc().getCallsNb() == 0) {
if (LinphoneActivity.isInstanciated() && LinphoneActivity.instance().getStatusFragment() != null) {
if (CallActivity.isInstanciated()) {
removeSasNotification();
LinphoneActivity.instance().getStatusFragment().setisZrtpAsk(false);
CallActivity.instance().setisZrtpAsk(false);
}
}
destroyOverlay();

View file

@ -24,6 +24,7 @@ import android.app.Activity;
import android.app.Dialog;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.app.KeyguardManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@ -111,13 +112,13 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
private TextView missedChats;
private RelativeLayout mActiveCallHeader, sideMenuContent, avatar_layout;
private ImageView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference, conferenceStatus, contactPicture;
private ImageView audioRoute, routeSpeaker, routeEarpiece, routeBluetooth, menu, chat;
private ImageView audioRoute, routeSpeaker, routeEarpiece, routeBluetooth, menu, chat, encryption;
private LinearLayout mNoCurrentCall, callInfo, mCallPaused;
private ProgressBar videoProgress;
private StatusFragment status;
private CallAudioFragment audioCallFragment;
private CallVideoFragment videoCallFragment;
private boolean isSpeakerEnabled = false, isMicMuted = false, isTransferAllowed, isVideoAsk;
private boolean isSpeakerEnabled = false, isMicMuted = false, isTransferAllowed, isVideoAsk, isZrtpAsk;
private LinearLayout mControlsLayout;
private Numpad numpad;
private int cameraNumber;
@ -126,6 +127,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
private Dialog dialog = null;
private static long TimeRemind = 0;
private HeadsetReceiver headsetReceiver;
private Dialog ZRTPdialog = null;
private LinearLayout callsList, conferenceList;
private LayoutInflater inflater;
@ -185,10 +187,8 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
@Override
public void onCallStateChanged(Core lc, final Call call, Call.State state, String message) {
if (LinphoneManager.getLc().getCallsNb() == 0) {
if (status != null) {
LinphoneService.instance().removeSasNotification();
status.setisZrtpAsk(false);
}
LinphoneService.instance().removeSasNotification();
setisZrtpAsk(false);
finish();
return;
}
@ -205,7 +205,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
}
} else if (state == State.Resuming) {
if(LinphonePreferences.instance().isVideoEnabled()){
status.refreshStatusItems(call, isVideoEnabled(call));
refreshStatusItems(call, isVideoEnabled(call));
if(call.getCurrentParams().videoEnabled()){
showVideoView();
}
@ -217,10 +217,8 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
switchVideo(isVideoEnabled(call));
enableAndRefreshInCallActions();
if (status != null) {
videoProgress.setVisibility(View.GONE);
status.refreshStatusItems(call, isVideoEnabled(call));
}
videoProgress.setVisibility(View.GONE);
refreshStatusItems(call, isVideoEnabled(call));
} else if (state == State.UpdatedByRemote) {
// If the correspondent proposes video while audio call
boolean videoEnabled = LinphonePreferences.instance().isVideoEnabled();
@ -251,12 +249,10 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
@Override
public void onCallEncryptionChanged(Core lc, final Call call, boolean encrypted, String authenticationToken) {
if (status != null) {
if(call.getCurrentParams().getMediaEncryption().equals(MediaEncryption.ZRTP) && !call.getAuthenticationTokenVerified()){
status.showZRTPDialog(call);
if(call.getCurrentParams().getMediaEncryption().equals(MediaEncryption.ZRTP) && !call.getAuthenticationTokenVerified()){
showZRTPDialog(call);
}
status.refreshStatusItems(call, call.getCurrentParams().videoEnabled());
}
refreshStatusItems(call, call.getCurrentParams().videoEnabled());
}
};
@ -281,8 +277,8 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
TimeRemind = savedInstanceState.getLong("TimeRemind");
createTimerForDialog(TimeRemind);
}
if (status != null && savedInstanceState.getBoolean("AskingZrtp")) {
status.setisZrtpAsk(savedInstanceState.getBoolean("AskingZrtp"));
if (savedInstanceState.getBoolean("AskingZrtp")) {
setisZrtpAsk(savedInstanceState.getBoolean("AskingZrtp"));
}
refreshInCallActions();
return;
@ -341,7 +337,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
outState.putBoolean("VideoCallPaused", isVideoCallPaused);
outState.putBoolean("AskingVideo", isVideoAsk);
outState.putLong("TimeRemind", TimeRemind);
if (status != null) outState.putBoolean("AskingZrtp", status.getisZrtpAsk());
if (status != null) outState.putBoolean("AskingZrtp", getisZrtpAsk());
if (dialog != null) dialog.dismiss();
super.onSaveInstanceState(outState);
}
@ -435,6 +431,9 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
mControlsLayout = (LinearLayout) findViewById(R.id.menu);
encryption = (ImageView) findViewById(R.id.encryption);
encryption.setVisibility(View.VISIBLE);
if (!isTransferAllowed) {
addCall.setBackgroundResource(R.drawable.options_add_call);
}
@ -540,10 +539,10 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
} else {
if(video.isEnabled()) {
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
video.setImageResource(R.drawable.camera_selected);
video.setImageResource(R.drawable.camera_default);
videoProgress.setVisibility(View.INVISIBLE);
} else {
video.setImageResource(R.drawable.camera_button);
video.setImageResource(R.drawable.camera_disabled);
}
} else {
video.setImageResource(R.drawable.camera_button);
@ -554,7 +553,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
}
if (isSpeakerEnabled) {
speaker.setImageResource(R.drawable.speaker_selected);
speaker.setImageResource(R.drawable.route_speaker_default);
} else {
speaker.setImageResource(R.drawable.speaker_default);
}
@ -569,21 +568,28 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
}
try {
routeSpeaker.setImageResource(R.drawable.route_speaker);
routeSpeaker.setImageResource(R.drawable.speaker_default);
if (BluetoothManager.getInstance().isUsingBluetoothAudioRoute()) {
isSpeakerEnabled = false; // We need this if isSpeakerEnabled wasn't set correctly
routeEarpiece.setImageResource(R.drawable.route_earpiece);
routeBluetooth.setImageResource(R.drawable.route_bluetooth_selected);
//routeEarpiece.setImageResource(R.drawable.route_earpiece);
//routeBluetooth.setImageResource(R.drawable.route_bluetooth_selected);
routeEarpiece.setAlpha(0.5f);
routeBluetooth.setAlpha(1f);
return;
} else {
routeEarpiece.setImageResource(R.drawable.route_earpiece_selected);
routeBluetooth.setImageResource(R.drawable.route_bluetooth);
//routeEarpiece.setImageResource(R.drawable.route_earpiece_selected);
//routeBluetooth.setImageResource(R.drawable.route_bluetooth);
routeEarpiece.setAlpha(1f);
routeBluetooth.setAlpha(0.5f);
}
if (isSpeakerEnabled) {
routeSpeaker.setImageResource(R.drawable.route_speaker_selected);
routeEarpiece.setImageResource(R.drawable.route_earpiece);
routeBluetooth.setImageResource(R.drawable.route_bluetooth);
routeSpeaker.setImageResource(R.drawable.route_speaker);
//routeSpeaker.setImageResource(R.drawable.route_speaker_selected);
//routeEarpiece.setImageResource(R.drawable.route_earpiece);
//routeBluetooth.setImageResource(R.drawable.route_bluetooth);
routeEarpiece.setAlpha(0.5f);
routeBluetooth.setAlpha(0.5f);
}
} catch (NullPointerException npe) {
Log.e("Bluetooth: Audio routes menu disabled on tablets for now (4)");
@ -702,26 +708,35 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
else if (id == R.id.route_bluetooth) {
if (BluetoothManager.getInstance().routeAudioToBluetooth()) {
isSpeakerEnabled = false;
routeBluetooth.setImageResource(R.drawable.route_bluetooth_selected);
/*routeBluetooth.setImageResource(R.drawable.route_bluetooth_selected);
routeSpeaker.setImageResource(R.drawable.route_speaker);
routeEarpiece.setImageResource(R.drawable.route_earpiece);
routeEarpiece.setImageResource(R.drawable.route_earpiece);*/
routeEarpiece.setAlpha(0.5f);
routeBluetooth.setAlpha(1f);
routeSpeaker.setImageResource(R.drawable.speaker_default);
}
hideOrDisplayAudioRoutes();
}
else if (id == R.id.route_earpiece) {
LinphoneManager.getInstance().routeAudioToReceiver();
isSpeakerEnabled = false;
routeBluetooth.setImageResource(R.drawable.route_bluetooth);
/*routeBluetooth.setImageResource(R.drawable.route_bluetooth);
routeSpeaker.setImageResource(R.drawable.route_speaker);
routeEarpiece.setImageResource(R.drawable.route_earpiece_selected);
routeEarpiece.setImageResource(R.drawable.route_earpiece_selected);*/
routeEarpiece.setAlpha(1f);
routeBluetooth.setAlpha(0.5f);
routeSpeaker.setImageResource(R.drawable.speaker_default);
hideOrDisplayAudioRoutes();
}
else if (id == R.id.route_speaker) {
LinphoneManager.getInstance().routeAudioToSpeaker();
isSpeakerEnabled = true;
routeBluetooth.setImageResource(R.drawable.route_bluetooth);
/*routeBluetooth.setImageResource(R.drawable.route_bluetooth);
routeSpeaker.setImageResource(R.drawable.route_speaker_selected);
routeEarpiece.setImageResource(R.drawable.route_earpiece);
routeEarpiece.setImageResource(R.drawable.route_earpiece);*/
routeEarpiece.setAlpha(0.5f);
routeBluetooth.setAlpha(0.5f);
routeSpeaker.setImageResource(R.drawable.route_speaker_default);
hideOrDisplayAudioRoutes();
}
@ -919,7 +934,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
}
if (isSpeakerEnabled) {
LinphoneManager.getInstance().routeAudioToSpeaker();
speaker.setImageResource(R.drawable.speaker_selected);
speaker.setImageResource(R.drawable.route_speaker_default);
LinphoneManager.getInstance().enableSpeaker(isSpeakerEnabled);
} else {
Log.d("Toggle speaker off, routing back to earpiece");
@ -1006,7 +1021,8 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
conference.setVisibility(View.INVISIBLE);
displayVideoCall(false);
numpad.setVisibility(View.GONE);
options.setImageResource(R.drawable.options_default);
//options.setImageResource(R.drawable.options_default);
options.setImageAlpha(125);
}
}, SECONDS_BEFORE_HIDING_CONTROLS);
}
@ -1056,7 +1072,8 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
private void hideOrDisplayCallOptions() {
//Hide options
if (addCall.getVisibility() == View.VISIBLE) {
options.setImageResource(R.drawable.options_default);
//options.setImageResource(R.drawable.options_disabled);
options.setImageAlpha(125);
if (isTransferAllowed) {
transfer.setVisibility(View.INVISIBLE);
}
@ -1068,7 +1085,8 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
}
addCall.setVisibility(View.VISIBLE);
conference.setVisibility(View.VISIBLE);
options.setImageResource(R.drawable.options_selected);
//options.setImageResource(R.drawable.options_default);
options.setImageAlpha(255);
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
}
}
@ -1208,8 +1226,12 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
refreshIncallUi();
handleViewIntent();
if (status != null && status.getisZrtpAsk() && lc != null) {
status.showZRTPDialog(lc.getCurrentCall());
if (lc != null) {
refreshStatusItems(lc.getCurrentCall(), lc.getCurrentCall().getCurrentParams().videoEnabled());
}
if (lc != null) {
showZRTPDialog(lc.getCurrentCall());
}
if (!isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
@ -1220,6 +1242,125 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
}
}
public void showZRTPDialog(final Call call) {
if(ZRTPdialog == null || !ZRTPdialog.isShowing()) {
String token = call.getAuthenticationToken();
if (token == null){
Log.w("Can't display ZRTP popup, no token !");
return;
}
if (token.length()<4){
Log.w("Can't display ZRTP popup, token is invalid ("+token+")");
return;
}
ZRTPdialog = new Dialog(this);
ZRTPdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
ZRTPdialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
ZRTPdialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
ZRTPdialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Drawable d = new ColorDrawable(ContextCompat.getColor(this, R.color.colorC));
d.setAlpha(200);
ZRTPdialog.setContentView(R.layout.dialog);
ZRTPdialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
ZRTPdialog.getWindow().setBackgroundDrawable(d);
String zrtpToRead, zrtpToListen;
isZrtpAsk = true;
if (call.getDir().equals(Call.Dir.Incoming)) {
zrtpToRead = token.substring(0,2);
zrtpToListen = token.substring(2);
} else {
zrtpToListen = token.substring(0,2);
zrtpToRead = token.substring(2);
}
// Obiane specific dev : display sas notif only if screen locked
KeyguardManager myKM = (KeyguardManager) this.getSystemService(Context.KEYGUARD_SERVICE);
if( myKM.inKeyguardRestrictedInputMode()) {
//Screen is locked
LinphoneService.instance().displaySasNotification(call.getAuthenticationToken());
}
TextView customText = (TextView) ZRTPdialog.findViewById(R.id.customText);
String newText = getString(R.string.zrtp_dialog1).replace("%s", zrtpToRead)
+ getString(R.string.zrtp_dialog2).replace("%s", zrtpToListen);
customText.setText(newText);
Button delete = (Button) ZRTPdialog.findViewById(R.id.delete_button);
delete.setText(R.string.accept);
Button cancel = (Button) ZRTPdialog.findViewById(R.id.cancel);
cancel.setText(R.string.deny);
delete.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
call.setAuthenticationTokenVerified(true);
if (encryption != null) {
encryption.setImageResource(R.drawable.security_button_default);
}
isZrtpAsk = false;
ZRTPdialog.dismiss();
LinphoneService.instance().removeSasNotification();
}
});
cancel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (call != null) {
call.setAuthenticationTokenVerified(false);
if (encryption != null) {
encryption.setImageResource(R.drawable.security_button1_over);
}
}
isZrtpAsk = false;
ZRTPdialog.dismiss();
LinphoneService.instance().removeSasNotification();
}
});
ZRTPdialog.show();
}
}
public boolean getisZrtpAsk() {
return isZrtpAsk;
}
public void setisZrtpAsk(boolean bool) {
isZrtpAsk = bool;
}
public void refreshStatusItems(final Call call, boolean isVideoEnabled) {
if (call != null) {
MediaEncryption mediaEncryption = call.getCurrentParams().getMediaEncryption();
if (isVideoEnabled) {
//background.setVisibility(View.GONE);
} else {
//background.setVisibility(View.VISIBLE);
}
if (mediaEncryption == MediaEncryption.SRTP || (mediaEncryption == MediaEncryption.ZRTP && call.getAuthenticationTokenVerified()) || mediaEncryption == MediaEncryption.DTLS) {
encryption.setImageResource(R.drawable.security_button_default);
} else if (mediaEncryption == MediaEncryption.ZRTP && !call.getAuthenticationTokenVerified()) {
encryption.setImageResource(R.drawable.security_button1_default);
} else {
encryption.setImageResource(R.drawable.security_button1_over);
}
if (mediaEncryption == MediaEncryption.ZRTP) {
encryption.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showZRTPDialog(call);
}
});
} else {
encryption.setOnClickListener(null);
}
}
}
private void handleViewIntent() {
Intent intent = getIntent();
if(intent != null && intent.getAction() == "android.intent.action.VIEW") {

View file

@ -117,7 +117,7 @@ public class ChatCreationFragment extends Fragment implements View.OnClickListen
mNextButton = view.findViewById(R.id.next);
mNextButton.setOnClickListener(this);
mNextButton.setEnabled(false);
//mNextButton.setEnabled(false);
mSearchLayout = view.findViewById(R.id.layoutSearchField);
mClearSearchFieldButton = view.findViewById(R.id.clearSearchField);
@ -234,7 +234,8 @@ public class ChatCreationFragment extends Fragment implements View.OnClickListen
private void displayChatCreation() {
mNextButton.setVisibility(View.VISIBLE);
mNextButton.setEnabled(mContactsSelected.size() > 0);
//mNextButton.setEnabled(mContactsSelected.size() > 0);
updateListSelected();
mContactsList.setVisibility(View.VISIBLE);
mSearchLayout.setVisibility(View.VISIBLE);
@ -268,9 +269,13 @@ public class ChatCreationFragment extends Fragment implements View.OnClickListen
private void updateListSelected() {
if (mContactsSelected.size() > 0) {
mContactsSelectLayout.invalidate();
mNextButton.setEnabled(true);
//mNextButton.setEnabled(true);
mNextButton.setImageAlpha(255);
mNextButton.setClickable(true);
} else {
mNextButton.setEnabled(false);
//mNextButton.setEnabled(false);
mNextButton.setImageAlpha(100);
mNextButton.setClickable(false);
}
}

View file

@ -251,13 +251,14 @@ public class SearchContactsListAdapter extends BaseAdapter {
holder.name.setVisibility(View.GONE);
}
holder.address.setText(a);
if (holder.linphoneContact != null) {
// Obiane
/*if (holder.linphoneContact != null) {
if (contact.isLinphoneContact() && c != null && c.isInFriendList() && address != null) {
holder.linphoneContact.setVisibility(View.VISIBLE);
} else {
holder.linphoneContact.setVisibility(View.GONE);
}
}
}*/
if (holder.isSelect != null) {
if (contactIsSelected(contact)) {
holder.isSelect.setVisibility(View.VISIBLE);

View file

@ -58,11 +58,10 @@ import static org.linphone.LinphoneUtils.getTextFromRegistrationStatement;
public class StatusFragment extends Fragment {
private Handler refreshHandler = new Handler();
private TextView statusText, voicemailCount;
private ImageView statusLed, callQuality, encryption, menu, voicemail;
private ImageView statusLed, callQuality, menu, voicemail;
private Runnable mCallQualityUpdater;
private boolean isInCall, isAttached = false, isZrtpAsk;
private boolean isInCall, isAttached = false;
private CoreListenerStub mListener;
private Dialog ZRTPdialog = null;
private int mDisplayedQuality = -1;
@Override
@ -73,7 +72,6 @@ public class StatusFragment extends Fragment {
statusText = (TextView) view.findViewById(R.id.status_text);
statusLed = (ImageView) view.findViewById(R.id.status_led);
callQuality = (ImageView) view.findViewById(R.id.call_quality);
encryption = (ImageView) view.findViewById(R.id.encryption);
menu = (ImageView) view.findViewById(R.id.side_menu_button);
voicemail = (ImageView) view.findViewById(R.id.voicemail);
voicemailCount = (TextView) view.findViewById(R.id.voicemail_count);
@ -302,10 +300,8 @@ public class StatusFragment extends Fragment {
if (isInCall && (call != null || lc.getConferenceSize() > 1 || lc.getCallsNb() > 0)) {
if (call != null) {
startCallQuality();
refreshStatusItems(call, call.getCurrentParams().videoEnabled());
}
menu.setVisibility(View.INVISIBLE);
encryption.setVisibility(View.VISIBLE);
callQuality.setVisibility(View.VISIBLE);
// We are obviously connected
@ -319,7 +315,6 @@ public class StatusFragment extends Fragment {
}
} else {
statusText.setVisibility(View.VISIBLE);
encryption.setVisibility(View.GONE);
}
}
@ -337,129 +332,4 @@ public class StatusFragment extends Fragment {
mCallQualityUpdater = null;
}
}
public void refreshStatusItems(final Call call, boolean isVideoEnabled) {
if (call != null) {
voicemailCount.setVisibility(View.GONE);
MediaEncryption mediaEncryption = call.getCurrentParams().getMediaEncryption();
if (isVideoEnabled) {
//background.setVisibility(View.GONE);
} else {
//background.setVisibility(View.VISIBLE);
}
if (mediaEncryption == MediaEncryption.SRTP || (mediaEncryption == MediaEncryption.ZRTP && call.getAuthenticationTokenVerified()) || mediaEncryption == MediaEncryption.DTLS) {
encryption.setImageResource(R.drawable.security_ok);
} else if (mediaEncryption == MediaEncryption.ZRTP && !call.getAuthenticationTokenVerified()) {
encryption.setImageResource(R.drawable.security_pending);
} else {
encryption.setImageResource(R.drawable.security_ko);
}
if (mediaEncryption == MediaEncryption.ZRTP) {
encryption.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showZRTPDialog(call);
}
});
} else {
encryption.setOnClickListener(null);
}
}
}
public void showZRTPDialog(final Call call) {
if (getActivity() == null) {
Log.w("Can't display ZRTP popup, no Activity");
return;
}
if(ZRTPdialog == null || !ZRTPdialog.isShowing()) {
String token = call.getAuthenticationToken();
if (token == null){
Log.w("Can't display ZRTP popup, no token !");
return;
}
if (token.length()<4){
Log.w("Can't display ZRTP popup, token is invalid ("+token+")");
return;
}
ZRTPdialog = new Dialog(getActivity());
ZRTPdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
ZRTPdialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
ZRTPdialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
ZRTPdialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Drawable d = new ColorDrawable(ContextCompat.getColor(getActivity(), R.color.colorC));
d.setAlpha(200);
ZRTPdialog.setContentView(R.layout.dialog);
ZRTPdialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
ZRTPdialog.getWindow().setBackgroundDrawable(d);
String zrtpToRead, zrtpToListen;
isZrtpAsk = true;
if (call.getDir().equals(Call.Dir.Incoming)) {
zrtpToRead = token.substring(0,2);
zrtpToListen = token.substring(2);
} else {
zrtpToListen = token.substring(0,2);
zrtpToRead = token.substring(2);
}
// Obiane specific dev : display sas notif only if screen locked
KeyguardManager myKM = (KeyguardManager) getActivity().getSystemService(Context.KEYGUARD_SERVICE);
if( myKM.inKeyguardRestrictedInputMode()) {
//Screen is locked
LinphoneService.instance().displaySasNotification(call.getAuthenticationToken());
}
TextView customText = (TextView) ZRTPdialog.findViewById(R.id.customText);
String newText = getString(R.string.zrtp_dialog1).replace("%s", zrtpToRead)
+ getString(R.string.zrtp_dialog2).replace("%s", zrtpToListen);
customText.setText(newText);
Button delete = (Button) ZRTPdialog.findViewById(R.id.delete_button);
delete.setText(R.string.accept);
Button cancel = (Button) ZRTPdialog.findViewById(R.id.cancel);
cancel.setText(R.string.deny);
delete.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
call.setAuthenticationTokenVerified(true);
if (encryption != null) {
encryption.setImageResource(R.drawable.security_ok);
}
isZrtpAsk = false;
ZRTPdialog.dismiss();
LinphoneService.instance().removeSasNotification();
}
});
cancel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (call != null) {
call.setAuthenticationTokenVerified(false);
if (encryption != null) {
encryption.setImageResource(R.drawable.security_ko);
}
}
isZrtpAsk = false;
ZRTPdialog.dismiss();
LinphoneService.instance().removeSasNotification();
}
});
ZRTPdialog.show();
}
}
public boolean getisZrtpAsk() {
return isZrtpAsk;
}
public void setisZrtpAsk(boolean bool) {
isZrtpAsk = bool;
}
}