summaryrefslogtreecommitdiffstats
path: root/quickstep
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2019-04-09 17:06:14 -0700
committerHyunyoung Song <hyunyoungs@google.com>2019-04-10 14:29:36 -0700
commit052624d8971ba52d2a0bdb388bcf9985c2381b50 (patch)
treeb8be0eff12ab37085643c42f7f1da4417cd796bb /quickstep
parent0d7b0159b37361f8483ea2120d286ec249a82673 (diff)
downloadandroid_packages_apps_Trebuchet-052624d8971ba52d2a0bdb388bcf9985c2381b50.tar.gz
android_packages_apps_Trebuchet-052624d8971ba52d2a0bdb388bcf9985c2381b50.tar.bz2
android_packages_apps_Trebuchet-052624d8971ba52d2a0bdb388bcf9985c2381b50.zip
TaskCornerRadius should not use dialogCornerRadius on devices not supporting rounded corners
Bug: 123985787 Change-Id: I4ffe06362256d4cc83bbe34c139d71ea1f6ca92e
Diffstat (limited to 'quickstep')
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java2
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/util/TaskCornerRadius.java32
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java3
-rw-r--r--quickstep/res/values/dimens.xml2
4 files changed, 37 insertions, 2 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
index cbac944aa..1242d79dc 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
@@ -102,7 +102,7 @@ public class ClipAnimationHelper {
public ClipAnimationHelper(Context context) {
mWindowCornerRadius = getWindowCornerRadius(context.getResources());
mSupportsRoundedCornersOnWindows = supportsRoundedCornersOnWindows(context.getResources());
- mTaskCornerRadius = Themes.getDialogCornerRadius(context);
+ mTaskCornerRadius = TaskCornerRadius.get(context);
}
private void updateSourceStack(RemoteAnimationTargetCompat target) {
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/TaskCornerRadius.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/TaskCornerRadius.java
new file mode 100644
index 000000000..3ddf1b60f
--- /dev/null
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/TaskCornerRadius.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.util;
+
+import static com.android.systemui.shared.system.QuickStepContract.supportsRoundedCornersOnWindows;
+
+import android.content.Context;
+
+import com.android.launcher3.R;
+import com.android.launcher3.util.Themes;
+
+public class TaskCornerRadius {
+
+ public static float get(Context context) {
+ return supportsRoundedCornersOnWindows(context.getResources()) ?
+ Themes.getDialogCornerRadius(context):
+ context.getResources().getDimension(R.dimen.task_corner_radius_small);
+ }
+}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java
index 790523022..ed68d87d7 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java
@@ -48,6 +48,7 @@ import com.android.launcher3.util.SystemUiController;
import com.android.launcher3.util.Themes;
import com.android.quickstep.TaskOverlayFactory;
import com.android.quickstep.TaskOverlayFactory.TaskOverlay;
+import com.android.quickstep.util.TaskCornerRadius;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.QuickStepContract;
@@ -108,7 +109,7 @@ public class TaskThumbnailView extends View {
public TaskThumbnailView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
- mCornerRadius = Themes.getDialogCornerRadius(context);
+ mCornerRadius = TaskCornerRadius.get(context);
mOverlay = TaskOverlayFactory.INSTANCE.get(context).createOverlay(this);
mPaint.setFilterBitmap(true);
mBackgroundPaint.setColor(Color.WHITE);
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 6ec3bf62d..c5a1aca5f 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -19,6 +19,8 @@
<dimen name="task_thumbnail_top_margin">24dp</dimen>
<dimen name="task_thumbnail_half_top_margin">12dp</dimen>
<dimen name="task_thumbnail_icon_size">48dp</dimen>
+ <!-- For screens without rounded corners -->
+ <dimen name="task_corner_radius_small">2dp</dimen>
<dimen name="recents_page_spacing">10dp</dimen>
<dimen name="recents_clear_all_deadzone_vertical_margin">70dp</dimen>