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

Commit a93df437 authored by calderwoodra's avatar calderwoodra Committed by Copybara-Service
Browse files

Converted ThemeUtil into a DaggerModule.

This enables us to have Google-Sans font in GoogleDialer and Roboto in AOSP.

Bug: 79883035
Test: tap
PiperOrigin-RevId: 197774497
Change-Id: I1d490ab196a444c62e439444627d659fc42973ea
parent ffd525d8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import com.android.contacts.common.R;
import com.android.dialer.theme.base.ThemeUtil;
import com.android.dialer.theme.base.ThemeComponent;

public class ViewPagerTabStrip extends LinearLayout {

@@ -43,8 +43,8 @@ public class ViewPagerTabStrip extends LinearLayout {
    final Resources res = context.getResources();

    mSelectedUnderlineThickness = res.getDimensionPixelSize(R.dimen.tab_selected_underline_height);
    int underlineColor = ThemeUtil.getColorAccent();
    int backgroundColor = ThemeUtil.getColorPrimary();
    int underlineColor = ThemeComponent.get(context).theme().getColorAccent();
    int backgroundColor = ThemeComponent.get(context).theme().getColorPrimary();

    mSelectedUnderlinePaint = new Paint();
    mSelectedUnderlinePaint.setColor(underlineColor);
+2 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import com.android.dialer.notification.DialerNotificationManager;
import com.android.dialer.notification.NotificationChannelManager;
import com.android.dialer.phonenumberutil.PhoneNumberHelper;
import com.android.dialer.telecom.TelecomUtil;
import com.android.dialer.theme.base.ThemeComponent;

/** Shows a notification in the status bar for legacy vociemail. */
@TargetApi(VERSION_CODES.O)
@@ -115,7 +116,7 @@ public final class LegacyVoicemailNotifier {
    Notification.Builder builder =
        new Notification.Builder(context)
            .setSmallIcon(android.R.drawable.stat_notify_voicemail)
            .setColor(context.getColor(R.color.dialer_theme_color))
            .setColor(ThemeComponent.get(context).theme().getColorPrimary())
            .setWhen(System.currentTimeMillis())
            .setContentTitle(notificationTitle)
            .setContentText(contentText)
+2 −1
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ import com.android.dialer.notification.missedcalls.MissedCallNotificationTags;
import com.android.dialer.phonenumbercache.ContactInfo;
import com.android.dialer.phonenumberutil.PhoneNumberHelper;
import com.android.dialer.precall.PreCall;
import com.android.dialer.theme.base.ThemeComponent;
import com.android.dialer.util.DialerUtils;
import com.android.dialer.util.IntentUtil;
import java.util.Iterator;
@@ -396,7 +397,7 @@ public class MissedCallNotifier implements Worker<Pair<Integer, String>, Void> {
    return new Notification.Builder(context)
        .setGroup(MissedCallConstants.GROUP_KEY)
        .setSmallIcon(android.R.drawable.stat_notify_missed_call)
        .setColor(context.getResources().getColor(R.color.dialer_theme_color, null))
        .setColor(ThemeComponent.get(context).theme().getColorPrimary())
        .setAutoCancel(true)
        .setOnlyAlertOnce(true)
        .setShowWhen(true)
+6 −4
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ import com.android.dialer.oem.MotorolaUtils;
import com.android.dialer.phonenumberutil.PhoneNumberHelper;
import com.android.dialer.spannable.ContentWithLearnMoreSpanner;
import com.android.dialer.storage.StorageComponent;
import com.android.dialer.theme.base.ThemeUtil;
import com.android.dialer.theme.base.ThemeComponent;
import com.android.dialer.util.DialerUtils;
import com.android.voicemail.VoicemailClient;
import com.android.voicemail.VoicemailComponent;
@@ -270,7 +270,9 @@ public class PhoneCallDetailsHelper
    views.voicemailTranscriptionBrandingView.setTypeface(typeface);
    views.callLocationAndDate.setTypeface(typeface);
    views.callLocationAndDate.setTextColor(
        details.isRead ? ThemeUtil.getTextColorSecondary() : ThemeUtil.getTextColorPrimary());
        details.isRead
            ? ThemeComponent.get(context).theme().getTextColorSecondary()
            : ThemeComponent.get(context).theme().getTextColorPrimary());
  }

  private void setNameView(PhoneCallDetailsViews views, PhoneCallDetails details) {
@@ -391,11 +393,11 @@ public class PhoneCallDetailsHelper
    textView.setMovementMethod(LinkMovementMethod.getInstance());
    Button positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
    if (positiveButton != null) {
      positiveButton.setTextColor(ThemeUtil.getColorPrimary());
      positiveButton.setTextColor(ThemeComponent.get(context).theme().getColorPrimary());
    }
    Button negativeButton = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
    if (negativeButton != null) {
      negativeButton.setTextColor(ThemeUtil.getTextColorSecondary());
      negativeButton.setTextColor(ThemeComponent.get(context).theme().getTextColorSecondary());
    }
  }

+2 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import com.android.dialer.notification.NotificationChannelManager;
import com.android.dialer.notification.NotificationManagerUtils;
import com.android.dialer.phonenumbercache.ContactInfo;
import com.android.dialer.telecom.TelecomUtil;
import com.android.dialer.theme.base.ThemeComponent;
import java.util.List;
import java.util.Map;

@@ -144,7 +145,7 @@ final class VisualVoicemailNotifier {
  private static NotificationCompat.Builder createNotificationBuilder(@NonNull Context context) {
    return new NotificationCompat.Builder(context)
        .setSmallIcon(android.R.drawable.stat_notify_voicemail)
        .setColor(context.getColor(R.color.dialer_theme_color))
        .setColor(ThemeComponent.get(context).theme().getColorPrimary())
        .setGroup(GROUP_KEY)
        .setOnlyAlertOnce(true)
        .setAutoCancel(true);
Loading