Incall actiivty
This commit is contained in:
parent
eae5c18e07
commit
7388723f40
3 changed files with 226 additions and 153 deletions
|
@ -1,8 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:linphone="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_margin="2dp"
|
android:layout_margin="2dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
@ -19,6 +18,7 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/contactNameOrNumber"
|
android:id="@+id/contactNameOrNumber"
|
||||||
style="@style/font14"
|
style="@style/font14"
|
||||||
|
android:singleLine="true"
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
@ -36,9 +36,9 @@
|
||||||
android:gravity="center_vertical|right"/>
|
android:gravity="center_vertical|right"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/callStatus"
|
||||||
android:contentDescription="@string/content_description_pause"
|
android:contentDescription="@string/content_description_pause"
|
||||||
android:src="@drawable/pause_small_over_selected"
|
android:src="@drawable/pause_small_over_selected"
|
||||||
android:id="@+id/callStatus"
|
|
||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
@ -46,4 +46,4 @@
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</TableRow>
|
</LinearLayout>
|
|
@ -24,6 +24,16 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal" />
|
android:orientation="horizontal" />
|
||||||
|
|
||||||
|
<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
|
<RelativeLayout
|
||||||
android:id="@+id/activeCallHeader"
|
android:id="@+id/activeCallHeader"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -35,8 +45,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contactPicture"
|
android:id="@+id/contactPicture"
|
||||||
android:src="@drawable/avatar"
|
android:src="@drawable/avatar"
|
||||||
android:layout_width="220dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="220dp"
|
android:layout_height="200dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:paddingBottom="10dp"/>
|
android:paddingBottom="10dp"/>
|
||||||
|
|
||||||
|
@ -70,23 +80,49 @@
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
<TableLayout
|
<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>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:id="@+id/calls"
|
android:id="@+id/calls"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/activeCallHeader"
|
android:layout_below="@id/activeCallHeader"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_gravity="bottom"/>
|
android:background="@color/colorH"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:orientation="vertical">
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/switchCamera"
|
android:id="@+id/switchCamera"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="80dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="80dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:adjustViewBounds="true"
|
android:padding="10dp"
|
||||||
android:contentDescription="@string/content_description_switch_camera"
|
android:contentDescription="@string/content_description_switch_camera"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
|
@ -118,14 +154,13 @@
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:padding="25dp"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/video"
|
android:id="@+id/video"
|
||||||
android:src="@drawable/camera_default"
|
android:src="@drawable/camera_default"
|
||||||
android:background="@drawable/button_background"
|
android:background="@drawable/button_background"
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:scaleType="center"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
@ -144,8 +179,7 @@
|
||||||
android:id="@+id/micro"
|
android:id="@+id/micro"
|
||||||
android:src="@drawable/micro_default"
|
android:src="@drawable/micro_default"
|
||||||
android:background="@drawable/button_background"
|
android:background="@drawable/button_background"
|
||||||
android:adjustViewBounds="true"
|
android:padding="15dp"
|
||||||
android:scaleType="center"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
@ -154,8 +188,7 @@
|
||||||
android:id="@+id/speaker"
|
android:id="@+id/speaker"
|
||||||
android:src="@drawable/speaker_default"
|
android:src="@drawable/speaker_default"
|
||||||
android:background="@drawable/button_background"
|
android:background="@drawable/button_background"
|
||||||
android:adjustViewBounds="true"
|
android:padding="20dp"
|
||||||
android:scaleType="center"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
@ -171,8 +204,7 @@
|
||||||
android:id="@+id/options"
|
android:id="@+id/options"
|
||||||
android:src="@drawable/options_default"
|
android:src="@drawable/options_default"
|
||||||
android:background="@drawable/button_background"
|
android:background="@drawable/button_background"
|
||||||
android:adjustViewBounds="true"
|
android:padding="20dp"
|
||||||
android:scaleType="center"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
@ -191,19 +223,17 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:adjustViewBounds="true"
|
android:padding="20dp"
|
||||||
android:scaleType="center"
|
|
||||||
android:background="@color/colorC"
|
android:background="@color/colorC"
|
||||||
android:contentDescription="@string/content_description_contacts"
|
android:contentDescription="@string/content_description_contacts"
|
||||||
android:src="@drawable/footer_dialer" />
|
android:src="@drawable/footer_dialer" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/hangUp"
|
android:id="@+id/hangUp"
|
||||||
android:scaleType="center"
|
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:adjustViewBounds="true"
|
android:padding="15dp"
|
||||||
android:layout_weight="0.5"
|
android:layout_weight="0.5"
|
||||||
android:background="@color/colorD"
|
android:background="@color/colorD"
|
||||||
android:contentDescription="@string/content_description_contacts"
|
android:contentDescription="@string/content_description_contacts"
|
||||||
|
@ -214,8 +244,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:adjustViewBounds="true"
|
android:padding="20dp"
|
||||||
android:scaleType="center"
|
|
||||||
android:background="@color/colorC"
|
android:background="@color/colorC"
|
||||||
android:contentDescription="@string/content_description_contacts"
|
android:contentDescription="@string/content_description_contacts"
|
||||||
android:src="@drawable/footer_chat" />
|
android:src="@drawable/footer_chat" />
|
||||||
|
@ -253,15 +282,14 @@
|
||||||
android:layout_weight="0.5" />
|
android:layout_weight="0.5" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/conference"
|
android:id="@+id/addCall"
|
||||||
android:src="@drawable/options_start_conference"
|
android:src="@drawable/options_add_call"
|
||||||
android:background="@drawable/button_background"
|
android:background="@drawable/button_background"
|
||||||
android:adjustViewBounds="true"
|
android:padding="20dp"
|
||||||
android:scaleType="center"
|
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.5"/>
|
android:layout_weight="0.5" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -296,8 +324,7 @@
|
||||||
android:id="@+id/transfer"
|
android:id="@+id/transfer"
|
||||||
android:src="@drawable/options_transfer_call"
|
android:src="@drawable/options_transfer_call"
|
||||||
android:background="@drawable/button_background"
|
android:background="@drawable/button_background"
|
||||||
android:adjustViewBounds="true"
|
android:padding="20dp"
|
||||||
android:scaleType="center"
|
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -333,15 +360,14 @@
|
||||||
android:layout_weight="0.5" />
|
android:layout_weight="0.5" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/addCall"
|
android:id="@+id/conference"
|
||||||
android:src="@drawable/options_add_call"
|
android:src="@drawable/options_start_conference"
|
||||||
android:background="@drawable/button_background"
|
android:background="@drawable/button_background"
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:scaleType="center"
|
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
|
android:padding="20dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.5" />
|
android:layout_weight="0.5"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ import org.linphone.core.LinphoneCoreFactory;
|
||||||
import org.linphone.core.LinphoneCoreListenerBase;
|
import org.linphone.core.LinphoneCoreListenerBase;
|
||||||
import org.linphone.core.LinphonePlayer;
|
import org.linphone.core.LinphonePlayer;
|
||||||
import org.linphone.mediastream.Log;
|
import org.linphone.mediastream.Log;
|
||||||
import org.linphone.mediastream.Version;
|
|
||||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||||
import org.linphone.ui.Numpad;
|
import org.linphone.ui.Numpad;
|
||||||
|
|
||||||
|
@ -40,6 +39,7 @@ import android.app.FragmentTransaction;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.media.Image;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.CountDownTimer;
|
import android.os.CountDownTimer;
|
||||||
|
@ -62,7 +62,6 @@ import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TableLayout;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -79,14 +78,13 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
private Runnable mControls;
|
private Runnable mControls;
|
||||||
private ImageView switchCamera;
|
private ImageView switchCamera;
|
||||||
private RelativeLayout mActiveCallHeader;
|
private RelativeLayout mActiveCallHeader;
|
||||||
private ImageView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference;
|
private ImageView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference, conferenceStatus;
|
||||||
private TextView audioRoute, routeSpeaker, routeReceiver, routeBluetooth;
|
private TextView audioRoute, routeSpeaker, routeReceiver, routeBluetooth;
|
||||||
private LinearLayout routeLayout;
|
private LinearLayout routeLayout, mNoCurrentCall;
|
||||||
private ProgressBar videoProgress;
|
private ProgressBar videoProgress;
|
||||||
private StatusFragment status;
|
private StatusFragment status;
|
||||||
private AudioCallFragment audioCallFragment;
|
private AudioCallFragment audioCallFragment;
|
||||||
private VideoCallFragment videoCallFragment;
|
private VideoCallFragment videoCallFragment;
|
||||||
private ConferenceCallFragment conferenceCallFragment;
|
|
||||||
private boolean isSpeakerEnabled = false, isMicMuted = false, isTransferAllowed, isAnimationDisabled;
|
private boolean isSpeakerEnabled = false, isMicMuted = false, isTransferAllowed, isAnimationDisabled;
|
||||||
private LinearLayout mControlsLayout;
|
private LinearLayout mControlsLayout;
|
||||||
private Numpad numpad;
|
private Numpad numpad;
|
||||||
|
@ -96,7 +94,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
private boolean isVideoCallPaused = false;
|
private boolean isVideoCallPaused = false;
|
||||||
AcceptCallUpdateDialogFragment callUpdateDialog;
|
AcceptCallUpdateDialogFragment callUpdateDialog;
|
||||||
|
|
||||||
private TableLayout callsList;
|
private LinearLayout callsList, conferenceList;
|
||||||
private LayoutInflater inflater;
|
private LayoutInflater inflater;
|
||||||
private ViewGroup container;
|
private ViewGroup container;
|
||||||
private boolean isConferenceRunning = false;
|
private boolean isConferenceRunning = false;
|
||||||
|
@ -134,13 +132,17 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log.w("State " + message);
|
||||||
|
|
||||||
if (state == State.IncomingReceived) {
|
if (state == State.IncomingReceived) {
|
||||||
startIncomingCallActivity();
|
startIncomingCallActivity();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == State.Paused || state == State.PausedByRemote || state == State.Pausing) {
|
if (state == State.Paused || state == State.PausedByRemote || state == State.Pausing) {
|
||||||
|
if(LinphoneManager.getLc().getCurrentCall() != null)
|
||||||
|
Log.w(LinphoneManager.getLc().getCurrentCall().getRemoteContact());
|
||||||
enabledVideoButton(false);
|
enabledVideoButton(false);
|
||||||
if(isVideoEnabled(call)){
|
if(isVideoEnabled(call)){
|
||||||
showAudioView();
|
showAudioView();
|
||||||
|
@ -149,7 +151,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
if (state == State.Resuming) {
|
if (state == State.Resuming) {
|
||||||
if(LinphonePreferences.instance().isVideoEnabled()){
|
if(LinphonePreferences.instance().isVideoEnabled()){
|
||||||
//status.refreshStatusItems(call, isVideoEnabled(call));
|
status.refreshStatusItems(call, isVideoEnabled(call));
|
||||||
if(call.getCurrentParamsCopy().getVideoEnabled()){
|
if(call.getCurrentParamsCopy().getVideoEnabled()){
|
||||||
showVideoView();
|
showVideoView();
|
||||||
}
|
}
|
||||||
|
@ -174,9 +176,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshInCallActions();
|
|
||||||
refreshCallList(getResources());
|
|
||||||
|
|
||||||
if (state == State.CallUpdatedByRemote) {
|
if (state == State.CallUpdatedByRemote) {
|
||||||
// If the correspondent proposes video while audio call
|
// If the correspondent proposes video while audio call
|
||||||
boolean videoEnabled = LinphonePreferences.instance().isVideoEnabled();
|
boolean videoEnabled = LinphonePreferences.instance().isVideoEnabled();
|
||||||
|
@ -209,6 +208,8 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshIncallUi();
|
||||||
|
|
||||||
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
|
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
|
||||||
}
|
}
|
||||||
|
@ -290,7 +291,8 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
private void initUI() {
|
private void initUI() {
|
||||||
inflater = LayoutInflater.from(this);
|
inflater = LayoutInflater.from(this);
|
||||||
container = (ViewGroup) findViewById(R.id.topLayout);
|
container = (ViewGroup) findViewById(R.id.topLayout);
|
||||||
callsList = (TableLayout) findViewById(R.id.calls);
|
callsList = (LinearLayout) findViewById(R.id.calls);
|
||||||
|
conferenceList = (LinearLayout) findViewById(R.id.conferenceCalls);
|
||||||
|
|
||||||
//TopBar
|
//TopBar
|
||||||
video = (ImageView) findViewById(R.id.video);
|
video = (ImageView) findViewById(R.id.video);
|
||||||
|
@ -327,6 +329,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
pause.setEnabled(false);
|
pause.setEnabled(false);
|
||||||
|
|
||||||
mActiveCallHeader = (RelativeLayout) findViewById(R.id.activeCallHeader);
|
mActiveCallHeader = (RelativeLayout) findViewById(R.id.activeCallHeader);
|
||||||
|
mNoCurrentCall = (LinearLayout) findViewById(R.id.noCurrentCall);
|
||||||
|
|
||||||
/*if(isTablet()){
|
/*if(isTablet()){
|
||||||
speaker.setEnabled(false);
|
speaker.setEnabled(false);
|
||||||
|
@ -345,6 +348,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
transfer.setEnabled(false);
|
transfer.setEnabled(false);
|
||||||
|
|
||||||
conference = (ImageView) findViewById(R.id.conference);
|
conference = (ImageView) findViewById(R.id.conference);
|
||||||
|
conference.setEnabled(false);
|
||||||
conference.setOnClickListener(this);
|
conference.setOnClickListener(this);
|
||||||
|
|
||||||
|
|
||||||
|
@ -400,9 +404,15 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
LinphoneManager.getInstance().changeStatusToOnThePhone();
|
LinphoneManager.getInstance().changeStatusToOnThePhone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void refreshIncallUi(){
|
||||||
|
refreshInCallActions();
|
||||||
|
refreshCallList(getResources());
|
||||||
|
}
|
||||||
|
|
||||||
private void refreshInCallActions() {
|
private void refreshInCallActions() {
|
||||||
if (!LinphonePreferences.instance().isVideoEnabled()) {
|
if (!LinphonePreferences.instance().isVideoEnabled() || isConferenceRunning) {
|
||||||
enabledVideoButton(false);
|
enabledVideoButton(false);
|
||||||
} else {
|
} else {
|
||||||
if(video.isEnabled()) {
|
if(video.isEnabled()) {
|
||||||
|
@ -454,14 +464,14 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
if (LinphoneManager.getLc().getCallsNb() > 1) {
|
if (LinphoneManager.getLc().getCallsNb() > 1) {
|
||||||
//pause.setVisibility(View.GONE);
|
//pause.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
/*pause.setVisibility(View.VISIBLE);
|
//pause.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(LinphoneManager.getLc(), Arrays.asList(State.Paused));
|
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(LinphoneManager.getLc(), Arrays.asList(State.Paused));
|
||||||
if (pausedCalls.size() == 1) {
|
if (pausedCalls.size() == 1) {
|
||||||
pause.setBackgroundResource(R.drawable.pause_on);
|
//pause.setBackgroundResource(R.drawable.pa);
|
||||||
} else {
|
} else {
|
||||||
pause.setBackgroundResource(R.drawable.pause_off);
|
//pause.setBackgroundResource(R.drawable.pause_off);
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -509,7 +519,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
goBackToDialer();
|
goBackToDialer();
|
||||||
}
|
}
|
||||||
else if (id == R.id.pause) {
|
else if (id == R.id.pause) {
|
||||||
pauseOrResumeCall();
|
pauseOrResumeCall(LinphoneManager.getLc().getCurrentCall());
|
||||||
}
|
}
|
||||||
else if (id == R.id.hangUp) {
|
else if (id == R.id.hangUp) {
|
||||||
hangUp();
|
hangUp();
|
||||||
|
@ -519,6 +529,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
else if (id == R.id.conference) {
|
else if (id == R.id.conference) {
|
||||||
enterConference();
|
enterConference();
|
||||||
|
hideOrDisplayCallOptions();
|
||||||
}
|
}
|
||||||
else if (id == R.id.switchCamera) {
|
else if (id == R.id.switchCamera) {
|
||||||
if (videoCallFragment != null) {
|
if (videoCallFragment != null) {
|
||||||
|
@ -640,12 +651,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
replaceFragmentVideoByAudio();
|
replaceFragmentVideoByAudio();
|
||||||
setCallControlsVisibleAndRemoveCallbacks();
|
setCallControlsVisibleAndRemoveCallbacks();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showConferenceView() {
|
|
||||||
LinphoneManager.startProximitySensorForActivity(InCallActivity.this);
|
|
||||||
replaceFragmentByConference();
|
|
||||||
displayConference();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showVideoView() {
|
private void showVideoView() {
|
||||||
if (!BluetoothManager.getInstance().isBluetoothHeadsetAvailable()) {
|
if (!BluetoothManager.getInstance().isBluetoothHeadsetAvailable()) {
|
||||||
|
@ -659,18 +664,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
replaceFragmentAudioByVideo();
|
replaceFragmentAudioByVideo();
|
||||||
displayVideoCallControlsIfHidden();
|
displayVideoCallControlsIfHidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void replaceFragmentByConference() {
|
|
||||||
mControlsLayout.setVisibility(View.GONE);
|
|
||||||
switchCamera.setVisibility(View.INVISIBLE);
|
|
||||||
conferenceCallFragment = new ConferenceCallFragment();
|
|
||||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
|
||||||
transaction.replace(R.id.fragmentContainer, conferenceCallFragment);
|
|
||||||
try {
|
|
||||||
transaction.commitAllowingStateLoss();
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void replaceFragmentVideoByAudio() {
|
private void replaceFragmentVideoByAudio() {
|
||||||
audioCallFragment = new AudioCallFragment();
|
audioCallFragment = new AudioCallFragment();
|
||||||
|
@ -695,6 +688,20 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void displayOrHideCallsHeader(boolean display){
|
||||||
|
if(display){
|
||||||
|
callsList.setVisibility(View.VISIBLE);
|
||||||
|
mActiveCallHeader.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
callsList.setVisibility(View.GONE);
|
||||||
|
mActiveCallHeader.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void displayNoCurrentCall(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void toggleMicro() {
|
private void toggleMicro() {
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
|
@ -731,25 +738,16 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
public void pauseOrResumeCall(LinphoneCall call) {
|
public void pauseOrResumeCall(LinphoneCall call) {
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
if (call != null && LinphoneUtils.isCallRunning(call)) {
|
if (call != null && LinphoneUtils.isCallRunning(call)) {
|
||||||
if (call.isInConference()) {
|
lc.pauseCall(call);
|
||||||
lc.removeFromConference(call);
|
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
|
||||||
if (lc.getConferenceSize() <= 1) {
|
isVideoCallPaused = true;
|
||||||
lc.leaveConference();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
lc.pauseCall(call);
|
|
||||||
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
|
|
||||||
isVideoCallPaused = true;
|
|
||||||
showAudioView();
|
|
||||||
}
|
|
||||||
pause.setImageResource(R.drawable.pause_big_over_selected);
|
|
||||||
}
|
}
|
||||||
|
pause.setImageResource(R.drawable.pause_big_over_selected);
|
||||||
} else if (call != null) {
|
} else if (call != null) {
|
||||||
if (call.getState() == State.Paused) {
|
if (call.getState() == State.Paused) {
|
||||||
lc.resumeCall(call);
|
lc.resumeCall(call);
|
||||||
if (isVideoCallPaused) {
|
if (isVideoCallPaused) {
|
||||||
isVideoCallPaused = false;
|
isVideoCallPaused = false;
|
||||||
showVideoView();
|
|
||||||
}
|
}
|
||||||
pause.setImageResource(R.drawable.pause_big_default);
|
pause.setImageResource(R.drawable.pause_big_default);
|
||||||
}
|
}
|
||||||
|
@ -769,32 +767,12 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enterConference() {
|
|
||||||
LinphoneManager.getLc().addAllToConference();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void pauseOrResumeConference() {
|
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
|
||||||
if (lc.isInConference()) {
|
|
||||||
lc.leaveConference();
|
|
||||||
} else {
|
|
||||||
lc.enterConference();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void displayConference(){
|
|
||||||
mControlsLayout.setVisibility(View.VISIBLE);
|
|
||||||
callsList.setVisibility(View.GONE);
|
|
||||||
mActiveCallHeader.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void displayVideoCallControlsIfHidden() {
|
public void displayVideoCallControlsIfHidden() {
|
||||||
if (mControlsLayout != null) {
|
if (mControlsLayout != null) {
|
||||||
if (mControlsLayout.getVisibility() != View.VISIBLE) {
|
if (mControlsLayout.getVisibility() != View.VISIBLE) {
|
||||||
if (isAnimationDisabled) {
|
if (isAnimationDisabled) {
|
||||||
mControlsLayout.setVisibility(View.VISIBLE);
|
mControlsLayout.setVisibility(View.VISIBLE);
|
||||||
callsList.setVisibility(View.GONE);
|
displayOrHideCallsHeader(false);
|
||||||
mActiveCallHeader.setVisibility(View.GONE);
|
|
||||||
if (cameraNumber > 1) {
|
if (cameraNumber > 1) {
|
||||||
switchCamera.setVisibility(View.VISIBLE);
|
switchCamera.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
@ -804,8 +782,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animation animation) {
|
public void onAnimationStart(Animation animation) {
|
||||||
mControlsLayout.setVisibility(View.VISIBLE);
|
mControlsLayout.setVisibility(View.VISIBLE);
|
||||||
callsList.setVisibility(View.GONE);
|
displayOrHideCallsHeader(false);
|
||||||
mActiveCallHeader.setVisibility(View.GONE);
|
|
||||||
if (cameraNumber > 1) {
|
if (cameraNumber > 1) {
|
||||||
switchCamera.setVisibility(View.VISIBLE);
|
switchCamera.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
@ -842,11 +819,11 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
hideNumpad();
|
hideNumpad();
|
||||||
|
|
||||||
if (isAnimationDisabled) {
|
if (isAnimationDisabled) {
|
||||||
|
video.setEnabled(true);
|
||||||
transfer.setVisibility(View.INVISIBLE);
|
transfer.setVisibility(View.INVISIBLE);
|
||||||
addCall.setVisibility(View.INVISIBLE);
|
addCall.setVisibility(View.INVISIBLE);
|
||||||
mControlsLayout.setVisibility(View.GONE);
|
mControlsLayout.setVisibility(View.GONE);
|
||||||
mActiveCallHeader.setVisibility(View.GONE);
|
displayOrHideCallsHeader(false);
|
||||||
// callsList.setVisibility(View.GONE);
|
|
||||||
switchCamera.setVisibility(View.INVISIBLE);
|
switchCamera.setVisibility(View.INVISIBLE);
|
||||||
numpad.setVisibility(View.GONE);
|
numpad.setVisibility(View.GONE);
|
||||||
options.setImageResource(R.drawable.options_default);
|
options.setImageResource(R.drawable.options_default);
|
||||||
|
@ -868,8 +845,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
transfer.setVisibility(View.INVISIBLE);
|
transfer.setVisibility(View.INVISIBLE);
|
||||||
addCall.setVisibility(View.INVISIBLE);
|
addCall.setVisibility(View.INVISIBLE);
|
||||||
mControlsLayout.setVisibility(View.GONE);
|
mControlsLayout.setVisibility(View.GONE);
|
||||||
// callsList.setVisibility(View.GONE);
|
displayOrHideCallsHeader(false);
|
||||||
mActiveCallHeader.setVisibility(View.GONE);
|
|
||||||
switchCamera.setVisibility(View.INVISIBLE);
|
switchCamera.setVisibility(View.INVISIBLE);
|
||||||
numpad.setVisibility(View.GONE);
|
numpad.setVisibility(View.GONE);
|
||||||
options.setImageResource(R.drawable.options_default);
|
options.setImageResource(R.drawable.options_default);
|
||||||
|
@ -894,8 +870,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
mControls = null;
|
mControls = null;
|
||||||
|
|
||||||
mControlsLayout.setVisibility(View.VISIBLE);
|
mControlsLayout.setVisibility(View.VISIBLE);
|
||||||
callsList.setVisibility(View.VISIBLE);
|
|
||||||
mActiveCallHeader.setVisibility(View.VISIBLE);
|
|
||||||
switchCamera.setVisibility(View.INVISIBLE);
|
switchCamera.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1151,7 +1125,8 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
transfer.setVisibility(View.VISIBLE);
|
transfer.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
addCall.setVisibility(View.VISIBLE);
|
addCall.setVisibility(View.VISIBLE);
|
||||||
conference.setVisibility(View.VISIBLE);
|
if(LinphoneManager.getLc().getCalls().length > 1)
|
||||||
|
conference.setVisibility(View.VISIBLE);
|
||||||
options.setImageResource(R.drawable.options_selected);
|
options.setImageResource(R.drawable.options_selected);
|
||||||
} else {
|
} else {
|
||||||
if (isOrientationLandscape) {
|
if (isOrientationLandscape) {
|
||||||
|
@ -1219,7 +1194,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
|
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
|
||||||
displayVideoCallControlsIfHidden();
|
displayVideoCallControlsIfHidden();
|
||||||
} else if(isConferenceRunning) {
|
} else if(LinphoneManager.getLc().isInConference()) {
|
||||||
displayConference();
|
displayConference();
|
||||||
} else {
|
} else {
|
||||||
LinphoneManager.startProximitySensorForActivity(this);
|
LinphoneManager.startProximitySensorForActivity(this);
|
||||||
|
@ -1233,7 +1208,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
lc.addListener(mListener);
|
lc.addListener(mListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshCallList(getResources());
|
refreshIncallUi();
|
||||||
handleViewIntent();
|
handleViewIntent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1334,11 +1309,14 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
videoCallFragment = fragment;
|
videoCallFragment = fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void bindConferenceFragment(ConferenceCallFragment fragment) {
|
|
||||||
conferenceCallFragment = fragment;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void displayActiveCall(LinphoneCall call){
|
private void displayActiveCall(LinphoneCall call){
|
||||||
|
if(isVideoEnabled(call)){
|
||||||
|
mActiveCallHeader.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
mActiveCallHeader.setVisibility(View.VISIBLE);
|
||||||
|
mNoCurrentCall.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
if(call == null) return;
|
if(call == null) return;
|
||||||
String sipUri = call.getRemoteAddress().asStringUriOnly();
|
String sipUri = call.getRemoteAddress().asStringUriOnly();
|
||||||
LinphoneAddress lAddress;
|
LinphoneAddress lAddress;
|
||||||
|
@ -1346,7 +1324,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
|
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
|
||||||
} catch (LinphoneCoreException e) {
|
} catch (LinphoneCoreException e) {
|
||||||
Log.e("Incall activity cannot parse remote address",e);
|
Log.e("Incall activity cannot parse remote address",e);
|
||||||
lAddress= LinphoneCoreFactory.instance().createLinphoneAddress("uknown","unknown","unkonown");
|
lAddress= LinphoneCoreFactory.instance().createLinphoneAddress("unknown","unknown","unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
TextView contact = (TextView) findViewById(R.id.contactNameOrNumber);
|
TextView contact = (TextView) findViewById(R.id.contactNameOrNumber);
|
||||||
|
@ -1374,10 +1352,9 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
timer.setBase(SystemClock.elapsedRealtime() - 1000 * callDuration);
|
timer.setBase(SystemClock.elapsedRealtime() - 1000 * callDuration);
|
||||||
timer.start();
|
timer.start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayOtherCalls(Resources resources, LinphoneCall call, int index) {
|
private void displayOtherCalls(Resources resources, final LinphoneCall call, int index) {
|
||||||
Log.w("Display other calls");
|
Log.w("Display other calls");
|
||||||
String sipUri = call.getRemoteAddress().asStringUriOnly();
|
String sipUri = call.getRemoteAddress().asStringUriOnly();
|
||||||
LinphoneAddress lAddress;
|
LinphoneAddress lAddress;
|
||||||
|
@ -1389,7 +1366,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Control Row
|
// Control Row
|
||||||
LinearLayout callView = (LinearLayout) inflater.inflate(R.layout.active_call_control_row, container, false);
|
LinearLayout callView = (LinearLayout) inflater.inflate(R.layout.active_call_control_row, container, false);
|
||||||
callView.setId(index+1);
|
callView.setId(index+1);
|
||||||
|
|
||||||
TextView contact = (TextView) callView.findViewById(R.id.contactNameOrNumber);
|
TextView contact = (TextView) callView.findViewById(R.id.contactNameOrNumber);
|
||||||
|
@ -1405,7 +1382,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
contact.setText(lContact.getName());
|
contact.setText(lContact.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
//displayCallStatusIconAndReturnCallPaused(callView, call);
|
displayCallStatusIconAndReturnCallPaused(callView, call);
|
||||||
registerCallDurationTimer(callView, call);
|
registerCallDurationTimer(callView, call);
|
||||||
callsList.addView(callView);
|
callsList.addView(callView);
|
||||||
|
|
||||||
|
@ -1418,19 +1395,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
callsList.addView(imageView);*/
|
callsList.addView(imageView);*/
|
||||||
|
|
||||||
int callDuration = call.getDuration();
|
|
||||||
if (callDuration == 0 && call.getState() != State.StreamsRunning) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Chronometer timer = (Chronometer) findViewById(R.id.callTimer);
|
|
||||||
if (timer == null) {
|
|
||||||
throw new IllegalArgumentException("no callee_duration view found");
|
|
||||||
}
|
|
||||||
|
|
||||||
timer.setBase(SystemClock.elapsedRealtime() - 1000 * callDuration);
|
|
||||||
timer.start();
|
|
||||||
|
|
||||||
// callView.setTag(imageView);
|
// callView.setTag(imageView);
|
||||||
/* callView.setOnClickListener(new OnClickListener() {
|
/* callView.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1516,19 +1481,12 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
public void refreshCallList(Resources resources) {
|
public void refreshCallList(Resources resources) {
|
||||||
isConferenceRunning = LinphoneManager.getLc().isInConference();
|
isConferenceRunning = LinphoneManager.getLc().isInConference();
|
||||||
if (isConferenceRunning) {
|
if (isConferenceRunning) {
|
||||||
callsList.removeAllViews();
|
displayConference();
|
||||||
callsList.setVisibility(View.GONE);
|
mNoCurrentCall.setVisibility(View.GONE);
|
||||||
showConferenceView();
|
} else {
|
||||||
return;
|
conferenceList.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(LinphoneManager.getLc().getCalls().length == 1) {
|
|
||||||
Log.w(LinphoneManager.getLc().getCalls()[0].getRemoteContact());
|
|
||||||
displayActiveCall(LinphoneManager.getLc().getCalls()[0]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.w("Plusieurs call");
|
|
||||||
if(callsList != null) {
|
if(callsList != null) {
|
||||||
callsList.setVisibility(View.VISIBLE);
|
callsList.setVisibility(View.VISIBLE);
|
||||||
callsList.removeAllViews();
|
callsList.removeAllViews();
|
||||||
|
@ -1540,6 +1498,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (LinphoneCall call : LinphoneManager.getLc().getCalls()) {
|
for (LinphoneCall call : LinphoneManager.getLc().getCalls()) {
|
||||||
|
if(call.isInConference()) break;
|
||||||
if (call != LinphoneManager.getLc().getCurrentCall()) {
|
if (call != LinphoneManager.getLc().getCurrentCall()) {
|
||||||
displayOtherCalls(resources, call, index);
|
displayOtherCalls(resources, call, index);
|
||||||
index++;
|
index++;
|
||||||
|
@ -1550,11 +1509,99 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
if (LinphoneManager.getLc().getCurrentCall() == null) {
|
if (LinphoneManager.getLc().getCurrentCall() == null) {
|
||||||
showAudioView();
|
showAudioView();
|
||||||
|
mActiveCallHeader.setVisibility(View.GONE);
|
||||||
|
mNoCurrentCall.setVisibility(View.VISIBLE);
|
||||||
video.setEnabled(false);
|
video.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
callsList.invalidate();
|
//callsList.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Conference
|
||||||
|
private void exitConference(final LinphoneCall call){
|
||||||
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
|
|
||||||
|
if (call.isInConference()) {
|
||||||
|
lc.removeFromConference(call);
|
||||||
|
if (lc.getConferenceSize() <= 1) {
|
||||||
|
lc.leaveConference();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
refreshIncallUi();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void enterConference() {
|
||||||
|
LinphoneManager.getLc().addAllToConference();
|
||||||
|
displayConferenceHeader();
|
||||||
|
displayOrHideCallsHeader(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void pauseOrResumeConference() {
|
||||||
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
|
if (lc.isInConference()) {
|
||||||
|
conferenceStatus.setImageResource(R.drawable.pause_big_over_selected);
|
||||||
|
lc.leaveConference();
|
||||||
|
} else {
|
||||||
|
conferenceStatus.setImageResource(R.drawable.pause_big_default);
|
||||||
|
lc.enterConference();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void displayConferenceParticipant(int index, final LinphoneCall call){
|
||||||
|
LinearLayout confView = (LinearLayout) inflater.inflate(R.layout.conf_call_control_row, container, false);
|
||||||
|
conferenceList.setId(index+1);
|
||||||
|
TextView contact = (TextView) confView.findViewById(R.id.contactNameOrNumber);
|
||||||
|
|
||||||
|
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(),call.getRemoteAddress());
|
||||||
|
if (lContact == null) {
|
||||||
|
contact.setText(call.getRemoteAddress().getUserName());
|
||||||
|
} else {
|
||||||
|
contact.setText(lContact.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
registerCallDurationTimer(confView, call);
|
||||||
|
|
||||||
|
ImageView quitConference = (ImageView) confView.findViewById(R.id.quitConference);
|
||||||
|
quitConference.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
exitConference(call);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
conferenceList.addView(confView);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void displayConferenceHeader(){
|
||||||
|
conferenceList.setVisibility(View.VISIBLE);
|
||||||
|
RelativeLayout headerConference = (RelativeLayout) inflater.inflate(R.layout.conference_header, container, false);
|
||||||
|
conferenceStatus = (ImageView) headerConference.findViewById(R.id.conferenceStatus);
|
||||||
|
conferenceStatus.setOnClickListener(this);
|
||||||
|
conferenceList.addView(headerConference);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void displayConference(){
|
||||||
|
mControlsLayout.setVisibility(View.VISIBLE);
|
||||||
|
LinphoneManager.startProximitySensorForActivity(InCallActivity.this);
|
||||||
|
mActiveCallHeader.setVisibility(View.GONE);
|
||||||
|
callsList.setVisibility(View.VISIBLE);
|
||||||
|
conferenceList.removeAllViews();
|
||||||
|
|
||||||
|
//Conference Header
|
||||||
|
displayConferenceHeader();
|
||||||
|
|
||||||
|
//Conference participant
|
||||||
|
int index = 1;
|
||||||
|
for (LinphoneCall call : LinphoneManager.getLc().getCalls()) {
|
||||||
|
if(call.isInConference()) {
|
||||||
|
displayConferenceParticipant(index,call);
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
conferenceList.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue