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

Commit 31481450 authored by Florence Yang's avatar Florence Yang
Browse files

GSF variations on Bouncer

Apply GSF font styles to hero surfaces on Bouncer (i.e. numeral pinpad).
This change is targeted to only reach trunkfood-50 to gather memory
performance in production and then will be rolled back.

Flag: com.android.systemui.gsf_bouncer
Bug: 379364381
Test: manual
Change-Id: Ib298d119bc60935030eada7948062f0cd9205d5f
parent 87878eba
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -16,7 +16,10 @@

package com.android.keyguard;

import static com.android.systemui.Flags.gsfBouncer;

import android.content.Context;
import android.graphics.Typeface;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.MotionEvent;
@@ -122,6 +125,9 @@ public class EmergencyButton extends Button {
                textId = com.android.internal.R.string.lockscreen_emergency_call;
            }
            setText(textId);
            if (gsfBouncer()) {
                setTypeface(Typeface.create("gsf-title-medium", Typeface.NORMAL));
            }
        } else {
            setVisibility(View.GONE);
        }
+5 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import static androidx.constraintlayout.widget.ConstraintSet.START;
import static androidx.constraintlayout.widget.ConstraintSet.TOP;
import static androidx.constraintlayout.widget.ConstraintSet.WRAP_CONTENT;

import static com.android.systemui.Flags.gsfBouncer;
import static com.android.systemui.plugins.FalsingManager.LOW_PENALTY;

import static java.lang.Integer.max;
@@ -51,6 +52,7 @@ import android.graphics.Bitmap;
import android.graphics.BlendMode;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
@@ -1335,6 +1337,9 @@ public class KeyguardSecurityContainer extends ConstraintLayout {
                    true);
            mUserSwitcherViewGroup = mView.findViewById(R.id.keyguard_bouncer_user_switcher);
            mUserSwitcher = mView.findViewById(R.id.user_switcher_header);
            if (gsfBouncer()) {
                mUserSwitcher.setTypeface(Typeface.create("gsf-label-medium", Typeface.NORMAL));
            }
        }

        interface UserSwitcherCallback {
+5 −0
Original line number Diff line number Diff line
@@ -15,11 +15,13 @@
 */
package com.android.keyguard;

import static com.android.systemui.Flags.gsfBouncer;
import static com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_KEY;

import android.content.Context;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.PowerManager;
@@ -158,6 +160,9 @@ public class NumPadKey extends ViewGroup implements NumPadAnimationListener {
        int klondikeColor = Utils.getColorAttr(getContext(), android.R.attr.textColorSecondary)
                .getDefaultColor();
        mDigitText.setTextColor(textColor);
        if (gsfBouncer()) {
            mDigitText.setTypeface(Typeface.create("gsf-label-large-emphasized", Typeface.NORMAL));
        }
        mKlondikeText.setTextColor(klondikeColor);

        if (mAnimator != null) mAnimator.reloadColors(getContext());
+12 −0
Original line number Diff line number Diff line
@@ -17,11 +17,13 @@
package com.android.systemui.bouncer.ui

import android.content.Context
import android.graphics.Typeface
import android.util.AttributeSet
import android.widget.LinearLayout
import com.android.keyguard.BouncerKeyguardMessageArea
import com.android.keyguard.KeyguardMessageArea
import com.android.keyguard.KeyguardMessageAreaController
import com.android.systemui.Flags
import com.android.systemui.res.R

class BouncerMessageView : LinearLayout {
@@ -37,10 +39,20 @@ class BouncerMessageView : LinearLayout {
    var secondaryMessageView: BouncerKeyguardMessageArea? = null
    var primaryMessage: KeyguardMessageAreaController<KeyguardMessageArea>? = null
    var secondaryMessage: KeyguardMessageAreaController<KeyguardMessageArea>? = null

    override fun onFinishInflate() {
        super.onFinishInflate()
        primaryMessageView = findViewById(R.id.bouncer_primary_message_area)
        secondaryMessageView = findViewById(R.id.bouncer_secondary_message_area)

        if (Flags.gsfBouncer()) {
            primaryMessageView?.apply {
                typeface = Typeface.create("gsf-title-large-emphasized", Typeface.NORMAL)
            }
            secondaryMessageView?.apply {
                typeface = Typeface.create("gsf-title-medium-emphasized", Typeface.NORMAL)
            }
        }
    }

    fun init(factory: KeyguardMessageAreaController.Factory) {