From 7f78e23ccce099ea18787e9f264f0c9622e5139d Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 10 Apr 2019 14:02:38 -0700 Subject: [PATCH 001/101] Don't scale/translate hotseat icons if they are visible in overview Bug: 129145824 Change-Id: I02af7ad21b6dbc46041e774dfc6f5d3efb0ab8a9 --- .../launcher3/uioverrides/states/OverviewState.java | 12 +++++++++--- .../FlingAndHoldTouchController.java | 1 + src/com/android/launcher3/LauncherStateManager.java | 8 ++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/OverviewState.java index 94c1545745..043fd5596f 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/OverviewState.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/OverviewState.java @@ -17,8 +17,6 @@ package com.android.launcher3.uioverrides.states; import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS; import static com.android.launcher3.anim.Interpolators.DEACCEL_2; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; -import static com.android.launcher3.logging.LoggerUtils.getTargetStr; import static com.android.launcher3.logging.LoggerUtils.newContainerTarget; import static com.android.launcher3.states.RotationHelper.REQUEST_ROTATE; @@ -27,7 +25,6 @@ import android.view.View; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DeviceProfile; -import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; @@ -73,6 +70,15 @@ public class OverviewState extends LauncherState { return new ScaleAndTranslation(scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor); } + @Override + public ScaleAndTranslation getHotseatScaleAndTranslation(Launcher launcher) { + if ((getVisibleElements(launcher) & HOTSEAT_ICONS) != 0) { + // If the hotseat icons are visible in overview, keep them in their normal position. + return super.getWorkspaceScaleAndTranslation(launcher); + } + return getWorkspaceScaleAndTranslation(launcher); + } + @Override public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) { return new ScaleAndTranslation(1f, 0f, 0f); diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java index 6dd5e21a85..bab215b864 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java @@ -111,6 +111,7 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { AnimatorSetBuilder builder = new AnimatorSetBuilder(); builder.setInterpolator(AnimatorSetBuilder.ANIM_VERTICAL_PROGRESS, OVERSHOOT_1_2); + builder.setInterpolator(AnimatorSetBuilder.ANIM_WORKSPACE_TRANSLATE, OVERSHOOT_1_2); AnimatorSet overviewAnim = mLauncher.getStateManager().createAtomicAnimation( NORMAL, OVERVIEW, builder, ANIM_ALL, ATOMIC_DURATION); overviewAnim.addListener(new AnimatorListenerAdapter() { diff --git a/src/com/android/launcher3/LauncherStateManager.java b/src/com/android/launcher3/LauncherStateManager.java index 5b654d8f34..8145695c0e 100644 --- a/src/com/android/launcher3/LauncherStateManager.java +++ b/src/com/android/launcher3/LauncherStateManager.java @@ -320,8 +320,12 @@ public class LauncherStateManager { if (!isWorkspaceVisible) { workspace.setScaleX(0.92f); workspace.setScaleY(0.92f); - workspace.getHotseat().setScaleX(0.92f); - workspace.getHotseat().setScaleY(0.92f); + } + Hotseat hotseat = workspace.getHotseat(); + boolean isHotseatVisible = hotseat.getVisibility() == VISIBLE && hotseat.getAlpha() > 0; + if (!isHotseatVisible) { + hotseat.setScaleX(0.92f); + hotseat.setScaleY(0.92f); } } else if (fromState == NORMAL && toState == OVERVIEW_PEEK) { builder.setInterpolator(ANIM_OVERVIEW_FADE, INSTANT); From 052624d8971ba52d2a0bdb388bcf9985c2381b50 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Tue, 9 Apr 2019 17:06:14 -0700 Subject: [PATCH 002/101] TaskCornerRadius should not use dialogCornerRadius on devices not supporting rounded corners Bug: 123985787 Change-Id: I4ffe06362256d4cc83bbe34c139d71ea1f6ca92e --- .../quickstep/util/ClipAnimationHelper.java | 2 +- .../quickstep/util/TaskCornerRadius.java | 32 +++++++++++++++++++ .../quickstep/views/TaskThumbnailView.java | 3 +- quickstep/res/values/dimens.xml | 2 ++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 quickstep/recents_ui_overrides/src/com/android/quickstep/util/TaskCornerRadius.java 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 cbac944aaf..1242d79dc3 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 0000000000..3ddf1b60f3 --- /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 7905230223..ed68d87d7e 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 6ec3bf62d7..c5a1aca5f0 100644 --- a/quickstep/res/values/dimens.xml +++ b/quickstep/res/values/dimens.xml @@ -19,6 +19,8 @@ 24dp 12dp 48dp + + 2dp 10dp 70dp From 4060a75d8f2ef1aebe0944f05e4a1c8198edfeea Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 8 Apr 2019 15:49:37 -0700 Subject: [PATCH 003/101] Add state callback in launcher Bug: 129785904 Test: Manual, change states and verify state is sent Change-Id: Ia1f69494a6cbae68085fb09670ffa309ce147430 (cherry picked from commit c4b88c3dfb662318dc5c318c7a4b34889c1295bc) --- .../src/com/android/quickstep/TouchInteractionService.java | 4 ++++ .../src/com/android/quickstep/TouchInteractionService.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java index 734425ee4c..39f8448d1f 100644 --- a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -88,6 +88,10 @@ public class TouchInteractionService extends Service { boolean gestureSwipeLeft) { } + public void onSystemUiStateChanged(int stateFlags) { + // To be implemented + } + /** Deprecated methods **/ public void onQuickStep(MotionEvent motionEvent) { } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index 3ea8de0ce3..e591177404 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -159,6 +159,10 @@ public class TouchInteractionService extends Service implements isButton, gestureSwipeLeft, activityControl.getContainerType()); } + public void onSystemUiStateChanged(int stateFlags) { + // To be implemented + } + /** Deprecated methods **/ public void onQuickStep(MotionEvent motionEvent) { } From df4bf92412059663e3ac9d787d34f5afbedca59f Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Thu, 11 Apr 2019 15:17:41 -0700 Subject: [PATCH 004/101] Popups (shortcut, system, scroller) / Drop Targets / Widgets (bottom/full) should follow themed font Bug: 126229665 Change-Id: I429da6b9bc5f99d42be0f2498cbdecb059f127f4 --- res/layout/deep_shortcut.xml | 1 - res/layout/system_shortcut.xml | 1 - res/layout/widget_cell_content.xml | 2 -- res/layout/widgets_bottom_sheet.xml | 2 +- res/layout/widgets_scroll_container.xml | 1 + res/values/styles.xml | 6 ++++-- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/res/layout/deep_shortcut.xml b/res/layout/deep_shortcut.xml index 92f70e661a..ca6f409dbe 100644 --- a/res/layout/deep_shortcut.xml +++ b/res/layout/deep_shortcut.xml @@ -33,7 +33,6 @@ android:drawablePadding="@dimen/deep_shortcut_drawable_padding" android:textSize="14sp" android:textColor="?android:attr/textColorPrimary" - android:fontFamily="sans-serif" launcher:layoutHorizontal="true" launcher:iconDisplay="shortcut_popup" launcher:iconSizeOverride="@dimen/deep_shortcut_icon_size" /> diff --git a/res/layout/system_shortcut.xml b/res/layout/system_shortcut.xml index 04f3d027dc..4b7097a97b 100644 --- a/res/layout/system_shortcut.xml +++ b/res/layout/system_shortcut.xml @@ -31,7 +31,6 @@ android:paddingEnd="@dimen/popup_padding_end" android:textSize="14sp" android:textColor="?android:attr/textColorPrimary" - android:fontFamily="sans-serif" launcher:iconDisplay="shortcut_popup" launcher:layoutHorizontal="true" android:focusable="false" /> diff --git a/res/layout/widget_cell_content.xml b/res/layout/widget_cell_content.xml index c77b0b931d..64f2362ed3 100644 --- a/res/layout/widget_cell_content.xml +++ b/res/layout/widget_cell_content.xml @@ -34,7 +34,6 @@ android:layout_weight="1" android:ellipsize="end" android:fadingEdge="horizontal" - android:fontFamily="sans-serif-condensed" android:gravity="start" android:singleLine="true" android:maxLines="1" @@ -51,7 +50,6 @@ android:layout_marginLeft="5dp" android:textColor="?android:attr/textColorSecondary" android:textSize="14sp" - android:fontFamily="sans-serif-condensed" android:alpha="0.8" /> diff --git a/res/layout/widgets_bottom_sheet.xml b/res/layout/widgets_bottom_sheet.xml index 6bf90481ad..3fdfc96667 100644 --- a/res/layout/widgets_bottom_sheet.xml +++ b/res/layout/widgets_bottom_sheet.xml @@ -26,7 +26,7 @@ android:theme="?attr/widgetsTheme"> - -