Fix top black bar on tablets + fix echo canceller setting + updated ms2

This commit is contained in:
Sylvain Berfini 2014-01-23 16:59:39 +01:00
parent eb0fc34453
commit 3a0cb99605
7 changed files with 226 additions and 16 deletions

View file

@ -14,8 +14,7 @@
android:id="@+id/fragmentContainer" android:id="@+id/fragmentContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" android:orientation="horizontal" />
android:paddingTop="40dp" />
<TableLayout <TableLayout
android:id="@+id/calls" android:id="@+id/calls"

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/video_frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<org.linphone.mediastream.video.display.GL2JNIView
android:visibility="visible"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/videoSurface" />
<SurfaceView
android:id="@+id/videoCaptureSurface"
android:layout_width="218dp"
android:layout_height="160dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />
</RelativeLayout>

View file

@ -0,0 +1,179 @@
<?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">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true">
<LinearLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" />
<TableLayout
android:id="@+id/calls"
android:paddingTop="40dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top" />
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/status" />
</FrameLayout>
<ImageView
android:id="@+id/switchCamera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:contentDescription="@string/content_description_switch_camera"
android:layout_marginTop="40dp"
android:visibility="invisible"
android:src="@drawable/switch_camera" />
<org.linphone.ui.Numpad
android:id="@+id/numpad"
android:background="@drawable/dialer_alt_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_marginBottom="150dp"
android:layout_centerInParent="true" />
<RelativeLayout
android:id="@+id/menu"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_gravity="bottom"
android:gravity="bottom"
android:orientation="horizontal" >
<TextView
android:id="@+id/video"
android:background="@drawable/video_off"
android:text="@string/button_video"
android:gravity="center"
android:paddingTop="45dp"
android:textColor="@drawable/text_incall_button_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/micro"
android:background="@drawable/micro_on"
android:text="@string/button_micro"
android:gravity="center"
android:paddingTop="45dp"
android:textColor="@drawable/text_incall_button_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/speaker"
android:background="@drawable/speaker_off"
android:text="@string/button_speaker"
android:gravity="center"
android:paddingTop="45dp"
android:textColor="@drawable/text_incall_button_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/options"
android:background="@drawable/options"
android:text="@string/button_options"
android:gravity="center"
android:paddingTop="45dp"
android:textColor="@drawable/text_incall_button_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/addCall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/options_add_call_alt"
android:visibility="gone"
android:gravity="center"
android:paddingTop="45dp"
android:text="@string/button_add_call"
android:textColor="@drawable/text_incall_button_color" />
<TextView
android:id="@+id/transfer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/options_transfer"
android:visibility="gone"
android:gravity="center"
android:paddingTop="45dp"
android:text="@string/button_transfer"
android:textColor="@drawable/text_incall_button_color" />
</LinearLayout>
<LinearLayout
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/conference"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description_conference"
android:scaleType="fitXY"
android:src="@drawable/conference" />
<ImageView
android:id="@+id/pause"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description_pause"
android:scaleType="fitXY"
android:src="@drawable/pause_off" />
<ImageView
android:id="@+id/dialer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description_numpad"
android:scaleType="fitXY"
android:src="@drawable/dialer_alt" />
<ImageView
android:id="@+id/hangUp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description_hang_up"
android:scaleType="fitXY"
android:src="@drawable/hangup" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>

View file

@ -82,12 +82,14 @@
android:paddingTop="40dp"> android:paddingTop="40dp">
<LinearLayout <LinearLayout
android:orientation="horizontal"
android:id="@+id/fragmentContainer" android:id="@+id/fragmentContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.67" /> android:layout_weight="0.67" />
<LinearLayout <LinearLayout
android:orientation="horizontal"
android:id="@+id/fragmentContainer2" android:id="@+id/fragmentContainer2"
android:visibility="gone" android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/video_frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<org.linphone.mediastream.video.display.GL2JNIView
android:visibility="visible"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/videoSurface" />
<SurfaceView
android:id="@+id/videoCaptureSurface"
android:layout_width="290dp"
android:layout_height="240dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />
</RelativeLayout>

View file

@ -34,7 +34,6 @@ import org.linphone.core.PayloadType;
import org.linphone.mediastream.Log; import org.linphone.mediastream.Log;
import org.linphone.mediastream.Version; import org.linphone.mediastream.Version;
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration; import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
import org.linphone.mediastream.video.capture.hwconf.Hacks;
import org.linphone.setup.SetupActivity; import org.linphone.setup.SetupActivity;
import org.linphone.ui.LedPreference; import org.linphone.ui.LedPreference;
import org.linphone.ui.PreferencesListFragment; import org.linphone.ui.PreferencesListFragment;
@ -153,7 +152,7 @@ public class SettingsFragment extends PreferencesListFragment implements EcCalib
} }
} }
if (Hacks.hasBuiltInEchoCanceller()) { if (LinphoneManager.getLc().needsEchoCalibration()) {
uncheckAndHidePreference(R.string.pref_echo_cancellation_key); uncheckAndHidePreference(R.string.pref_echo_cancellation_key);
hidePreference(R.string.pref_echo_canceller_calibration_key); hidePreference(R.string.pref_echo_canceller_calibration_key);
} }

View file

@ -23,18 +23,15 @@ import java.net.URL;
import org.linphone.LinphoneManager; import org.linphone.LinphoneManager;
import org.linphone.LinphoneManager.EcCalibrationListener; import org.linphone.LinphoneManager.EcCalibrationListener;
import org.linphone.LinphoneService; import org.linphone.LinphonePreferences;
import org.linphone.R; import org.linphone.R;
import org.linphone.core.LinphoneCore.EcCalibratorStatus; import org.linphone.core.LinphoneCore.EcCalibratorStatus;
import org.linphone.core.LinphoneCoreException; import org.linphone.core.LinphoneCoreException;
import org.linphone.mediastream.Log; import org.linphone.mediastream.Log;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -67,17 +64,11 @@ public class EchoCancellerCalibrationFragment extends Fragment implements EcCali
@Override @Override
public void onEcCalibrationStatus(EcCalibratorStatus status, int delayMs) { public void onEcCalibrationStatus(EcCalibratorStatus status, int delayMs) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SetupActivity.instance());
SharedPreferences.Editor editor = prefs.edit();
Context context = SetupActivity.instance() == null ? LinphoneService.instance().getApplicationContext() : SetupActivity.instance();
if (status == EcCalibratorStatus.DoneNoEcho) { if (status == EcCalibratorStatus.DoneNoEcho) {
editor.putBoolean(context.getString(R.string.pref_echo_cancellation_key), false); LinphonePreferences.instance().setEchoCancellation(false);
} else if ((status == EcCalibratorStatus.Done) || (status == EcCalibratorStatus.Failed)) { } else if ((status == EcCalibratorStatus.Done) || (status == EcCalibratorStatus.Failed)) {
editor.putBoolean(context.getString(R.string.pref_echo_cancellation_key), true); LinphonePreferences.instance().setEchoCancellation(true);
} }
editor.commit();
if (mSendEcCalibrationResult) { if (mSendEcCalibrationResult) {
sendEcCalibrationResult(status, delayMs); sendEcCalibrationResult(status, delayMs);
} else { } else {