Rework incall view

This commit is contained in:
Margaux Clerc 2015-10-26 19:48:37 +01:00
parent a992ba8dab
commit 3aae0ef4c3
9 changed files with 908 additions and 605 deletions

View file

@ -14,419 +14,447 @@
<android.support.v4.widget.DrawerLayout
android:id="@+id/call_stats"
android:id="@+id/side_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/status">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/status">
<LinearLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/menu">
<LinearLayout
android:id="@+id/conferenceCalls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:visibility="gone">
</LinearLayout>
<RelativeLayout
android:id="@+id/activeCallHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible">
<LinearLayout
android:id="@+id/call_header_description"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_centerHorizontal="true"
android:orientation="vertical"
android:background="@color/colorH"
android:alpha="0.8">
<TextView
android:id="@+id/contactNameOrNumber"
style="@style/font5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:layout_alignParentTop="true"
android:layout_gravity="center"/>
<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_gravity="center"/>
</LinearLayout>
<ImageView
android:id="@+id/pause"
android:contentDescription="@string/content_description_pause"
android:layout_width="80dp"
android:layout_height="80dp"
android:padding="10dp"
android:src="@drawable/pause_big_default"
android:layout_below="@+id/call_header_description"
android:layout_alignParentRight="true"/>
<RelativeLayout
android:id="@+id/avatar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/call_header_description"
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="match_parent"
android:adjustViewBounds="true"/>
<ImageView
android:id="@+id/mask"
android:src="@drawable/avatar_mask_border"
android:contentDescription="@string/content_description_contact_picture"
android:layout_width="200dp"
android:layout_height="match_parent"
android:adjustViewBounds="true"/>
</RelativeLayout>
<ImageView
android:id="@+id/switchCamera"
android:layout_width="80dp"
android:layout_height="80dp"
android:padding="10dp"
android:contentDescription="@string/content_description_switch_camera"
android:visibility="invisible"
android:src="@drawable/switch_camera"
android:layout_below="@+id/call_header_description"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/>
</RelativeLayout>
<LinearLayout
android:id="@+id/calls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/activeCallHeader"
android:layout_alignParentBottom="true"
android:background="@color/colorH"
android:layout_gravity="bottom"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/noCurrentCall"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical"
android:background="@color/colorC"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/waiting_time"/>
<TextView
android:text="No current call"
style="@style/font16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</LinearLayout>
</FrameLayout>
<org.linphone.ui.Numpad
android:contentDescription="@string/content_description_numpad"
android:id="@+id/numpad"
android:background="@color/colorF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_margin="10dp"
android:layout_above="@id/menu"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
<LinearLayout
android:id="@+id/menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@color/colorF"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/button_background"
android:layout_weight="1">
<ImageView
android:id="@+id/video"
android:src="@drawable/camera_default"
android:padding="25dp"
android:background="@drawable/button_background"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ProgressBar
android:id="@+id/videoInProgress"
style="?android:attr/progressBarStyle"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
<ImageView
android:id="@+id/micro"
android:src="@drawable/micro_default"
android:background="@drawable/button_background"
android:padding="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:id="@+id/speaker"
android:src="@drawable/speaker_default"
android:background="@drawable/button_background"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="@+id/audioRoute"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:id="@+id/options"
android:src="@drawable/options_default"
android:background="@drawable/button_background"
android:padding="20dp"
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="70dp"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:orientation="horizontal" >
<ImageView
android:id="@+id/dialer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="20dp"
android:background="@color/colorC"
android:contentDescription="@string/content_description_contacts"
android:src="@drawable/footer_dialer" />
<ImageView
android:id="@+id/hangUp"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp"
android:layout_weight="0.5"
android:background="@color/colorD"
android:contentDescription="@string/content_description_contacts"
android:src="@drawable/call_hangup" />
<ImageView
android:id="@+id/chat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="20dp"
android:background="@color/colorC"
android:contentDescription="@string/content_description_contacts"
android:src="@drawable/footer_chat" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/menu_bottom"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_above="@id/menu"
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"/>
<ImageView
android:id="@+id/routeBluetooth"
android:src="@drawable/route_bluetooth"
android:background="@drawable/button_background"
android:padding="20dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
<ImageView
android:id="@+id/addCall"
android:src="@drawable/options_add_call"
android:background="@drawable/button_background"
android:padding="20dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
</LinearLayout>
<LinearLayout
android:id="@+id/menu_middle"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_above="@id/menu_bottom"
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"/>
<ImageView
android:id="@+id/routeEarpiece"
android:src="@drawable/route_earpiece"
android:background="@drawable/button_background"
android:padding="20dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
<ImageView
android:id="@+id/transfer"
android:src="@drawable/options_transfer_call"
android:background="@drawable/button_background"
android:padding="20dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
</LinearLayout>
<LinearLayout
android:layout_above="@id/menu_middle"
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"/>
<ImageView
android:id="@+id/routeSpeaker"
android:src="@drawable/route_speaker"
android:background="@drawable/button_background"
android:visibility="invisible"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
<ImageView
android:id="@+id/conference"
android:src="@drawable/options_start_conference"
android:background="@drawable/button_background"
android:visibility="invisible"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/status">
<LinearLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/menu">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<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:orientation="vertical"
android:visibility="gone">
</LinearLayout>
<RelativeLayout
android:id="@+id/active_call"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible">
<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_centerHorizontal="true"
android:orientation="vertical">
<TextView
android:id="@+id/contact_name"
style="@style/font5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:layout_alignParentTop="true"
android:layout_gravity="center"/>
<Chronometer
android:id="@+id/call_timer"
style="@style/font2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/contact_name"
android:layout_gravity="center"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/avatar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/active_call_info"
android:layout_margin="5dp"
android:paddingTop="10dp"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/contact_picture"
android:src="@drawable/avatar"
android:contentDescription="@string/content_description_contact_picture"
android:layout_width="200dp"
android:layout_height="200dp"
android:adjustViewBounds="true"/>
<ImageView
android:id="@+id/mask"
android:src="@drawable/avatar_mask_border"
android:contentDescription="@string/content_description_contact_picture"
android:layout_width="200dp"
android:layout_height="200dp"
android:adjustViewBounds="true"/>
</RelativeLayout>
<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: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"/>
<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"/>
</LinearLayout>
<ImageView
android:id="@+id/pause"
android:src="@drawable/pause_big_default"
android:contentDescription="@string/content_description_pause"
android:layout_width="80dp"
android:layout_height="80dp"
android:padding="10dp"
android:layout_below="@+id/active_call_info"
android:layout_alignParentRight="true"/>
<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"/>
</RelativeLayout>
<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: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:gravity="center_vertical"
android:visibility="gone">
<ImageView
android:src="@drawable/waiting_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
<TextView
android:text="@string/no_current_call"
style="@style/font16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</LinearLayout>
</RelativeLayout>
</FrameLayout>
<org.linphone.ui.Numpad
android:id="@+id/numpad"
android:background="@color/colorF"
android:contentDescription="@string/content_description_numpad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_margin="10dp"
android:layout_above="@id/menu"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
<LinearLayout
android:id="@+id/menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<LinearLayout
android:background="@color/colorF"
android:layout_width="match_parent"
android:layout_height="70dp"
android:orientation="horizontal">
<RelativeLayout
android:background="@drawable/button_background"
android:layout_width="match_parent"
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:padding="25dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ProgressBar
android:id="@+id/video_in_progress"
style="?android:attr/progressBarStyle"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
<ImageView
android:id="@+id/micro"
android:src="@drawable/micro_default"
android:background="@drawable/button_background"
android:padding="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:id="@+id/speaker"
android:src="@drawable/speaker_default"
android:background="@drawable/button_background"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="@+id/audio_route"
android:src="@drawable/routes_default"
android:background="@drawable/button_background"
android:visibility="gone"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="@+id/options"
android:src="@drawable/options_default"
android:background="@drawable/button_background"
android:padding="20dp"
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="70dp"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:orientation="horizontal" >
<ImageView
android:id="@+id/dialer"
android:src="@drawable/footer_dialer"
android:background="@color/colorC"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="20dp" />
<ImageView
android:id="@+id/hang_up"
android:src="@drawable/call_hangup"
android:background="@drawable/hangup"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:padding="15dp"/>
<ImageView
android:id="@+id/chat"
android:src="@drawable/footer_chat"
android:background="@color/colorC"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="20dp"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/menu_bottom"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_above="@id/menu"
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"/>
<ImageView
android:id="@+id/route_bluetooth"
android:src="@drawable/route_bluetooth"
android:background="@drawable/button_background"
android:padding="20dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
<ImageView
android:id="@+id/add_call"
android:src="@drawable/options_add_call"
android:background="@drawable/button_background"
android:padding="20dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
</LinearLayout>
<LinearLayout
android:id="@+id/menu_middle"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_above="@id/menu_bottom"
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"/>
<ImageView
android:id="@+id/route_earpiece"
android:src="@drawable/route_earpiece"
android:background="@drawable/button_background"
android:padding="20dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
<ImageView
android:id="@+id/transfer"
android:src="@drawable/options_transfer_call"
android:background="@drawable/button_background"
android:padding="20dp"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
</LinearLayout>
<LinearLayout
android:layout_above="@id/menu_middle"
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"/>
<ImageView
android:id="@+id/route_speaker"
android:src="@drawable/route_speaker"
android:background="@drawable/button_background"
android:visibility="invisible"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
<ImageView
android:id="@+id/conference"
android:src="@drawable/options_start_conference"
android:background="@drawable/button_background"
android:visibility="invisible"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/side_menu_content"
android:layout_gravity="left"
android:background="@color/colorH">
android:background="@color/colorH"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="left">
<include layout="@layout/incall_stats" android:id="@+id/incall_stats"/>
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>

