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

Commit 1373fdb3 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

FlingAnimationUtils now takes DisplayMetrics, not Context.

Bug: 146496319
Test: atestSystemUITests && manual
Change-Id: I5a400d2ac500d044d50a878a5b2e5aa7f304628a
parent 9d4f6c0c
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt

    private final Object mQueueLock = new Object();
    private final CarNavigationBarController mCarNavigationBarController;
    private final FlingAnimationUtils.Builder mFlingAnimationUtilsBuilder;
    private final Lazy<PowerManagerHelper> mPowerManagerHelperLazy;
    private final ShadeController mShadeController;
    private final CarServiceProvider mCarServiceProvider;
@@ -318,7 +319,8 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
            CarServiceProvider carServiceProvider,
            Lazy<PowerManagerHelper> powerManagerHelperLazy,
            Lazy<FullscreenUserSwitcher> fullscreenUserSwitcherLazy,
            CarNavigationBarController carNavigationBarController) {
            CarNavigationBarController carNavigationBarController,
            FlingAnimationUtils.Builder flingAnimationUtilsBuilder) {
        super(
                context,
                featureFlags,
@@ -401,6 +403,7 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
        mPowerManagerHelperLazy = powerManagerHelperLazy;
        mFullscreenUserSwitcherLazy = fullscreenUserSwitcherLazy;
        mCarNavigationBarController = carNavigationBarController;
        mFlingAnimationUtilsBuilder = flingAnimationUtilsBuilder;
    }

    @Override
@@ -436,8 +439,10 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
                R.integer.notification_settle_open_percentage);
        mSettleClosePercentage = mContext.getResources().getInteger(
                R.integer.notification_settle_close_percentage);
        mFlingAnimationUtils = new FlingAnimationUtils(mContext,
                FLING_ANIMATION_MAX_TIME, FLING_SPEED_UP_FACTOR);
        mFlingAnimationUtils = mFlingAnimationUtilsBuilder
                .setMaxLengthSeconds(FLING_ANIMATION_MAX_TIME)
                .setSpeedUpFactor(FLING_SPEED_UP_FACTOR)
                .build();

        createBatteryController();
        mCarBatteryController.startListening();
+5 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import com.android.systemui.shared.plugins.PluginManager;
import com.android.systemui.stackdivider.Divider;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.FlingAnimationUtils;
import com.android.systemui.statusbar.NavigationBarController;
import com.android.systemui.statusbar.NotificationListener;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
@@ -191,7 +192,8 @@ public class CarStatusBarModule {
            CarServiceProvider carServiceProvider,
            Lazy<PowerManagerHelper> powerManagerHelperLazy,
            Lazy<FullscreenUserSwitcher> fullscreenUserSwitcherLazy,
            CarNavigationBarController carNavigationBarController) {
            CarNavigationBarController carNavigationBarController,
            FlingAnimationUtils.Builder flingAnimationUtilsBuilder) {
        return new CarStatusBar(
                context,
                featureFlags,
@@ -268,6 +270,7 @@ public class CarStatusBarModule {
                carServiceProvider,
                powerManagerHelperLazy,
                fullscreenUserSwitcherLazy,
                carNavigationBarController);
                carNavigationBarController,
                flingAnimationUtilsBuilder);
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -179,7 +179,8 @@ public class ExpandHelper implements Gefingerpoken {
        mTouchSlop = configuration.getScaledTouchSlop();

        mSGD = new ScaleGestureDetector(context, mScaleGestureListener);
        mFlingAnimationUtils = new FlingAnimationUtils(context, EXPAND_DURATION);
        mFlingAnimationUtils = new FlingAnimationUtils(mContext.getResources().getDisplayMetrics(),
                EXPAND_DURATION);
    }

    @VisibleForTesting
+2 −3
Original line number Diff line number Diff line
@@ -93,13 +93,11 @@ public class SwipeHelper implements Gefingerpoken {
    private boolean mTouchAboveFalsingThreshold;
    private boolean mDisableHwLayers;
    private final boolean mFadeDependingOnAmountSwiped;
    private final Context mContext;

    private final ArrayMap<View, Animator> mDismissPendingMap = new ArrayMap<>();

    public SwipeHelper(
            int swipeDirection, Callback callback, Context context, FalsingManager falsingManager) {
        mContext = context;
        mCallback = callback;
        mHandler = new Handler();
        mSwipeDirection = swipeDirection;
@@ -114,7 +112,8 @@ public class SwipeHelper implements Gefingerpoken {
        mFalsingThreshold = res.getDimensionPixelSize(R.dimen.swipe_helper_falsing_threshold);
        mFadeDependingOnAmountSwiped = res.getBoolean(R.bool.config_fadeDependingOnAmountSwiped);
        mFalsingManager = falsingManager;
        mFlingAnimationUtils = new FlingAnimationUtils(context, getMaxEscapeAnimDuration() / 1000f);
        mFlingAnimationUtils = new FlingAnimationUtils(res.getDisplayMetrics(),
                getMaxEscapeAnimDuration() / 1000f);
    }

    public void setDensityScale(float densityScale) {
+2 −1
Original line number Diff line number Diff line
@@ -194,7 +194,8 @@ public class PipTouchHandler {
        mMenuController.addListener(mMenuListener);
        mDismissViewController = new PipDismissViewController(context);
        mSnapAlgorithm = new PipSnapAlgorithm(mContext);
        mFlingAnimationUtils = new FlingAnimationUtils(context, 2.5f);
        mFlingAnimationUtils = new FlingAnimationUtils(context.getResources().getDisplayMetrics(),
                2.5f);
        mGestures = new PipTouchGesture[] {
                mDefaultMovementGesture
        };
Loading