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

Commit 8c38fd32 authored by Winson Chung's avatar Winson Chung
Browse files

Revert "Saving the stack state when you rotate."

This reverts commit bf0be0a8.

Change-Id: I40b852889980473aea02828b5b0fe29c21951638
parent bf0be0a8
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -87,9 +87,6 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
    private final static String TAG = "RecentsActivity";
    private final static boolean DEBUG = false;

    private final static String KEY_SAVED_STATE_HISTORY_VISIBLE =
            "saved_instance_state_history_visible";

    public final static int EVENT_BUS_PRIORITY = Recents.EVENT_BUS_PRIORITY + 1;

    private RecentsPackageMonitor mPackageMonitor;
@@ -517,25 +514,6 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
        EventBus.getDefault().unregister(mScrimViews);
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putBoolean(KEY_SAVED_STATE_HISTORY_VISIBLE,
                (mHistoryView != null) && mHistoryView.isVisible());
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        if (savedInstanceState.getBoolean(KEY_SAVED_STATE_HISTORY_VISIBLE, false)) {
            ReferenceCountedTrigger postHideStackAnimationTrigger =
                    Tnew ReferenceCountedTrigger(this);
            postHideStackAnimationTrigger.increment();
            EventBus.getDefault().send(new ShowHistoryEvent(postHideStackAnimationTrigger));
            postHideStackAnimationTrigger.decrement();
        }
    }

    @Override
    public void onTrimMemory(int level) {
        RecentsTaskLoader loader = Recents.getTaskLoader();
+0 −25
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.IntProperty;
import android.util.Log;
import android.util.Property;
@@ -92,12 +91,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
    private final static String TAG = "TaskStackView";
    private final static boolean DEBUG = false;

    private final static String KEY_SAVED_STATE_SUPER = "saved_instance_state_super";
    private final static String KEY_SAVED_STATE_LAYOUT_FOCUSED_STATE =
            "saved_instance_state_layout_focused_state";
    private final static String KEY_SAVED_STATE_LAYOUT_STACK_SCROLL =
            "saved_instance_state_layout_stack_scroll";

    // The thresholds at which to show/hide the history button.
    private static final float SHOW_HISTORY_BUTTON_SCROLL_THRESHOLD = 0.3f;
    private static final float HIDE_HISTORY_BUTTON_SCROLL_THRESHOLD = 0.3f;
@@ -834,24 +827,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
        }
    }

    @Override
    protected Parcelable onSaveInstanceState() {
        Bundle savedState = new Bundle();
        savedState.putParcelable(KEY_SAVED_STATE_SUPER, super.onSaveInstanceState());
        savedState.putFloat(KEY_SAVED_STATE_LAYOUT_FOCUSED_STATE, mLayoutAlgorithm.getFocusState());
        savedState.putFloat(KEY_SAVED_STATE_LAYOUT_STACK_SCROLL, mStackScroller.getStackScroll());
        return super.onSaveInstanceState();
    }

    @Override
    protected void onRestoreInstanceState(Parcelable state) {
        Bundle savedState = (Bundle) state;
        super.onRestoreInstanceState(savedState.getParcelable(KEY_SAVED_STATE_SUPER));

        mLayoutAlgorithm.setFocusState(savedState.getFloat(KEY_SAVED_STATE_LAYOUT_FOCUSED_STATE));
        mStackScroller.setStackScroll(savedState.getFloat(KEY_SAVED_STATE_LAYOUT_STACK_SCROLL));
    }

    @Override
    public CharSequence getAccessibilityClassName() {
        return TaskStackView.class.getName();