View file

@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/colorA"
android:alpha="0.5"
android:layout_height="60dp"
android:layout_width="match_parent"
android:layout_margin="2dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:background="@color/colorA"
android:alpha="0.5"
android:padding="2dp">
android:padding="5dp">
<ImageView
android:id="@+id/contactPicture"
android:id="@+id/contact_picture"
android:src="@drawable/avatar"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/avatar" />
android:layout_height="40dp"/>
<TextView
android:id="@+id/contactNameOrNumber"
android:id="@+id/contact_name"
style="@style/font14"
android:singleLine="true"
android:layout_width="0dip"
@ -27,7 +27,7 @@
android:paddingRight="10dp"/>
<Chronometer
android:id="@+id/callTimer"
android:id="@+id/call_timer"
style="@style/font16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -36,14 +36,11 @@
android:gravity="center_vertical|right"/>
<ImageView
android:id="@+id/callStatus"
android:contentDescription="@string/content_description_pause"
android:id="@+id/call_pause"
android:src="@drawable/pause_small_over_selected"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center_vertical"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
/>
android:contentDescription="@string/content_description_pause"
android:layout_width="40dp"
android:layout_height="40dp"
android:gravity="center_vertical"/>
</LinearLayout>

View file

@ -34,9 +34,9 @@
android:id="@+id/contact_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/menu"
android:layout_below="@id/top_bar"
android:paddingTop="10dp">
android:paddingTop="10dp"
android:layout_above="@+id/menu">
<TextView
android:id="@+id/contact_name"
@ -74,7 +74,7 @@
android:adjustViewBounds="true"/>
<ImageView
android:src="@drawable/avatar_mask"
android:src="@drawable/avatar_mask_border"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
@ -86,7 +86,6 @@
<LinearLayout
android:id="@+id/menu"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_alignParentBottom="true"
@ -102,6 +101,37 @@
android:layout_weight="1"
android:padding="15dp"/>
<LinearLayout
android:id="@+id/acceptUnlock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:orientation="horizontal"
android:background="@color/colorA"
android:paddingLeft="15dp"
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:layout_gravity="bottom">
<ImageView
android:src="@drawable/arrow_accept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView
android:src="@drawable/arrow_accept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.6"/>
<ImageView
android:id="@+id/acceptArrow"
android:src="@drawable/arrow_accept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.2"/>
</LinearLayout>
<ImageView
android:id="@+id/accept"
android:src="@drawable/call_audio_start"
@ -111,6 +141,39 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="15dp"/>
<LinearLayout
android:id="@+id/declineUnlock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:orientation="horizontal"
android:background="@color/colorD"
android:paddingLeft="15dp"
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:layout_gravity="bottom">
<ImageView
android:id="@+id/arrow_hangup"
android:src="@drawable/arrow_hangup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.2"/>
<ImageView
android:src="@drawable/arrow_hangup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.6"/>
<ImageView
android:src="@drawable/arrow_hangup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>

View file

