Code cleaned a bit

This commit is contained in:
Sylvain Berfini 2012-07-20 16:58:32 +02:00
parent 1cef2ca364
commit 43e543368b
8 changed files with 151 additions and 164 deletions

View file

@ -82,8 +82,7 @@
<activity android:name="org.linphone.InCallActivity"
android:theme="@android:style/Theme.NoTitleBar"
android:launchMode="singleTask"
android:configChanges="orientation">
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>

View file

@ -44,44 +44,44 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="0.5"
android:layout_weight="1"
android:orientation="horizontal" >
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<ImageView
android:id="@+id/transfer"
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_transfer"
android:visibility="gone" />
@ -89,14 +89,14 @@
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="0.5"
android:layout_weight="1"
android:orientation="horizontal" >
<View
@ -108,32 +108,32 @@
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<ImageView
android:id="@+id/addCall"
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_add_call_alt"
android:visibility="gone" />
@ -141,21 +141,21 @@
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="0.5"
android:layout_weight="1"
android:orientation="horizontal" >
<ImageView
android:id="@+id/pause"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="1"
android:contentDescription="@string/content_description_pause"
android:scaleType="fitXY"
android:src="@drawable/pause_off" />
@ -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" />

View file

@ -21,6 +21,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/status" />
</FrameLayout>
<ImageView
@ -44,32 +45,32 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:layout_weight="1"
android:orientation="horizontal" >
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<ImageView
android:id="@+id/transfer"
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_transfer"
android:visibility="gone" />
@ -78,48 +79,49 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:layout_weight="1"
android:orientation="horizontal" >
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:layout_weight="1"
android:visibility="invisible" />
<ImageView
android:id="@+id/addCall"
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_add_call_alt"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:layout_weight="1"
android:orientation="horizontal" >
<ImageView
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:layout_weight="1"
android:contentDescription="@string/content_description_switch_video"
android:scaleType="fitXY"
android:src="@drawable/video_off" />
@ -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" />
</LinearLayout>
@ -154,14 +156,14 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.5"
android:layout_weight="1"
android:orientation="horizontal" >
<ImageView
android:id="@+id/pause"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:layout_weight="1"
android:contentDescription="@string/content_description_pause"
android:scaleType="fitXY"
android:src="@drawable/pause_off" />
@ -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" />

View file

@ -1,115 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<LinearLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="20dp"
android:paddingBottom="75dp"
android:orientation="horizontal" />
<fragment android:name="org.linphone.StatusFragment"
android:id="@+id/status"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
<LinearLayout
android:id="@+id/menu"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2">
<ImageView
android:contentDescription="@string/content_description_history"
android:id="@+id/history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/history" />
<TextView
android:id="@+id/missedCalls"
android:layout_width="25dp"
android:layout_height="25dp"
android:gravity="center"
android:textSize="20dp"
android:visibility="gone"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="@drawable/missed_calls_bg" />
</RelativeLayout>
<ImageView
android:contentDescription="@string/content_description_contacts"
android:id="@+id/contacts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/contacts" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" >
<ImageView
android:contentDescription="@string/content_description_dialer"
android:id="@+id/dialer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/dialer" />
<LinearLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingBottom="75dp"
android:paddingTop="20dp" />
<ImageView
android:contentDescription="@string/content_description_settings"
android:id="@+id/settings"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/settings" />
<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>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2">
<ImageView
android:contentDescription="@string/content_description_chat"
android:id="@+id/chat"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/chat" />
<TextView
android:id="@+id/missedChats"
android:layout_width="25dp"
android:layout_height="25dp"
android:gravity="center"
android:textSize="20dp"
android:visibility="gone"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="@drawable/missed_calls_bg" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/menu"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2" >
<ImageView
android:id="@+id/history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description_history"
android:scaleType="fitXY"
android:src="@drawable/history" />
<TextView
android:id="@+id/missedCalls"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/missed_calls_bg"
android:gravity="center"
android:textSize="20dp"
android:visibility="gone" />
</RelativeLayout>
<ImageView
android:id="@+id/contacts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:contentDescription="@string/content_description_contacts"
android:scaleType="fitXY"
android:src="@drawable/contacts" />
<ImageView
android:id="@+id/dialer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:contentDescription="@string/content_description_dialer"
android:scaleType="fitXY"
android:src="@drawable/dialer" />
<ImageView
android:id="@+id/settings"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:contentDescription="@string/content_description_settings"
android:scaleType="fitXY"
android:src="@drawable/settings" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2" >
<ImageView
android:id="@+id/chat"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:contentDescription="@string/content_description_chat"
android:scaleType="fitXY"
android:src="@drawable/chat" />
<TextView
android:id="@+id/missedChats"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/missed_calls_bg"
android:gravity="center"
android:textSize="20dp"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View file

@ -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();

View file

@ -557,12 +557,6 @@ public class InCallActivity extends FragmentActivity implements
}
}
@Override
protected void onDestroy() {
instance = null;
super.onDestroy();
}
@Override
protected void onResume() {
super.onResume();

View file

@ -276,7 +276,7 @@ public class StatusFragment extends Fragment {
mCallQualityUpdater = null;
}
}
public void refreshStatusItems() {
LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
if (call != null && encryption != null) {

View file

@ -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();
}