summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-08-14 12:23:10 -0700
committerAndrew Lee <anwlee@google.com>2015-08-14 18:46:10 -0700
commitd3b9beaa804324bd5748d151310f4f2bc5d76ee9 (patch)
tree0686f457560de2bcdbd080886a3f19083db1c128
parent95d29a40ba7d1b3aafb14b054b64a54e1c33fbb9 (diff)
Scale call card fragment for all devices.
Before we just wrapped content, which led to visual sadness on certain devices. + Scale call card fragment to one-third in portrait, to better space out the dialpad. + Scale call card fragment to half in landscape, to fix jank on N6 in landscape mode. + Shift up default photo so it is spaced evenly between the FAB and call card fragment or top of the screen. + Some other dimension/layout tweaks. Bug: 23218944 Bug: 23219273 Change-Id: I76801b64f6ae5d14a0d12cd55de7c60238eec5d7
-rw-r--r--InCallUI/res/layout-land/call_card_fragment.xml166
-rw-r--r--InCallUI/res/layout/call_card_fragment.xml176
-rw-r--r--InCallUI/res/layout/primary_call_info.xml3
-rw-r--r--InCallUI/res/values-sw360dp/dimens.xml3
-rw-r--r--InCallUI/res/values/colors.xml2
-rw-r--r--InCallUI/res/values/dimens.xml3
-rw-r--r--InCallUI/src/com/android/incallui/CallCardFragment.java3
7 files changed, 170 insertions, 186 deletions
diff --git a/InCallUI/res/layout-land/call_card_fragment.xml b/InCallUI/res/layout-land/call_card_fragment.xml
index c02af1b03..663529313 100644
--- a/InCallUI/res/layout-land/call_card_fragment.xml
+++ b/InCallUI/res/layout-land/call_card_fragment.xml
@@ -16,18 +16,17 @@
~ limitations under the License
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentStart="true" >
+ android:orientation="horizontal">
<LinearLayout
android:id="@+id/primary_call_info_container"
- android:layout_alignParentStart="true"
android:layout_centerVertical="true"
- android:layout_width="wrap_content"
+ android:layout_width="0dp"
android:layout_height="match_parent"
+ android:layout_weight="1"
android:orientation="vertical"
android:elevation="@dimen/primary_call_elevation"
android:background="@drawable/rounded_call_card_background"
@@ -39,104 +38,99 @@
<include layout="@layout/primary_call_info" />
- <FrameLayout
+ <fragment android:name="com.android.incallui.CallButtonFragment"
+ android:id="@+id/callButtonFragment"
android:layout_width="wrap_content"
- android:layout_height="match_parent" >
-
- <fragment android:name="com.android.incallui.CallButtonFragment"
- android:id="@+id/callButtonFragment"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:layout_marginBottom="@dimen/call_buttons_bottom_margin" />
- <!-- Secondary "Call info" block, for the background ("on hold") call. -->
- <include layout="@layout/secondary_call_info"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom" />
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom|center_horizontal"
+ android:layout_marginBottom="@dimen/call_buttons_bottom_margin" />
- </FrameLayout>
+ <!-- Secondary "Call info" block, for the background ("on hold") call. -->
+ <include layout="@layout/secondary_call_info"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom" />
</LinearLayout>
<FrameLayout
android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:layout_below="@id/primary_call_info_container"
- android:id="@+id/call_card_content">
+ android:layout_width="0dp"
+ android:layout_weight="1">
- <ImageView android:id="@+id/photo"
- android:layout_toEndOf="@id/primary_call_info_container"
- android:layout_width="match_parent"
- android:layout_gravity="start|center_vertical"
+ <FrameLayout
android:layout_height="match_parent"
- android:gravity="start|center_vertical"
- android:scaleType="centerCrop"
- android:contentDescription="@string/contactPhoto"
- android:background="@android:color/white"
- android:src="@drawable/img_no_image_automirrored" />
-
- </FrameLayout>
+ android:layout_width="match_parent"
+ android:id="@+id/call_card_content">
- <include layout="@layout/manage_conference_call_button"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignTop="@id/photo" />
+ <ImageView android:id="@+id/photo"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop"
+ android:contentDescription="@string/contactPhoto"
+ android:background="@color/incall_photo_background_color"
+ android:src="@drawable/img_no_image_automirrored"
+ android:paddingBottom="@dimen/end_call_floating_action_button_diameter" />
- <!-- Progress spinner, useful for indicating pending operations such as upgrade to video. -->
- <FrameLayout
- android:id="@+id/progressSpinner"
- android:layout_toEndOf="@id/primary_call_info_container"
- android:background="#63000000"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_centerHorizontal="true"
- android:layout_centerVertical="true"
- android:visibility="gone" >
+ </FrameLayout>
- <ProgressBar
- android:id="@+id/progress_bar"
- style="@android:style/Widget.Material.ProgressBar"
- android:layout_gravity="center"
- android:layout_width="48dp"
- android:layout_height="48dp"
- android:indeterminate="true" />
+ <include layout="@layout/manage_conference_call_button"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignTop="@id/photo" />
- </FrameLayout>
+ <!-- Progress spinner, useful for indicating pending operations such as upgrade to video. -->
+ <FrameLayout
+ android:id="@+id/progressSpinner"
+ android:background="#63000000"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:visibility="gone" >
+
+ <ProgressBar
+ android:id="@+id/progress_bar"
+ style="@android:style/Widget.Material.ProgressBar"
+ android:layout_gravity="center"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:indeterminate="true" />
- <fragment android:name="com.android.incallui.VideoCallFragment"
- android:layout_alignParentStart="true"
- android:layout_gravity="start|center_vertical"
- android:id="@+id/videoCallFragment"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
+ </FrameLayout>
- <!-- Placeholder for the dialpad which is replaced with the dialpad fragment when shown. -->
- <FrameLayout
- android:id="@+id/answer_and_dialpad_container"
- android:layout_toEndOf="@id/primary_call_info_container"
- android:layout_gravity="end|center_vertical"
- android:layout_alignParentEnd="true"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
+ <fragment android:name="com.android.incallui.VideoCallFragment"
+ android:layout_alignParentStart="true"
+ android:layout_gravity="start|center_vertical"
+ android:id="@+id/videoCallFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
- <FrameLayout
- android:id="@+id/floating_end_call_action_button_container"
- android:layout_width="@dimen/end_call_floating_action_button_diameter"
- android:layout_height="@dimen/end_call_floating_action_button_diameter"
- android:background="@drawable/fab_red"
- android:layout_centerHorizontal="true"
- android:layout_marginBottom="@dimen/end_call_button_margin_bottom"
- android:layout_alignParentBottom="true" >
-
- <ImageButton android:id="@+id/floating_end_call_action_button"
+ <!-- Placeholder for the dialpad which is replaced with the dialpad fragment when shown. -->
+ <FrameLayout
+ android:id="@+id/answer_and_dialpad_container"
+ android:layout_gravity="bottom"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/end_call_background"
- android:src="@drawable/fab_ic_end_call"
- android:scaleType="center"
- android:contentDescription="@string/onscreenEndCallText" />
+ android:layout_height="match_parent" />
+
+ <FrameLayout
+ android:id="@+id/floating_end_call_action_button_container"
+ android:layout_width="@dimen/end_call_floating_action_button_diameter"
+ android:layout_height="@dimen/end_call_floating_action_button_diameter"
+ android:background="@drawable/fab_red"
+ android:layout_gravity="bottom|center_horizontal"
+ android:layout_marginBottom="@dimen/end_call_button_margin_bottom">
+
+ <ImageButton android:id="@+id/floating_end_call_action_button"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/end_call_background"
+ android:src="@drawable/fab_ic_end_call"
+ android:scaleType="center"
+ android:contentDescription="@string/onscreenEndCallText" />
+
+ </FrameLayout>
</FrameLayout>
-</RelativeLayout>
+</LinearLayout>
diff --git a/InCallUI/res/layout/call_card_fragment.xml b/InCallUI/res/layout/call_card_fragment.xml
index dabba7662..c2112b65b 100644
--- a/InCallUI/res/layout/call_card_fragment.xml
+++ b/InCallUI/res/layout/call_card_fragment.xml
@@ -16,34 +16,27 @@
~ limitations under the License
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentStart="true">
-
- <!-- The main content of the CallCard is either one or two "call info"
- blocks, depending on whether one or two lines are in use.
-
- The call_info blocks are stacked vertically inside a CallCard (LinearLayout),
- each with layout_weight="1". If only one line is in use (i.e. the
- common case) then the 2nd call info will be GONE and thus the 1st one
- will expand to fill the full height of the CallCard. -->
+ android:orientation="vertical">
<!-- Primary "call card" block, for the foreground call. -->
<LinearLayout
android:id="@+id/primary_call_info_container"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="0dp"
+ android:layout_weight="1"
android:orientation="vertical"
android:elevation="@dimen/primary_call_elevation"
- android:layout_centerHorizontal="true"
android:background="@color/incall_call_banner_background_color"
android:paddingTop="@dimen/call_banner_primary_call_container_top_padding"
android:clipChildren="false"
- android:clipToPadding="false">
+ android:clipToPadding="false"
+ android:gravity="bottom">
- <include layout="@layout/primary_call_info" />
+ <include layout="@layout/primary_call_info"
+ android:layout_centerHorizontal="true" />
<fragment android:name="com.android.incallui.CallButtonFragment"
android:id="@+id/callButtonFragment"
@@ -60,89 +53,90 @@
</LinearLayout>
- <FrameLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:layout_below="@id/primary_call_info_container"
- android:id="@+id/call_card_content">
-
- <!-- Contact photo for primary call info -->
- <ImageView android:id="@+id/photo"
- android:layout_below="@id/primary_call_info_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center_vertical"
- android:gravity="top|center_horizontal"
- android:scaleType="centerCrop"
- android:importantForAccessibility="no"
- android:background="@android:color/white"
- android:src="@drawable/img_no_image_automirrored" />
-
- </FrameLayout>
-
- <fragment android:name="com.android.incallui.VideoCallFragment"
- android:id="@+id/videoCallFragment"
- android:layout_alignParentTop="true"
- android:layout_gravity="top|center_horizontal"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- <!-- Progress spinner, useful for indicating pending operations such as upgrade to video. -->
<FrameLayout
- android:id="@+id/progressSpinner"
- android:layout_below="@id/primary_call_info_container"
- android:background="#63000000"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_centerHorizontal="true"
- android:layout_centerVertical="true"
- android:visibility="gone">
-
- <ProgressBar
- android:id="@+id/progress_bar"
- style="@android:style/Widget.Material.ProgressBar"
- android:layout_gravity="center"
- android:layout_width="48dp"
- android:layout_height="48dp"
- android:indeterminate="true" />
-
- </FrameLayout>
-
- <!-- Secondary "Call info" block, for the background ("on hold") call. -->
- <include layout="@layout/secondary_call_info" />
-
- <include layout="@layout/manage_conference_call_button"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/primary_call_info_container" />
+ android:layout_height="0dp"
+ android:layout_weight="2">
- <!-- Placeholder for various fragments that are added dynamically underneath the caller info. -->
- <FrameLayout
- android:id="@+id/answer_and_dialpad_container"
- android:layout_below="@id/primary_call_info_container"
- android:layout_gravity="bottom|center_horizontal"
- android:layout_alignParentBottom="true"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:elevation="@dimen/dialpad_elevation" />
+ <FrameLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:id="@+id/call_card_content">
+
+ <!-- Contact photo for primary call info -->
+ <ImageView android:id="@+id/photo"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop"
+ android:importantForAccessibility="no"
+ android:background="@color/incall_photo_background_color"
+ android:src="@drawable/img_no_image_automirrored"
+ android:paddingBottom="@dimen/end_call_floating_action_button_diameter" />
+
+ </FrameLayout>
+
+ <fragment android:name="com.android.incallui.VideoCallFragment"
+ android:id="@+id/videoCallFragment"
+ android:layout_alignParentTop="true"
+ android:layout_gravity="top|center_horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ <!-- Progress spinner, useful for indicating pending operations such as upgrade to video. -->
+ <FrameLayout
+ android:id="@+id/progressSpinner"
+ android:background="#63000000"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:visibility="gone">
+
+ <ProgressBar
+ android:id="@+id/progress_bar"
+ style="@android:style/Widget.Material.ProgressBar"
+ android:layout_gravity="center"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:indeterminate="true" />
+
+ </FrameLayout>
+
+ <!-- Secondary "Call info" block, for the background ("on hold") call. -->
+ <include layout="@layout/secondary_call_info" />
+
+ <include layout="@layout/manage_conference_call_button"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
- <FrameLayout
- android:id="@+id/floating_end_call_action_button_container"
- android:layout_width="@dimen/end_call_floating_action_button_diameter"
- android:layout_height="@dimen/end_call_floating_action_button_diameter"
- android:background="@drawable/fab_red"
- android:layout_centerHorizontal="true"
- android:layout_marginBottom="@dimen/end_call_button_margin_bottom"
- android:layout_alignParentBottom="true" >
-
- <ImageButton android:id="@+id/floating_end_call_action_button"
+ <!-- Placeholder for various fragments that are added dynamically underneath the caller info. -->
+ <FrameLayout
+ android:id="@+id/answer_and_dialpad_container"
+ android:layout_gravity="bottom|center_horizontal"
+ android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@drawable/end_call_background"
- android:src="@drawable/fab_ic_end_call"
- android:scaleType="center"
- android:contentDescription="@string/onscreenEndCallText" />
+ android:elevation="@dimen/dialpad_elevation" />
+
+ <FrameLayout
+ android:id="@+id/floating_end_call_action_button_container"
+ android:layout_width="@dimen/end_call_floating_action_button_diameter"
+ android:layout_height="@dimen/end_call_floating_action_button_diameter"
+ android:background="@drawable/fab_red"
+ android:layout_gravity="bottom|center_horizontal"
+ android:layout_marginBottom="@dimen/end_call_button_margin_bottom">
+
+ <ImageButton android:id="@+id/floating_end_call_action_button"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/end_call_background"
+ android:src="@drawable/fab_ic_end_call"
+ android:scaleType="center"
+ android:contentDescription="@string/onscreenEndCallText" />
+
+ </FrameLayout>
</FrameLayout>
-</RelativeLayout>
+</LinearLayout>
diff --git a/InCallUI/res/layout/primary_call_info.xml b/InCallUI/res/layout/primary_call_info.xml
index 8f78440ba..a157121c4 100644
--- a/InCallUI/res/layout/primary_call_info.xml
+++ b/InCallUI/res/layout/primary_call_info.xml
@@ -23,7 +23,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/primary_call_banner"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="0dp"
+ android:layout_weight="1"
android:orientation="vertical"
android:minHeight="@dimen/call_banner_height"
android:paddingStart="@dimen/call_banner_side_padding"
diff --git a/InCallUI/res/values-sw360dp/dimens.xml b/InCallUI/res/values-sw360dp/dimens.xml
index d6ee5b4ce..9fbcd605b 100644
--- a/InCallUI/res/values-sw360dp/dimens.xml
+++ b/InCallUI/res/values-sw360dp/dimens.xml
@@ -18,9 +18,6 @@
<resources>
<!-- Dimensions for CallCard elements (the normal in-call UI) -->
- <!-- Height of the "call banner" overlay on top of the upper part of
- the call info area. -->
- <dimen name="call_banner_height">122dp</dimen>
<!-- Text size for the name in the call info. -->
<dimen name="call_status_text_size">22sp</dimen>
<dimen name="call_status_text_min_size">18sp</dimen>
diff --git a/InCallUI/res/values/colors.xml b/InCallUI/res/values/colors.xml
index cac382deb..d77fe0b5f 100644
--- a/InCallUI/res/values/colors.xml
+++ b/InCallUI/res/values/colors.xml
@@ -32,6 +32,8 @@
<color name="incall_action_bar_background_color">@color/incall_background_color</color>
<color name="incall_action_bar_text_color">@color/incall_call_banner_text_color</color>
+ <color name="incall_photo_background_color">#545454</color>
+
<!-- Put on top of each photo, implying 80% darker than usual. -->
<color name="on_hold_dim_effect">#cc000000</color>
diff --git a/InCallUI/res/values/dimens.xml b/InCallUI/res/values/dimens.xml
index 64853770c..a6ae2e28a 100644
--- a/InCallUI/res/values/dimens.xml
+++ b/InCallUI/res/values/dimens.xml
@@ -21,9 +21,6 @@
<!-- Dimensions for CallCard elements (the normal in-call UI) -->
- <!-- Height of the "call banner" overlay on top of the upper part of the call info area.
- Note: This is the default size for small (<600dp height) devices: larger screen sizes apply
- the values in values-h600dp/dimens.xml. -->
<dimen name="call_banner_height">90dp</dimen>
<dimen name="incall_action_bar_elevation">3dp</dimen>
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index c2b969c98..aa91cb50a 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -1135,8 +1135,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
}
mFloatingActionButtonController.align(
- mIsLandscape ? FloatingActionButtonController.ALIGN_QUARTER_END
- : FloatingActionButtonController.ALIGN_MIDDLE,
+ FloatingActionButtonController.ALIGN_MIDDLE,
0 /* offsetX */,
offsetY,
true);