summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhisek Devkota <ciwrl@cyanogenmod.com>2014-06-14 00:40:07 +0000
committerGerrit Code Review <gerrit@cyanogenmod.org>2014-06-14 00:40:07 +0000
commitacce9b9390d7db3f15d58060cc3211b496bb95b2 (patch)
treee409d77ed6d0d803216431b4996395ba2322c542
parentdb221939fde437d56870dd89281d1fad83e8ecdb (diff)
parent9c32d37c200c4231fa552e8e17c46b8dc76bdd43 (diff)
downloadpackages_apps_InCallUI-acce9b9390d7db3f15d58060cc3211b496bb95b2.tar.gz
packages_apps_InCallUI-acce9b9390d7db3f15d58060cc3211b496bb95b2.tar.bz2
packages_apps_InCallUI-acce9b9390d7db3f15d58060cc3211b496bb95b2.zip
Merge "incallui: make navigation bar translucent + other fixes" into cm-11.0
-rw-r--r--res/layout-land/incall_screen.xml38
-rw-r--r--res/layout-land/incall_screen_msim.xml78
-rw-r--r--res/layout/conference_manager_fragment.xml1
-rw-r--r--res/layout/dtmf_twelve_key_dialer_view.xml5
-rw-r--r--res/layout/incall_screen.xml42
-rw-r--r--res/layout/incall_screen_msim.xml42
-rw-r--r--res/layout/primary_call_info.xml7
-rw-r--r--res/values/dimens.xml2
-rw-r--r--src/com/android/incallui/AnswerFragment.java4
-rw-r--r--src/com/android/incallui/ConferenceManagerFragment.java8
-rw-r--r--src/com/android/incallui/InCallActivity.java25
11 files changed, 182 insertions, 70 deletions
diff --git a/res/layout-land/incall_screen.xml b/res/layout-land/incall_screen.xml
index e3cc9522..e158d4e7 100644
--- a/res/layout-land/incall_screen.xml
+++ b/res/layout-land/incall_screen.xml
@@ -22,40 +22,38 @@
android:background="@color/incall_button_background"
android:id="@+id/main">
- <LinearLayout
+ <FrameLayout
android:id="@+id/in_call_and_button_container"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal">
+ android:layout_height="match_parent">
+
+ <fragment
+ android:name="com.android.incallui.CallCardFragment"
+ android:id="@+id/callCardFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
<RelativeLayout
- android:id="@+id/in_call_card_container"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
- <fragment
- android:name="com.android.incallui.CallCardFragment"
- android:id="@+id/callCardFragment"
- android:layout_width="match_parent"
+ <fragment android:name="com.android.incallui.CallButtonFragment"
+ android:id="@+id/callButtonFragment"
+ android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentStart="true" />
+ android:layout_alignParentEnd="true" />
+
<fragment
android:name="com.android.incallui.DialpadFragment"
android:id="@+id/dialpadFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_alignParentTop="true"
+ android:layout_toStartOf="@id/callButtonFragment"
android:layout_alignParentStart="true" />
- </RelativeLayout>
- <fragment android:name="com.android.incallui.CallButtonFragment"
- android:id="@+id/callButtonFragment"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"/>
+ </RelativeLayout>
- </LinearLayout>
+ </FrameLayout>
<fragment android:name="com.android.incallui.AnswerFragment"
android:id="@+id/answerFragment"
diff --git a/res/layout-land/incall_screen_msim.xml b/res/layout-land/incall_screen_msim.xml
new file mode 100644
index 00000000..97f5c9e8
--- /dev/null
+++ b/res/layout-land/incall_screen_msim.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- In-call Phone UI; see MsimInCallActivity.java. -->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/incall_button_background"
+ android:id="@+id/main">
+
+ <FrameLayout
+ android:id="@+id/in_call_and_button_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <fragment
+ android:name="com.android.incallui.CallCardFragment"
+ android:id="@+id/callCardFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <fragment android:name="com.android.incallui.CallButtonFragment"
+ android:id="@+id/callButtonFragment"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_alignParentEnd="true" />
+
+ <fragment
+ android:name="com.android.incallui.DialpadFragment"
+ android:id="@+id/dialpadFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_toStartOf="@id/callButtonFragment"
+ android:layout_alignParentStart="true" />
+
+ </RelativeLayout>
+
+ </FrameLayout>
+
+ <fragment android:name="com.android.incallui.MsimAnswerFragment"
+ android:id="@+id/answerFragment"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_alignParentEnd="true"
+ android:layout_centerVertical="true"
+ android:gravity="start"
+ android:layout_gravity="end|center_vertical"
+ android:layout_marginEnd="@dimen/glowpadview_margin_bottom"
+ android:visibility="gone" />
+
+ <fragment android:name="com.android.incallui.ConferenceManagerFragment"
+ android:id="@+id/conferenceManagerFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentEnd="true" />
+
+</FrameLayout>
diff --git a/res/layout/conference_manager_fragment.xml b/res/layout/conference_manager_fragment.xml
index a8fda2c2..983b795c 100644
--- a/res/layout/conference_manager_fragment.xml
+++ b/res/layout/conference_manager_fragment.xml
@@ -23,6 +23,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
+ android:fitsSystemWindows="true"
>
<!-- This original header (with timer) is currently not being used,
but may be of use in the future. -->
diff --git a/res/layout/dtmf_twelve_key_dialer_view.xml b/res/layout/dtmf_twelve_key_dialer_view.xml
index d921ca34..9ff7142e 100644
--- a/res/layout/dtmf_twelve_key_dialer_view.xml
+++ b/res/layout/dtmf_twelve_key_dialer_view.xml
@@ -20,13 +20,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:layout_marginTop="1dip" >
+ android:layout_marginTop="1dip"
+ android:background="@color/background_dialpad" >
<view class="com.android.incallui.DialpadFragment$HoverIgnoringLinearLayout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/background_dialpad">
+ android:fitsSystemWindows="true">
<!-- Display of the digits you've typed so far.
diff --git a/res/layout/incall_screen.xml b/res/layout/incall_screen.xml
index f7d9715f..5e6dfb5c 100644
--- a/res/layout/incall_screen.xml
+++ b/res/layout/incall_screen.xml
@@ -19,43 +19,41 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/incall_button_background"
+ android:background="@android:color/black"
android:id="@+id/main">
- <LinearLayout
+ <FrameLayout
android:id="@+id/in_call_and_button_container"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_height="match_parent">
+
+ <fragment
+ android:name="com.android.incallui.CallCardFragment"
+ android:id="@+id/callCardFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
<RelativeLayout
- android:id="@+id/in_call_card_container"
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1">
+ android:layout_height="match_parent">
- <fragment
- android:name="com.android.incallui.CallCardFragment"
- android:id="@+id/callCardFragment"
+ <fragment android:name="com.android.incallui.CallButtonFragment"
+ android:id="@+id/callButtonFragment"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentStart="true" />
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true" />
+
<fragment
android:name="com.android.incallui.DialpadFragment"
android:id="@+id/dialpadFragment"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentStart="true" />
- </RelativeLayout>
+ android:layout_height="wrap_content"
+ android:layout_above="@id/callButtonFragment"
+ android:layout_alignParentTop="true" />
- <fragment android:name="com.android.incallui.CallButtonFragment"
- android:id="@+id/callButtonFragment"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
+ </RelativeLayout>
- </LinearLayout>
+ </FrameLayout>
<fragment android:name="com.android.incallui.AnswerFragment"
android:id="@+id/answerFragment"
diff --git a/res/layout/incall_screen_msim.xml b/res/layout/incall_screen_msim.xml
index 52f79a9f..32ebec8d 100644
--- a/res/layout/incall_screen_msim.xml
+++ b/res/layout/incall_screen_msim.xml
@@ -18,49 +18,49 @@
limitations under the License.
-->
-<!-- In-call Phone UI; see InCallActivity.java. -->
+<!-- In-call Phone UI; see MsimInCallActivity.java. -->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="@android:color/black"
android:id="@+id/main">
- <LinearLayout
+ <FrameLayout
android:id="@+id/in_call_and_button_container"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_height="match_parent">
+
+ <fragment
+ android:name="com.android.incallui.CallCardFragment"
+ android:id="@+id/callCardFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
<RelativeLayout
- android:id="@+id/in_call_card_container"
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1">
+ android:layout_height="match_parent">
<fragment
- android:name="com.android.incallui.CallCardFragment"
- android:id="@+id/callCardFragment"
+ android:name="com.android.incallui.CallButtonFragment"
+ android:id="@+id/callButtonFragment"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentStart="true" />
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true" />
+
<fragment
android:name="com.android.incallui.DialpadFragment"
android:id="@+id/dialpadFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentStart="true" />
- </RelativeLayout>
+ android:layout_below="@id/callButtonFragment"
+ android:layout_alignParentTop="true" />
- <fragment android:name="com.android.incallui.CallButtonFragment"
- android:id="@+id/callButtonFragment"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
+ </RelativeLayout>
- </LinearLayout>
+ </FrameLayout>
- <fragment android:name="com.android.incallui.MSimAnswerFragment"
+ <fragment android:name="com.android.incallui.MsimAnswerFragment"
android:id="@+id/answerFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/res/layout/primary_call_info.xml b/res/layout/primary_call_info.xml
index 9a030a95..b1ee979e 100644
--- a/res/layout/primary_call_info.xml
+++ b/res/layout/primary_call_info.xml
@@ -35,7 +35,9 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical">
+ android:orientation="vertical"
+ android:background="@color/incall_call_banner_background"
+ android:fitsSystemWindows="true">
<!-- "Call Banner" for primary call, the foregound or ringing call.
The "call banner" is a block of info about a single call,
@@ -50,8 +52,7 @@
android:paddingStart="@dimen/call_banner_side_padding"
android:paddingEnd="@dimen/call_banner_side_padding"
android:paddingTop="@dimen/call_banner_top_bottom_padding"
- android:paddingBottom="@dimen/call_banner_top_bottom_padding"
- android:background="@color/incall_call_banner_background">
+ android:paddingBottom="@dimen/call_banner_top_bottom_padding">
<!-- Subscription id: it displays current subscription(SUB1/SUB2/SUB3) information
on which currently voice call is active(in foreground). -->
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 4eee2370..72d1023f 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -117,7 +117,7 @@
<!-- Default distance from each snap target that GlowPadView considers a "hit" -->
<dimen name="glowpadview_inner_radius">15dip</dimen>
- <dimen name="glowpadview_margin_bottom">-113dip</dimen>
+ <dimen name="glowpadview_margin_bottom">-48dip</dimen>
<dimen name="glowpadview_margin_right">0dip</dimen>
<!-- Text dimensions for dialpad keys -->
diff --git a/src/com/android/incallui/AnswerFragment.java b/src/com/android/incallui/AnswerFragment.java
index 1a5e8b6e..dbf9ace0 100644
--- a/src/com/android/incallui/AnswerFragment.java
+++ b/src/com/android/incallui/AnswerFragment.java
@@ -29,6 +29,7 @@ import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
@@ -102,13 +103,16 @@ public class AnswerFragment extends BaseFragment<AnswerPresenter, AnswerPresente
@Override
public void showAnswerUi(boolean show) {
+ final Window window = getActivity().getWindow();
getView().setVisibility(show ? View.VISIBLE : View.GONE);
Log.d(this, "Show answer UI: " + show);
if (show) {
mGlowpad.startPing();
+ window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
} else {
mGlowpad.stopPing();
+ window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
}
diff --git a/src/com/android/incallui/ConferenceManagerFragment.java b/src/com/android/incallui/ConferenceManagerFragment.java
index 119b5f35..3dab85c4 100644
--- a/src/com/android/incallui/ConferenceManagerFragment.java
+++ b/src/com/android/incallui/ConferenceManagerFragment.java
@@ -16,6 +16,7 @@
package com.android.incallui;
+import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
@@ -77,6 +78,11 @@ public class ConferenceManagerFragment
@Override
public void onClick(View v) {
getPresenter().manageConferenceDoneClicked();
+
+ final Activity activity = getActivity();
+ if (activity instanceof InCallActivity) {
+ ((InCallActivity) activity).onManageConferenceDoneClicked();
+ }
}
});
@@ -205,4 +211,4 @@ public class ConferenceManagerFragment
mConferenceTime.stop();
}
}
-} \ No newline at end of file
+}
diff --git a/src/com/android/incallui/InCallActivity.java b/src/com/android/incallui/InCallActivity.java
index 043bec09..15335645 100644
--- a/src/com/android/incallui/InCallActivity.java
+++ b/src/com/android/incallui/InCallActivity.java
@@ -66,6 +66,7 @@ public class InCallActivity extends Activity {
/** Use to pass 'showDialpad' from {@link #onNewIntent} to {@link #onResume} */
private boolean mShowDialpadRequested;
+ private boolean mConferenceManagerShown;
// This enum maps to Phone.SuppService defined in telephony
private enum SuppService {
@@ -129,6 +130,7 @@ public class InCallActivity extends Activity {
mCallButtonFragment.displayDialpad(true);
mShowDialpadRequested = false;
}
+ updateSystemBarTranslucency();
}
// onPause is guaranteed to be called when the InCallActivity goes
@@ -244,6 +246,8 @@ public class InCallActivity extends Activity {
return;
} else if (mConferenceManagerFragment.isVisible()) {
mConferenceManagerFragment.setVisible(false);
+ mConferenceManagerShown = false;
+ updateSystemBarTranslucency();
return;
}
@@ -474,9 +478,30 @@ public class InCallActivity extends Activity {
public void displayManageConferencePanel(boolean showPanel) {
if (showPanel) {
mConferenceManagerFragment.setVisible(true);
+ mConferenceManagerShown = true;
+ updateSystemBarTranslucency();
}
}
+ public void onManageConferenceDoneClicked() {
+ if (mConferenceManagerShown && !mConferenceManagerFragment.isVisible()) {
+ mConferenceManagerShown = false;
+ updateSystemBarTranslucency();
+ }
+ }
+
+ private void updateSystemBarTranslucency() {
+ final boolean doTranslucency = !mConferenceManagerShown;
+ final Window window = getWindow();
+
+ if (doTranslucency) {
+ window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+ } else {
+ window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+ }
+ window.getDecorView().requestFitSystemWindows();
+ }
+
// The function is called when Modify Call button gets pressed.
// The function creates and displays modify call options.
public void displayModifyCallOptions(final int callId) {