From 3a0cb99605c4caf0092ae6abbc1fac5b8abe5823 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 23 Jan 2014 16:59:39 +0100 Subject: [PATCH] Fix top black bar on tablets + fix echo canceller setting + updated ms2 --- res/layout-sw533dp-land/incall.xml | 3 +- res/layout-sw533dp-land/video.xml | 20 ++ res/layout-sw720dp-land/incall.xml | 179 ++++++++++++++++++ res/layout-sw720dp-land/main.xml | 2 + res/layout-sw720dp-land/video.xml | 20 ++ src/org/linphone/SettingsFragment.java | 3 +- .../EchoCancellerCalibrationFragment.java | 15 +- 7 files changed, 226 insertions(+), 16 deletions(-) create mode 100644 res/layout-sw533dp-land/video.xml create mode 100644 res/layout-sw720dp-land/incall.xml create mode 100644 res/layout-sw720dp-land/video.xml diff --git a/res/layout-sw533dp-land/incall.xml b/res/layout-sw533dp-land/incall.xml index a821b7a54..111fa177f 100644 --- a/res/layout-sw533dp-land/incall.xml +++ b/res/layout-sw533dp-land/incall.xml @@ -14,8 +14,7 @@ android:id="@+id/fragmentContainer" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="horizontal" - android:paddingTop="40dp" /> + android:orientation="horizontal" /> + + + + + + + \ No newline at end of file diff --git a/res/layout-sw720dp-land/incall.xml b/res/layout-sw720dp-land/incall.xml new file mode 100644 index 000000000..111fa177f --- /dev/null +++ b/res/layout-sw720dp-land/incall.xml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/layout-sw720dp-land/main.xml b/res/layout-sw720dp-land/main.xml index 84db874be..2fb565d49 100644 --- a/res/layout-sw720dp-land/main.xml +++ b/res/layout-sw720dp-land/main.xml @@ -82,12 +82,14 @@ android:paddingTop="40dp"> + + + + + + + \ No newline at end of file diff --git a/src/org/linphone/SettingsFragment.java b/src/org/linphone/SettingsFragment.java index 34d58504e..89c75c7af 100644 --- a/src/org/linphone/SettingsFragment.java +++ b/src/org/linphone/SettingsFragment.java @@ -34,7 +34,6 @@ import org.linphone.core.PayloadType; 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.Hacks; import org.linphone.setup.SetupActivity; import org.linphone.ui.LedPreference; 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); hidePreference(R.string.pref_echo_canceller_calibration_key); } diff --git a/src/org/linphone/setup/EchoCancellerCalibrationFragment.java b/src/org/linphone/setup/EchoCancellerCalibrationFragment.java index 50cccb09e..90f1a1721 100644 --- a/src/org/linphone/setup/EchoCancellerCalibrationFragment.java +++ b/src/org/linphone/setup/EchoCancellerCalibrationFragment.java @@ -23,18 +23,15 @@ import java.net.URL; import org.linphone.LinphoneManager; import org.linphone.LinphoneManager.EcCalibrationListener; -import org.linphone.LinphoneService; +import org.linphone.LinphonePreferences; import org.linphone.R; import org.linphone.core.LinphoneCore.EcCalibratorStatus; import org.linphone.core.LinphoneCoreException; import org.linphone.mediastream.Log; -import android.content.Context; -import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.os.Handler; -import android.preference.PreferenceManager; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; @@ -67,17 +64,11 @@ public class EchoCancellerCalibrationFragment extends Fragment implements EcCali @Override 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) { - editor.putBoolean(context.getString(R.string.pref_echo_cancellation_key), false); + LinphonePreferences.instance().setEchoCancellation(false); } 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) { sendEcCalibrationResult(status, delayMs); } else {