From 43e543368bfc64aca160057217b7d8ed7c7a1d59 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 20 Jul 2012 16:58:32 +0200 Subject: [PATCH] Code cleaned a bit --- AndroidManifest.xml | 3 +- res/layout-land/incall.xml | 46 +++--- res/layout/incall.xml | 40 ++--- res/layout/main.xml | 211 ++++++++++++------------ src/org/linphone/AudioCallFragment.java | 6 - src/org/linphone/InCallActivity.java | 6 - src/org/linphone/StatusFragment.java | 2 +- src/org/linphone/VideoCallFragment.java | 1 - 8 files changed, 151 insertions(+), 164 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 12b82681c..957526c39 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -82,8 +82,7 @@ + android:launchMode="singleTask"> diff --git a/res/layout-land/incall.xml b/res/layout-land/incall.xml index 956c9636e..8f6fb9952 100644 --- a/res/layout-land/incall.xml +++ b/res/layout-land/incall.xml @@ -44,44 +44,44 @@ @@ -89,14 +89,14 @@ @@ -141,21 +141,21 @@ @@ -164,7 +164,7 @@ android:id="@+id/video" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_weight="0.25" + android:layout_weight="1" android:contentDescription="@string/content_description_switch_video" android:scaleType="fitXY" android:src="@drawable/video_off" /> @@ -173,7 +173,7 @@ android:id="@+id/micro" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_weight="0.25" + android:layout_weight="1" android:contentDescription="@string/content_description_toggle_micro" android:scaleType="fitXY" android:src="@drawable/micro_on" /> @@ -182,7 +182,7 @@ android:id="@+id/hangUp" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_weight="0.25" + android:layout_weight="1" android:contentDescription="@string/content_description_hang_up" android:scaleType="fitXY" android:src="@drawable/hangup" /> @@ -191,7 +191,7 @@ android:id="@+id/speaker" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_weight="0.25" + android:layout_weight="1" android:contentDescription="@string/content_description_toggle_speaker" android:scaleType="fitXY" android:src="@drawable/speaker_off" /> @@ -200,7 +200,7 @@ android:id="@+id/options" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_weight="0.25" + android:layout_weight="1" android:scaleType="fitXY" android:src="@drawable/options" /> @@ -208,7 +208,7 @@ android:id="@+id/dialer" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_weight="0.25" + android:layout_weight="1" android:contentDescription="@string/content_description_numpad" android:scaleType="fitXY" android:src="@drawable/dialer_alt" /> diff --git a/res/layout/incall.xml b/res/layout/incall.xml index 19d1f8b34..ee161c00f 100644 --- a/res/layout/incall.xml +++ b/res/layout/incall.xml @@ -21,6 +21,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" tools:layout="@layout/status" /> + @@ -78,48 +79,49 @@ + @@ -128,7 +130,7 @@ android:id="@+id/micro" android:layout_width="match_parent" android:layout_height="75dp" - android:layout_weight="0.25" + android:layout_weight="1" android:contentDescription="@string/content_description_toggle_micro" android:scaleType="fitXY" android:src="@drawable/micro_on" /> @@ -137,7 +139,7 @@ android:id="@+id/speaker" android:layout_width="match_parent" android:layout_height="75dp" - android:layout_weight="0.25" + android:layout_weight="1" android:contentDescription="@string/content_description_toggle_speaker" android:scaleType="fitXY" android:src="@drawable/speaker_off" /> @@ -146,7 +148,7 @@ android:id="@+id/options" android:layout_width="match_parent" android:layout_height="75dp" - android:layout_weight="0.25" + android:layout_weight="1" android:scaleType="fitXY" android:src="@drawable/options" /> @@ -154,14 +156,14 @@ @@ -170,7 +172,7 @@ android:id="@+id/hangUp" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_weight="0.3" + android:layout_weight="1" android:contentDescription="@string/content_description_hang_up" android:scaleType="fitXY" android:src="@drawable/hangup" /> @@ -179,7 +181,7 @@ android:id="@+id/dialer" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_weight="0.3" + android:layout_weight="1" android:contentDescription="@string/content_description_numpad" android:scaleType="fitXY" android:src="@drawable/dialer_alt" /> diff --git a/res/layout/main.xml b/res/layout/main.xml index 07941dd78..fbdb2c272 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -1,115 +1,114 @@ + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" > - - - - - - - - - - - - - - - - - - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" > - + - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/org/linphone/AudioCallFragment.java b/src/org/linphone/AudioCallFragment.java index 33c890dcb..0924d2f27 100644 --- a/src/org/linphone/AudioCallFragment.java +++ b/src/org/linphone/AudioCallFragment.java @@ -152,12 +152,6 @@ public class AudioCallFragment extends Fragment { InCallActivity.instance().setCallControlsVisibleAndRemoveCallbacks(); } - @Override - public void onDestroy() { - instance = null; - super.onDestroy(); - } - @Override public void onResume() { super.onResume(); diff --git a/src/org/linphone/InCallActivity.java b/src/org/linphone/InCallActivity.java index d11fb0e52..749010063 100644 --- a/src/org/linphone/InCallActivity.java +++ b/src/org/linphone/InCallActivity.java @@ -557,12 +557,6 @@ public class InCallActivity extends FragmentActivity implements } } - @Override - protected void onDestroy() { - instance = null; - super.onDestroy(); - } - @Override protected void onResume() { super.onResume(); diff --git a/src/org/linphone/StatusFragment.java b/src/org/linphone/StatusFragment.java index 9aec6bc38..e88a09aeb 100644 --- a/src/org/linphone/StatusFragment.java +++ b/src/org/linphone/StatusFragment.java @@ -276,7 +276,7 @@ public class StatusFragment extends Fragment { mCallQualityUpdater = null; } } - + public void refreshStatusItems() { LinphoneCall call = LinphoneManager.getLc().getCurrentCall(); if (call != null && encryption != null) { diff --git a/src/org/linphone/VideoCallFragment.java b/src/org/linphone/VideoCallFragment.java index 4cecfb6b4..2b10e8e4c 100644 --- a/src/org/linphone/VideoCallFragment.java +++ b/src/org/linphone/VideoCallFragment.java @@ -153,7 +153,6 @@ public class VideoCallFragment extends Fragment { // Prevent linphone from crashing if correspondent hang up while you are rotating androidVideoWindowImpl.release(); } - instance = null; super.onDestroy(); }