From 8c47d75d9a128db66faf1e824f628ed5a1a87723 Mon Sep 17 00:00:00 2001 From: yueg Date: Thu, 9 Nov 2017 11:39:10 -0800 Subject: Conferece call management screen UI adjustment. Including: - change action icon color - hide TextView for name if name is empty - if name is empty, use number to generate avatar - don't show number type Bug: 67053842 Test: manual PiperOrigin-RevId: 175188810 Change-Id: I4ba40e5332d7b8567932360d36c8dc6ec3d604a5 --- .../dialer/calllogutils/CallTypeIconsView.java | 8 +++--- .../com/android/dialer/theme/res/values/colors.xml | 4 +-- .../incallui/ConferenceParticipantListAdapter.java | 32 ++++++++-------------- .../incallui/res/layout/caller_in_conference.xml | 16 ++--------- java/com/android/incallui/res/values/colors.xml | 2 -- 5 files changed, 20 insertions(+), 42 deletions(-) (limited to 'java') diff --git a/java/com/android/dialer/calllogutils/CallTypeIconsView.java b/java/com/android/dialer/calllogutils/CallTypeIconsView.java index bf33faa33..0c28a9728 100644 --- a/java/com/android/dialer/calllogutils/CallTypeIconsView.java +++ b/java/com/android/dialer/calllogutils/CallTypeIconsView.java @@ -268,7 +268,7 @@ public class CallTypeIconsView extends View { iconId = R.drawable.quantum_ic_voicemail_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); voicemail = drawable.mutate(); - voicemail.setColorFilter(r.getColor(R.color.call_type_icon_color), PorterDuff.Mode.MULTIPLY); + voicemail.setColorFilter(r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_block_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); @@ -278,17 +278,17 @@ public class CallTypeIconsView extends View { iconId = R.drawable.quantum_ic_videocam_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); videoCall = drawable.mutate(); - videoCall.setColorFilter(r.getColor(R.color.call_type_icon_color), PorterDuff.Mode.MULTIPLY); + videoCall.setColorFilter(r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_hd_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); hdCall = drawable.mutate(); - hdCall.setColorFilter(r.getColor(R.color.call_type_icon_color), PorterDuff.Mode.MULTIPLY); + hdCall.setColorFilter(r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_signal_wifi_4_bar_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); wifiCall = drawable.mutate(); - wifiCall.setColorFilter(r.getColor(R.color.call_type_icon_color), PorterDuff.Mode.MULTIPLY); + wifiCall.setColorFilter(r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY); iconMargin = largeIcons ? 0 : r.getDimensionPixelSize(R.dimen.call_log_icon_margin); } diff --git a/java/com/android/dialer/theme/res/values/colors.xml b/java/com/android/dialer/theme/res/values/colors.xml index f44a7ccc6..a59fa6704 100644 --- a/java/com/android/dialer/theme/res/values/colors.xml +++ b/java/com/android/dialer/theme/res/values/colors.xml @@ -68,8 +68,8 @@ #CFD8DC - - #89000000 + + #89000000 #FFDF0000 diff --git a/java/com/android/incallui/ConferenceParticipantListAdapter.java b/java/com/android/incallui/ConferenceParticipantListAdapter.java index d0f488501..66b6a97c1 100644 --- a/java/com/android/incallui/ConferenceParticipantListAdapter.java +++ b/java/com/android/incallui/ConferenceParticipantListAdapter.java @@ -242,7 +242,6 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { contactCache.namePrimary, call.updateNameIfRestricted(name), contactCache.number, - contactCache.label, contactCache.lookupKey, contactCache.displayPhotoUri, thisRowCanSeparate, @@ -277,7 +276,6 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { * @param view The view to set the details on. * @param callerName The participant's name. * @param callerNumber The participant's phone number. - * @param callerNumberType The participant's phone number typ.e * @param lookupKey The lookup key for the participant (for photo lookup). * @param photoUri The URI of the contact photo. * @param thisRowCanSeparate {@code True} if this participant can separate from the conference. @@ -288,7 +286,6 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { String callerName, String preferredName, String callerNumber, - String callerNumberType, String lookupKey, Uri photoUri, boolean thisRowCanSeparate, @@ -299,16 +296,13 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { final TextView statusTextView = (TextView) view.findViewById(R.id.conferenceCallerStatus); final TextView nameTextView = (TextView) view.findViewById(R.id.conferenceCallerName); final TextView numberTextView = (TextView) view.findViewById(R.id.conferenceCallerNumber); - final TextView numberTypeTextView = - (TextView) view.findViewById(R.id.conferenceCallerNumberType); final View endButton = view.findViewById(R.id.conferenceCallerDisconnect); final View separateButton = view.findViewById(R.id.conferenceCallerSeparate); if (callState == DialerCall.State.ONHOLD) { - setViewsOnHold(photoView, statusTextView, nameTextView, numberTextView, numberTypeTextView); + setViewsOnHold(photoView, statusTextView, nameTextView, numberTextView); } else { - setViewsNotOnHold( - photoView, statusTextView, nameTextView, numberTextView, numberTypeTextView); + setViewsNotOnHold(photoView, statusTextView, nameTextView, numberTextView); } endButton.setVisibility(thisRowCanDisconnect ? View.VISIBLE : View.GONE); @@ -325,27 +319,30 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { separateButton.setOnClickListener(null); } + String displayNameForImage = TextUtils.isEmpty(callerName) ? callerNumber : callerName; DefaultImageRequest imageRequest = (photoUri != null) ? null - : new DefaultImageRequest(callerName, lookupKey, true /* isCircularPhoto */); + : new DefaultImageRequest(displayNameForImage, lookupKey, true /* isCircularPhoto */); mContactPhotoManager.loadDirectoryPhoto(photoView, photoUri, false, true, imageRequest); // set the caller name - nameTextView.setText(preferredName); + if (TextUtils.isEmpty(preferredName)) { + nameTextView.setVisibility(View.GONE); + } else { + nameTextView.setVisibility(View.VISIBLE); + nameTextView.setText(preferredName); + } // set the caller number in subscript, or make the field disappear. if (TextUtils.isEmpty(callerNumber)) { numberTextView.setVisibility(View.GONE); - numberTypeTextView.setVisibility(View.GONE); } else { numberTextView.setVisibility(View.VISIBLE); numberTextView.setText( PhoneNumberUtilsCompat.createTtsSpannable( BidiFormatter.getInstance().unicodeWrap(callerNumber, TextDirectionHeuristics.LTR))); - numberTypeTextView.setVisibility(View.VISIBLE); - numberTypeTextView.setText(callerNumberType); } } @@ -353,8 +350,7 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { ImageView photoView, TextView statusTextView, TextView nameTextView, - TextView numberTextView, - TextView numberTypeTextView) { + TextView numberTextView) { CharSequence onHoldText = TextUtils.concat(getContext().getText(R.string.notification_on_hold).toString(), " • "); statusTextView.setText(onHoldText); @@ -363,7 +359,6 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { int onHoldColor = getContext().getColor(R.color.dialer_secondary_text_color_hiden); nameTextView.setTextColor(onHoldColor); numberTextView.setTextColor(onHoldColor); - numberTypeTextView.setTextColor(onHoldColor); TypedValue alpha = new TypedValue(); getContext().getResources().getValue(R.dimen.alpha_hiden, alpha, true); @@ -374,16 +369,13 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { ImageView photoView, TextView statusTextView, TextView nameTextView, - TextView numberTextView, - TextView numberTypeTextView) { + TextView numberTextView) { statusTextView.setVisibility(View.GONE); nameTextView.setTextColor( getContext().getColor(R.color.conference_call_manager_caller_name_text_color)); numberTextView.setTextColor( getContext().getColor(R.color.conference_call_manager_secondary_text_color)); - numberTypeTextView.setTextColor( - getContext().getColor(R.color.conference_call_manager_secondary_text_color)); TypedValue alpha = new TypedValue(); getContext().getResources().getValue(R.dimen.alpha_enabled, alpha, true); diff --git a/java/com/android/incallui/res/layout/caller_in_conference.xml b/java/com/android/incallui/res/layout/caller_in_conference.xml index 37918188f..be4eca5f6 100644 --- a/java/com/android/incallui/res/layout/caller_in_conference.xml +++ b/java/com/android/incallui/res/layout/caller_in_conference.xml @@ -82,18 +82,6 @@ android:textColor="@color/conference_call_manager_secondary_text_color" android:textSize="14sp"/> - - - @@ -110,7 +98,7 @@ android:contentDescription="@string/goPrivate" android:scaleType="center" android:src="@drawable/ic_call_split_white_24dp" - android:tint="@color/conference_call_manager_icon_color"/> + android:tint="@color/icon_color_grey"/> + android:tint="@color/icon_color_grey"/> diff --git a/java/com/android/incallui/res/values/colors.xml b/java/com/android/incallui/res/values/colors.xml index 4bded7855..32da57b84 100644 --- a/java/com/android/incallui/res/values/colors.xml +++ b/java/com/android/incallui/res/values/colors.xml @@ -17,7 +17,6 @@ #4d4d4d - #999999 #999999 @@ -34,7 +33,6 @@ These colors are also used by InCallUIMaterialColorMapUtils to generate primary activity colors. - --> #00796B -- cgit v1.2.3