@ -74,7 +74,7 @@
android:adjustViewBounds="true"/>
<ImageView
android:src="@drawable/avatar_mask"
android:src="@drawable/avatar_mask_border"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"

View file

@ -7,7 +7,7 @@
<string name="username">Username</string>
<string name="display_name">Display name</string>
<string name="password">Password</string>
<string name="confirm_password">Confirm password</string>
<string name="confirm_password">Password confirmation</string>
<string name="domain">Domain</string>
<string name="remote_provisioning_url">Provisioning url</string>
<string name="email">Email</string>
@ -17,6 +17,8 @@
<string name="cancel">Cancel</string>
<string name="accept">Accept</string>
<string name="about">About</string>
<string name="deny">Deny</string>
<string name="no_account">No account configured</string>
<!-- splashscreen -->
<string name="app_description">free SIP VOIP client</string>
@ -44,26 +46,47 @@
<string name="address_bar_hint">Enter a number or an address</string>
<!-- 2. History -->
<string name="no_call_history">No call in your history</string>
<string name="no_missed_call_history">No missed call in your history</string>
<string name="delete_history_log">Do you want to delete selected log?</string>
<!-- 3. Contacts -->
<string name="no_contact">No contact in your address book.</string>
<string name="no_sip_contact">No SIP contact in your address book.</string>
<string name="delete_contacts">Do you want to delete selected contact?</string>
<string name="delete_contact">Do you want to delete selected this contact?</string>
<!-- 4. Chat -->
<string name="no_chat_history">No conversations</string>
<string name="delete_conversation">Do you want to delete selected conversation?</string>
<string name="delete_message">Do you want to delete selected message?</string>
<!-- Side Menu -->
<string-array name="side_menu_item">
<item>Settings</item>
<item>Assistant</item>
<item>Settings</item>
<item>About</item>
</string-array>
<string name="quit">Quit</string>
<!-- Call -->
<string name="incoming_call">incoming call</string>
<string name="outgoing_call">outgoing call</string>
<string name="call_update_video">Call update requested\nYour correspondent would like to add video to the current call.</string>
<string name="add_video_dialog">Your correspondent would like to turn on the video</string>
<string name="no_current_call">No active call</string>
<string name="call_paused_by_remote">Your correspondent paused the call</string>
<string name="zrtp_dialog">ZRTP token is %s\nYou should only accept if you have the same token as your correspondent</string>
<!-- Content description -->
<string name="content_description_toggle_micro">Toggle micro</string>
<string name="content_description_toggle_speaker">Toggle speaker</string>
<string name="content_description_decline">Decline</string>
<string name="content_description_hang_up">Hang up</string>
<string name="content_description_accept">Accept</string>
<string name="content_description_edit">Edit button</string>
<string name="content_description_valid">Valid button</string>
<string name="content_description_validate">Valid button</string>
@ -90,11 +113,9 @@
<string name="content_description_all_calls">All calls</string>
<string name="content_description_missed_calls">Missed calls</string>
<string name="content_description_switch_video">Switch video</string>
<string name="content_description_toggle_speaker">Toggle speaker</string>
<string name="content_description_toggle_micro">Toggle micro</string>
<string name="content_description_add_call">Add call</string>
<string name="content_description_pause">Pause</string>
<string name="content_description_hang_up">Hang up</string>
<string name="content_description_numpad">Numpad</string>
<string name="content_description_settings">Settings button</string>
<string name="content_description_dialer">Dialer</string>
@ -339,11 +360,6 @@
<string name="conference">Conference</string>
<string name="draft">Draft</string>
<string name="new_fast_chat">Enter a SIP address to chat with…</string>
<string name="no_call_history">No call in your history.</string>
<string name="no_missed_call_history">No missed call in your history.</string>
<string name="no_contact">No contact in your address book.</string>
<string name="no_sip_contact">No SIP contact in your address book.</string>
<string name="no_chat_history">No chat history.</string>
<string name="call_stats_audio">Audio</string>
<string name="call_stats_video">Video</string>
<string name="call_stats_codec">Codec:</string>
@ -412,8 +428,6 @@
<string name="pref_image_sharing_server_title">Sharing server</string>
<string name="pref_remote_provisioning_title">Remote provisioning</string>
<string name="delete_contact">Delete</string>
<string name="delete_contact_dialog">This contact will be deleted.</string>
<string name="sip_address">SIP address</string>
<string name="phone_number">Phone number</string>
<string name="contact_first_name">First name</string>
@ -460,9 +474,6 @@
<string name="setup_remote_provisioning_login_hint">The configuration you downloaded doesn\'t include your account. Please fill it in.</string>
<string name="setup_confirm_username">Your username will be %s.\r\n\r\nIt may differ from what you entered to match some requirements.\r\nDo you accept ?</string>
<string name="zrtp_accept">Accept</string>
<string name="zrtp_deny">Deny</string>
<string name="zrtp_help">You should only accept if you have the same code (see above) as your correspondent</string>
<string name="remote_composing">Remote is writing...</string>
<string name="unread_messages">%i unread messages</string>
<string name="remote_provisioning_failure">Failed to download or apply remote provisioning profile...</string>

View file

