Landscape incall view

This commit is contained in:
Sylvain Berfini 2012-07-20 16:20:16 +02:00
parent 64732160e5
commit 1cef2ca364
50 changed files with 434 additions and 201 deletions

View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

218
res/layout-land/incall.xml Normal file
View file

@ -0,0 +1,218 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingTop="20dp" />
<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:layout_alignParentTop="true"
android:contentDescription="@string/content_description_switch_camera"
android:paddingTop="20dp"
android:src="@drawable/switch_camera"
android:visibility="gone" />
<LinearLayout
android:id="@+id/menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="0.5"
android:orientation="horizontal" >
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
<ImageView
android:id="@+id/transfer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:scaleType="fitXY"
android:src="@drawable/options_transfer"
android:visibility="gone" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="0.5"
android:orientation="horizontal" >
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
<ImageView
android:id="@+id/addCall"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:scaleType="fitXY"
android:src="@drawable/options_add_call_alt"
android:visibility="gone" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:visibility="invisible" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="0.5"
android:orientation="horizontal" >
<ImageView
android:id="@+id/pause"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:contentDescription="@string/content_description_pause"
android:scaleType="fitXY"
android:src="@drawable/pause_off" />
<ImageView
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:contentDescription="@string/content_description_switch_video"
android:scaleType="fitXY"
android:src="@drawable/video_off" />
<ImageView
android:id="@+id/micro"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:contentDescription="@string/content_description_toggle_micro"
android:scaleType="fitXY"
android:src="@drawable/micro_on" />
<ImageView
android:id="@+id/hangUp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:contentDescription="@string/content_description_hang_up"
android:scaleType="fitXY"
android:src="@drawable/hangup" />
<ImageView
android:id="@+id/speaker"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:contentDescription="@string/content_description_toggle_speaker"
android:scaleType="fitXY"
android:src="@drawable/speaker_off" />
<ImageView
android:id="@+id/options"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:scaleType="fitXY"
android:src="@drawable/options" />
<ImageView
android:id="@+id/dialer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:contentDescription="@string/content_description_numpad"
android:scaleType="fitXY"
android:src="@drawable/dialer_alt" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>

View file

@ -1,5 +1,6 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent" >
@ -11,26 +12,27 @@
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="20dp"
android:orientation="horizontal" />
android:orientation="horizontal"
android:paddingTop="20dp" />
<fragment android:name="org.linphone.StatusFragment"
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
tools:layout="@layout/status" />
</FrameLayout>
<ImageView
android:id="@+id/switchCamera"
android:visibility="gone"
android:paddingTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:contentDescription="@string/content_description_switch_camera"
android:src="@drawable/switch_camera" />
android:paddingTop="20dp"
android:src="@drawable/switch_camera"
android:visibility="gone" />
<LinearLayout
android:id="@+id/menu"
@ -42,8 +44,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.5">
android:layout_weight="0.5"
android:orientation="horizontal" >
<View
android:layout_width="match_parent"
@ -65,20 +67,19 @@
<ImageView
android:id="@+id/transfer"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/options_transfer"
android:layout_weight="0.25"
android:scaleType="fitXY"
android:layout_weight="0.25" />
android:src="@drawable/options_transfer"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.5">
android:layout_weight="0.5"
android:orientation="horizontal" >
<View
android:layout_width="match_parent"
@ -100,93 +101,89 @@
<ImageView
android:id="@+id/addCall"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/options_add_call_alt"
android:layout_weight="0.25"
android:scaleType="fitXY"
android:layout_weight="0.25" />
android:src="@drawable/options_add_call_alt"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.5">
android:layout_weight="0.5"
android:orientation="horizontal" >
<ImageView
android:contentDescription="@string/content_description_switch_video"
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:contentDescription="@string/content_description_switch_video"
android:scaleType="fitXY"
android:src="@drawable/video_off" />
<ImageView
android:contentDescription="@string/content_description_toggle_micro"
android:id="@+id/micro"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/micro_on"
android:layout_weight="0.25"
android:contentDescription="@string/content_description_toggle_micro"
android:scaleType="fitXY"
android:layout_weight="0.25"/>
android:src="@drawable/micro_on" />
<ImageView
android:contentDescription="@string/content_description_toggle_speaker"
android:id="@+id/speaker"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/speaker_off"
android:layout_weight="0.25"
android:contentDescription="@string/content_description_toggle_speaker"
android:scaleType="fitXY"
android:layout_weight="0.25"/>
android:src="@drawable/speaker_off" />
<ImageView
android:id="@+id/options"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/options"
android:layout_weight="0.25"
android:scaleType="fitXY"
android:layout_weight="0.25" />
android:src="@drawable/options" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="75dp"
android:orientation="horizontal"
android:layout_weight="0.5">
android:layout_weight="0.5"
android:orientation="horizontal" >
<ImageView
android:contentDescription="@string/content_description_pause"
android:id="@+id/pause"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/pause_off"
android:layout_weight="0.3"
android:contentDescription="@string/content_description_pause"
android:scaleType="fitXY"
android:layout_weight="0.3"/>
android:src="@drawable/pause_off" />
<ImageView
android:contentDescription="@string/content_description_hang_up"
android:id="@+id/hangUp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/hangup"
android:layout_weight="0.3"
android:contentDescription="@string/content_description_hang_up"
android:scaleType="fitXY"
android:layout_weight="0.3"/>
android:src="@drawable/hangup" />
<ImageView
android:contentDescription="@string/content_description_numpad"
android:id="@+id/dialer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/dialer_alt"
android:layout_weight="0.3"
android:contentDescription="@string/content_description_numpad"
android:scaleType="fitXY"
android:layout_weight="0.3"/>
android:src="@drawable/dialer_alt" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>

