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

Commit 305199f3 authored by András Kurucz's avatar András Kurucz
Browse files

Convert IMPROVED_HUN_ANIMATIONS flag to aconfig

Convert a classic flag to aconfig.

Bug: 25690710
Flag: ACONFIG notifications_improved_hun_animation DEVELOPMENT
Test: m droid
Change-Id: I2d07d86d29a6a1d38321f3f0cadb96b241d8caba
parent 7e1eb56e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -44,6 +44,13 @@ flag {
    bug: "293824309"
}

flag {
    name: "notifications_improved_hun_animation"
    namespace: "systemui"
    description: "Adds a translateY animation, and other improvements to match the motion specs of the HUN Intro + Outro animations."
    bug: "243302608"
}

flag {
    name: "notification_lifetime_extension_refactor"
    namespace: "systemui"
+1 −4
Original line number Diff line number Diff line
@@ -17,11 +17,11 @@ package com.android.systemui.flags

import android.provider.DeviceConfig
import com.android.internal.annotations.Keep
import com.android.systemui.res.R
import com.android.systemui.flags.FlagsFactory.releasedFlag
import com.android.systemui.flags.FlagsFactory.resourceBooleanFlag
import com.android.systemui.flags.FlagsFactory.sysPropBooleanFlag
import com.android.systemui.flags.FlagsFactory.unreleasedFlag
import com.android.systemui.res.R

/**
 * List of [Flag] objects for use in SystemUI.
@@ -600,9 +600,6 @@ object Flags {
    @JvmField
    val LOCKSCREEN_WALLPAPER_DREAM_ENABLED = unreleasedFlag("enable_lockscreen_wallpaper_dream")

    // TODO(b/283084712): Tracking Bug
    @JvmField val IMPROVED_HUN_ANIMATIONS = unreleasedFlag("improved_hun_animations")

    // TODO(b/283447257): Tracking bug
    @JvmField
    val BIGPICTURE_NOTIFICATION_LAZY_LOADING =
+3 −8
Original line number Diff line number Diff line
@@ -3,10 +3,8 @@ package com.android.systemui.statusbar.notification
import android.util.FloatProperty
import android.view.View
import androidx.annotation.FloatRange
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.flags.RefactorFlag
import com.android.systemui.res.R
import com.android.systemui.statusbar.notification.shared.NotificationsImprovedHunAnimation
import com.android.systemui.statusbar.notification.stack.AnimationProperties
import com.android.systemui.statusbar.notification.stack.StackStateAnimator
import kotlin.math.abs
@@ -42,13 +40,13 @@ interface Roundable {
    /** Current top corner in pixel, based on [topRoundness] and [maxRadius] */
    val topCornerRadius: Float
        get() =
            if (roundableState.newHeadsUpAnim.isEnabled) roundableState.topCornerRadius
            if (NotificationsImprovedHunAnimation.isEnabled) roundableState.topCornerRadius
            else topRoundness * maxRadius

    /** Current bottom corner in pixel, based on [bottomRoundness] and [maxRadius] */
    val bottomCornerRadius: Float
        get() =
            if (roundableState.newHeadsUpAnim.isEnabled) roundableState.bottomCornerRadius
            if (NotificationsImprovedHunAnimation.isEnabled) roundableState.bottomCornerRadius
            else bottomRoundness * maxRadius

    /** Get and update the current radii */
@@ -318,13 +316,10 @@ constructor(
    internal val targetView: View,
    private val roundable: Roundable,
    maxRadius: Float,
    featureFlags: FeatureFlags? = null
) {
    internal var maxRadius = maxRadius
        private set

    internal val newHeadsUpAnim = RefactorFlag.forView(Flags.IMPROVED_HUN_ANIMATIONS, featureFlags)

    /** Animatable for top roundness */
    private val topAnimatable = topAnimatable(roundable)

+3 −2
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import com.android.systemui.statusbar.notification.FakeShadowView;
import com.android.systemui.statusbar.notification.NotificationUtils;
import com.android.systemui.statusbar.notification.SourceType;
import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.statusbar.notification.shared.NotificationsImprovedHunAnimation;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
import com.android.systemui.util.DumpUtilsKt;
@@ -569,7 +570,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView

    @Override
    public float getTopCornerRadius() {
        if (mImprovedHunAnimation.isEnabled()) {
        if (NotificationsImprovedHunAnimation.isEnabled()) {
            return super.getTopCornerRadius();
        }

@@ -579,7 +580,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView

    @Override
    public float getBottomCornerRadius() {
        if (mImprovedHunAnimation.isEnabled()) {
        if (NotificationsImprovedHunAnimation.isEnabled()) {
            return super.getBottomCornerRadius();
        }

+2 −5
Original line number Diff line number Diff line
@@ -28,10 +28,9 @@ import android.util.IndentingPrintWriter;
import android.view.View;
import android.view.ViewOutlineProvider;

import com.android.systemui.flags.Flags;
import com.android.systemui.flags.RefactorFlag;
import com.android.systemui.res.R;
import com.android.systemui.statusbar.notification.RoundableState;
import com.android.systemui.statusbar.notification.shared.NotificationsImprovedHunAnimation;
import com.android.systemui.statusbar.notification.stack.NotificationChildrenContainer;
import com.android.systemui.util.DumpUtilsKt;

@@ -49,8 +48,6 @@ public abstract class ExpandableOutlineView extends ExpandableView {
    private float mOutlineAlpha = -1f;
    private boolean mAlwaysRoundBothCorners;
    private Path mTmpPath = new Path();
    protected final RefactorFlag mImprovedHunAnimation =
            RefactorFlag.forView(Flags.IMPROVED_HUN_ANIMATIONS);

    /**
     * {@code false} if the children views of the {@link ExpandableOutlineView} are translated when
@@ -126,7 +123,7 @@ public abstract class ExpandableOutlineView extends ExpandableView {
            return EMPTY_PATH;
        }
        float bottomRadius = mAlwaysRoundBothCorners ? getMaxRadius() : getBottomCornerRadius();
        if (!mImprovedHunAnimation.isEnabled() && (topRadius + bottomRadius > height)) {
        if (!NotificationsImprovedHunAnimation.isEnabled() && (topRadius + bottomRadius > height)) {
            float overShoot = topRadius + bottomRadius - height;
            float currentTopRoundness = getTopRoundness();
            float currentBottomRoundness = getBottomRoundness();
Loading