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

Commit bd0beb99 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Cancel launcher app transition when changing states" into ub-launcher3-master

parents dccf3956 dc76f8e8
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.media.midi.MidiManager.OnDeviceOpenedListener;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -118,6 +117,14 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
        mCurrentAnimator = animator;
    }

    @Override
    public void finishAnimation() {
        if (mCurrentAnimator != null && mCurrentAnimator.isRunning()) {
            mCurrentAnimator.end();
        }
        mCurrentAnimator = null;
    }

    /**
     * @return A Bundle with remote animations that controls how the window of the opening
     *         targets are displayed.
+4 −4
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;

import static com.android.launcher3.ItemInfoWithIcon.FLAG_DISABLED_BY_PUBLISHER;
import static com.android.launcher3.ItemInfoWithIcon.FLAG_DISABLED_LOCKED_USER;
import static com.android.launcher3.ItemInfoWithIcon.FLAG_DISABLED_QUIET_USER;
@@ -40,7 +39,6 @@ import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.ActivityOptions;
import android.app.AlertDialog;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetManager;
@@ -55,14 +53,12 @@ import android.content.IntentFilter;
import android.content.IntentSender;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
@@ -450,6 +446,10 @@ public class Launcher extends BaseActivity
        return mStateManager;
    }

    public LauncherAppTransitionManager getAppTransitionManager() {
        return mAppTransitionManager;
    }

    protected void overrideTheme(boolean isDark, boolean supportsDarkText) {
        if (isDark) {
            setTheme(R.style.LauncherThemeDark);
+4 −0
Original line number Diff line number Diff line
@@ -64,4 +64,8 @@ public class LauncherAppTransitionManager {
    public Bundle getActivityLaunchOptions(Launcher launcher, View v) {
        return getDefaultActivityLaunchOptions(launcher, v);
    }

    /** Cancels the current transition animation */
    public void finishAnimation() {
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -269,6 +269,13 @@ public class LauncherStateManager {
            // Only disable clipping if needed, otherwise leave it as previous value.
            mLauncher.getWorkspace().setClipChildren(false);
        }

        // If we are still animating to launcher from an app,
        // finish it and let this state animation take over.
        LauncherAppTransitionManager transitionManager = mLauncher.getAppTransitionManager();
        if (transitionManager != null) {
            transitionManager.finishAnimation();
        }
    }

    private void onStateTransitionEnd(LauncherState state) {