View file

@ -142,12 +142,22 @@ public class AudioCallFragment extends Fragment {
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
if (InCallActivity.instance() == null) {
return;
}
InCallActivity.instance().bindAudioFragment(this);
// Just to be sure we have incall controls
InCallActivity.instance().setCallControlsVisibleAndRemoveCallbacks();
}
@Override
public void onDestroy() {
instance = null;
super.onDestroy();
}
@Override
public void onResume() {
super.onResume();

View file

@ -76,15 +76,12 @@ public class InCallActivity extends FragmentActivity implements
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.incall);
instance = this;
setContentView(R.layout.incall);
isVideoEnabled = getIntent().getExtras() != null && getIntent().getExtras().getBoolean("VideoEnabled");
if (findViewById(R.id.fragmentContainer) != null) {
if (savedInstanceState != null) {
return;
}
initUI();
if (LinphoneManager.getLc().getCallsNb() > 0) {
@ -497,6 +494,10 @@ public class InCallActivity extends FragmentActivity implements
private boolean isCallRunning(LinphoneCall call)
{
if (call == null) {
return false;
}
LinphoneCall.State state = call.getState();
return state == LinphoneCall.State.Connected ||
@ -507,6 +508,10 @@ public class InCallActivity extends FragmentActivity implements
}
private boolean isCallEstablished(LinphoneCall call) {
if (call == null) {
return false;
}
LinphoneCall.State state = call.getState();
return isCallRunning(call) ||
@ -552,6 +557,12 @@ public class InCallActivity extends FragmentActivity implements
}
}
@Override
protected void onDestroy() {
instance = null;
super.onDestroy();
}
@Override
protected void onResume() {
super.onResume();
@ -563,13 +574,6 @@ public class InCallActivity extends FragmentActivity implements
}
}
@Override
protected void onPause() {
super.onPause();
setCallControlsVisibleAndRemoveCallbacks();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (LinphoneUtils.onKeyVolumeAdjust(keyCode)) return true;

View file

@ -153,6 +153,8 @@ public class VideoCallFragment extends Fragment {
// Prevent linphone from crashing if correspondent hang up while you are rotating
androidVideoWindowImpl.release();
}
instance = null;
super.onDestroy();
}

View file

@ -127,7 +127,9 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
public void logIn(String username, String password, String domain) {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) {
imm.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), 0);
}
saveCreatedAccount(username, password, domain);
LinphoneManager.getInstance().initializePayloads();