@ -73,7 +73,7 @@ import android.widget.Toast;
* @author Sylvain Berfini
*/
public class CallActivity extends Activity implements OnClickListener {
private final static int SECONDS_BEFORE_HIDING_CONTROLS = 10000;
private final static int SECONDS_BEFORE_HIDING_CONTROLS = 5000;
private final static int SECONDS_BEFORE_DENYING_CALL_UPDATE = 30000;
private static CallActivity instance;
@ -84,7 +84,7 @@ public class CallActivity extends Activity implements OnClickListener {
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;
private LinearLayout routeLayout, mNoCurrentCall, callInfo;
private LinearLayout mNoCurrentCall, callInfo, mCallPaused;
private ProgressBar videoProgress;
private StatusFragment status;
private CallAudioFragment audioCallFragment;
@ -143,8 +143,9 @@ public class CallActivity extends Activity implements OnClickListener {
}
if (state == State.Paused || state == State.PausedByRemote || state == State.Pausing) {
if(LinphoneManager.getLc().getCurrentCall() != null)
if(LinphoneManager.getLc().getCurrentCall() != null) {
enabledVideoButton(false);
}
if(isVideoEnabled(call)){
showAudioView();
}
@ -157,7 +158,16 @@ public class CallActivity extends Activity implements OnClickListener {
showVideoView();
}
}
enabledVideoButton(true);
if(LinphoneManager.getLc().getCurrentCall() != null) {
enabledVideoButton(true);
}
}
if (state == State.Connected) {
if(call.getCurrentParamsCopy().getMediaEncryption().equals(LinphoneCore.MediaEncryption.ZRTP) && !call.isAuthenticationTokenVerified()){
//TODO AFFICHER DIALOG ZRTP
status.showZRTPDialog(call);
}
}
if (state == State.StreamsRunning) {
@ -165,13 +175,14 @@ public class CallActivity extends Activity implements OnClickListener {
//Check media in progress
if(LinphonePreferences.instance().isVideoEnabled() && !call.mediaInProgress()){
enabledVideoButton(true);
enabledPauseButton(true);
}
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
isMicMuted = LinphoneManager.getLc().isMicMuted();
enableAndRefreshInCallActions();
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
isMicMuted = LinphoneManager.getLc().isMicMuted();
if (status != null) {
videoProgress.setVisibility(View.GONE);
status.refreshStatusItems(call, isVideoEnabled(call));
@ -239,7 +250,7 @@ public class CallActivity extends Activity implements OnClickListener {
isSpeakerEnabled = savedInstanceState.getBoolean("Speaker");
isMicMuted = savedInstanceState.getBoolean("Mic");
isVideoCallPaused = savedInstanceState.getBoolean("VideoCallPaused");
//refreshInCallActions();
refreshInCallActions();
return;
}
@ -247,15 +258,11 @@ public class CallActivity extends Activity implements OnClickListener {
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
callFragment = new CallVideoFragment();
videoCallFragment = (CallVideoFragment) callFragment;
displayVideoCall(false);
isSpeakerEnabled = true;
if (cameraNumber > 1) {
switchCamera.setVisibility(View.VISIBLE);
}
} else {
callFragment = new CallAudioFragment();
audioCallFragment = (CallAudioFragment) callFragment;
switchCamera.setVisibility(View.INVISIBLE);
}
if(BluetoothManager.getInstance().isBluetoothHeadsetAvailable()){
@ -291,15 +298,15 @@ public class CallActivity extends Activity implements OnClickListener {
private void initUI() {
inflater = LayoutInflater.from(this);
container = (ViewGroup) findViewById(R.id.topLayout);
callsList = (LinearLayout) findViewById(R.id.calls);
conferenceList = (LinearLayout) findViewById(R.id.conferenceCalls);
callsList = (LinearLayout) findViewById(R.id.calls_list);
conferenceList = (LinearLayout) findViewById(R.id.conference_list);
//TopBar
video = (ImageView) findViewById(R.id.video);
video.setOnClickListener(this);
enabledVideoButton(false);
videoProgress = (ProgressBar) findViewById(R.id.videoInProgress);
videoProgress = (ProgressBar) findViewById(R.id.video_in_progress);
videoProgress.setVisibility(View.GONE);
micro = (ImageView) findViewById(R.id.micro);
@ -313,7 +320,7 @@ public class CallActivity extends Activity implements OnClickListener {
options.setEnabled(false);
//BottonBar
hangUp = (ImageView) findViewById(R.id.hangUp);
hangUp = (ImageView) findViewById(R.id.hang_up);
hangUp.setOnClickListener(this);
dialer = (ImageView) findViewById(R.id.dialer);
@ -325,14 +332,15 @@ public class CallActivity extends Activity implements OnClickListener {
//Others
//Active Call
callInfo = (LinearLayout) findViewById(R.id.call_header_description);
callInfo = (LinearLayout) findViewById(R.id.active_call_info);
pause = (ImageView) findViewById(R.id.pause);
pause.setOnClickListener(this);
pause.setEnabled(false);
enabledPauseButton(false);
mActiveCallHeader = (RelativeLayout) findViewById(R.id.activeCallHeader);
mNoCurrentCall = (LinearLayout) findViewById(R.id.noCurrentCall);
mActiveCallHeader = (RelativeLayout) findViewById(R.id.active_call);
mNoCurrentCall = (LinearLayout) findViewById(R.id.no_current_call);
mCallPaused = (LinearLayout) findViewById(R.id.remote_pause);
contactPicture = (ImageView) findViewById(R.id.contact_picture);
avatar_layout = (RelativeLayout) findViewById(R.id.avatar_layout);
@ -345,7 +353,7 @@ public class CallActivity extends Activity implements OnClickListener {
//Options
addCall = (ImageView) findViewById(R.id.addCall);
addCall = (ImageView) findViewById(R.id.add_call);
addCall.setOnClickListener(this);
addCall.setEnabled(false);
@ -358,14 +366,13 @@ public class CallActivity extends Activity implements OnClickListener {
conference.setOnClickListener(this);
try {
//routeLayout = (LinearLayout) findViewById(R.id.routesLayout);
audioRoute = (ImageView) findViewById(R.id.audioRoute);
audioRoute = (ImageView) findViewById(R.id.audio_route);
audioRoute.setOnClickListener(this);
routeSpeaker = (ImageView) findViewById(R.id.routeSpeaker);
routeSpeaker = (ImageView) findViewById(R.id.route_speaker);
routeSpeaker.setOnClickListener(this);
routeEarpiece = (ImageView) findViewById(R.id.routeEarpiece);
routeEarpiece = (ImageView) findViewById(R.id.route_earpiece);
routeEarpiece.setOnClickListener(this);
routeBluetooth = (ImageView) findViewById(R.id.routeBluetooth);
routeBluetooth = (ImageView) findViewById(R.id.route_bluetooth);
routeBluetooth.setOnClickListener(this);
} catch (NullPointerException npe) {
Log.e("Bluetooth: Audio routes menu disabled on tablets for now (1)");
@ -391,15 +398,11 @@ public class CallActivity extends Activity implements OnClickListener {
if (BluetoothManager.getInstance().isBluetoothHeadsetAvailable()) {
try {
if (routeLayout != null)
routeLayout.setVisibility(View.VISIBLE);
audioRoute.setVisibility(View.VISIBLE);
speaker.setVisibility(View.GONE);
} catch (NullPointerException npe) { Log.e("Bluetooth: Audio routes menu disabled on tablets for now (2)"); }
} else {
try {
if (routeLayout != null)
routeLayout.setVisibility(View.GONE);
audioRoute.setVisibility(View.GONE);
speaker.setVisibility(View.VISIBLE);
} catch (NullPointerException npe) { Log.e("Bluetooth: Audio routes menu disabled on tablets for now (3)"); }
@ -410,7 +413,7 @@ public class CallActivity extends Activity implements OnClickListener {
}
public void createInCallStats() {
sideMenu = (DrawerLayout) findViewById(R.id.call_stats);
sideMenu = (DrawerLayout) findViewById(R.id.side_menu);
menu = (ImageView) findViewById(R.id.call_quality);
sideMenuContent = (RelativeLayout) findViewById(R.id.side_menu_content);
@ -418,7 +421,7 @@ public class CallActivity extends Activity implements OnClickListener {
menu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if(sideMenu.isDrawerVisible(Gravity.LEFT)){
if (sideMenu.isDrawerVisible(Gravity.LEFT)) {
sideMenu.closeDrawer(sideMenuContent);
} else {
sideMenu.openDrawer(sideMenuContent);
@ -431,8 +434,44 @@ public class CallActivity extends Activity implements OnClickListener {
}
private void refreshIncallUi(){
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(LinphoneManager.getLc(), Arrays.asList(State.PausedByRemote));
if (pausedCalls.size() == 1) {
displayCallPaused(true);
} else {
displayCallPaused(false);
}
if(LinphoneManager.getLc().getCurrentCall() != null){
if(isTransferAllowed)
enabledTransferButton(true);
if(!isVideoEnabled(LinphoneManager.getLc().getCurrentCall()))
callInfo.setVisibility(View.VISIBLE);
}
if(LinphoneManager.getLc().getCallsNb() > 1){
callsList.setVisibility(View.VISIBLE);
enabledConferenceButton(true);
} else {
if(LinphoneManager.getLc().getCallsNb() == 1 && LinphoneManager.getLc().getCurrentCall() == null){
callsList.setVisibility(View.VISIBLE);
if(isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
avatar_layout.setVisibility(View.GONE);
} else {
avatar_layout.setVisibility(View.VISIBLE);
}
if(isTransferAllowed)
enabledTransferButton(false);
} else {
callsList.setVisibility(View.GONE);
}
enabledConferenceButton(false);
}
refreshInCallActions();
refreshCallList(getResources());
}
private void refreshInCallActions() {
@ -463,37 +502,22 @@ public class CallActivity extends Activity implements OnClickListener {
try {
if (isSpeakerEnabled) {
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_selected);
routeEarpiece.setBackgroundResource(R.drawable.route_earpiece);
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth);
routeSpeaker.setImageResource(R.drawable.route_speaker_selected);
routeEarpiece.setImageResource(R.drawable.route_earpiece);
routeBluetooth.setImageResource(R.drawable.route_bluetooth);
}
routeSpeaker.setBackgroundResource(R.drawable.route_speaker);
routeSpeaker.setImageResource(R.drawable.route_speaker);
if (BluetoothManager.getInstance().isUsingBluetoothAudioRoute()) {
routeEarpiece.setBackgroundResource(R.drawable.route_earpiece);
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_selected);
routeEarpiece.setImageResource(R.drawable.route_earpiece);
routeBluetooth.setImageResource(R.drawable.route_bluetooth_selected);
} else {
routeEarpiece.setBackgroundResource(R.drawable.route_earpiece_selected);
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth);
routeEarpiece.setImageResource(R.drawable.route_earpiece_selected);
routeBluetooth.setImageResource(R.drawable.route_bluetooth);
}
} catch (NullPointerException npe) {
Log.e("Bluetooth: Audio routes menu disabled on tablets for now (4)");
}
if (LinphoneManager.getLc().getCallsNb() > 1) {
//pause.setVisibility(View.GONE);
} else {
//pause.setVisibility(View.VISIBLE);
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(LinphoneManager.getLc(), Arrays.asList(State.Paused));
if (pausedCalls.size() == 1) {
//pause.setBackgroundResource(R.drawable.pa);
} else {
//pause.setBackgroundResource(R.drawable.pause_off);
}
}
}
private void enableAndRefreshInCallActions() {
@ -511,8 +535,7 @@ public class CallActivity extends Activity implements OnClickListener {
transfer.setEnabled(true);
pause.setEnabled(true);
dialer.setEnabled(true);
conference.setEnabled(true);
refreshInCallActions();
enabledConferenceButton(true);
}
public void updateStatusFragment(StatusFragment statusFragment) {
@ -524,7 +547,7 @@ public class CallActivity extends Activity implements OnClickListener {
int id = v.getId();
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
displayVideoCallControlsIfHidden();
//displayVideoCallControlsIfHidden();
}
if (id == R.id.video) {
@ -536,13 +559,13 @@ public class CallActivity extends Activity implements OnClickListener {
else if (id == R.id.speaker) {
toggleSpeaker();
}
else if (id == R.id.addCall) {
else if (id == R.id.add_call) {
goBackToDialer();
}
else if (id == R.id.pause) {
pauseOrResumeCall(LinphoneManager.getLc().getCurrentCall());
}
else if (id == R.id.hangUp) {
else if (id == R.id.hang_up) {
hangUp();
}
else if (id == R.id.dialer) {
@ -563,36 +586,36 @@ public class CallActivity extends Activity implements OnClickListener {
else if (id == R.id.options) {
hideOrDisplayCallOptions();
}
else if (id == R.id.audioRoute) {
else if (id == R.id.audio_route) {
hideOrDisplayAudioRoutes();
}
else if (id == R.id.routeBluetooth) {
else if (id == R.id.route_bluetooth) {
if (BluetoothManager.getInstance().routeAudioToBluetooth()) {
isSpeakerEnabled = false;
/*routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_on);
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_off);*/
routeBluetooth.setImageResource(R.drawable.route_bluetooth_selected);
routeSpeaker.setImageResource(R.drawable.route_speaker);
routeEarpiece.setImageResource(R.drawable.route_earpiece);
}
hideOrDisplayAudioRoutes();
}
else if (id == R.id.routeEarpiece) {
else if (id == R.id.route_earpiece) {
LinphoneManager.getInstance().routeAudioToReceiver();
isSpeakerEnabled = false;
/*routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
routeReceiver.setBackgroundResource(R.drawable.route_receiver_on);
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_off);*/
routeBluetooth.setImageResource(R.drawable.route_bluetooth);
routeSpeaker.setImageResource(R.drawable.route_speaker);
routeEarpiece.setImageResource(R.drawable.route_earpiece_selected);
hideOrDisplayAudioRoutes();
}
else if (id == R.id.routeSpeaker) {
else if (id == R.id.route_speaker) {
LinphoneManager.getInstance().routeAudioToSpeaker();
isSpeakerEnabled = true;
/*routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_on);*/
routeBluetooth.setImageResource(R.drawable.route_bluetooth);
routeSpeaker.setImageResource(R.drawable.route_speaker_selected);
routeEarpiece.setImageResource(R.drawable.route_earpiece);
hideOrDisplayAudioRoutes();
}
else if (id == R.id.callStatus) {
else if (id == R.id.call_pause) {
LinphoneCall call = (LinphoneCall) v.getTag();
pauseOrResumeCall(call);
}
@ -604,10 +627,40 @@ public class CallActivity extends Activity implements OnClickListener {
private void enabledVideoButton(boolean enabled){
if(enabled) {
video.setEnabled(true);
video.setImageResource(R.drawable.camera_default);
video.setAlpha(1f);
} else {
video.setEnabled(false);
video.setImageResource(R.drawable.camera_disabled);
video.setAlpha(0.2f);
}
}
private void enabledPauseButton(boolean enabled){
if(enabled) {
pause.setEnabled(true);
pause.setImageResource(R.drawable.pause_big_default);
} else {
pause.setEnabled(false);
pause.setImageResource(R.drawable.pause_big_disabled);
}
}
private void enabledTransferButton(boolean enabled){
if(enabled) {
transfer.setEnabled(true);
transfer.setImageAlpha(250);
} else {
transfer.setEnabled(false);
transfer.setImageAlpha(50);
}
}
private void enabledConferenceButton(boolean enabled){
if(enabled) {
conference.setEnabled(true);
conference.setImageAlpha(250);
} else {
conference.setEnabled(false);
conference.setImageAlpha(50);
}
}
@ -671,6 +724,7 @@ public class CallActivity extends Activity implements OnClickListener {
LinphoneManager.startProximitySensorForActivity(CallActivity.this);
replaceFragmentVideoByAudio();
displayAudioCall();
showStatusBar();
removeCallbacks();
}
@ -684,8 +738,8 @@ public class CallActivity extends Activity implements OnClickListener {
LinphoneManager.stopProximitySensorForActivity(CallActivity.this);
replaceFragmentAudioByVideo();
hideStatusBar();
displayVideoCall(false);
displayVideoCallControlsIfHidden();
}
private void displayNoCurrentCall(boolean display){
@ -698,6 +752,14 @@ public class CallActivity extends Activity implements OnClickListener {
}
}
private void displayCallPaused(boolean display){
if(display){
mCallPaused.setVisibility(View.VISIBLE);
} else {
mCallPaused.setVisibility(View.GONE);
}
}
private void displayAudioCall(){
mActiveCallHeader.setVisibility(View.VISIBLE);
callInfo.setVisibility(View.VISIBLE);
@ -707,28 +769,6 @@ public class CallActivity extends Activity implements OnClickListener {
switchCamera.setVisibility(View.GONE);
}
private void displayVideoCall(boolean display){
if(display) {
LinphoneActivity.instance().showStatusBar();
mControlsLayout.setVisibility(View.VISIBLE);
mActiveCallHeader.setVisibility(View.VISIBLE);
callInfo.setVisibility(View.VISIBLE);
avatar_layout.setVisibility(View.GONE);
mNoCurrentCall.setVisibility(View.GONE);
callsList.setVisibility(View.VISIBLE);
if (cameraNumber > 1) {
switchCamera.setVisibility(View.VISIBLE);
}
} else {
LinphoneActivity.instance().hideStatusBar();
mControlsLayout.setVisibility(View.GONE);
mActiveCallHeader.setVisibility(View.GONE);
switchCamera.setVisibility(View.GONE);
mNoCurrentCall.setVisibility(View.GONE);
callsList.setVisibility(View.GONE);
}
}
private void replaceFragmentVideoByAudio() {
audioCallFragment = new CallAudioFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
@ -775,17 +815,9 @@ public class CallActivity extends Activity implements OnClickListener {
}
}
private void pauseOrResumeCall() {
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
if (lc != null && lc.getCallsNb() >= 1) {
LinphoneCall call = lc.getCalls()[0];
pauseOrResumeCall(call);
}
}
public void pauseOrResumeCall(LinphoneCall call) {
LinphoneCore lc = LinphoneManager.getLc();
if (call != null && LinphoneUtils.isCallRunning(call)) {
if (call != null && LinphoneManager.getLc().getCurrentCall() == call) {
lc.pauseCall(call);
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
isVideoCallPaused = true;
@ -815,6 +847,30 @@ public class CallActivity extends Activity implements OnClickListener {
}
}
public void displayVideoCall(boolean display){
if(display) {
showStatusBar();
mControlsLayout.setVisibility(View.VISIBLE);
mActiveCallHeader.setVisibility(View.VISIBLE);
callInfo.setVisibility(View.VISIBLE);
avatar_layout.setVisibility(View.GONE);
mNoCurrentCall.setVisibility(View.GONE);
callsList.setVisibility(View.VISIBLE);
if (cameraNumber > 1) {
switchCamera.setVisibility(View.VISIBLE);
}
} else {
hideStatusBar();
mControlsLayout.setVisibility(View.GONE);
mActiveCallHeader.setVisibility(View.GONE);
switchCamera.setVisibility(View.GONE);
mNoCurrentCall.setVisibility(View.GONE);
Log.w("Call list gone");
callsList.setVisibility(View.GONE);
}
}
public void displayVideoCallControlsIfHidden() {
if (mControlsLayout != null) {
if (mControlsLayout.getVisibility() != View.VISIBLE) {
@ -1155,8 +1211,7 @@ public class CallActivity extends Activity implements OnClickListener {
transfer.setVisibility(View.VISIBLE);
}
addCall.setVisibility(View.VISIBLE);
if(LinphoneManager.getLc().getCalls().length > 1)
conference.setVisibility(View.VISIBLE);
conference.setVisibility(View.VISIBLE);
options.setImageResource(R.drawable.options_selected);
} else {
if (isOrientationLandscape) {
@ -1210,6 +1265,28 @@ public class CallActivity extends Activity implements OnClickListener {
startActivity(new Intent(this, CallIncomingActivity.class));
}
public void hideStatusBar() {
if (isTablet()) {
return;
}
findViewById(R.id.status).setVisibility(View.GONE);
findViewById(R.id.fragmentContainer).setPadding(0, 0, 0, 0);
}
public void showStatusBar() {
if (isTablet()) {
return;
}
if (status != null && !status.isVisible()) {
// Hack to ensure statusFragment is visible after coming back to
// dialer from chat
status.getView().setVisibility(View.VISIBLE);
}
findViewById(R.id.status).setVisibility(View.VISIBLE);
//findViewById(R.id.fragmentContainer).setPadding(0, LinphoneUtils.pixelsToDpi(getResources(), 40), 0, 0);
}
private void showAcceptCallUpdateDialog() {
@ -1222,7 +1299,7 @@ public class CallActivity extends Activity implements OnClickListener {
dialog.getWindow().setBackgroundDrawable(d);
TextView customText = (TextView) dialog.findViewById(R.id.customText);
customText.setText(getResources().getString(R.string.call_update_video));
customText.setText(getResources().getString(R.string.add_video_dialog));
Button delete = (Button) dialog.findViewById(R.id.delete);
delete.setText(R.string.accept);
Button cancel = (Button) dialog.findViewById(R.id.cancel);
@ -1257,7 +1334,7 @@ public class CallActivity extends Activity implements OnClickListener {
instance = this;
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
displayVideoCallControlsIfHidden();
//displayVideoCallControlsIfHidden();
} else if(LinphoneManager.getLc().isInConference()) {
displayConference();
} else {
@ -1374,9 +1451,7 @@ public class CallActivity extends Activity implements OnClickListener {
}
private void displayActiveCall(LinphoneCall call){
if(isVideoEnabled(call)){
mActiveCallHeader.setVisibility(View.GONE);
} else {
if(!isVideoEnabled(call)){
mActiveCallHeader.setVisibility(View.VISIBLE);
mNoCurrentCall.setVisibility(View.GONE);
}
@ -1391,7 +1466,7 @@ public class CallActivity extends Activity implements OnClickListener {
lAddress= LinphoneCoreFactory.instance().createLinphoneAddress("unknown","unknown","unknown");
}
TextView contact = (TextView) findViewById(R.id.contactNameOrNumber);
TextView contact = (TextView) findViewById(R.id.contact_name);
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), lAddress);
if (lContact == null) {
@ -1414,7 +1489,7 @@ public class CallActivity extends Activity implements OnClickListener {
return;
}
Chronometer timer = (Chronometer) findViewById(R.id.callTimer);
Chronometer timer = (Chronometer) findViewById(R.id.call_timer);
if (timer == null) {
throw new IllegalArgumentException("no callee_duration view found");
}
@ -1434,10 +1509,10 @@ public class CallActivity extends Activity implements OnClickListener {
}
// Control Row
LinearLayout callView = (LinearLayout) inflater.inflate(R.layout.active_call_control_row, container, false);
LinearLayout callView = (LinearLayout) inflater.inflate(R.layout.call_inactive_row, container, false);
callView.setId(index+1);
TextView contact = (TextView) callView.findViewById(R.id.contactNameOrNumber);
TextView contact = (TextView) callView.findViewById(R.id.contact_name);
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), lAddress);
if (lContact == null) {
@ -1483,7 +1558,7 @@ public class CallActivity extends Activity implements OnClickListener {
private boolean displayCallStatusIconAndReturnCallPaused(LinearLayout callView, LinphoneCall call) {
boolean isCallPaused, isInConference;
ImageView callState = (ImageView) callView.findViewById(R.id.callStatus);
ImageView callState = (ImageView) callView.findViewById(R.id.call_pause);
callState.setTag(call);
callState.setOnClickListener(this);
@ -1523,7 +1598,7 @@ public class CallActivity extends Activity implements OnClickListener {
return;
}
Chronometer timer = (Chronometer) v.findViewById(R.id.callTimer);
Chronometer timer = (Chronometer) v.findViewById(R.id.call_timer);
if (timer == null) {
throw new IllegalArgumentException("no callee_duration view found");
}
@ -1541,6 +1616,7 @@ public class CallActivity extends Activity implements OnClickListener {
conferenceList.setVisibility(View.GONE);
}
//TODO DON'T SHOW CALLLIST IF THERE IS VIDEO CALL
if(callsList != null) {
callsList.setVisibility(View.VISIBLE);
callsList.removeAllViews();

View file

@ -27,11 +27,22 @@ 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.content.ClipData;
import android.content.ClipDescription;
import android.content.Context;
import android.content.Intent;
import android.graphics.Point;
import android.os.Build;
import android.os.Bundle;
import android.os.PowerManager;
import android.view.DragEvent;
import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
@ -44,11 +55,15 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig
private static CallIncomingActivity instance;
private TextView name, number;
private ImageView contactPicture, acceptArrow, accept, decline;
private ImageView contactPicture, acceptArrow, accept, acceptCall, decline;
private LinphoneCall mCall;
private LinphoneCoreListenerBase mListener;
private LinearLayout acceptUnlock;
private LinearLayout declineUnlock;
private StatusFragment status;
private boolean isActive;
private float answerX;
private float declineX;
public static CallIncomingActivity instance() {
return instance;
@ -73,24 +88,113 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
getWindow().addFlags(flags);
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
isActive = pm.isInteractive();
} else {
isActive = pm.isScreenOn();
}
acceptUnlock = (LinearLayout) findViewById(R.id.acceptUnlock);
declineUnlock = (LinearLayout) findViewById(R.id.declineUnlock);
//mIncomingCallWidget = (LinphoneSliders) findViewById(R.id.sliding_widget);
accept = (ImageView) findViewById(R.id.accept);
acceptArrow = (ImageView) findViewById(R.id.acceptArrow);
decline = (ImageView) findViewById(R.id.decline);
accept.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
answer();
}
});
decline = (ImageView) findViewById(R.id.decline);
decline.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
decline();
if(isActive) {
answer();
} else {
decline.setVisibility(View.GONE);
acceptUnlock.setVisibility(View.VISIBLE);
}
}
});
if(!isActive) {
accept.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
float curX;
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
acceptUnlock.setVisibility(View.VISIBLE);
decline.setVisibility(View.GONE);
answerX = motionEvent.getX();
break;
case MotionEvent.ACTION_MOVE:
curX = motionEvent.getX();
view.scrollBy((int) (answerX - curX), view.getScrollY());
answerX = curX;
if (curX < 50) {
answer();
return true;
}
break;
case MotionEvent.ACTION_UP:
view.scrollTo(0, view.getScrollY());
decline.setVisibility(View.VISIBLE);
acceptUnlock.setVisibility(View.GONE);
break;
}
return true;
}
});
decline.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
float curX;
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
declineUnlock.setVisibility(View.VISIBLE);
accept.setVisibility(View.GONE);
declineX = motionEvent.getX();
break;
case MotionEvent.ACTION_MOVE:
curX = motionEvent.getX();
view.scrollBy((int) (declineX - curX), view.getScrollY());
declineX = curX;
Log.w(curX);
if (curX > 800) {
//decline();
return true;
}
break;
case MotionEvent.ACTION_UP:
view.scrollTo(0, view.getScrollY());
accept.setVisibility(View.VISIBLE);
declineUnlock.setVisibility(View.GONE);
break;
}
return true;
}
});
}
decline.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(isActive) {
decline();
} else {
accept.setVisibility(View.GONE);
acceptUnlock.setVisibility(View.VISIBLE);
}
}
});
mListener = new LinphoneCoreListenerBase(){
@Override
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
public void callState(LinphoneCore lc, LinphoneCall call, State state, String message) {
if (call == mCall && State.CallEnd == state) {
finish();
}
@ -101,6 +205,7 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig
}
};
super.onCreate(savedInstanceState);
instance = this;
}
@ -193,13 +298,11 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig
@Override
public void onLeftHandleTriggered() {
answer();
finish();
}
@Override
public void onRightHandleTriggered() {
decline();
finish();
}
}

View file

@ -155,7 +155,7 @@ public final class LinphoneService extends Service {
bm = BitmapFactory.decodeResource(getResources(), R.drawable.logo_linphone_57x57);
} catch (Exception e) {
}
mNotif = Compatibility.createNotification(this, mNotificationTitle, "", R.drawable.status_level, IC_LEVEL_OFFLINE, bm, mNotifContentIntent, true,notifcationsPriority);
mNotif = Compatibility.createNotification(this, mNotificationTitle, "", R.drawable.status_level, R.drawable.logo_linphone_57x57, bm, mNotifContentIntent, true,notifcationsPriority);
LinphoneManager.createAndStart(LinphoneService.this);
@ -200,7 +200,7 @@ public final class LinphoneService extends Service {
@Override
public void globalState(LinphoneCore lc,LinphoneCore.GlobalState state, String message) {
if (state == GlobalState.GlobalOn) {
sendNotification(IC_LEVEL_OFFLINE, R.string.notification_started);
sendNotification(IC_LEVEL_ORANGE, R.string.notification_started);
}
}
@ -216,11 +216,11 @@ public final class LinphoneService extends Service {
}
if ((state == RegistrationState.RegistrationFailed || state == RegistrationState.RegistrationCleared) && (LinphoneManager.getLc().getDefaultProxyConfig() == null || !LinphoneManager.getLc().getDefaultProxyConfig().isRegistered())) {
sendNotification(IC_LEVEL_OFFLINE, R.string.notification_register_failure);
sendNotification(IC_LEVEL_ORANGE, R.string.notification_register_failure);
}
if (state == RegistrationState.RegistrationNone) {
sendNotification(IC_LEVEL_OFFLINE, R.string.notification_started);
sendNotification(IC_LEVEL_ORANGE, R.string.notification_started);
}
}
}
@ -293,7 +293,7 @@ public final class LinphoneService extends Service {
notificationTextId = R.string.incall_notif_active;
break;
case PAUSE:
inconId = R.drawable.conf_status_paused;
inconId = R.drawable.topbar_call_notification;
notificationTextId = R.string.incall_notif_paused;
break;
case VIDEO:

View file

@ -36,8 +36,11 @@ import org.linphone.mediastream.Log;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.app.Fragment;
@ -45,6 +48,9 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
@ -86,8 +92,8 @@ public class StatusFragment extends Fragment {
}
if(lc.getProxyConfigList() == null){
statusLed.setVisibility(View.INVISIBLE);
statusText.setText("");
statusLed.setImageResource(R.drawable.led_disconnected);
statusText.setText(getString(R.string.no_account));
} else {
statusLed.setVisibility(View.VISIBLE);
}
@ -191,8 +197,8 @@ public class StatusFragment extends Fragment {
}
if(LinphoneManager.getLc().getProxyConfigList().length == 0){
statusLed.setVisibility(View.INVISIBLE);
statusText.setText("");
statusLed.setImageResource(R.drawable.led_disconnected);
statusText.setText(getString(R.string.no_account));
}
}
}
@ -372,33 +378,52 @@ public class StatusFragment extends Fragment {
}
}
private void showZRTPDialog(final LinphoneCall call) {
public void showZRTPDialog(final LinphoneCall call) {
if (getActivity() == null) {
Log.w("Can't display ZRTP popup, no Activity");
return;
}
new AlertDialog.Builder(getActivity())
.setTitle(call.getAuthenticationToken())
.setMessage(getString(R.string.zrtp_help))
.setPositiveButton(R.string.zrtp_accept, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
call.setAuthenticationTokenVerified(true);
final Dialog dialog = new Dialog(getActivity());
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
Drawable d = new ColorDrawable(getResources().getColor(R.color.colorC));
d.setAlpha(200);
dialog.setContentView(R.layout.dialog);
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
dialog.getWindow().setBackgroundDrawable(d);
TextView customText = (TextView) dialog.findViewById(R.id.customText);
String newText = getString(R.string.zrtp_dialog).replace("%s",call.getAuthenticationToken());
customText.setText(newText);
Button delete = (Button) dialog.findViewById(R.id.delete);
delete.setText(R.string.accept);
Button cancel = (Button) dialog.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);
}
dialog.dismiss();
}
});
cancel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (call != null) {
call.setAuthenticationTokenVerified(false);
if (encryption != null) {
encryption.setImageResource(R.drawable.security_ok);
encryption.setImageResource(R.drawable.security_pending);
}
}
})
.setNegativeButton(R.string.zrtp_deny, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (call != null) {
call.setAuthenticationTokenVerified(false);
if (encryption != null) {
encryption.setImageResource(R.drawable.security_pending);
}
}
}
})
.show();
}
dialog.dismiss();
}
});
dialog.show();
}
public void initCallStatsRefresher(final LinphoneCall call, final View view) {