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

Commit cc96aa1f authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Running state animations if launcher is visible

Change-Id: Ibc522edec4f86375ea75ac645b748fec43fceb31
parent b5d047ca
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ public abstract class BaseActivity extends Activity {
    protected UserEventDispatcher mUserEventDispatcher;
    protected SystemUiController mSystemUiController;

    private boolean mStarted;

    public DeviceProfile getDeviceProfile() {
        return mDeviceProfile;
    }
@@ -69,4 +71,20 @@ public abstract class BaseActivity extends Activity {
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    }

    @Override
    protected void onStart() {
        mStarted = true;
        super.onStart();
    }

    @Override
    protected void onStop() {
        mStarted = false;
        super.onStop();
    }

    public boolean isStarted() {
        return mStarted;
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -915,7 +915,7 @@ public class Launcher extends BaseActivity
     * Finds all the views we need and configure them properly.
     */
    private void setupViews() {
        mDragLayer = (DragLayer) findViewById(R.id.drag_layer);
        mDragLayer = findViewById(R.id.drag_layer);
        mFocusHandler = mDragLayer.getFocusIndicatorHelper();
        mWorkspace = mDragLayer.findViewById(R.id.workspace);
        mWorkspace.initParentViews(mDragLayer);
@@ -1237,9 +1237,9 @@ public class Launcher extends BaseActivity
                }

                // In all these cases, only animate if we're already on home
                AbstractFloatingView.closeAllOpenViews(this, alreadyOnHome);
                AbstractFloatingView.closeAllOpenViews(this, isStarted());

                mStateManager.goToState(NORMAL, alreadyOnHome /* animated */);
                mStateManager.goToState(NORMAL);

                // Reset the apps view
                if (!alreadyOnHome && mAppsView != null) {
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ public class LauncherStateManager {
     * @see #goToState(LauncherState, boolean, Runnable)
     */
    public void goToState(LauncherState state) {
        goToState(state, true, 0, null);
        goToState(state, mLauncher.isStarted() /* animated */, 0, null);
    }

    /**