diff --git a/res/anim/slide_in_top_to_bottom.xml b/res/anim/slide_in_top_to_bottom.xml
new file mode 100644
index 000000000..6bb7ac339
--- /dev/null
+++ b/res/anim/slide_in_top_to_bottom.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/res/anim/slide_out_bottom_to_top.xml b/res/anim/slide_out_bottom_to_top.xml
new file mode 100644
index 000000000..5db6fd044
--- /dev/null
+++ b/res/anim/slide_out_bottom_to_top.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/res/drawable/add_call_page_contact.png b/res/drawable/add_call_page_contact.png
deleted file mode 100644
index f91eeffb6..000000000
Binary files a/res/drawable/add_call_page_contact.png and /dev/null differ
diff --git a/res/drawable/incall_contact_actif.png b/res/drawable/incall_contact_actif.png
deleted file mode 100644
index d2dbc4ca9..000000000
Binary files a/res/drawable/incall_contact_actif.png and /dev/null differ
diff --git a/res/drawable/incall_contact_over.png b/res/drawable/incall_contact_over.png
deleted file mode 100644
index 5a904ef36..000000000
Binary files a/res/drawable/incall_contact_over.png and /dev/null differ
diff --git a/res/drawable/incall_contacts.xml b/res/drawable/incall_contacts.xml
deleted file mode 100644
index 72d41e948..000000000
--- a/res/drawable/incall_contacts.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/switch_camera_default.png b/res/drawable/switch_camera_default.png
index e0e42c09f..f67fe6312 100644
Binary files a/res/drawable/switch_camera_default.png and b/res/drawable/switch_camera_default.png differ
diff --git a/res/drawable/switch_camera_over.png b/res/drawable/switch_camera_over.png
index 7afcd0a23..2f12f0ea4 100644
Binary files a/res/drawable/switch_camera_over.png and b/res/drawable/switch_camera_over.png differ
diff --git a/res/layout/incall.xml b/res/layout/incall.xml
index 15b31907e..28891d933 100644
--- a/res/layout/incall.xml
+++ b/res/layout/incall.xml
@@ -9,7 +9,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
-
+
+
-
+
-
-
\ No newline at end of file
diff --git a/src/org/linphone/InCallActivity.java b/src/org/linphone/InCallActivity.java
index 0025fd94d..40f1f0e1f 100644
--- a/src/org/linphone/InCallActivity.java
+++ b/src/org/linphone/InCallActivity.java
@@ -56,9 +56,10 @@ public class InCallActivity extends FragmentActivity implements
private Handler mHandler = new Handler();
private Handler controlsHandler = new Handler();
private Runnable mControls;
- private ImageView video, micro, speaker, addCall, pause, hangUp, dialer;
+ private ImageView video, micro, speaker, addCall, pause, hangUp, dialer, switchCamera;
private StatusFragment status;
private AudioCallFragment audioCallFragment;
+ private VideoCallFragment videoCallFragment;
private boolean isSpeakerEnabled, isMicMuted, isVideoEnabled;
private LinearLayout mControlsLayout;
@@ -89,9 +90,12 @@ public class InCallActivity extends FragmentActivity implements
Fragment callFragment;
if (isVideoEnabled) {
callFragment = new VideoCallFragment();
+ videoCallFragment = (VideoCallFragment) callFragment;
+ switchCamera.setVisibility(View.VISIBLE);
} else {
callFragment = new AudioCallFragment();
audioCallFragment = (AudioCallFragment) callFragment;
+ switchCamera.setVisibility(View.GONE);
}
callFragment.setArguments(getIntent().getExtras());
getSupportFragmentManager().beginTransaction().add(R.id.fragmentContainer, callFragment).commit();
@@ -116,6 +120,9 @@ public class InCallActivity extends FragmentActivity implements
dialer = (ImageView) findViewById(R.id.dialer);
dialer.setOnClickListener(this);
+ switchCamera = (ImageView) findViewById(R.id.switchCamera);
+ switchCamera.setOnClickListener(this);
+
mControlsLayout = (LinearLayout) findViewById(R.id.menu);
if (isVideoEnabled) {
@@ -164,6 +171,11 @@ public class InCallActivity extends FragmentActivity implements
else if (id == R.id.dialer) {
}
+ else if (id == R.id.switchCamera) {
+ if (videoCallFragment != null) {
+ videoCallFragment.switchCamera();
+ }
+ }
}
@@ -207,11 +219,12 @@ public class InCallActivity extends FragmentActivity implements
}
private void replaceFragmentAudioByVideo() {
- VideoCallFragment videoCallFragment = new VideoCallFragment();
+ switchCamera.setVisibility(View.VISIBLE);
+ videoCallFragment = new VideoCallFragment();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragmentContainer, videoCallFragment);
- transaction.commitAllowingStateLoss();
+ transaction.commitAllowingStateLoss();
}
private void toogleMicro() {
@@ -270,12 +283,14 @@ public class InCallActivity extends FragmentActivity implements
if (mControlsLayout.getVisibility() == View.GONE) {
if (InCallActivity.this.getResources().getBoolean(R.bool.disable_animations)) {
mControlsLayout.setVisibility(View.VISIBLE);
+ switchCamera.setVisibility(View.VISIBLE);
} else {
Animation animation = AnimationUtils.loadAnimation(this, R.anim.slide_in_bottom_to_top);
animation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
mControlsLayout.setVisibility(View.VISIBLE);
+ switchCamera.setVisibility(View.VISIBLE);
}
@Override
@@ -287,6 +302,7 @@ public class InCallActivity extends FragmentActivity implements
}
});
mControlsLayout.startAnimation(animation);
+ switchCamera.startAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_top_to_bottom));
}
}
@@ -298,6 +314,7 @@ public class InCallActivity extends FragmentActivity implements
public void run() {
if (InCallActivity.this.getResources().getBoolean(R.bool.disable_animations)) {
mControlsLayout.setVisibility(View.GONE);
+ switchCamera.setVisibility(View.GONE);
} else {
Animation animation = AnimationUtils.loadAnimation(InCallActivity.this, R.anim.slide_out_top_to_bottom);
animation.setAnimationListener(new AnimationListener() {
@@ -312,9 +329,11 @@ public class InCallActivity extends FragmentActivity implements
@Override
public void onAnimationEnd(Animation animation) {
mControlsLayout.setVisibility(View.GONE);
+ switchCamera.setVisibility(View.GONE);
}
});
mControlsLayout.startAnimation(animation);
+ switchCamera.startAnimation(AnimationUtils.loadAnimation(InCallActivity.this, R.anim.slide_out_bottom_to_top));
}
}
}, SECONDS_BEFORE_HIDING_CONTROLS);
@@ -328,6 +347,7 @@ public class InCallActivity extends FragmentActivity implements
}
mControlsLayout.setVisibility(View.VISIBLE);
+ switchCamera.setVisibility(View.GONE);
}
private boolean isCallRunning(LinphoneCall call)
diff --git a/src/org/linphone/VideoCallFragment.java b/src/org/linphone/VideoCallFragment.java
index fcda06aed..e4d9f1231 100644
--- a/src/org/linphone/VideoCallFragment.java
+++ b/src/org/linphone/VideoCallFragment.java
@@ -33,10 +33,8 @@ import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
-import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
-import android.widget.ImageView;
//FIXME : preview gone after coming back from audio only
/**
@@ -47,7 +45,6 @@ public class VideoCallFragment extends Fragment {
private WakeLock mWakeLock;
private SurfaceView mVideoView;
private SurfaceView mCaptureView;
- private ImageView switchCamera;
private AndroidVideoWindowImpl androidVideoWindowImpl;
@Override
@@ -55,14 +52,6 @@ public class VideoCallFragment extends Fragment {
Bundle savedInstanceState) {
instance = this;
View view = inflater.inflate(R.layout.video, container, false);
-
- switchCamera = (ImageView) view.findViewById(R.id.switchCamera);
- switchCamera.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- switchCamera();
- }
- });
mVideoView = (SurfaceView) view.findViewById(R.id.videoSurface);
mCaptureView = (SurfaceView) view.findViewById(R.id.videoCaptureSurface);
@@ -124,7 +113,7 @@ public class VideoCallFragment extends Fragment {
preview.setZOrderMediaOverlay(true); // Needed to be able to display control layout over
}
- private void switchCamera() {
+ public void switchCamera() {
int videoDeviceId = LinphoneManager.getLc().getVideoDevice();
videoDeviceId = (videoDeviceId + 1) % AndroidCameraConfiguration.retrieveCameras().length;
LinphoneManager.getLc().setVideoDevice(videoDeviceId);