Loading packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +22 −0 Original line number Original line Diff line number Diff line Loading @@ -87,6 +87,9 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD private final static String TAG = "RecentsActivity"; private final static String TAG = "RecentsActivity"; private final static boolean DEBUG = false; 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; public final static int EVENT_BUS_PRIORITY = Recents.EVENT_BUS_PRIORITY + 1; private RecentsPackageMonitor mPackageMonitor; private RecentsPackageMonitor mPackageMonitor; Loading Loading @@ -514,6 +517,25 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD EventBus.getDefault().unregister(mScrimViews); 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 @Override public void onTrimMemory(int level) { public void onTrimMemory(int level) { RecentsTaskLoader loader = Recents.getTaskLoader(); RecentsTaskLoader loader = Recents.getTaskLoader(); Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +25 −0 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.GradientDrawable; import android.os.Bundle; import android.os.Bundle; import android.os.Parcelable; import android.util.IntProperty; import android.util.IntProperty; import android.util.Log; import android.util.Log; import android.util.Property; import android.util.Property; Loading Loading @@ -91,6 +92,12 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal private final static String TAG = "TaskStackView"; private final static String TAG = "TaskStackView"; private final static boolean DEBUG = false; 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. // 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 SHOW_HISTORY_BUTTON_SCROLL_THRESHOLD = 0.3f; private static final float HIDE_HISTORY_BUTTON_SCROLL_THRESHOLD = 0.3f; private static final float HIDE_HISTORY_BUTTON_SCROLL_THRESHOLD = 0.3f; Loading Loading @@ -827,6 +834,24 @@ 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 @Override public CharSequence getAccessibilityClassName() { public CharSequence getAccessibilityClassName() { return TaskStackView.class.getName(); return TaskStackView.class.getName(); Loading Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +22 −0 Original line number Original line Diff line number Diff line Loading @@ -87,6 +87,9 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD private final static String TAG = "RecentsActivity"; private final static String TAG = "RecentsActivity"; private final static boolean DEBUG = false; 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; public final static int EVENT_BUS_PRIORITY = Recents.EVENT_BUS_PRIORITY + 1; private RecentsPackageMonitor mPackageMonitor; private RecentsPackageMonitor mPackageMonitor; Loading Loading @@ -514,6 +517,25 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD EventBus.getDefault().unregister(mScrimViews); 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 @Override public void onTrimMemory(int level) { public void onTrimMemory(int level) { RecentsTaskLoader loader = Recents.getTaskLoader(); RecentsTaskLoader loader = Recents.getTaskLoader(); Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +25 −0 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.GradientDrawable; import android.os.Bundle; import android.os.Bundle; import android.os.Parcelable; import android.util.IntProperty; import android.util.IntProperty; import android.util.Log; import android.util.Log; import android.util.Property; import android.util.Property; Loading Loading @@ -91,6 +92,12 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal private final static String TAG = "TaskStackView"; private final static String TAG = "TaskStackView"; private final static boolean DEBUG = false; 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. // 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 SHOW_HISTORY_BUTTON_SCROLL_THRESHOLD = 0.3f; private static final float HIDE_HISTORY_BUTTON_SCROLL_THRESHOLD = 0.3f; private static final float HIDE_HISTORY_BUTTON_SCROLL_THRESHOLD = 0.3f; Loading Loading @@ -827,6 +834,24 @@ 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 @Override public CharSequence getAccessibilityClassName() { public CharSequence getAccessibilityClassName() { return TaskStackView.class.getName(); return TaskStackView.class.getName(); Loading