diff options
author | Andrew Lee <anwlee@google.com> | 2014-04-24 11:06:18 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2014-04-24 11:36:51 -0700 |
commit | 4f958735b2c95275c2887df6f362b74f1eaf9974 (patch) | |
tree | 5da76967091740e25767920b1cef8fedd924e61d | |
parent | 7e5763d2b5ee7211c5d19d2b1fd2736e407a7e83 (diff) |
Restyle text in primary call info.
- Update positioning, color, and sizing of primary call info text.
- In particular, moving the call state to above the "name".
- Delete the supplementary info container; it's no longer needed.
- Remove programmatic updating of gravity on call state; it is now
always left aligned.
Bug: 13956531
Change-Id: Ib165a2afd13444f70e3bfe0ae23ae6c6bb77bb84
-rw-r--r-- | InCallUI/res/layout/primary_call_info.xml | 76 | ||||
-rw-r--r-- | InCallUI/res/values/colors.xml | 2 | ||||
-rw-r--r-- | InCallUI/res/values/dimens.xml | 6 | ||||
-rw-r--r-- | InCallUI/res/values/styles.xml | 4 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardFragment.java | 26 |
5 files changed, 40 insertions, 74 deletions
diff --git a/InCallUI/res/layout/primary_call_info.xml b/InCallUI/res/layout/primary_call_info.xml index 1102402a2..18cc70b7c 100644 --- a/InCallUI/res/layout/primary_call_info.xml +++ b/InCallUI/res/layout/primary_call_info.xml @@ -37,44 +37,61 @@ android:minHeight="@dimen/call_banner_height" android:paddingStart="@dimen/call_banner_side_padding" android:paddingEnd="@dimen/call_banner_side_padding" - android:paddingTop="@dimen/call_banner_top_bottom_padding" + android:paddingTop="@dimen/call_banner_primary_call_top_padding" android:paddingBottom="@dimen/call_banner_top_bottom_padding" - android:background="@color/incall_call_banner_background_color"> + 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/name" - android:layout_alignParentTop="true" - android:layout_alignParentStart="true" + <LinearLayout android:id="@+id/stateAndName" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingEnd="@dimen/call_banner_name_number_right_padding" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textColor="@color/incall_call_banner_text_color" - android:singleLine="true" - android:textAlignment="viewStart"/> + android:orientation="vertical" > + + <TextView android:id="@+id/callStateLabel" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceLarge" + android:singleLine="true" + android:gravity="left" + android:ellipsize="end" /> + + <TextView android:id="@+id/name" + android:layout_width="match_parent" + android:paddingEnd="@dimen/call_banner_name_number_right_padding" + android:layout_height="wrap_content" + android:fontFamily="sans-serif-light" + android:textAppearance="?android:attr/textAppearanceLarge" + android:textSize="@dimen/call_name_text_size" + android:singleLine="true" /> + + </LinearLayout> <!-- Label (like "Mobile" or "Work", if present) and phone number, side by side --> <LinearLayout android:id="@+id/labelAndNumber" - android:layout_below="@id/name" + android:layout_below="@id/stateAndName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingEnd="@dimen/call_banner_name_number_right_padding" - android:orientation="horizontal"> + android:orientation="horizontal" > + <TextView android:id="@+id/phoneNumber" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="@color/incall_call_banner_text_color" + android:textColor="@color/incall_call_banner_secondary_text_color" + android:textSize="@dimen/call_label_text_size" android:singleLine="true" android:textDirection="ltr" /> + <TextView android:id="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="@color/incall_call_banner_text_color" - android:textAllCaps="true" + android:textColor="@color/incall_call_banner_secondary_text_color" + android:textSize="@dimen/call_label_text_size" android:singleLine="true" android:layout_marginStart="6dp" /> + </LinearLayout> <!-- Elapsed time indication for a call in progress. --> @@ -101,35 +118,6 @@ </RelativeLayout> <!-- End of call_banner --> - - <LinearLayout android:id="@+id/supplementary_info_container" - style="@style/PrimaryCallInfoSupplementaryInfoContainer" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical|right" - android:orientation="vertical" - android:background="@color/incall_call_banner_background_color" - android:animateLayoutChanges="true"> - - <!-- The "call state label": In some states, this shows a special - indication like "Dialing" or "Incoming call" or "Call ended". - It's unused for the normal case of an active ongoing call. --> - <TextView android:id="@+id/callStateLabel" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingTop="@dimen/provider_info_top_bottom_padding" - android:paddingBottom="@dimen/provider_info_top_bottom_padding" - android:paddingStart="@dimen/call_banner_side_padding" - android:paddingEnd="@dimen/call_banner_side_padding" - android:gravity="end" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="@color/incall_call_banner_text_color" - android:textAllCaps="true" - android:background="@android:color/transparent" - android:singleLine="true" - android:ellipsize="end"/> - </LinearLayout> - </LinearLayout> </FrameLayout> diff --git a/InCallUI/res/values/colors.xml b/InCallUI/res/values/colors.xml index f6679249c..b187820ea 100644 --- a/InCallUI/res/values/colors.xml +++ b/InCallUI/res/values/colors.xml @@ -26,6 +26,8 @@ <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 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 92e55d60c..069f98dc5 100644 --- a/InCallUI/res/values/dimens.xml +++ b/InCallUI/res/values/dimens.xml @@ -31,11 +31,17 @@ <!-- Padding at the right edges of the secondary call banner. --> <dimen name="secondary_call_banner_right_padding">100dp</dimen> <!-- Padding at the top and bottom edges of the "call banner". --> + <dimen name="call_banner_primary_call_top_padding">32dp</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> + <!-- Text size for the name in the call info. --> + <dimen name="call_name_text_size">36sp</dimen> + <!-- Text size for the call info label and number. --> + <dimen name="call_label_text_size">18sp</dimen> + <!-- Right padding for name and number fields in the call banner. This padding is used to ensure that ultra-long names or numbers won't overlap the elapsed time indication. --> diff --git a/InCallUI/res/values/styles.xml b/InCallUI/res/values/styles.xml index 085cdb189..21b6d93a4 100644 --- a/InCallUI/res/values/styles.xml +++ b/InCallUI/res/values/styles.xml @@ -182,10 +182,6 @@ <style name="PrimaryCallInfoPrimaryCallBanner"> <item name="android:layout_alignParentTop">true</item> </style> - <style name="PrimaryCallInfoSupplementaryInfoContainer"> - <item name="android:layout_below">@id/primary_call_banner</item> - </style> - <style name="SecondaryCallInfoSecondaryCallName"> <item name="android:layout_gravity">top|left</item> </style> diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 2093a442c..402008f5f 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -50,7 +50,6 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr private TextView mCallTypeLabel; private ImageView mPhoto; private TextView mElapsedTime; - private ViewGroup mSupplementaryInfoContainer; // Secondary caller info private ViewStub mSecondaryCallInfo; @@ -110,8 +109,6 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr mCallStateLabel = (TextView) view.findViewById(R.id.callStateLabel); mCallTypeLabel = (TextView) view.findViewById(R.id.callTypeLabel); mElapsedTime = (TextView) view.findViewById(R.id.elapsedTime); - mSupplementaryInfoContainer = - (ViewGroup) view.findViewById(R.id.supplementary_info_container); mEndCallButton = view.findViewById(R.id.endButton); mEndCallButton.setOnClickListener(new View.OnClickListener() { @@ -255,16 +252,6 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr Log.v(this, "bluetooth on " + bluetoothOn); Log.v(this, "gateway " + gatewayLabel + gatewayNumber); - // There are cases where we totally skip the animation, in which case remove the transition - // animation here and restore it afterwards. - final boolean skipAnimation = (Call.State.isDialing(state) - || state == Call.State.DISCONNECTED || state == Call.State.DISCONNECTING); - LayoutTransition transition = null; - if (skipAnimation) { - transition = mSupplementaryInfoContainer.getLayoutTransition(); - mSupplementaryInfoContainer.setLayoutTransition(null); - } - // Update the call state label. if (!TextUtils.isEmpty(callStateLabel)) { mCallStateLabel.setVisibility(View.VISIBLE); @@ -275,19 +262,6 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } } else { mCallStateLabel.setVisibility(View.GONE); - // Gravity is aligned left when receiving an incoming call in landscape. - // In that rare case, the gravity needs to be reset to the right. - // Also, setText("") is used since there is a delay in making the view GONE, - // so the user will otherwise see the text jump to the right side before disappearing. - if(mCallStateLabel.getGravity() != Gravity.END) { - mCallStateLabel.setText(""); - mCallStateLabel.setGravity(Gravity.END); - } - } - - // Restore the animation. - if (skipAnimation) { - mSupplementaryInfoContainer.setLayoutTransition(transition); } } |