diff options
author | yueg <yueg@google.com> | 2017-10-06 14:35:15 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-10-06 14:58:20 -0700 |
commit | 265089a047d575666a7c9fe325bf46d28b0342d1 (patch) | |
tree | 88f2cb2d8b3e2d62fbacb0ba670b9f65e609778b /java/com/android/incallui/ConferenceParticipantListAdapter.java | |
parent | 549fd00bfa7de12530beff678f8c0542d321a881 (diff) |
Show on hold in management screen for conference call.
Do the following when a participant is on hold:
- Add "On hold • " in front of the number
- Gray out avatar and text (contact name & number)
Notice:
We only have the on hold state information for VoLTE conference call and IMS conference call. So the change only works for them (not for GSM/CDMA conference call).
Test: ConferenceManagerPresenterTest
PiperOrigin-RevId: 171345423
Change-Id: Ie5fe2fc1097f4858604283989dcb916c2ac21972
Diffstat (limited to 'java/com/android/incallui/ConferenceParticipantListAdapter.java')
-rw-r--r-- | java/com/android/incallui/ConferenceParticipantListAdapter.java | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/java/com/android/incallui/ConferenceParticipantListAdapter.java b/java/com/android/incallui/ConferenceParticipantListAdapter.java index 70cdf245f..d0f488501 100644 --- a/java/com/android/incallui/ConferenceParticipantListAdapter.java +++ b/java/com/android/incallui/ConferenceParticipantListAdapter.java @@ -24,6 +24,7 @@ import android.text.BidiFormatter; import android.text.TextDirectionHeuristics; import android.text.TextUtils; import android.util.ArraySet; +import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -245,7 +246,8 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { contactCache.lookupKey, contactCache.displayPhotoUri, thisRowCanSeparate, - thisRowCanDisconnect); + thisRowCanDisconnect, + call.getNonConferenceState()); // Tag the row in the conference participant list with the call id to make it easier to // find calls when contact cache information is loaded. @@ -290,9 +292,11 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { String lookupKey, Uri photoUri, boolean thisRowCanSeparate, - boolean thisRowCanDisconnect) { + boolean thisRowCanDisconnect, + int callState) { final ImageView photoView = (ImageView) view.findViewById(R.id.callerPhoto); + 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 = @@ -300,6 +304,13 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { 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); + } else { + setViewsNotOnHold( + photoView, statusTextView, nameTextView, numberTextView, numberTypeTextView); + } + endButton.setVisibility(thisRowCanDisconnect ? View.VISIBLE : View.GONE); if (thisRowCanDisconnect) { endButton.setOnClickListener(mDisconnectListener); @@ -338,6 +349,47 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { } } + private void setViewsOnHold( + ImageView photoView, + TextView statusTextView, + TextView nameTextView, + TextView numberTextView, + TextView numberTypeTextView) { + CharSequence onHoldText = + TextUtils.concat(getContext().getText(R.string.notification_on_hold).toString(), " • "); + statusTextView.setText(onHoldText); + statusTextView.setVisibility(View.VISIBLE); + + 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); + photoView.setAlpha(alpha.getFloat()); + } + + private void setViewsNotOnHold( + ImageView photoView, + TextView statusTextView, + TextView nameTextView, + TextView numberTextView, + TextView numberTypeTextView) { + 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); + photoView.setAlpha(alpha.getFloat()); + } + /** * Updates the participant info list which is bound to the ListView. Stores the call and contact * info for all entries. The list is sorted alphabetically by participant name. |