Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81acc3f0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I6eb4bf23,If020b83c

* changes:
  Correctly show the contact's photo in CallDetailsActivity when launched from the new call log.
  Handle hiding bubble right after showing it.
parents 594a9bfe bb41b26b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -136,9 +136,9 @@ public class CallDetailsHeaderViewHolder extends RecyclerView.ViewHolder
    ContactPhotoManager.getInstance(context)
        .loadDialerThumbnailOrPhoto(
            contactPhoto,
            contact.hasContactUri() ? Uri.parse(contact.getContactUri()) : null,
            contact.getContactUri().isEmpty() ? null : Uri.parse(contact.getContactUri()),
            contact.getPhotoId(),
            contact.hasPhotoUri() ? Uri.parse(contact.getPhotoUri()) : null,
            contact.getPhotoUri().isEmpty() ? null : Uri.parse(contact.getPhotoUri()),
            contact.getNameOrNumber(),
            contact.getContactType());

+8 −12
Original line number Diff line number Diff line
@@ -23,13 +23,13 @@ import android.text.TextUtils;
import com.android.dialer.calldetails.CallDetailsActivity;
import com.android.dialer.callintent.CallInitiationType;
import com.android.dialer.calllog.model.CoalescedRow;
import com.android.dialer.calllogutils.CallLogContactTypes;
import com.android.dialer.calllogutils.PhoneAccountUtils;
import com.android.dialer.contactactions.ContactActionModule;
import com.android.dialer.contactactions.DividerModule;
import com.android.dialer.contactactions.IntentModule;
import com.android.dialer.contactactions.SharedModules;
import com.android.dialer.dialercontact.DialerContact;
import com.android.dialer.lettertile.LetterTileDrawable;
import java.util.ArrayList;
import java.util.List;

@@ -125,23 +125,19 @@ final class Modules {
    DialerContact.Builder dialerContactBuilder =
        DialerContact.newBuilder()
            .setNumber(originalNumber)
            .setContactType(LetterTileDrawable.TYPE_DEFAULT) // TODO(zachh): Use proper type.
            .setContactType(CallLogContactTypes.getContactType(row))
            .setPhotoId(row.numberAttributes().getPhotoId());

    if (!TextUtils.isEmpty(row.numberAttributes().getName())) {
    if (!row.numberAttributes().getName().isEmpty()) {
      dialerContactBuilder.setNameOrNumber(row.numberAttributes().getName());
    } else if (!TextUtils.isEmpty(originalNumber)) {
      dialerContactBuilder.setNameOrNumber(originalNumber);
    }
    if (row.numberAttributes().hasNumberTypeLabel()) {

    dialerContactBuilder.setNumberLabel(row.numberAttributes().getNumberTypeLabel());
    }
    if (row.numberAttributes().hasPhotoUri()) {
    dialerContactBuilder.setPhotoUri(row.numberAttributes().getPhotoUri());
    }
    if (row.numberAttributes().hasLookupUri()) {
    dialerContactBuilder.setContactUri(row.numberAttributes().getLookupUri());
    }

    if (row.formattedNumber() != null) {
      dialerContactBuilder.setDisplayNumber(row.formattedNumber());
    }
+14 −5
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ public class NewBubble {
  @NonNull
  private NewBubbleInfo currentInfo;

  @Visibility private int visibility;
  @VisibleForTesting @Visibility int visibility;
  private boolean expanded;
  private CharSequence textAfterShow;
  private int collapseEndAction;
@@ -112,6 +112,7 @@ public class NewBubble {
  private AnimatorSet collapseAnimatorSet;
  private Integer overrideGravity;
  @VisibleForTesting AnimatorSet exitAnimatorSet;
  @VisibleForTesting AnimatorSet enterAnimatorSet;

  private final int primaryIconMoveDistance;
  private final int leftBoundary;
@@ -120,15 +121,15 @@ public class NewBubble {
  /** Type of action after bubble collapse */
  @Retention(RetentionPolicy.SOURCE)
  @IntDef({CollapseEnd.NOTHING, CollapseEnd.HIDE})
  @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
  public @interface CollapseEnd {
  private @interface CollapseEnd {
    int NOTHING = 0;
    int HIDE = 1;
  }

  @Retention(RetentionPolicy.SOURCE)
  @VisibleForTesting
  @IntDef({Visibility.ENTERING, Visibility.SHOWING, Visibility.EXITING, Visibility.HIDDEN})
  private @interface Visibility {
  @interface Visibility {
    int HIDDEN = 0;
    int ENTERING = 1;
    int SHOWING = 2;
@@ -440,7 +441,7 @@ public class NewBubble {
        ObjectAnimator.ofFloat(viewHolder.getPrimaryAvatar(), "alpha", 1);
    ObjectAnimator iconAlphaAnimator =
        ObjectAnimator.ofFloat(viewHolder.getPrimaryIcon(), "alpha", 1);
    AnimatorSet enterAnimatorSet = new AnimatorSet();
    enterAnimatorSet = new AnimatorSet();
    enterAnimatorSet.playTogether(
        scaleXAnimator, scaleYAnimator, avatarAlphaAnimator, iconAlphaAnimator);
    enterAnimatorSet.setInterpolator(new OvershootInterpolator());
@@ -609,6 +610,14 @@ public class NewBubble {
    // Make bubble non clickable to prevent further buggy actions
    viewHolder.setChildClickable(false);

    if (visibility == Visibility.ENTERING) {
      enterAnimatorSet.removeAllListeners();
      enterAnimatorSet.cancel();
      enterAnimatorSet = null;
      afterHiding.run();
      return;
    }

    if (collapseAnimatorSet != null) {
      collapseEndAction = CollapseEnd.HIDE;
      return;