Improved incall status bar

This commit is contained in:
Sylvain Berfini 2012-09-05 15:45:59 +02:00
parent 329a2348fc
commit 7e1856bab2
5 changed files with 49 additions and 30 deletions

View file

@ -5,11 +5,26 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <FrameLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" /> android:layout_alignParentTop="true">
<LinearLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingTop="40dp" />
<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 <ImageView
android:id="@+id/switchCamera" android:id="@+id/switchCamera"
@ -17,17 +32,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:contentDescription="@string/content_description_switch_camera" android:contentDescription="@string/content_description_switch_camera"
android:layout_marginTop="20dp" android:layout_marginTop="40dp"
android:src="@drawable/switch_camera" android:src="@drawable/switch_camera"
android:visibility="invisible" /> android:visibility="invisible" />
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/status" />
<org.linphone.ui.Numpad <org.linphone.ui.Numpad
android:id="@+id/numpad" android:id="@+id/numpad"
android:background="@drawable/dialer_alt_background" android:background="@drawable/dialer_alt_background"

View file

@ -5,11 +5,26 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <FrameLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" /> android:layout_alignParentTop="true">
<LinearLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingTop="40dp" />
<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 <ImageView
android:id="@+id/switchCamera" android:id="@+id/switchCamera"
@ -17,18 +32,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:contentDescription="@string/content_description_switch_camera" android:contentDescription="@string/content_description_switch_camera"
android:layout_marginTop="20dp" android:layout_marginTop="40dp"
android:visibility="invisible" android:visibility="invisible"
android:src="@drawable/switch_camera" /> android:src="@drawable/switch_camera" />
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/status" />
<org.linphone.ui.Numpad <org.linphone.ui.Numpad
android:id="@+id/numpad" android:id="@+id/numpad"
android:background="@drawable/dialer_alt_background" android:background="@drawable/dialer_alt_background"

View file

@ -68,7 +68,8 @@
android:contentDescription="@string/content_description_call_quality" android:contentDescription="@string/content_description_call_quality"
android:id="@+id/callQuality" android:id="@+id/callQuality"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:src="@drawable/call_quality_indicator_0" android:src="@drawable/call_quality_indicator_0"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
@ -78,7 +79,8 @@
android:contentDescription="@string/content_description_encryption" android:contentDescription="@string/content_description_encryption"
android:id="@+id/encryption" android:id="@+id/encryption"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:src="@drawable/security_pending" android:src="@drawable/security_pending"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:visibility="gone" android:visibility="gone"

View file

@ -663,7 +663,7 @@ public class InCallActivity extends FragmentActivity implements
mHandler.post(new Runnable() { mHandler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
status.refreshStatusItems(call); status.refreshStatusItems(call, isVideoEnabled);
} }
}); });
} }
@ -696,7 +696,7 @@ public class InCallActivity extends FragmentActivity implements
mHandler.post(new Runnable() { mHandler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
status.refreshStatusItems(call); status.refreshStatusItems(call, call.getCurrentParamsCopy().getVideoEnabled());
} }
}); });
} }

View file

@ -271,7 +271,7 @@ public class StatusFragment extends Fragment {
if (isInCall) { if (isInCall) {
LinphoneCall call = LinphoneManager.getLc().getCurrentCall(); LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
startCallQuality(); startCallQuality();
refreshStatusItems(call); refreshStatusItems(call, call.getCurrentParamsCopy().getVideoEnabled());
// We are obviously connected // We are obviously connected
statusLed.setImageResource(R.drawable.led_connected); statusLed.setImageResource(R.drawable.led_connected);
@ -299,14 +299,16 @@ public class StatusFragment extends Fragment {
} }
} }
public void refreshStatusItems(LinphoneCall call) { public void refreshStatusItems(LinphoneCall call, boolean isVideoEnabled) {
if (call != null && encryption != null) { if (call != null && encryption != null) {
MediaEncryption mediaEncryption = call.getCurrentParamsCopy().getMediaEncryption(); MediaEncryption mediaEncryption = call.getCurrentParamsCopy().getMediaEncryption();
Log.e("MediaEncryption = " + mediaEncryption); Log.e("MediaEncryption = " + mediaEncryption);
exit.setVisibility(View.GONE); exit.setVisibility(View.GONE);
statusText.setVisibility(View.GONE); statusText.setVisibility(View.GONE);
background.setVisibility(View.GONE); if (isVideoEnabled) {
background.setVisibility(View.GONE);
}
encryption.setVisibility(View.VISIBLE); encryption.setVisibility(View.VISIBLE);
if (mediaEncryption == MediaEncryption.SRTP || (mediaEncryption == MediaEncryption.ZRTP && call.isAuthenticationTokenVerified())) { if (mediaEncryption == MediaEncryption.SRTP || (mediaEncryption == MediaEncryption.ZRTP && call.isAuthenticationTokenVerified())) {