summaryrefslogtreecommitdiffstats
path: root/quickstep
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2018-05-11 21:55:21 +0000
committerWinson Chung <winsonc@google.com>2018-05-11 21:55:21 +0000
commita0f09f94b58988ed28666183aaa3917fc78eca6d (patch)
treef26e2c8f3b82f470fc8f92e79ac202bf5b382075 /quickstep
parentf5d5b6f00fcf64dc7d4a0df5dad683ba8d8921f6 (diff)
downloadandroid_packages_apps_Trebuchet-a0f09f94b58988ed28666183aaa3917fc78eca6d.tar.gz
android_packages_apps_Trebuchet-a0f09f94b58988ed28666183aaa3917fc78eca6d.tar.bz2
android_packages_apps_Trebuchet-a0f09f94b58988ed28666183aaa3917fc78eca6d.zip
Revert "Revert "Update sysui flags on swipe, skip task backgrounds on opaque apps""
This reverts commit f5d5b6f00fcf64dc7d4a0df5dad683ba8d8921f6. Reason for revert: Can be submitted once a build with ag/4040557 is available for flashing Change-Id: Id94440a1dc9b765bb9758af81b0567628befa283
Diffstat (limited to 'quickstep')
-rw-r--r--quickstep/libs/sysui_shared.jarbin128480 -> 128394 bytes
-rw-r--r--quickstep/src/com/android/quickstep/views/RecentsView.java12
-rw-r--r--quickstep/src/com/android/quickstep/views/TaskThumbnailView.java45
3 files changed, 44 insertions, 13 deletions
diff --git a/quickstep/libs/sysui_shared.jar b/quickstep/libs/sysui_shared.jar
index f16e4d0df..b343cc205 100644
--- a/quickstep/libs/sysui_shared.jar
+++ b/quickstep/libs/sysui_shared.jar
Binary files differ
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 503572181..a8e38a1ab 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -22,6 +22,7 @@ import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId;
+import static com.android.launcher3.util.SystemUiController.UI_STATE_OVERVIEW;
import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -106,6 +107,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
};
public static final boolean FLIP_RECENTS = true;
private static final int DISMISS_TASK_DURATION = 300;
+ // The threshold at which we update the SystemUI flags when animating from the task into the app
+ private static final float UPDATE_SYSUI_FLAGS_THRESHOLD = 0.6f;
private static final float[] sTempFloatArray = new float[3];
@@ -1152,12 +1155,21 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
}
tv.setVisibility(INVISIBLE);
+ int targetSysUiFlags = tv.getThumbnail().getSysUiStatusNavFlags();
TaskViewDrawable drawable = new TaskViewDrawable(tv, this);
getOverlay().add(drawable);
ObjectAnimator drawableAnim =
ObjectAnimator.ofFloat(drawable, TaskViewDrawable.PROGRESS, 1, 0);
drawableAnim.setInterpolator(LINEAR);
+ drawableAnim.addUpdateListener((animator) -> {
+ // Once we pass a certain threshold, update the sysui flags to match the target tasks'
+ // flags
+ mActivity.getSystemUiController().updateUiState(UI_STATE_OVERVIEW,
+ animator.getAnimatedFraction() > UPDATE_SYSUI_FLAGS_THRESHOLD
+ ? targetSysUiFlags
+ : 0);
+ });
AnimatorSet anim = createAdjacentPageAnimForTaskLaunch(tv,
drawable.getClipAnimationHelper());
diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
index c72493084..af7a735f5 100644
--- a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
@@ -16,6 +16,7 @@
package com.android.quickstep.views;
+import static android.view.View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN;
import android.content.Context;
@@ -38,6 +39,7 @@ import com.android.launcher3.BaseActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.util.SystemUiController;
import com.android.quickstep.TaskOverlayFactory;
import com.android.quickstep.TaskOverlayFactory.TaskOverlay;
import com.android.systemui.shared.recents.model.Task;
@@ -143,6 +145,20 @@ public class TaskThumbnailView extends View {
return new Rect();
}
+ public int getSysUiStatusNavFlags() {
+ if (mThumbnailData != null) {
+ int flags = 0;
+ flags |= (mThumbnailData.systemUiVisibility & SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) != 0
+ ? SystemUiController.FLAG_LIGHT_STATUS
+ : SystemUiController.FLAG_DARK_STATUS;
+ flags |= (mThumbnailData.systemUiVisibility & SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR) != 0
+ ? SystemUiController.FLAG_LIGHT_NAV
+ : SystemUiController.FLAG_DARK_NAV;
+ return flags;
+ }
+ return 0;
+ }
+
@Override
protected void onDraw(Canvas canvas) {
drawOnCanvas(canvas, 0, 0, getMeasuredWidth(), getMeasuredHeight(), mCornerRadius);
@@ -154,21 +170,24 @@ public class TaskThumbnailView extends View {
public void drawOnCanvas(Canvas canvas, float x, float y, float width, float height,
float cornerRadius) {
- // Always draw the background since the snapshots may be translucent
- canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mBackgroundPaint);
- if (mTask == null) {
- return;
- }
- if (!mTask.isLocked) {
- if (mClipBottom > 0) {
- canvas.save();
- canvas.clipRect(x, y, width, mClipBottom);
- canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mPaint);
- canvas.restore();
- } else {
- canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mPaint);
+ // Draw the background in all cases, except when the thumbnail data is opaque
+ final boolean drawBackgroundOnly = mTask == null || mTask.isLocked || mBitmapShader == null
+ || mThumbnailData == null;
+ if (drawBackgroundOnly || mClipBottom > 0 || mThumbnailData.isTranslucent) {
+ canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mBackgroundPaint);
+ if (drawBackgroundOnly) {
+ return;
}
}
+
+ if (mClipBottom > 0) {
+ canvas.save();
+ canvas.clipRect(x, y, width, mClipBottom);
+ canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mPaint);
+ canvas.restore();
+ } else {
+ canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mPaint);
+ }
}
private void updateThumbnailPaintFilter() {