Rework and rename incoming call and outgoing call activity
This commit is contained in:
parent
23e66f1c70
commit
24af401775
15 changed files with 765 additions and 727 deletions
|
@ -89,7 +89,7 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name="org.linphone.IncomingCallActivity"
|
||||
<activity android:name=".CallIncomingActivity"
|
||||
android:theme="@style/NoTitle"
|
||||
android:noHistory="true"
|
||||
android:launchMode="singleTop"
|
||||
|
@ -99,7 +99,7 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name="org.linphone.OutgoingCallActivity"
|
||||
<activity android:name=".CallOutgoingActivity"
|
||||
android:theme="@style/NoTitle"
|
||||
android:noHistory="true"
|
||||
android:launchMode="singleTop"
|
||||
|
@ -109,7 +109,7 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name="org.linphone.InCallActivity"
|
||||
<activity android:name=".CallActivity"
|
||||
android:theme="@style/FullScreen"
|
||||
android:noHistory="true"
|
||||
android:launchMode="singleTop">
|
||||
|
|
117
res/layout/call_incoming.xml
Normal file
117
res/layout/call_incoming.xml
Normal file
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/topLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/colorH">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/status"
|
||||
android:name="org.linphone.StatusFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
tools:layout="@layout/status" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/top_bar"
|
||||
android:background="@color/colorF"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_below="@id/status">
|
||||
|
||||
<TextView
|
||||
android:text="@string/incoming_call"
|
||||
style="@style/font1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="10dp"
|
||||
android:gravity="center"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contact_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:textAlignment="center"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:padding="5dp"
|
||||
style="@style/font5"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contact_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/font2"
|
||||
android:layout_below="@id/contact_name"
|
||||
android:layout_gravity="center"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:padding="5dp"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/contact_number"
|
||||
android:layout_margin="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/avatar_mask"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentTop="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/menu"
|
||||
android:visibility="visible"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/decline"
|
||||
android:src="@drawable/call_hangup"
|
||||
android:background="@drawable/hangup"
|
||||
android:contentDescription="@string/content_description_decline"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="15dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/accept"
|
||||
android:src="@drawable/call_audio_start"
|
||||
android:background="@drawable/call"
|
||||
android:contentDescription="@string/content_description_accept"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="15dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
|
@ -9,77 +9,88 @@
|
|||
<fragment
|
||||
android:id="@+id/status"
|
||||
android:name="org.linphone.StatusFragment"
|
||||
tools:layout="@layout/status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
tools:layout="@layout/status" />
|
||||
android:layout_height="40dp"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/toolbar"
|
||||
android:id="@+id/top_bar"
|
||||
android:background="@color/colorF"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_below="@id/status"
|
||||
android:background="@color/colorF">
|
||||
android:layout_below="@id/status">
|
||||
|
||||
<TextView
|
||||
android:text="@string/outgoing_call"
|
||||
style="@style/font1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="@style/font1"
|
||||
android:text="@string/outgoing_call"
|
||||
android:paddingLeft="10dp"
|
||||
android:gravity="center"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:id="@+id/contact_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:layout_above="@id/menu">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/incoming_caller_profile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:layout_above="@id/menu"
|
||||
android:layout_below="@id/top_bar"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/incoming_picture"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:src="@drawable/avatar"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_caller_name"
|
||||
android:id="@+id/contact_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_alignParentTop="true"
|
||||
android:textAlignment="center"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:padding="5dp"
|
||||
style="@style/font5"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_caller_number"
|
||||
android:id="@+id/contact_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/font2"
|
||||
android:layout_gravity="center"/>
|
||||
android:layout_below="@id/contact_name"
|
||||
android:layout_gravity="center"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:padding="5dp"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/contact_number"
|
||||
android:layout_margin="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/avatar_mask"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentTop="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<org.linphone.mediastream.video.display.GL2JNIView
|
||||
android:id="@+id/videoSurface"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/videoSurface"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/menu"
|
||||
|
@ -93,20 +104,20 @@
|
|||
android:id="@+id/micro"
|
||||
android:src="@drawable/micro_default"
|
||||
android:background="@drawable/button_background"
|
||||
android:contentDescription="@string/content_description_toggle_micro"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/content_description_pause"
|
||||
android:padding="15dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/speaker"
|
||||
android:src="@drawable/speaker_default"
|
||||
android:background="@drawable/button_background"
|
||||
android:contentDescription="@string/content_description_toggle_speaker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/content_description_pause"
|
||||
android:padding="20dp"/>
|
||||
|
||||
<ImageView
|
|
@ -1,112 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/topLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/status"
|
||||
android:name="org.linphone.StatusFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
tools:layout="@layout/status" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_below="@id/status"
|
||||
android:background="@color/colorF">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="@style/font1"
|
||||
android:text="@string/incoming_call"
|
||||
android:paddingLeft="10dp"
|
||||
android:gravity="center"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:layout_above="@id/menu">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/incoming_caller_profile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/incoming_picture"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:src="@drawable/avatar"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_caller_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textAlignment="center"
|
||||
style="@style/font5"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_caller_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/font2"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<org.linphone.mediastream.video.display.GL2JNIView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/videoSurface"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/decline"
|
||||
android:src="@drawable/call_hangup"
|
||||
android:background="@drawable/hangup"
|
||||
android:contentDescription="@string/content_description_pause"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="15dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/accept"
|
||||
android:src="@drawable/call_audio_start"
|
||||
android:background="@drawable/call"
|
||||
android:contentDescription="@string/content_description_pause"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="15dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
|
@ -22,7 +22,7 @@
|
|||
</TableRow>
|
||||
|
||||
<TableRow android:layout_weight="1" android:gravity="center">
|
||||
<org.linphone.ui.Digit android:id="@+id/DigitStar" android:text="*" style="@style/DialerDigit" android:background="@drawable/numpad_star" android:soundEffectsEnabled="true" />
|
||||
<org.linphone.ui.Digit android:id="@+id/DigitStar" android:text="*" style="@style/DialerDigit" android:background="@drawable/numpad_star_digit" android:soundEffectsEnabled="true" />
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit00" android:text="0+" style="@style/DialerDigit" android:background="@drawable/numpad_zero" android:soundEffectsEnabled="true" />
|
||||
<org.linphone.ui.Digit android:id="@+id/DigitHash" android:text="#" style="@style/DialerDigit" android:background="@drawable/numpad_sharp" android:soundEffectsEnabled="true" />
|
||||
</TableRow>
|
||||
|
|
|
@ -30,7 +30,7 @@ import android.view.ViewGroup;
|
|||
* @author Sylvain Berfini
|
||||
*/
|
||||
public class AudioCallFragment extends Fragment {
|
||||
private InCallActivity incallActvityInstance;
|
||||
private CallActivity incallActvityInstance;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
|
@ -42,7 +42,7 @@ public class AudioCallFragment extends Fragment {
|
|||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
incallActvityInstance = (InCallActivity) activity;
|
||||
incallActvityInstance = (CallActivity) activity;
|
||||
|
||||
if (incallActvityInstance != null) {
|
||||
incallActvityInstance.bindAudioFragment(this);
|
||||
|
@ -55,7 +55,7 @@ public class AudioCallFragment extends Fragment {
|
|||
|
||||
// Just to be sure we have incall controls
|
||||
if (incallActvityInstance != null) {
|
||||
incallActvityInstance.setCallControlsVisibleAndRemoveCallbacks();
|
||||
incallActvityInstance.removeCallbacks();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,29 +34,33 @@ import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
|||
import org.linphone.ui.Numpad;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.FragmentManager;
|
||||
import android.app.Dialog;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.media.Image;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemClock;
|
||||
import android.app.Fragment;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
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.view.animation.Animation;
|
||||
import android.view.animation.Animation.AnimationListener;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Button;
|
||||
import android.widget.Chronometer;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
@ -68,19 +72,19 @@ import android.widget.Toast;
|
|||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
public class InCallActivity extends Activity implements OnClickListener {
|
||||
private final static int SECONDS_BEFORE_HIDING_CONTROLS = 3000;
|
||||
public class CallActivity extends Activity implements OnClickListener {
|
||||
private final static int SECONDS_BEFORE_HIDING_CONTROLS = 10000;
|
||||
private final static int SECONDS_BEFORE_DENYING_CALL_UPDATE = 30000;
|
||||
|
||||
private static InCallActivity instance;
|
||||
private static CallActivity instance;
|
||||
|
||||
private Handler mControlsHandler = new Handler();
|
||||
private Runnable mControls;
|
||||
private ImageView switchCamera;
|
||||
private RelativeLayout mActiveCallHeader;
|
||||
private ImageView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference, conferenceStatus;
|
||||
private TextView audioRoute, routeSpeaker, routeReceiver, routeBluetooth;
|
||||
private LinearLayout routeLayout, mNoCurrentCall;
|
||||
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 ProgressBar videoProgress;
|
||||
private StatusFragment status;
|
||||
private AudioCallFragment audioCallFragment;
|
||||
|
@ -92,15 +96,15 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
private Animation slideOutLeftToRight, slideInRightToLeft, slideInBottomToTop, slideInTopToBottom, slideOutBottomToTop, slideOutTopToBottom;
|
||||
private CountDownTimer timer;
|
||||
private boolean isVideoCallPaused = false;
|
||||
AcceptCallUpdateDialogFragment callUpdateDialog;
|
||||
|
||||
private LinearLayout callsList, conferenceList;
|
||||
private LayoutInflater inflater;
|
||||
private ViewGroup container;
|
||||
private boolean isConferenceRunning = false;
|
||||
private LinphoneCoreListenerBase mListener;
|
||||
private DrawerLayout sideMenu;
|
||||
|
||||
public static InCallActivity instance() {
|
||||
public static CallActivity instance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
@ -133,8 +137,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
return;
|
||||
}
|
||||
|
||||
Log.w("State " + message);
|
||||
|
||||
if (state == State.IncomingReceived) {
|
||||
startIncomingCallActivity();
|
||||
return;
|
||||
|
@ -142,7 +144,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
|
||||
if (state == State.Paused || state == State.PausedByRemote || state == State.Pausing) {
|
||||
if(LinphoneManager.getLc().getCurrentCall() != null)
|
||||
Log.w(LinphoneManager.getLc().getCurrentCall().getRemoteContact());
|
||||
enabledVideoButton(false);
|
||||
if(isVideoEnabled(call)){
|
||||
showAudioView();
|
||||
|
@ -156,6 +157,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
showVideoView();
|
||||
}
|
||||
}
|
||||
enabledVideoButton(true);
|
||||
}
|
||||
|
||||
if (state == State.StreamsRunning) {
|
||||
|
@ -172,7 +174,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
|
||||
if (status != null) {
|
||||
videoProgress.setVisibility(View.GONE);
|
||||
//status.refreshStatusItems(call, isVideoEnabled(call));
|
||||
status.refreshStatusItems(call, isVideoEnabled(call));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,8 +195,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
timer = new CountDownTimer(SECONDS_BEFORE_DENYING_CALL_UPDATE, 1000) {
|
||||
public void onTick(long millisUntilFinished) { }
|
||||
public void onFinish() {
|
||||
if (callUpdateDialog != null)
|
||||
callUpdateDialog.dismiss();
|
||||
//TODO dismiss dialog
|
||||
acceptCallUpdate(false);
|
||||
}
|
||||
}.start();
|
||||
|
@ -210,7 +211,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
|
||||
refreshIncallUi();
|
||||
|
||||
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
|
||||
}
|
||||
|
||||
|
@ -324,6 +324,8 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
//Others
|
||||
|
||||
//Active Call
|
||||
callInfo = (LinearLayout) findViewById(R.id.call_header_description);
|
||||
|
||||
pause = (ImageView) findViewById(R.id.pause);
|
||||
pause.setOnClickListener(this);
|
||||
pause.setEnabled(false);
|
||||
|
@ -331,6 +333,9 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
mActiveCallHeader = (RelativeLayout) findViewById(R.id.activeCallHeader);
|
||||
mNoCurrentCall = (LinearLayout) findViewById(R.id.noCurrentCall);
|
||||
|
||||
contactPicture = (ImageView) findViewById(R.id.contact_picture);
|
||||
avatar_layout = (RelativeLayout) findViewById(R.id.avatar_layout);
|
||||
|
||||
/*if(isTablet()){
|
||||
speaker.setEnabled(false);
|
||||
}*/
|
||||
|
@ -351,22 +356,19 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
conference.setEnabled(false);
|
||||
conference.setOnClickListener(this);
|
||||
|
||||
|
||||
|
||||
|
||||
/*try {
|
||||
routeLayout = (LinearLayout) findViewById(R.id.routesLayout);
|
||||
audioRoute = (TextView) findViewById(R.id.audioRoute);
|
||||
try {
|
||||
//routeLayout = (LinearLayout) findViewById(R.id.routesLayout);
|
||||
audioRoute = (ImageView) findViewById(R.id.audioRoute);
|
||||
audioRoute.setOnClickListener(this);
|
||||
routeSpeaker = (TextView) findViewById(R.id.routeSpeaker);
|
||||
routeSpeaker = (ImageView) findViewById(R.id.routeSpeaker);
|
||||
routeSpeaker.setOnClickListener(this);
|
||||
routeReceiver = (TextView) findViewById(R.id.routeReceiver);
|
||||
routeReceiver.setOnClickListener(this);
|
||||
routeBluetooth = (TextView) findViewById(R.id.routeBluetooth);
|
||||
routeEarpiece = (ImageView) findViewById(R.id.routeEarpiece);
|
||||
routeEarpiece.setOnClickListener(this);
|
||||
routeBluetooth = (ImageView) findViewById(R.id.routeBluetooth);
|
||||
routeBluetooth.setOnClickListener(this);
|
||||
} catch (NullPointerException npe) {
|
||||
Log.e("Bluetooth: Audio routes menu disabled on tablets for now (1)");
|
||||
}*/
|
||||
}
|
||||
|
||||
switchCamera = (ImageView) findViewById(R.id.switchCamera);
|
||||
switchCamera.setOnClickListener(this);
|
||||
|
@ -402,9 +404,30 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
} catch (NullPointerException npe) { Log.e("Bluetooth: Audio routes menu disabled on tablets for now (3)"); }
|
||||
}
|
||||
|
||||
createInCallStats();
|
||||
LinphoneManager.getInstance().changeStatusToOnThePhone();
|
||||
}
|
||||
|
||||
public void createInCallStats() {
|
||||
sideMenu = (DrawerLayout) findViewById(R.id.call_stats);
|
||||
menu = (ImageView) findViewById(R.id.call_quality);
|
||||
|
||||
sideMenuContent = (RelativeLayout) findViewById(R.id.side_menu_content);
|
||||
|
||||
menu.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if(sideMenu.isDrawerVisible(Gravity.LEFT)){
|
||||
sideMenu.closeDrawer(sideMenuContent);
|
||||
} else {
|
||||
sideMenu.openDrawer(sideMenuContent);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
status.initCallStatsRefresher(LinphoneManager.getLc().getCurrentCall(), findViewById(R.id.incall_stats));
|
||||
|
||||
}
|
||||
|
||||
private void refreshIncallUi(){
|
||||
refreshInCallActions();
|
||||
|
@ -437,24 +460,21 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
micro.setImageResource(R.drawable.micro_default);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
try {
|
||||
if (isSpeakerEnabled) {
|
||||
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_selected);
|
||||
routeEarpiece.setBackgroundResource(R.drawable.route_earpiece);
|
||||
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth);
|
||||
}
|
||||
|
||||
/*routeSpeaker.setBackgroundResource(R.drawable.route_speaker_on);
|
||||
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
|
||||
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);*/
|
||||
|
||||
/*routeSpeaker.setBackgroundResource(R.drawable.route_speaker_off);
|
||||
routeSpeaker.setBackgroundResource(R.drawable.route_speaker);
|
||||
if (BluetoothManager.getInstance().isUsingBluetoothAudioRoute()) {
|
||||
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
|
||||
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_on);
|
||||
routeEarpiece.setBackgroundResource(R.drawable.route_earpiece);
|
||||
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_selected);
|
||||
} else {
|
||||
routeReceiver.setBackgroundResource(R.drawable.route_receiver_on);
|
||||
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
|
||||
}*/
|
||||
routeEarpiece.setBackgroundResource(R.drawable.route_earpiece_selected);
|
||||
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth);
|
||||
}
|
||||
} catch (NullPointerException npe) {
|
||||
Log.e("Bluetooth: Audio routes menu disabled on tablets for now (4)");
|
||||
}
|
||||
|
@ -554,7 +574,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
hideOrDisplayAudioRoutes();
|
||||
}
|
||||
else if (id == R.id.routeReceiver) {
|
||||
else if (id == R.id.routeEarpiece) {
|
||||
LinphoneManager.getInstance().routeAudioToReceiver();
|
||||
isSpeakerEnabled = false;
|
||||
/*routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
|
||||
|
@ -647,9 +667,10 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
|
||||
private void showAudioView() {
|
||||
LinphoneManager.startProximitySensorForActivity(InCallActivity.this);
|
||||
LinphoneManager.startProximitySensorForActivity(CallActivity.this);
|
||||
replaceFragmentVideoByAudio();
|
||||
setCallControlsVisibleAndRemoveCallbacks();
|
||||
displayAudioCall();
|
||||
removeCallbacks();
|
||||
}
|
||||
|
||||
private void showVideoView() {
|
||||
|
@ -660,11 +681,53 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
refreshInCallActions();
|
||||
|
||||
LinphoneManager.stopProximitySensorForActivity(InCallActivity.this);
|
||||
LinphoneManager.stopProximitySensorForActivity(CallActivity.this);
|
||||
replaceFragmentAudioByVideo();
|
||||
displayVideoCall(false);
|
||||
displayVideoCallControlsIfHidden();
|
||||
}
|
||||
|
||||
private void displayNoCurrentCall(boolean display){
|
||||
if(!display) {
|
||||
mActiveCallHeader.setVisibility(View.VISIBLE);
|
||||
mNoCurrentCall.setVisibility(View.GONE);
|
||||
} else {
|
||||
mActiveCallHeader.setVisibility(View.GONE);
|
||||
mNoCurrentCall.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void displayAudioCall(){
|
||||
mActiveCallHeader.setVisibility(View.VISIBLE);
|
||||
callInfo.setVisibility(View.VISIBLE);
|
||||
avatar_layout.setVisibility(View.VISIBLE);
|
||||
mNoCurrentCall.setVisibility(View.GONE);
|
||||
callsList.setVisibility(View.VISIBLE);
|
||||
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 AudioCallFragment();
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
|
@ -677,8 +740,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
|
||||
private void replaceFragmentAudioByVideo() {
|
||||
// Hiding controls to let displayVideoCallControlsIfHidden add them plus the callback
|
||||
mControlsLayout.setVisibility(View.GONE);
|
||||
switchCamera.setVisibility(View.INVISIBLE);
|
||||
videoCallFragment = new VideoCallFragment();
|
||||
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
|
@ -689,20 +750,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
}
|
||||
|
||||
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() {
|
||||
LinphoneCore lc = LinphoneManager.getLc();
|
||||
isMicMuted = !isMicMuted;
|
||||
|
@ -771,21 +818,13 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
if (mControlsLayout != null) {
|
||||
if (mControlsLayout.getVisibility() != View.VISIBLE) {
|
||||
if (isAnimationDisabled) {
|
||||
mControlsLayout.setVisibility(View.VISIBLE);
|
||||
displayOrHideCallsHeader(false);
|
||||
if (cameraNumber > 1) {
|
||||
switchCamera.setVisibility(View.VISIBLE);
|
||||
}
|
||||
displayVideoCall(true);
|
||||
} else {
|
||||
Animation animation = slideInBottomToTop;
|
||||
animation.setAnimationListener(new AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
mControlsLayout.setVisibility(View.VISIBLE);
|
||||
displayOrHideCallsHeader(false);
|
||||
if (cameraNumber > 1) {
|
||||
switchCamera.setVisibility(View.VISIBLE);
|
||||
}
|
||||
displayVideoCall(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -822,9 +861,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
video.setEnabled(true);
|
||||
transfer.setVisibility(View.INVISIBLE);
|
||||
addCall.setVisibility(View.INVISIBLE);
|
||||
mControlsLayout.setVisibility(View.GONE);
|
||||
displayOrHideCallsHeader(false);
|
||||
switchCamera.setVisibility(View.INVISIBLE);
|
||||
displayVideoCall(false);
|
||||
numpad.setVisibility(View.GONE);
|
||||
options.setImageResource(R.drawable.options_default);
|
||||
} else {
|
||||
|
@ -844,12 +881,9 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
video.setEnabled(true); // HACK: Used to avoid controls from being hided if video is switched while controls are hiding
|
||||
transfer.setVisibility(View.INVISIBLE);
|
||||
addCall.setVisibility(View.INVISIBLE);
|
||||
mControlsLayout.setVisibility(View.GONE);
|
||||
displayOrHideCallsHeader(false);
|
||||
switchCamera.setVisibility(View.INVISIBLE);
|
||||
displayVideoCall(false);
|
||||
numpad.setVisibility(View.GONE);
|
||||
options.setImageResource(R.drawable.options_default);
|
||||
|
||||
animation.setAnimationListener(null);
|
||||
}
|
||||
});
|
||||
|
@ -863,14 +897,11 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
}
|
||||
|
||||
public void setCallControlsVisibleAndRemoveCallbacks() {
|
||||
public void removeCallbacks() {
|
||||
if (mControlsHandler != null && mControls != null) {
|
||||
mControlsHandler.removeCallbacks(mControls);
|
||||
}
|
||||
mControls = null;
|
||||
|
||||
mControlsLayout.setVisibility(View.VISIBLE);
|
||||
switchCamera.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
private void hideNumpad() {
|
||||
|
@ -981,7 +1012,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
public void onAnimationEnd(Animation animation) {
|
||||
transfer.setAnimation(null);
|
||||
transfer.setVisibility(View.INVISIBLE);
|
||||
animation = AnimationUtils.loadAnimation(InCallActivity.this, R.anim.slide_out_top_to_bottom); // Reload animation to prevent transfer button to blink
|
||||
animation = AnimationUtils.loadAnimation(CallActivity.this, R.anim.slide_out_top_to_bottom); // Reload animation to prevent transfer button to blink
|
||||
animation.setAnimationListener(new AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
|
@ -1089,13 +1120,11 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
if (routeSpeaker.getVisibility() == View.VISIBLE) {
|
||||
routeSpeaker.setVisibility(View.GONE);
|
||||
routeBluetooth.setVisibility(View.GONE);
|
||||
routeReceiver.setVisibility(View.GONE);
|
||||
audioRoute.setSelected(false);
|
||||
routeEarpiece.setVisibility(View.GONE);
|
||||
} else {
|
||||
routeSpeaker.setVisibility(View.VISIBLE);
|
||||
routeBluetooth.setVisibility(View.VISIBLE);
|
||||
routeReceiver.setVisibility(View.VISIBLE);
|
||||
audioRoute.setSelected(true);
|
||||
routeEarpiece.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1177,15 +1206,49 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
|
||||
public void startIncomingCallActivity() {
|
||||
startActivity(new Intent(this, IncomingCallActivity.class));
|
||||
startActivity(new Intent(this, CallIncomingActivity.class));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void showAcceptCallUpdateDialog() {
|
||||
FragmentManager fm = getFragmentManager();
|
||||
callUpdateDialog = new AcceptCallUpdateDialogFragment();
|
||||
callUpdateDialog.show(fm, "Accept Call Update Dialog");
|
||||
final Dialog dialog = new Dialog(this);
|
||||
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);
|
||||
customText.setText(getResources().getString(R.string.call_update_video));
|
||||
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.decline);
|
||||
|
||||
delete.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (CallActivity.isInstanciated()) {
|
||||
Log.d("Call Update Accepted");
|
||||
CallActivity.instance().acceptCallUpdate(true);
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (CallActivity.isInstanciated()) {
|
||||
Log.d("Call Update Denied");
|
||||
CallActivity.instance().acceptCallUpdate(false);
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1198,7 +1261,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
displayConference();
|
||||
} else {
|
||||
LinphoneManager.startProximitySensorForActivity(this);
|
||||
setCallControlsVisibleAndRemoveCallbacks();
|
||||
removeCallbacks();
|
||||
}
|
||||
|
||||
super.onResume();
|
||||
|
@ -1331,15 +1394,20 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
|
||||
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), lAddress);
|
||||
if (lContact == null) {
|
||||
if (getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
|
||||
contact.setText(lAddress.getUserName());
|
||||
} else {
|
||||
contact.setText(sipUri);
|
||||
}
|
||||
} else {
|
||||
contact.setText(lContact.getName());
|
||||
LinphoneUtils.setImagePictureFromUri(contactPicture.getContext(), contactPicture, lContact.getPhotoUri(), lContact.getThumbnailUri());
|
||||
}
|
||||
|
||||
|
||||
/*if(contact != null) {
|
||||
|
||||
} else {
|
||||
displayOrHideContactPicture(imageView, null, null, false);
|
||||
}
|
||||
callsList.addView(imageView);*/
|
||||
|
||||
int callDuration = call.getDuration();
|
||||
if (callDuration == 0 && call.getState() != State.StreamsRunning) {
|
||||
return;
|
||||
|
@ -1372,11 +1440,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
|
||||
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), lAddress);
|
||||
if (lContact == null) {
|
||||
if (getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
|
||||
contact.setText(lAddress.getUserName());
|
||||
} else {
|
||||
contact.setText(sipUri);
|
||||
}
|
||||
} else {
|
||||
contact.setText(lContact.getName());
|
||||
}
|
||||
|
@ -1386,13 +1450,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
callsList.addView(callView);
|
||||
|
||||
// Image Row
|
||||
//Contact contact = ContactsManager.getInstance().findContactWithAddress(imageView.getContext().getContentResolver(), lAddress);
|
||||
/*if(contact != null) {
|
||||
displayOrHideContactPicture(imageView, contact.getPhotoUri(), contact.getThumbnailUri(), false);
|
||||
} else {
|
||||
displayOrHideContactPicture(imageView, null, null, false);
|
||||
}
|
||||
callsList.addView(imageView);*/
|
||||
|
||||
|
||||
|
||||
// callView.setTag(imageView);
|
||||
|
@ -1416,11 +1474,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
|
||||
Contact lContact = ContactsManager.getInstance().findContactWithAddress(callView.getContext().getContentResolver(), lAddress);
|
||||
if (lContact == null) {
|
||||
if (resources.getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
|
||||
contact.setText(lAddress.getUserName());
|
||||
} else {
|
||||
contact.setText(sipUri);
|
||||
}
|
||||
} else {
|
||||
contact.setText(lContact.getName());
|
||||
}
|
||||
|
@ -1457,7 +1511,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
private void displayOrHideContactPicture(LinearLayout callView, Uri pictureUri, Uri thumbnailUri, boolean hide) {
|
||||
/*ImageView contactPicture = (ImageView) callView.findViewById(R.id.contactPicture);
|
||||
if (pictureUri != null) {
|
||||
LinphoneUtils.setImagePictureFromUri(callView.getContext(), contactPicture, Uri.parse(pictureUri.toString()), thumbnailUri, R.drawable.unknown_small);
|
||||
|
||||
}
|
||||
callView.setVisibility(hide ? View.GONE : View.VISIBLE);*/
|
||||
}
|
||||
|
@ -1535,7 +1589,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
LinphoneManager.getLc().addAllToConference();
|
||||
displayConferenceHeader();
|
||||
mNoCurrentCall.setVisibility(View.GONE);
|
||||
displayOrHideCallsHeader(false);
|
||||
mActiveCallHeader.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void pauseOrResumeConference() {
|
||||
|
@ -1585,7 +1639,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
|||
|
||||
private void displayConference(){
|
||||
mControlsLayout.setVisibility(View.VISIBLE);
|
||||
LinphoneManager.startProximitySensorForActivity(InCallActivity.this);
|
||||
LinphoneManager.startProximitySensorForActivity(CallActivity.this);
|
||||
mActiveCallHeader.setVisibility(View.GONE);
|
||||
mNoCurrentCall.setVisibility(View.GONE);
|
||||
callsList.setVisibility(View.VISIBLE);
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
IncomingCallActivity.java
|
||||
Copyright (C) 2011 Belledonne Communications, Grenoble, France
|
||||
CallIncomingActivity.java
|
||||
Copyright (C) 2015 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -35,27 +35,22 @@ import android.view.KeyEvent;
|
|||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
/**
|
||||
* Activity displayed when a call comes in.
|
||||
* It should bypass the screen lock mechanism.
|
||||
*
|
||||
* @author Guillaume Beraudo
|
||||
*/
|
||||
public class IncomingCallActivity extends Activity implements LinphoneSliderTriggered {
|
||||
public class CallIncomingActivity extends Activity implements LinphoneSliderTriggered {
|
||||
|
||||
private static IncomingCallActivity instance;
|
||||
private static CallIncomingActivity instance;
|
||||
|
||||
private TextView mNameView;
|
||||
private TextView mNumberView;
|
||||
private ImageView mPictureView;
|
||||
private TextView name, number;
|
||||
private ImageView contactPicture, acceptArrow, accept, decline;
|
||||
private LinphoneCall mCall;
|
||||
private LinphoneCoreListenerBase mListener;
|
||||
private LinearLayout acceptUnlock;
|
||||
private StatusFragment status;
|
||||
|
||||
public static IncomingCallActivity instance() {
|
||||
public static CallIncomingActivity instance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
@ -68,25 +63,24 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
|
|||
super.onCreate(savedInstanceState);
|
||||
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
setContentView(R.layout.incoming);
|
||||
setContentView(R.layout.call_incoming);
|
||||
|
||||
mNameView = (TextView) findViewById(R.id.incoming_caller_name);
|
||||
mNumberView = (TextView) findViewById(R.id.incoming_caller_number);
|
||||
mPictureView = (ImageView) findViewById(R.id.incoming_picture);
|
||||
name = (TextView) findViewById(R.id.contact_name);
|
||||
number = (TextView) findViewById(R.id.contact_number);
|
||||
contactPicture = (ImageView) findViewById(R.id.contact_picture);
|
||||
|
||||
// set this flag so this activity will stay in front of the keyguard
|
||||
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
|
||||
getWindow().addFlags(flags);
|
||||
|
||||
ImageView accept = (ImageView) findViewById(R.id.accept);
|
||||
accept = (ImageView) findViewById(R.id.accept);
|
||||
accept.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
answer();
|
||||
}
|
||||
});
|
||||
|
||||
ImageView decline = (ImageView) findViewById(R.id.decline);
|
||||
decline = (ImageView) findViewById(R.id.decline);
|
||||
decline.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -94,8 +88,6 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
|
|||
}
|
||||
});
|
||||
|
||||
// "Dial-to-answer" widget for incoming calls.
|
||||
|
||||
mListener = new LinphoneCoreListenerBase(){
|
||||
@Override
|
||||
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
|
||||
|
@ -138,14 +130,14 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
|
|||
return;
|
||||
}
|
||||
LinphoneAddress address = mCall.getRemoteAddress();
|
||||
// May be greatly sped up using a drawable cache
|
||||
Contact contact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), address);
|
||||
//LinphoneUtils.setImagePictureFromUri(this, mPictureView, contact != null ? contact.getPhotoUri() : null,
|
||||
// contact != null ? contact.getThumbnailUri() : null, R.drawable.unknown_small);
|
||||
|
||||
// To be done after findUriPictureOfContactAndSetDisplayName called
|
||||
mNameView.setText(contact != null ? contact.getName() : address.getUserName());
|
||||
mNumberView.setText(address.asStringUriOnly());
|
||||
if (contact != null) {
|
||||
LinphoneUtils.setImagePictureFromUri(this, contactPicture, contact.getPhotoUri(), contact.getThumbnailUri());
|
||||
name.setText(contact.getName());
|
||||
} else {
|
||||
name.setText(LinphoneUtils.getAddressDisplayName(address));
|
||||
}
|
||||
number.setText(address.asStringUriOnly());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -183,12 +175,6 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
|
|||
private void answer() {
|
||||
LinphoneCallParams params = LinphoneManager.getLc().createDefaultCallParameters();
|
||||
|
||||
boolean isLowBandwidthConnection = !LinphoneUtils.isHighBandwidthConnection(this);
|
||||
if (isLowBandwidthConnection) {
|
||||
params.enableLowBandwidth(true);
|
||||
Log.d("Low bandwidth enabled in call params");
|
||||
}
|
||||
|
||||
if (!LinphoneManager.getInstance().acceptCallWithParams(mCall, params)) {
|
||||
// the above method takes care of Samsung Galaxy S
|
||||
Toast.makeText(this, R.string.couldnt_accept_call, Toast.LENGTH_LONG).show();
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
IncomingCallActivity.java
|
||||
Copyright (C) 2011 Belledonne Communications, Grenoble, France
|
||||
CallOutgoingActivity.java
|
||||
Copyright (C) 2015 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -29,35 +29,26 @@ import org.linphone.core.LinphoneCoreListenerBase;
|
|||
import org.linphone.mediastream.Log;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import de.timroes.axmlrpc.Call;
|
||||
public class CallOutgoingActivity extends Activity implements OnClickListener{
|
||||
|
||||
/**
|
||||
* Activity displayed when a call comes in.
|
||||
* It should bypass the screen lock mechanism.
|
||||
*
|
||||
* @author Guillaume Beraudo
|
||||
*/
|
||||
public class OutgoingCallActivity extends Activity {
|
||||
private static CallOutgoingActivity instance;
|
||||
|
||||
private static OutgoingCallActivity instance;
|
||||
|
||||
private TextView mNameView, mNumberView;
|
||||
private ImageView mPictureView, micro, speaker, decline;
|
||||
private TextView name, number;
|
||||
private ImageView contactPicture, micro, speaker, hangUp;
|
||||
private LinphoneCall mCall;
|
||||
private LinphoneCoreListenerBase mListener;
|
||||
private boolean isMicMuted, isSpeakerEnabled;
|
||||
private StatusFragment status;
|
||||
|
||||
public static OutgoingCallActivity instance() {
|
||||
public static CallOutgoingActivity instance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
@ -74,63 +65,26 @@ public class OutgoingCallActivity extends Activity {
|
|||
super.onCreate(savedInstanceState);
|
||||
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
setContentView(R.layout.outgoing_call);
|
||||
setContentView(R.layout.call_outgoing);
|
||||
|
||||
mNameView = (TextView) findViewById(R.id.incoming_caller_name);
|
||||
mNumberView = (TextView) findViewById(R.id.incoming_caller_number);
|
||||
mPictureView = (ImageView) findViewById(R.id.incoming_picture);
|
||||
|
||||
micro = (ImageView) findViewById(R.id.micro);
|
||||
micro.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
}
|
||||
});
|
||||
speaker = (ImageView) findViewById(R.id.speaker);
|
||||
name = (TextView) findViewById(R.id.contact_name);
|
||||
number = (TextView) findViewById(R.id.contact_number);
|
||||
contactPicture = (ImageView) findViewById(R.id.contact_picture);
|
||||
|
||||
isMicMuted = false;
|
||||
isSpeakerEnabled = false;
|
||||
|
||||
micro.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
isMicMuted = !isMicMuted;
|
||||
if(isMicMuted) {
|
||||
micro.setImageResource(R.drawable.micro_selected);
|
||||
} else {
|
||||
micro.setImageResource(R.drawable.micro_default);
|
||||
}
|
||||
LinphoneManager.getLc().muteMic(isMicMuted);
|
||||
}
|
||||
});
|
||||
|
||||
speaker.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
isSpeakerEnabled = !isSpeakerEnabled;
|
||||
if(isSpeakerEnabled) {
|
||||
speaker.setImageResource(R.drawable.speaker_selected);
|
||||
} else {
|
||||
speaker.setImageResource(R.drawable.speaker_default);
|
||||
}
|
||||
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
|
||||
}
|
||||
});
|
||||
micro = (ImageView) findViewById(R.id.micro);
|
||||
micro.setOnClickListener(this);
|
||||
speaker = (ImageView) findViewById(R.id.speaker);
|
||||
speaker.setOnClickListener(this);
|
||||
|
||||
// set this flag so this activity will stay in front of the keyguard
|
||||
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
|
||||
getWindow().addFlags(flags);
|
||||
|
||||
// "Dial-to-answer" widget for incoming calls.
|
||||
|
||||
ImageView decline = (ImageView) findViewById(R.id.hang_up);
|
||||
decline.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
decline();
|
||||
}
|
||||
});
|
||||
hangUp = (ImageView) findViewById(R.id.hang_up);
|
||||
hangUp.setOnClickListener(this);
|
||||
|
||||
mListener = new LinphoneCoreListenerBase(){
|
||||
@Override
|
||||
|
@ -174,27 +128,27 @@ public class OutgoingCallActivity extends Activity {
|
|||
if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() != null) {
|
||||
List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc());
|
||||
for (LinphoneCall call : calls) {
|
||||
if (State.OutgoingInit == call.getState() || State.OutgoingProgress == call.getState()) {
|
||||
if (State.OutgoingInit == call.getState() || State.OutgoingProgress == call.getState() || State.OutgoingRinging == call.getState() || State.OutgoingEarlyMedia == call.getState()) {
|
||||
mCall = call;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mCall == null) {
|
||||
Log.e("Couldn't find incoming call");
|
||||
Log.e("Couldn't find outgoing call");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
LinphoneAddress address = mCall.getRemoteAddress();
|
||||
// May be greatly sped up using a drawable cache
|
||||
Contact contact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), address);
|
||||
//LinphoneUtils.setImagePictureFromUri(this, mPictureView, contact != null ? contact.getPhotoUri() : null,
|
||||
// contact != null ? contact.getThumbnailUri() : null, R.drawable.unknown_small);
|
||||
|
||||
// To be done after findUriPictureOfContactAndSetDisplayName called
|
||||
mNameView.setText(contact != null ? contact.getName() : address.getUserName());
|
||||
mNumberView.setText(address.asStringUriOnly());
|
||||
|
||||
if (contact != null) {
|
||||
LinphoneUtils.setImagePictureFromUri(this, contactPicture, contact.getPhotoUri(), contact.getThumbnailUri());
|
||||
name.setText(contact.getName());
|
||||
} else {
|
||||
name.setText(LinphoneUtils.getAddressDisplayName(address));
|
||||
}
|
||||
number.setText(address.asStringUriOnly());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -212,6 +166,33 @@ public class OutgoingCallActivity extends Activity {
|
|||
instance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
if (id == R.id.micro) {
|
||||
isMicMuted = !isMicMuted;
|
||||
if(isMicMuted) {
|
||||
micro.setImageResource(R.drawable.micro_selected);
|
||||
} else {
|
||||
micro.setImageResource(R.drawable.micro_default);
|
||||
}
|
||||
LinphoneManager.getLc().muteMic(isMicMuted);
|
||||
}
|
||||
if (id == R.id.speaker) {
|
||||
isSpeakerEnabled = !isSpeakerEnabled;
|
||||
if(isSpeakerEnabled) {
|
||||
speaker.setImageResource(R.drawable.speaker_selected);
|
||||
} else {
|
||||
speaker.setImageResource(R.drawable.speaker_default);
|
||||
}
|
||||
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
|
||||
}
|
||||
if (id == R.id.hang_up) {
|
||||
decline();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (LinphoneManager.isInstanciated() && (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_HOME)) {
|
||||
|
@ -224,5 +205,4 @@ public class OutgoingCallActivity extends Activity {
|
|||
private void decline() {
|
||||
LinphoneManager.getLc().terminateCall(mCall);
|
||||
}
|
||||
|
||||
}
|
|
@ -231,9 +231,9 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
|
||||
if (state == State.IncomingReceived) {
|
||||
//finish();
|
||||
startActivity(new Intent(LinphoneActivity.instance(), IncomingCallActivity.class));
|
||||
startActivity(new Intent(LinphoneActivity.instance(), CallIncomingActivity.class));
|
||||
} else if (state == State.OutgoingInit || state == State.OutgoingProgress) {
|
||||
startActivity(new Intent(LinphoneActivity.instance(), OutgoingCallActivity.class));
|
||||
startActivity(new Intent(LinphoneActivity.instance(), CallOutgoingActivity.class));
|
||||
} else if (state == State.CallEnd || state == State.Error || state == State.CallReleased) {
|
||||
// Convert LinphoneCore message for internalization
|
||||
if (message != null && call.getReason() == Reason.Declined) {
|
||||
|
@ -935,14 +935,14 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
}
|
||||
|
||||
public void startVideoActivity(LinphoneCall currentCall) {
|
||||
Intent intent = new Intent(this, InCallActivity.class);
|
||||
Intent intent = new Intent(this, CallActivity.class);
|
||||
intent.putExtra("VideoEnabled", true);
|
||||
startOrientationSensor();
|
||||
startActivityForResult(intent, CALL_ACTIVITY);
|
||||
}
|
||||
|
||||
public void startIncallActivity(LinphoneCall currentCall) {
|
||||
Intent intent = new Intent(this, InCallActivity.class);
|
||||
Intent intent = new Intent(this, CallActivity.class);
|
||||
intent.putExtra("VideoEnabled", false);
|
||||
startOrientationSensor();
|
||||
startActivityForResult(intent, CALL_ACTIVITY);
|
||||
|
@ -1028,7 +1028,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc().getCallsNb() > 0) {
|
||||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||
if (call.getState() == LinphoneCall.State.IncomingReceived) {
|
||||
startActivity(new Intent(LinphoneActivity.this, IncomingCallActivity.class));
|
||||
startActivity(new Intent(LinphoneActivity.this, CallIncomingActivity.class));
|
||||
} else if (call.getCurrentParamsCopy().getVideoEnabled()) {
|
||||
startVideoActivity(call);
|
||||
} else {
|
||||
|
@ -1124,9 +1124,9 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||
LinphoneCall.State callState = call.getState();
|
||||
if (callState == State.IncomingReceived) {
|
||||
startActivity(new Intent(this, IncomingCallActivity.class));
|
||||
startActivity(new Intent(this, CallIncomingActivity.class));
|
||||
} else if (callState == State.OutgoingInit) {
|
||||
startActivity(new Intent(this, OutgoingCallActivity.class));
|
||||
startActivity(new Intent(this, CallOutgoingActivity.class));
|
||||
} else {
|
||||
if (call.getCurrentParamsCopy().getVideoEnabled()) {
|
||||
startVideoActivity(call);
|
||||
|
@ -1217,10 +1217,10 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
Collection<LinphoneCall.State> incoming = new ArrayList<LinphoneCall.State>();
|
||||
incoming.add(LinphoneCall.State.IncomingReceived);
|
||||
if (LinphoneUtils.getCallsInState(LinphoneManager.getLc(), incoming).size() > 0) {
|
||||
if (InCallActivity.isInstanciated()) {
|
||||
InCallActivity.instance().startIncomingCallActivity();
|
||||
if (CallActivity.isInstanciated()) {
|
||||
CallActivity.instance().startIncomingCallActivity();
|
||||
} else {
|
||||
startActivity(new Intent(this, IncomingCallActivity.class));
|
||||
startActivity(new Intent(this, CallIncomingActivity.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,6 +167,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
mRingbackSoundFile = basePath + "/ringback.wav";
|
||||
mPauseSoundFile = basePath + "/toy_mono.wav";
|
||||
mChatDatabaseFile = basePath + "/linphone-history.db";
|
||||
mCallLogDatabaseFile = basePath + "/linphone-log-history.db";
|
||||
mErrorToneFile = basePath + "/error.wav";
|
||||
mConfigFile = basePath + "/configrc";
|
||||
|
||||
|
@ -190,6 +191,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
private final String mRingbackSoundFile;
|
||||
private final String mPauseSoundFile;
|
||||
private final String mChatDatabaseFile;
|
||||
private final String mCallLogDatabaseFile;
|
||||
private final String mErrorToneFile;
|
||||
private final String mConfigFile;
|
||||
private ByteArrayInputStream mUploadingImageStream;
|
||||
|
@ -413,9 +415,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
LinphoneAddress lAddress;
|
||||
try {
|
||||
lAddress = mLc.interpretUrl(to);
|
||||
if (mServiceContext.getResources().getBoolean(R.bool.override_domain_using_default_one)) {
|
||||
lAddress.setDomain(mServiceContext.getString(R.string.default_domain));
|
||||
}
|
||||
LinphoneProxyConfig lpc = mLc.getDefaultProxyConfig();
|
||||
|
||||
if (mR.getBoolean(R.bool.forbid_self_call) && lpc!=null && lAddress.asStringUriOnly().equals(lpc.getIdentity())) {
|
||||
|
@ -856,7 +855,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
|
||||
try {
|
||||
Contact contact = ContactsManager.getInstance().findContactWithAddress(mServiceContext.getContentResolver(), from);
|
||||
if (!mServiceContext.getResources().getBoolean(R.bool.disable_chat__message_notification)) {
|
||||
if (!mServiceContext.getResources().getBoolean(R.bool.disable_chat_message_notification)) {
|
||||
if (LinphoneActivity.isInstanciated() && !LinphoneActivity.instance().displayChatMessageNotification(from.asStringUriOnly())) {
|
||||
return;
|
||||
} else {
|
||||
|
@ -920,10 +919,10 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
try {
|
||||
if (LinphoneActivity.isInstanciated())
|
||||
return LinphoneActivity.instance();
|
||||
else if (InCallActivity.isInstanciated())
|
||||
return InCallActivity.instance();
|
||||
else if (IncomingCallActivity.isInstanciated())
|
||||
return IncomingCallActivity.instance();
|
||||
else if (CallActivity.isInstanciated())
|
||||
return CallActivity.instance();
|
||||
else if (CallIncomingActivity.isInstanciated())
|
||||
return CallIncomingActivity.instance();
|
||||
else if (mServiceContext != null)
|
||||
return mServiceContext;
|
||||
else if (LinphoneService.isReady())
|
||||
|
|
|
@ -22,6 +22,8 @@ import java.util.TimerTask;
|
|||
|
||||
import org.linphone.assistant.AssistantActivity;
|
||||
import org.linphone.core.LinphoneCall;
|
||||
import org.linphone.core.LinphoneCallParams;
|
||||
import org.linphone.core.LinphoneCallStats;
|
||||
import org.linphone.core.LinphoneContent;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.LinphoneCore.MediaEncryption;
|
||||
|
@ -29,6 +31,7 @@ import org.linphone.core.LinphoneCore.RegistrationState;
|
|||
import org.linphone.core.LinphoneCoreListenerBase;
|
||||
import org.linphone.core.LinphoneEvent;
|
||||
import org.linphone.core.LinphoneProxyConfig;
|
||||
import org.linphone.core.PayloadType;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
import android.app.Activity;
|
||||
|
@ -153,17 +156,17 @@ public class StatusFragment extends Fragment {
|
|||
if (activity instanceof LinphoneActivity) {
|
||||
((LinphoneActivity) activity).updateStatusFragment(this);
|
||||
isInCall = false;
|
||||
} else if (activity instanceof InCallActivity) {
|
||||
((InCallActivity) activity).updateStatusFragment(this);
|
||||
} else if (activity instanceof CallActivity) {
|
||||
((CallActivity) activity).updateStatusFragment(this);
|
||||
isInCall = true;
|
||||
} else if (activity instanceof AssistantActivity) {
|
||||
((AssistantActivity) activity).updateStatusFragment(this);
|
||||
isInCall = false;
|
||||
} else if (activity instanceof IncomingCallActivity) {
|
||||
((IncomingCallActivity) activity).updateStatusFragment(this);
|
||||
} else if (activity instanceof CallIncomingActivity) {
|
||||
((CallIncomingActivity) activity).updateStatusFragment(this);
|
||||
isInCall = true;
|
||||
} else if (activity instanceof OutgoingCallActivity) {
|
||||
((OutgoingCallActivity) activity).updateStatusFragment(this);
|
||||
} else if (activity instanceof CallOutgoingActivity) {
|
||||
((CallOutgoingActivity) activity).updateStatusFragment(this);
|
||||
isInCall = true;
|
||||
}
|
||||
}
|
||||
|
@ -180,7 +183,7 @@ public class StatusFragment extends Fragment {
|
|||
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc() != null) {
|
||||
voicemailCount.setVisibility(View.GONE);
|
||||
|
||||
if (isInCall && isAttached && getResources().getBoolean(R.bool.display_call_stats)) {
|
||||
if (isInCall && isAttached) {
|
||||
LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
|
||||
//initCallStatsRefresher(call, callStats);
|
||||
} else if (!isInCall) {
|
||||
|
@ -398,12 +401,12 @@ public class StatusFragment extends Fragment {
|
|||
.show();
|
||||
}
|
||||
|
||||
private void initCallStatsRefresher(final LinphoneCall call, final View view) {
|
||||
public void initCallStatsRefresher(final LinphoneCall call, final View view) {
|
||||
if (mTimer != null && mTask != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* mTimer = new Timer();
|
||||
mTimer = new Timer();
|
||||
mTask = new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -467,7 +470,7 @@ public class StatusFragment extends Fragment {
|
|||
});
|
||||
}
|
||||
};
|
||||
mTimer.scheduleAtFixedRate(mTask, 0, 1000);*/
|
||||
mTimer.scheduleAtFixedRate(mTask, 0, 1000);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public class VideoCallFragment extends Fragment implements OnGestureListener, On
|
|||
private float mZoomFactor = 1.f;
|
||||
private float mZoomCenterX, mZoomCenterY;
|
||||
private CompatibilityScaleGestureDetector mScaleDetector;
|
||||
private InCallActivity inCallActivity;
|
||||
private CallActivity inCallActivity;
|
||||
|
||||
@SuppressWarnings("deprecation") // Warning useless because value is ignored and automatically set by new APIs.
|
||||
@Override
|
||||
|
@ -274,7 +274,7 @@ public class VideoCallFragment extends Fragment implements OnGestureListener, On
|
|||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
|
||||
inCallActivity = (InCallActivity) activity;
|
||||
inCallActivity = (CallActivity) activity;
|
||||
if (inCallActivity != null) {
|
||||
inCallActivity.bindVideoFragment(this);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
package org.linphone.ui;
|
||||
|
||||
import org.linphone.InCallActivity;
|
||||
import org.linphone.CallActivity;
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.LinphonePreferences;
|
||||
import org.linphone.LinphoneService;
|
||||
|
@ -166,8 +166,8 @@ public class Digit extends Button implements AddressAware {
|
|||
if (!mPlayDtmf) return false;
|
||||
if (!linphoneServiceReady()) return true;
|
||||
|
||||
if (InCallActivity.isInstanciated()) {
|
||||
InCallActivity.instance().resetControlsHidingCallBack();
|
||||
if (CallActivity.isInstanciated()) {
|
||||
CallActivity.instance().resetControlsHidingCallBack();
|
||||
}
|
||||
|
||||
LinphoneCore lc = LinphoneManager.getLc();
|
||||
|
|
Loading…
Reference in a new issue