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

Commit ddfdbe56 authored by Johannes Gallmann's avatar Johannes Gallmann Committed by Automerger Merge Worker
Browse files

Migrate statusbar chip animators to androidx am: feb2df3c

parents fba275cc feb2df3c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.systemui.statusbar.events

import android.animation.Animator
import androidx.core.animation.Animator
import android.annotation.UiThread
import android.graphics.Point
import android.graphics.Rect
+10 −10
Original line number Diff line number Diff line
@@ -16,10 +16,6 @@

package com.android.systemui.statusbar.events

import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.animation.AnimatorSet
import android.animation.ValueAnimator
import android.content.Context
import android.graphics.Rect
import android.view.ContextThemeWrapper
@@ -30,6 +26,10 @@ import android.view.View.MeasureSpec.AT_MOST
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
import android.widget.FrameLayout
import androidx.core.animation.Animator
import androidx.core.animation.AnimatorListenerAdapter
import androidx.core.animation.AnimatorSet
import androidx.core.animation.ValueAnimator
import com.android.systemui.R
import com.android.systemui.statusbar.phone.StatusBarContentInsetsProvider
import com.android.systemui.statusbar.window.StatusBarWindowController
@@ -144,7 +144,7 @@ class SystemEventChipAnimationController @Inject constructor(
        }

        finish.addListener(object : AnimatorListenerAdapter() {
            override fun onAnimationEnd(animation: Animator?) {
            override fun onAnimationEnd(animation: Animator) {
                animationWindowView.removeView(currentAnimatedView!!.view)
            }
        })
@@ -157,7 +157,7 @@ class SystemEventChipAnimationController @Inject constructor(
            duration = 9.frames
            interpolator = STATUS_CHIP_WIDTH_TO_DOT_KEYFRAME_1
            addUpdateListener {
                updateAnimatedViewBoundsWidth(it.animatedValue as Int)
                updateAnimatedViewBoundsWidth(animatedValue as Int)
            }
        }

@@ -166,7 +166,7 @@ class SystemEventChipAnimationController @Inject constructor(
            duration = 20.frames
            interpolator = STATUS_CHIP_WIDTH_TO_DOT_KEYFRAME_2
            addUpdateListener {
                updateAnimatedViewBoundsWidth(it.animatedValue as Int)
                updateAnimatedViewBoundsWidth(animatedValue as Int)
            }
        }

@@ -179,7 +179,7 @@ class SystemEventChipAnimationController @Inject constructor(
            duration = 6.frames
            interpolator = STATUS_CHIP_HEIGHT_TO_DOT_KEYFRAME_1
            addUpdateListener {
                updateAnimatedViewBoundsHeight(it.animatedValue as Int, chipVerticalCenter)
                updateAnimatedViewBoundsHeight(animatedValue as Int, chipVerticalCenter)
            }
        }

@@ -188,7 +188,7 @@ class SystemEventChipAnimationController @Inject constructor(
            duration = 15.frames
            interpolator = STATUS_CHIP_HEIGHT_TO_DOT_KEYFRAME_2
            addUpdateListener {
                updateAnimatedViewBoundsHeight(it.animatedValue as Int, chipVerticalCenter)
                updateAnimatedViewBoundsHeight(animatedValue as Int, chipVerticalCenter)
            }
        }

@@ -233,7 +233,7 @@ class SystemEventChipAnimationController @Inject constructor(
            interpolator = STATUS_BAR_X_MOVE_OUT
            addUpdateListener {
                currentAnimatedView?.apply {
                    updateAnimatedViewBoundsWidth(it.animatedValue as Int)
                    updateAnimatedViewBoundsWidth(animatedValue as Int)
                }
            }
        }
+6 −6
Original line number Diff line number Diff line
@@ -16,14 +16,14 @@

package com.android.systemui.statusbar.events

import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.animation.AnimatorSet
import androidx.core.animation.Animator
import androidx.core.animation.AnimatorSet
import android.annotation.IntDef
import android.os.Process
import android.provider.DeviceConfig
import android.util.Log
import android.view.animation.PathInterpolator
import androidx.core.animation.AnimatorListenerAdapter
import androidx.core.animation.PathInterpolator
import com.android.systemui.Dumpable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
@@ -185,7 +185,7 @@ open class SystemStatusAnimationScheduler @Inject constructor(
                    "Expected: 500, actual: ${animSet.totalDuration}")
        }
        animSet.addListener(object : AnimatorListenerAdapter() {
            override fun onAnimationEnd(animation: Animator?) {
            override fun onAnimationEnd(animation: Animator) {
                animationState = RUNNING_CHIP_ANIM
            }
        })
@@ -195,7 +195,7 @@ open class SystemStatusAnimationScheduler @Inject constructor(
            val animSet2 = collectFinishAnimations()
            animationState = ANIMATING_OUT
            animSet2.addListener(object : AnimatorListenerAdapter() {
                override fun onAnimationEnd(animation: Animator?) {
                override fun onAnimationEnd(animation: Animator) {
                    animationState = if (hasPersistentDot) {
                        SHOWING_PERSISTENT_DOT
                    } else {
+8 −7
Original line number Diff line number Diff line
@@ -21,9 +21,6 @@ import static android.app.StatusBarManager.DISABLE_SYSTEM_INFO;

import static com.android.systemui.statusbar.StatusBarState.KEYGUARD;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.ContentObserver;
@@ -36,13 +33,16 @@ import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import androidx.core.animation.Animator;
import androidx.core.animation.AnimatorListenerAdapter;
import androidx.core.animation.ValueAnimator;

import com.android.keyguard.CarrierTextController;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.keyguard.logging.KeyguardLogger;
import com.android.systemui.R;
import com.android.systemui.animation.Interpolators;
import com.android.systemui.animation.InterpolatorsAndroidX;
import com.android.systemui.battery.BatteryMeterViewController;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.plugins.log.LogLevel;
@@ -166,7 +166,8 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat

    private final ValueAnimator.AnimatorUpdateListener mAnimatorUpdateListener =
            animation -> {
                mKeyguardStatusBarAnimateAlpha = (float) animation.getAnimatedValue();
                mKeyguardStatusBarAnimateAlpha =
                        (float) ((ValueAnimator) animation).getAnimatedValue();
                updateViewState();
            };

@@ -434,7 +435,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
        ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f);
        anim.addUpdateListener(mAnimatorUpdateListener);
        anim.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
        anim.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
        anim.setInterpolator(InterpolatorsAndroidX.LINEAR_OUT_SLOW_IN);
        anim.start();
    }

@@ -445,7 +446,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
        anim.addUpdateListener(mAnimatorUpdateListener);
        anim.setStartDelay(startDelay);
        anim.setDuration(duration);
        anim.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
        anim.setInterpolator(InterpolatorsAndroidX.LINEAR_OUT_SLOW_IN);
        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import static android.app.StatusBarManager.DISABLE_SYSTEM_INFO;
import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.IDLE;
import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.SHOWING_PERSISTENT_DOT;

import android.animation.Animator;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.app.Fragment;
@@ -43,6 +42,7 @@ import android.view.ViewStub;
import android.widget.LinearLayout;

import androidx.annotation.VisibleForTesting;
import androidx.core.animation.Animator;

import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.Dumpable;
Loading