summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-05-19 17:13:32 -0700
committerAndrew Lee <anwlee@google.com>2014-05-20 15:38:01 -0700
commite5c0d8bdf8269f9435e0381889e4870f36a43f07 (patch)
tree7376bdc6e7b62d4473e5eb3d847f907718a9742b
parentc5ff890f0a3deea02ac27a0b7574e7c112160b5b (diff)
Update call waiting UI.
- Reposition secondary call info location. - Simplify secondary call info; remove secondary photo. - Tweak secondary photo colors and padding. Bug: 14492083 Change-Id: I8ab37f9086b089480dec41ca0940d44d36a7b01e
-rw-r--r--InCallUI/res/layout/call_card.xml12
-rw-r--r--InCallUI/res/layout/primary_call_info.xml6
-rw-r--r--InCallUI/res/layout/secondary_call_info.xml80
-rw-r--r--InCallUI/res/values/colors.xml8
-rw-r--r--InCallUI/res/values/dimens.xml7
-rw-r--r--InCallUI/res/values/styles.xml7
-rw-r--r--InCallUI/src/com/android/incallui/CallCardFragment.java38
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java15
8 files changed, 57 insertions, 116 deletions
diff --git a/InCallUI/res/layout/call_card.xml b/InCallUI/res/layout/call_card.xml
index cf7a49009..2178ab7a5 100644
--- a/InCallUI/res/layout/call_card.xml
+++ b/InCallUI/res/layout/call_card.xml
@@ -46,7 +46,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:translationZ="@dimen/primary_call_translation_z"
+ android:elevation="@dimen/primary_call_elevation"
android:background="@color/incall_call_banner_background_color"
android:clipChildren="false"
android:clipToPadding="false" >
@@ -73,6 +73,9 @@
android:contentDescription="@string/contactPhoto"
android:src="@drawable/picture_unknown"/>
+ <!-- Secondary "Call info" block, for the background ("on hold") call. -->
+ <include layout="@layout/secondary_call_info" />
+
<fragment android:name="com.android.incallui.DialpadFragment"
android:id="@+id/dialpadFragment"
android:layout_width="match_parent"
@@ -125,11 +128,4 @@
</FrameLayout>
- <!-- Secondary "Call info" block, for the background ("on hold") call. -->
- <ViewStub android:id="@+id/secondary_call_info"
- android:layout="@layout/secondary_call_info"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
-
</LinearLayout>
diff --git a/InCallUI/res/layout/primary_call_info.xml b/InCallUI/res/layout/primary_call_info.xml
index f483471f4..4b19c4889 100644
--- a/InCallUI/res/layout/primary_call_info.xml
+++ b/InCallUI/res/layout/primary_call_info.xml
@@ -79,7 +79,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/incall_call_banner_secondary_text_color"
+ android:textColor="@color/incall_call_banner_subtext_color"
android:textSize="@dimen/call_label_text_size"
android:singleLine="true"
android:textDirection="ltr" />
@@ -88,7 +88,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/incall_call_banner_secondary_text_color"
+ android:textColor="@color/incall_call_banner_subtext_color"
android:textSize="@dimen/call_label_text_size"
android:singleLine="true"
android:layout_marginStart="6dp" />
@@ -101,7 +101,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/incall_call_banner_secondary_text_color"
+ android:textColor="@color/incall_call_banner_subtext_color"
android:singleLine="true"
android:visibility="gone" />
diff --git a/InCallUI/res/layout/secondary_call_info.xml b/InCallUI/res/layout/secondary_call_info.xml
index 6f0fee5c1..e45d90d2d 100644
--- a/InCallUI/res/layout/secondary_call_info.xml
+++ b/InCallUI/res/layout/secondary_call_info.xml
@@ -14,65 +14,39 @@
limitations under the License.
-->
-<!-- XML resource file for secondary call info, which will be used by CallCard.
- See also call_card.xml.
+<!-- XML resource file for secondary call info, which will be used by CallCard. -->
- This should look similar to primary call info (primary_call_info.xml), but
- to optimize the view usage, the structure is different. -->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/secondary_call_info"
android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <!-- Contact photo for call_info #2 -->
- <ImageView android:id="@+id/secondaryCallPhoto"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:gravity="top|center_horizontal"
- android:scaleType="centerCrop"
- android:contentDescription="@string/onHold" />
-
- <View android:id="@+id/dim_effect_for_secondary_photo"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/clickable_dim_effect"/>
-
- <!-- Parent FrameLayout is used to size the background correctly, while the child TextView
- just wraps its content and is aligned with layout_gravity start so that it is aligned
- to the correct side in RTL mode regardless of whether the text is Arabic or not -->
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="@dimen/call_banner_height"
- android:paddingStart="@dimen/call_banner_side_padding"
- android:paddingEnd="@dimen/secondary_call_banner_right_padding"
- android:paddingTop="@dimen/call_banner_top_bottom_padding"
- android:paddingBottom="@dimen/call_banner_top_bottom_padding"
- android:background="@color/incall_call_banner_background_color">
- <!-- Name (or the phone number, if we don't have a name to display). -->
- <TextView android:id="@+id/secondaryCallName"
- style="@style/SecondaryCallInfoSecondaryCallName"
- android:layout_gravity="bottom|start"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/incall_call_banner_text_color"
- android:ellipsize="marquee"
- android:singleLine="true"/>
- </FrameLayout>
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:paddingStart="@dimen/call_banner_side_padding"
+ android:paddingEnd="@dimen/secondary_call_banner_right_padding"
+ android:paddingTop="@dimen/call_banner_top_bottom_padding"
+ android:paddingBottom="@dimen/call_banner_top_bottom_padding"
+ android:background="@color/incall_banner_secondary_background_color"
+ android:elevation="@dimen/secondary_call_elevation" >
+
+ <!-- Name (or the phone number, if we don't have a name to display). -->
+ <TextView android:id="@+id/secondaryCallName"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/incall_banner_secondary_text_color"
+ android:ellipsize="marquee"
+ android:singleLine="true"/>
<!-- Call status of the background call, usually the string "On hold". -->
<TextView android:id="@+id/secondaryCallStatus"
- style="@style/SecondaryCallInfoSecondaryCallStatus"
android:layout_width="wrap_content"
- android:layout_height="@dimen/call_banner_height"
- android:gravity="bottom|end"
- android:layout_gravity="end"
- android:paddingStart="@dimen/call_banner_side_padding"
+ android:layout_height="wrap_content"
android:paddingEnd="@dimen/call_banner_side_padding"
- android:paddingTop="@dimen/call_banner_top_bottom_padding"
- android:paddingBottom="@dimen/call_banner_top_bottom_padding"
android:text="@string/onHold"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/incall_call_banner_text_color"
- android:textAllCaps="true"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/incall_banner_secondary_text_color"
+ android:textAlignment="textEnd"
android:singleLine="true" />
-</FrameLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/InCallUI/res/values/colors.xml b/InCallUI/res/values/colors.xml
index 74c218e34..57264f72e 100644
--- a/InCallUI/res/values/colors.xml
+++ b/InCallUI/res/values/colors.xml
@@ -23,10 +23,10 @@
<!-- Background color of main banner. -->
<color name="incall_call_banner_background_color">@color/incall_background_color</color>
- <!-- white -->
- <color name="incall_call_banner_text_color">#FFFFFF</color>
- <!-- White, with 80% opacity. -->
- <color name="incall_call_banner_secondary_text_color">#99ffffff</color>
+ <color name="incall_call_banner_text_color">#ffffff</color>
+ <color name="incall_call_banner_subtext_color">#99ffffff</color>
+ <color name="incall_banner_secondary_background_color">#f5f5f5</color>
+ <color name="incall_banner_secondary_text_color">#808080</color>
<!-- Color of the theme of the People app -->
<color name="people_app_theme_color">#33B5E5</color>
diff --git a/InCallUI/res/values/dimens.xml b/InCallUI/res/values/dimens.xml
index c01b9699f..24858c2af 100644
--- a/InCallUI/res/values/dimens.xml
+++ b/InCallUI/res/values/dimens.xml
@@ -29,10 +29,10 @@
<!-- Padding at the left and right edges of the "call banner". -->
<dimen name="call_banner_side_padding">24dp</dimen>
<!-- Padding at the right edges of the secondary call banner. -->
- <dimen name="secondary_call_banner_right_padding">100dp</dimen>
+ <dimen name="secondary_call_banner_right_padding">24dp</dimen>
<!-- Padding at the top and bottom edges of the "call banner". -->
<dimen name="call_banner_primary_call_top_padding">16dp</dimen>
- <dimen name="call_banner_top_bottom_padding">8dp</dimen>
+ <dimen name="call_banner_top_bottom_padding">16dp</dimen>
<!-- Padding at the top and bottom edges of the "provider information" -->
<dimen name="provider_info_top_bottom_padding">8dp</dimen>
@@ -55,7 +55,8 @@
<!-- Height of buttons in the extra button row. -->
<dimen name="extra_row_button_height">@dimen/in_call_button_dimension</dimen>
- <dimen name="primary_call_translation_z">8dp</dimen>
+ <dimen name="primary_call_elevation">8dp</dimen>
+ <dimen name="secondary_call_elevation">8dp</dimen>
<!-- Padding at the left and right edges of the incall_touch_ui button
diff --git a/InCallUI/res/values/styles.xml b/InCallUI/res/values/styles.xml
index 747a324e4..d86ff68fc 100644
--- a/InCallUI/res/values/styles.xml
+++ b/InCallUI/res/values/styles.xml
@@ -127,11 +127,4 @@
<style name="PrimaryCallInfoPrimaryCallBanner">
<item name="android:layout_alignParentTop">true</item>
</style>
-
- <style name="SecondaryCallInfoSecondaryCallName">
- <item name="android:layout_gravity">top|left</item>
- </style>
- <style name="SecondaryCallInfoSecondaryCallStatus">
- <item name="android:layout_gravity">top|right</item>
- </style>
</resources>
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index f43d66bd5..0c60fd555 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -73,10 +73,8 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
private View mCallButtonsContainer;
// Secondary caller info
- private ViewStub mSecondaryCallInfo;
+ private View mSecondaryCallInfo;
private TextView mSecondaryCallName;
- private ImageView mSecondaryPhoto;
- private View mSecondaryPhotoOverlay;
private View mEndCallButton;
private ImageButton mHandoffButton;
@@ -132,7 +130,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
mPhoneNumber = (TextView) view.findViewById(R.id.phoneNumber);
mPrimaryName = (TextView) view.findViewById(R.id.name);
mNumberLabel = (TextView) view.findViewById(R.id.label);
- mSecondaryCallInfo = (ViewStub) view.findViewById(R.id.secondary_call_info);
+ mSecondaryCallInfo = (View) view.findViewById(R.id.secondary_call_info);
mPhoto = (ImageView) view.findViewById(R.id.photo);
mCallStateLabel = (TextView) view.findViewById(R.id.callStateLabel);
mCallNumberAndLabel = view.findViewById(R.id.labelAndNumber);
@@ -246,12 +244,11 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
@Override
public void setSecondary(boolean show, String name, boolean nameIsNumber, String label,
- Drawable photo, boolean isConference, boolean isGeneric) {
+ boolean isConference, boolean isGeneric) {
if (show) {
if (isConference) {
name = getConferenceString(isGeneric);
- photo = getConferencePhoto(isGeneric);
nameIsNumber = false;
}
@@ -263,21 +260,12 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
nameDirection = View.TEXT_DIRECTION_LTR;
}
mSecondaryCallName.setTextDirection(nameDirection);
-
- setDrawableToImageView(mSecondaryPhoto, photo);
} else {
mSecondaryCallInfo.setVisibility(View.GONE);
}
}
@Override
- public void setSecondaryImage(Drawable image) {
- if (image != null) {
- setDrawableToImageView(mSecondaryPhoto, image);
- }
- }
-
- @Override
public void setCallState(int state, int cause, boolean bluetoothOn, String gatewayLabel,
String gatewayNumber, boolean isWiFi, boolean isHandoffCapable,
boolean isHandoffPending) {
@@ -511,20 +499,12 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
if (mSecondaryCallName == null) {
mSecondaryCallName = (TextView) getView().findViewById(R.id.secondaryCallName);
}
- if (mSecondaryPhoto == null) {
- mSecondaryPhoto = (ImageView) getView().findViewById(R.id.secondaryCallPhoto);
- }
-
- if (mSecondaryPhotoOverlay == null) {
- mSecondaryPhotoOverlay = getView().findViewById(R.id.dim_effect_for_secondary_photo);
- mSecondaryPhotoOverlay.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- getPresenter().secondaryPhotoClicked();
- }
- });
- mSecondaryPhotoOverlay.setOnTouchListener(new SmallerHitTargetTouchListener());
- }
+ mSecondaryCallInfo.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getPresenter().secondaryInfoClicked();
+ }
+ });
}
public void dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index e73848c1a..576283211 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -312,8 +312,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
if (entry.photo != null) {
if (mPrimary != null && callId.equals(mPrimary.getCallId())) {
getUi().setPrimaryImage(entry.photo);
- } else if (mSecondary != null && callId.equals(mSecondary.getCallId())) {
- getUi().setSecondaryImage(entry.photo);
}
}
}
@@ -418,11 +416,11 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
final boolean nameIsNumber = nameForCall != null && nameForCall.equals(
mSecondaryContactInfo.number);
- ui.setSecondary(true, nameForCall, nameIsNumber, mSecondaryContactInfo.label,
- mSecondaryContactInfo.photo, isConference, isGenericConf);
+ ui.setSecondary(true /* show */, nameForCall, nameIsNumber, mSecondaryContactInfo.label,
+ isConference, isGenericConf);
} else {
// reset to nothing so that it starts off blank next time we use it.
- ui.setSecondary(false, null, false, null, null, isConference, isGenericConf);
+ ui.setSecondary(false, null, false, null, isConference, isGenericConf);
}
}
@@ -488,9 +486,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
return contactInfo.number;
}
- public void secondaryPhotoClicked() {
+ public void secondaryInfoClicked() {
if (mSecondary == null) {
- Log.wtf(this, "Secondary photo clicked but no secondary call.");
+ Log.wtf(this, "Secondary info clicked but no secondary call.");
return;
}
@@ -512,8 +510,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
void setPrimary(String number, String name, boolean nameIsNumber, String label,
Drawable photo, boolean isConference, boolean isGeneric, boolean isSipCall);
void setSecondary(boolean show, String name, boolean nameIsNumber, String label,
- Drawable photo, boolean isConference, boolean isGeneric);
- void setSecondaryImage(Drawable image);
+ boolean isConference, boolean isGeneric);
void setCallState(int state, int cause, boolean bluetoothOn,
String gatewayLabel, String gatewayNumber, boolean isWifi, boolean isHandoffCapable,
boolean isHandoffPending);