Loading packages/SystemUI/res/layout/recents_task_view.xml +33 −37 Original line number Original line Diff line number Diff line Loading @@ -18,10 +18,6 @@ android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_height="match_parent" android:focusable="true"> android:focusable="true"> <FrameLayout android:id="@+id/task_view_content" android:layout_width="match_parent" android:layout_height="match_parent"> <com.android.systemui.recents.views.TaskViewThumbnail <com.android.systemui.recents.views.TaskViewThumbnail android:id="@+id/task_view_thumbnail" android:id="@+id/task_view_thumbnail" android:layout_width="match_parent" android:layout_width="match_parent" Loading @@ -29,6 +25,7 @@ <include layout="@layout/recents_task_view_header" /> <include layout="@layout/recents_task_view_header" /> <!-- TODO: Move this into a view stub --> <com.android.systemui.statusbar.AlphaOptimizedFrameLayout <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:id="@+id/lock_to_app_fab" android:id="@+id/lock_to_app_fab" android:layout_width="@dimen/recents_lock_to_app_size" android:layout_width="@dimen/recents_lock_to_app_size" Loading Loading @@ -58,7 +55,6 @@ android:layout_marginTop="48dp" android:layout_marginTop="48dp" android:layout_marginLeft="16dp" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" /> android:layout_marginRight="16dp" /> </FrameLayout> </com.android.systemui.recents.views.TaskView> </com.android.systemui.recents.views.TaskView> packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +8 −8 Original line number Original line Diff line number Diff line Loading @@ -98,7 +98,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD private RecentsPackageMonitor mPackageMonitor; private RecentsPackageMonitor mPackageMonitor; private long mLastTabKeyEventTime; private long mLastTabKeyEventTime; private int mLastOrientation = Configuration.ORIENTATION_UNDEFINED; private int mLastDeviceOrientation = Configuration.ORIENTATION_UNDEFINED; private boolean mFinishedOnStartup; private boolean mFinishedOnStartup; private boolean mIgnoreAltTabRelease; private boolean mIgnoreAltTabRelease; private boolean mIsVisible; private boolean mIsVisible; Loading Loading @@ -276,7 +276,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD getWindow().getAttributes().privateFlags |= getWindow().getAttributes().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY; WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY; mLastOrientation = getResources().getConfiguration().orientation; mLastDeviceOrientation = Utilities.getAppConfiguration(this).orientation; mFocusTimerDuration = getResources().getInteger(R.integer.recents_auto_advance_duration); mFocusTimerDuration = getResources().getInteger(R.integer.recents_auto_advance_duration); mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() { mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() { @Override @Override Loading Loading @@ -426,13 +426,12 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); // Notify of the config change // Notify of the config change int newOrientation = getResources().getConfiguration().orientation; int newDeviceOrientation = Utilities.getAppConfiguration(this).orientation; int numStackTasks = mRecentsView.getStack().getStackTaskCount(); int numStackTasks = mRecentsView.getStack().getStackTaskCount(); EventBus.getDefault().send(new ConfigurationChangedEvent(false /* fromMultiWindow */, EventBus.getDefault().send(new ConfigurationChangedEvent(false /* fromMultiWindow */, (mLastOrientation != newOrientation), numStackTasks > 0)); (mLastDeviceOrientation != newDeviceOrientation), numStackTasks > 0)); mLastOrientation = newOrientation; mLastDeviceOrientation = newDeviceOrientation; } } @Override @Override Loading @@ -455,7 +454,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD int numStackTasks = stack.getStackTaskCount(); int numStackTasks = stack.getStackTaskCount(); EventBus.getDefault().send(new ConfigurationChangedEvent(true /* fromMultiWindow */, EventBus.getDefault().send(new ConfigurationChangedEvent(true /* fromMultiWindow */, false /* fromOrientationChange */, numStackTasks > 0)); false /* fromDeviceOrientationChange */, numStackTasks > 0)); if (mRecentsView != null) { if (mRecentsView != null) { mRecentsView.updateStack(stack); mRecentsView.updateStack(stack); Loading Loading @@ -777,6 +776,8 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD @Override @Override public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) { public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) { super.dump(prefix, fd, writer, args); super.dump(prefix, fd, writer, args); EventBus.getDefault().dump(prefix, writer); String id = Integer.toHexString(System.identityHashCode(this)); String id = Integer.toHexString(System.identityHashCode(this)); writer.print(prefix); writer.print(TAG); writer.print(prefix); writer.print(TAG); Loading @@ -787,6 +788,5 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD if (mRecentsView != null) { if (mRecentsView != null) { mRecentsView.dump(prefix, writer); mRecentsView.dump(prefix, writer); } } EventBus.getDefault().dump(prefix, writer); } } } } packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -689,7 +689,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener TaskStackViewScroller stackScroller = stackView.getScroller(); TaskStackViewScroller stackScroller = stackView.getScroller(); stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateToInitialState(true /* scrollToInitialState */); stackView.updateToInitialState(); for (int i = tasks.size() - 1; i >= 0; i--) { for (int i = tasks.size() - 1; i >= 0; i--) { Task task = tasks.get(i); Task task = tasks.get(i); Loading Loading @@ -742,7 +742,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Get the transform for the running task // Get the transform for the running task stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateToInitialState(true /* scrollToInitialState */); stackView.updateToInitialState(); stackView.getStackAlgorithm().getStackTransformScreenCoordinates(launchTask, stackView.getStackAlgorithm().getStackTransformScreenCoordinates(launchTask, stackView.getScroller().getStackScroll(), mTmpTransform, null); stackView.getScroller().getStackScroll(), mTmpTransform, null); return mTmpTransform; return mTmpTransform; Loading packages/SystemUI/src/com/android/systemui/recents/events/activity/ConfigurationChangedEvent.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -24,13 +24,13 @@ import com.android.systemui.recents.events.EventBus; public class ConfigurationChangedEvent extends EventBus.AnimatedEvent { public class ConfigurationChangedEvent extends EventBus.AnimatedEvent { public final boolean fromMultiWindow; public final boolean fromMultiWindow; public final boolean fromOrientationChange; public final boolean fromDeviceOrientationChange; public final boolean hasStackTasks; public final boolean hasStackTasks; public ConfigurationChangedEvent(boolean fromMultiWindow, boolean fromOrientationChange, public ConfigurationChangedEvent(boolean fromMultiWindow, boolean fromDeviceOrientationChange, boolean hasStackTasks) { boolean hasStackTasks) { this.fromMultiWindow = fromMultiWindow; this.fromMultiWindow = fromMultiWindow; this.fromOrientationChange = fromOrientationChange; this.fromDeviceOrientationChange = fromDeviceOrientationChange; this.hasStackTasks = hasStackTasks; this.hasStackTasks = hasStackTasks; } } } } packages/SystemUI/src/com/android/systemui/recents/misc/Utilities.java +12 −1 Original line number Original line Diff line number Diff line Loading @@ -18,8 +18,11 @@ package com.android.systemui.recents.misc; import android.animation.Animator; import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.AnimatorSet; import android.animation.RectEvaluator; import android.annotation.FloatRange; import android.annotation.FloatRange; import android.app.Activity; import android.app.Activity; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.Resources; import android.graphics.Color; import android.graphics.Color; import android.graphics.Rect; import android.graphics.Rect; Loading Loading @@ -71,7 +74,7 @@ public class Utilities { }; }; public static final RectFEvaluator RECTF_EVALUATOR = new RectFEvaluator(); public static final RectFEvaluator RECTF_EVALUATOR = new RectFEvaluator(); public static final RectEvaluator RECT_EVALUATOR = new RectEvaluator(new Rect()); public static final Rect EMPTY_RECT = new Rect(); public static final Rect EMPTY_RECT = new Rect(); /** /** Loading Loading @@ -269,6 +272,14 @@ public class Utilities { Trace.traceEnd(Trace.TRACE_TAG_VIEW); Trace.traceEnd(Trace.TRACE_TAG_VIEW); } } /** * Returns the application configuration, which is independent of the activity's current * configuration in multiwindow. */ public static Configuration getAppConfiguration(Context context) { return context.getApplicationContext().getResources().getConfiguration(); } /** /** * Returns a lightweight dump of a rect. * Returns a lightweight dump of a rect. */ */ Loading Loading
packages/SystemUI/res/layout/recents_task_view.xml +33 −37 Original line number Original line Diff line number Diff line Loading @@ -18,10 +18,6 @@ android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_height="match_parent" android:focusable="true"> android:focusable="true"> <FrameLayout android:id="@+id/task_view_content" android:layout_width="match_parent" android:layout_height="match_parent"> <com.android.systemui.recents.views.TaskViewThumbnail <com.android.systemui.recents.views.TaskViewThumbnail android:id="@+id/task_view_thumbnail" android:id="@+id/task_view_thumbnail" android:layout_width="match_parent" android:layout_width="match_parent" Loading @@ -29,6 +25,7 @@ <include layout="@layout/recents_task_view_header" /> <include layout="@layout/recents_task_view_header" /> <!-- TODO: Move this into a view stub --> <com.android.systemui.statusbar.AlphaOptimizedFrameLayout <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:id="@+id/lock_to_app_fab" android:id="@+id/lock_to_app_fab" android:layout_width="@dimen/recents_lock_to_app_size" android:layout_width="@dimen/recents_lock_to_app_size" Loading Loading @@ -58,7 +55,6 @@ android:layout_marginTop="48dp" android:layout_marginTop="48dp" android:layout_marginLeft="16dp" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" /> android:layout_marginRight="16dp" /> </FrameLayout> </com.android.systemui.recents.views.TaskView> </com.android.systemui.recents.views.TaskView>
packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +8 −8 Original line number Original line Diff line number Diff line Loading @@ -98,7 +98,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD private RecentsPackageMonitor mPackageMonitor; private RecentsPackageMonitor mPackageMonitor; private long mLastTabKeyEventTime; private long mLastTabKeyEventTime; private int mLastOrientation = Configuration.ORIENTATION_UNDEFINED; private int mLastDeviceOrientation = Configuration.ORIENTATION_UNDEFINED; private boolean mFinishedOnStartup; private boolean mFinishedOnStartup; private boolean mIgnoreAltTabRelease; private boolean mIgnoreAltTabRelease; private boolean mIsVisible; private boolean mIsVisible; Loading Loading @@ -276,7 +276,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD getWindow().getAttributes().privateFlags |= getWindow().getAttributes().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY; WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY; mLastOrientation = getResources().getConfiguration().orientation; mLastDeviceOrientation = Utilities.getAppConfiguration(this).orientation; mFocusTimerDuration = getResources().getInteger(R.integer.recents_auto_advance_duration); mFocusTimerDuration = getResources().getInteger(R.integer.recents_auto_advance_duration); mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() { mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() { @Override @Override Loading Loading @@ -426,13 +426,12 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); // Notify of the config change // Notify of the config change int newOrientation = getResources().getConfiguration().orientation; int newDeviceOrientation = Utilities.getAppConfiguration(this).orientation; int numStackTasks = mRecentsView.getStack().getStackTaskCount(); int numStackTasks = mRecentsView.getStack().getStackTaskCount(); EventBus.getDefault().send(new ConfigurationChangedEvent(false /* fromMultiWindow */, EventBus.getDefault().send(new ConfigurationChangedEvent(false /* fromMultiWindow */, (mLastOrientation != newOrientation), numStackTasks > 0)); (mLastDeviceOrientation != newDeviceOrientation), numStackTasks > 0)); mLastOrientation = newOrientation; mLastDeviceOrientation = newDeviceOrientation; } } @Override @Override Loading @@ -455,7 +454,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD int numStackTasks = stack.getStackTaskCount(); int numStackTasks = stack.getStackTaskCount(); EventBus.getDefault().send(new ConfigurationChangedEvent(true /* fromMultiWindow */, EventBus.getDefault().send(new ConfigurationChangedEvent(true /* fromMultiWindow */, false /* fromOrientationChange */, numStackTasks > 0)); false /* fromDeviceOrientationChange */, numStackTasks > 0)); if (mRecentsView != null) { if (mRecentsView != null) { mRecentsView.updateStack(stack); mRecentsView.updateStack(stack); Loading Loading @@ -777,6 +776,8 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD @Override @Override public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) { public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) { super.dump(prefix, fd, writer, args); super.dump(prefix, fd, writer, args); EventBus.getDefault().dump(prefix, writer); String id = Integer.toHexString(System.identityHashCode(this)); String id = Integer.toHexString(System.identityHashCode(this)); writer.print(prefix); writer.print(TAG); writer.print(prefix); writer.print(TAG); Loading @@ -787,6 +788,5 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD if (mRecentsView != null) { if (mRecentsView != null) { mRecentsView.dump(prefix, writer); mRecentsView.dump(prefix, writer); } } EventBus.getDefault().dump(prefix, writer); } } } }
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -689,7 +689,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener TaskStackViewScroller stackScroller = stackView.getScroller(); TaskStackViewScroller stackScroller = stackView.getScroller(); stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateToInitialState(true /* scrollToInitialState */); stackView.updateToInitialState(); for (int i = tasks.size() - 1; i >= 0; i--) { for (int i = tasks.size() - 1; i >= 0; i--) { Task task = tasks.get(i); Task task = tasks.get(i); Loading Loading @@ -742,7 +742,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Get the transform for the running task // Get the transform for the running task stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateToInitialState(true /* scrollToInitialState */); stackView.updateToInitialState(); stackView.getStackAlgorithm().getStackTransformScreenCoordinates(launchTask, stackView.getStackAlgorithm().getStackTransformScreenCoordinates(launchTask, stackView.getScroller().getStackScroll(), mTmpTransform, null); stackView.getScroller().getStackScroll(), mTmpTransform, null); return mTmpTransform; return mTmpTransform; Loading
packages/SystemUI/src/com/android/systemui/recents/events/activity/ConfigurationChangedEvent.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -24,13 +24,13 @@ import com.android.systemui.recents.events.EventBus; public class ConfigurationChangedEvent extends EventBus.AnimatedEvent { public class ConfigurationChangedEvent extends EventBus.AnimatedEvent { public final boolean fromMultiWindow; public final boolean fromMultiWindow; public final boolean fromOrientationChange; public final boolean fromDeviceOrientationChange; public final boolean hasStackTasks; public final boolean hasStackTasks; public ConfigurationChangedEvent(boolean fromMultiWindow, boolean fromOrientationChange, public ConfigurationChangedEvent(boolean fromMultiWindow, boolean fromDeviceOrientationChange, boolean hasStackTasks) { boolean hasStackTasks) { this.fromMultiWindow = fromMultiWindow; this.fromMultiWindow = fromMultiWindow; this.fromOrientationChange = fromOrientationChange; this.fromDeviceOrientationChange = fromDeviceOrientationChange; this.hasStackTasks = hasStackTasks; this.hasStackTasks = hasStackTasks; } } } }
packages/SystemUI/src/com/android/systemui/recents/misc/Utilities.java +12 −1 Original line number Original line Diff line number Diff line Loading @@ -18,8 +18,11 @@ package com.android.systemui.recents.misc; import android.animation.Animator; import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.AnimatorSet; import android.animation.RectEvaluator; import android.annotation.FloatRange; import android.annotation.FloatRange; import android.app.Activity; import android.app.Activity; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.Resources; import android.graphics.Color; import android.graphics.Color; import android.graphics.Rect; import android.graphics.Rect; Loading Loading @@ -71,7 +74,7 @@ public class Utilities { }; }; public static final RectFEvaluator RECTF_EVALUATOR = new RectFEvaluator(); public static final RectFEvaluator RECTF_EVALUATOR = new RectFEvaluator(); public static final RectEvaluator RECT_EVALUATOR = new RectEvaluator(new Rect()); public static final Rect EMPTY_RECT = new Rect(); public static final Rect EMPTY_RECT = new Rect(); /** /** Loading Loading @@ -269,6 +272,14 @@ public class Utilities { Trace.traceEnd(Trace.TRACE_TAG_VIEW); Trace.traceEnd(Trace.TRACE_TAG_VIEW); } } /** * Returns the application configuration, which is independent of the activity's current * configuration in multiwindow. */ public static Configuration getAppConfiguration(Context context) { return context.getApplicationContext().getResources().getConfiguration(); } /** /** * Returns a lightweight dump of a rect. * Returns a lightweight dump of a rect. */ */ Loading