InCall views for tablets
This commit is contained in:
parent
81a4b0e29d
commit
4489e3e87b
6 changed files with 323 additions and 4 deletions
|
@ -76,7 +76,7 @@
|
|||
<!-- android:launchMode="singleTask"-->
|
||||
<activity android:name="org.linphone.IncallActivity"
|
||||
android:theme="@android:style/Theme.NoTitleBar"
|
||||
android:screenOrientation="portrait">
|
||||
android:configChanges="keyboardHidden|orientation">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="4"
|
||||
android:visibility="invisible"
|
||||
android:visibility="gone"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
149
res/layout-xlarge-land/incall_layout.xml
Normal file
149
res/layout-xlarge-land/incall_layout.xml
Normal file
|
@ -0,0 +1,149 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:ui="http://schemas.android.com/apk/res/org.linphone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/conf_header"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginBottom="10dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:minHeight="60sp"
|
||||
android:background="@drawable/conf_callee_selector_normal" >
|
||||
|
||||
<TextView
|
||||
android:text="@string/conf_conference"
|
||||
style="@style/callee_address"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/conf_header_details"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/conf_details"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/incall_controls_layout"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="bottom|center_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.ToggleImageButton
|
||||
android:id="@+id/toggleMuteMic"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_micro_inverse"
|
||||
ui:unchecked="@drawable/incall_micro"
|
||||
ui:bgdrawables="true" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/incallNumpadShow"
|
||||
style="@style/incall_control"
|
||||
android:background="@drawable/incall_dialpad" />
|
||||
|
||||
<org.linphone.ui.ToggleImageButton
|
||||
android:id="@+id/toggleSpeaker"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_speaker_inverse"
|
||||
ui:unchecked="@drawable/incall_speaker"
|
||||
ui:bgdrawables="true" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/addCall"
|
||||
style="@style/incall_control"
|
||||
android:background="@drawable/incall_add" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/conf_simple_merge"
|
||||
style="@style/incall_control"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/incall_merge" />
|
||||
|
||||
<org.linphone.ui.ToggleImageButton
|
||||
android:id="@+id/conf_simple_pause"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_pause_inverse"
|
||||
ui:unchecked="@drawable/incall_pause"
|
||||
ui:bgdrawables="true" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/conf_simple_video"
|
||||
style="@style/incall_control"
|
||||
android:text="@string/conf_simple_video_bt_txt"
|
||||
android:background="@drawable/clavier_bg" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/incallHang"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/clavier_bg"
|
||||
android:minHeight="60dip"
|
||||
android:src="@drawable/stopcall_red" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/picture_wrapper"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_above="@id/incall_controls_layout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/incall_picture"
|
||||
android:visibility="gone"
|
||||
android:layout_centerInParent="true"
|
||||
android:paddingBottom="8dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="fitCenter"
|
||||
android:minWidth="120dip"
|
||||
android:minHeight="120dip" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawSelectorOnTop="true"
|
||||
android:dividerHeight="10dip"
|
||||
android:divider="@android:color/transparent"
|
||||
android:layout_below="@id/conf_header"
|
||||
android:layout_above="@id/picture_wrapper"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:fadeScrollbars="false" />
|
||||
|
||||
</RelativeLayout>
|
149
res/layout-xlarge/incall_layout.xml
Normal file
149
res/layout-xlarge/incall_layout.xml
Normal file
|
@ -0,0 +1,149 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:ui="http://schemas.android.com/apk/res/org.linphone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/conf_header"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginBottom="10dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:minHeight="60sp"
|
||||
android:background="@drawable/conf_callee_selector_normal" >
|
||||
|
||||
<TextView
|
||||
android:text="@string/conf_conference"
|
||||
style="@style/callee_address"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/conf_header_details"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/conf_details"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/incall_controls_layout"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="bottom|center_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.ToggleImageButton
|
||||
android:id="@+id/toggleMuteMic"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_micro_inverse"
|
||||
ui:unchecked="@drawable/incall_micro"
|
||||
ui:bgdrawables="true" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/incallNumpadShow"
|
||||
style="@style/incall_control"
|
||||
android:background="@drawable/incall_dialpad" />
|
||||
|
||||
<org.linphone.ui.ToggleImageButton
|
||||
android:id="@+id/toggleSpeaker"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_speaker_inverse"
|
||||
ui:unchecked="@drawable/incall_speaker"
|
||||
ui:bgdrawables="true" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/addCall"
|
||||
style="@style/incall_control"
|
||||
android:background="@drawable/incall_add" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/conf_simple_merge"
|
||||
style="@style/incall_control"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/incall_merge" />
|
||||
|
||||
<org.linphone.ui.ToggleImageButton
|
||||
android:id="@+id/conf_simple_pause"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_pause_inverse"
|
||||
ui:unchecked="@drawable/incall_pause"
|
||||
ui:bgdrawables="true" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/conf_simple_video"
|
||||
style="@style/incall_control"
|
||||
android:text="@string/conf_simple_video_bt_txt"
|
||||
android:background="@drawable/clavier_bg" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/incallHang"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/clavier_bg"
|
||||
android:minHeight="60dip"
|
||||
android:src="@drawable/stopcall_red" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/picture_wrapper"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_above="@id/incall_controls_layout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/incall_picture"
|
||||
android:visibility="gone"
|
||||
android:layout_centerInParent="true"
|
||||
android:paddingBottom="8dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="fitCenter"
|
||||
android:minWidth="120dip"
|
||||
android:minHeight="120dip" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawSelectorOnTop="true"
|
||||
android:dividerHeight="10dip"
|
||||
android:divider="@android:color/transparent"
|
||||
android:layout_below="@id/conf_header"
|
||||
android:layout_above="@id/picture_wrapper"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:fadeScrollbars="false" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -28,7 +28,6 @@ import org.linphone.core.LinphoneCall.State;
|
|||
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||
import org.linphone.core.LinphoneProxyConfig;
|
||||
import org.linphone.core.Log;
|
||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||
import org.linphone.ui.AddressAware;
|
||||
import org.linphone.ui.AddressText;
|
||||
import org.linphone.ui.CallButton;
|
||||
|
@ -453,6 +452,12 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
|
|||
mStatus.setText(LinphoneManager.getInstance().getLastLcStatusMessage());
|
||||
|
||||
super.onResume();
|
||||
|
||||
if (mVideoCaptureViewReady != null && mCamera == null)
|
||||
{
|
||||
mCamera = Camera.open(mCurrentCameraId);
|
||||
mVideoCaptureViewReady.requestLayout();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,6 +44,8 @@ import android.app.AlertDialog;
|
|||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
|
@ -108,11 +110,19 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
private int mMultipleCallsLimit;
|
||||
private boolean mAllowTransfers;
|
||||
|
||||
private boolean isXLargeScreen()
|
||||
{
|
||||
return (getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
if (finishIfAutoRestartAfterACrash(savedInstanceState)) {
|
||||
return;
|
||||
}
|
||||
if (!isXLargeScreen())
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
|
||||
setContentView(R.layout.incall_layout);
|
||||
instance = this;
|
||||
|
||||
|
@ -652,6 +662,12 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig)
|
||||
{
|
||||
// DO nothing to not recreate the activity on smartphone is screen is rotated
|
||||
}
|
||||
|
||||
private void updateConfItem() {
|
||||
boolean confExists = lc().getConferenceSize() > 0;
|
||||
View confView = findViewById(R.id.conf_header);
|
||||
|
|
Loading…
Reference in a new issue