Merge changes I2cc102d7,Ifba9aa59 into sc-v2-dev
* changes:
Only show Taskbar Edu once (first time an app is opened).
Adds initial Taskbar Edu implementation.
diff --git a/buglist_with_title.txt b/buglist_with_title.txt
deleted file mode 100644
index aa8b413..0000000
--- a/buglist_with_title.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-144170434 twickham P1 FIXED Improve Overview -> Home transition ----
-149934536 twickham P2 FIXED Update gesture nav pullback logic ----
-154951045 peanutbutter P1 FIXED Odd animation occuring at times when swiping to home ----
-154964045 awickham P2 FIXED "Clear all" text is not in the middle of app's window vertically ----
-158701272 twickham P4 FIXED Discontinuities when long-swiping to home ----
-160361464 tracyzhou P2 FIXED Place launcher above the target app in live tile mode ----
-160568387 twickham P2 FIXED Can't get to app switcher by swiping up (motion pause not detected) ----
-160718310 xuqiu P1 FIXED With "Select" overview action selected, App icon is missing in other overview apps after orientation change ----
-160748731 sunnygoyal P2 ASSIGNED Unify prediction model with Launcher model ----
-160759508 twickham P2 FIXED Swipe up cannot back to home screen in overview. ----
-161273376 xuqiu P2 FIXED [Overview Actions] Add logging and helpful messages ----
-161536946 twickham P2 FIXED Haptics don't indicate snap-to in overview, ----
-161685099 winsonc P2 FIXED Screen still stay at the quick settings/notification when I swipe up with 3 finger to check the all apps. ----
-161801331 hyunyoungs P2 FIXED Change AllAppsSearch plugin to support only data fetch ----
-161901771 xuqiu P1 FIXED Overlapping layer of highlights with app layout getting darker when keep rotating the device from "Feedback" viewpoint in split screen ----
-161939759 sunnygoyal P2 FIXED RD1A: Going to overview in landscape mode clips the screen content ----
-162012217 perumaal P2 ASSIGNED Leaked Activity Caused by Gleams ----
-162454040 bookatz P2 ASSIGNED Create multiuser test that checks that opening an app works properly ----
-162480567 sfufa P4 FIXED Enable Item Decorations for search items ----
-162564471 tracyzhou P2 FIXED [Live tile] Handle tapping overview actions in live tile mode ----
-162623012 zakcohen P1 ASSIGNED Enable chips flag ----
-162812884 winsonc P2 ASSIGNED [R]The color have not changed in some page after turning on the dark theme. ----
-162861289 hyunyoungs P2 FIXED Add FocusIndicator support to DEVICE_SEARCH feature in S ----
-162871508 sfufa P2 ASSIGNED Introduce support for Hero app section ----
diff --git a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
index ea1ece8..d0fb9e5 100644
--- a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
+++ b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
@@ -15,10 +15,15 @@
*/
package com.android.quickstep.util;
+import static com.android.launcher3.Utilities.comp;
+
+import android.annotation.Nullable;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
+import com.android.launcher3.Hotseat;
import com.android.launcher3.Launcher;
+import com.android.launcher3.util.HorizontalInsettableView;
import com.android.unfold.UnfoldTransitionProgressProvider;
import com.android.unfold.UnfoldTransitionProgressProvider.TransitionProgressListener;
@@ -27,10 +32,17 @@
*/
public class LauncherUnfoldAnimationController {
+ // Percentage of the width of the quick search bar that will be reduced
+ // from the both sides of the bar when progress is 0
+ private static final float MAX_WIDTH_INSET_FRACTION = 0.15f;
+
private final Launcher mLauncher;
private final UnfoldTransitionProgressProvider mUnfoldTransitionProgressProvider;
private final UnfoldMoveFromCenterWorkspaceAnimator mMoveFromCenterWorkspaceAnimation;
+ @Nullable
+ private HorizontalInsettableView mQsbInsettable;
+
private final AnimationListener mAnimationListener = new AnimationListener();
private boolean mIsTransitionRunning = false;
@@ -51,6 +63,11 @@
* Called when launcher is resumed
*/
public void onResume() {
+ Hotseat hotseat = mLauncher.getHotseat();
+ if (hotseat != null && hotseat.getQsb() instanceof HorizontalInsettableView) {
+ mQsbInsettable = (HorizontalInsettableView) hotseat.getQsb();
+ }
+
final ViewTreeObserver obs = mLauncher.getWorkspace().getViewTreeObserver();
obs.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
@@ -68,12 +85,13 @@
* Called when launcher activity is paused
*/
public void onPause() {
- mIsReadyToPlayAnimation = false;
-
if (mIsTransitionRunning) {
mIsTransitionRunning = false;
- mMoveFromCenterWorkspaceAnimation.onTransitionFinished();
+ mAnimationListener.onTransitionFinished();
}
+
+ mIsReadyToPlayAnimation = false;
+ mQsbInsettable = null;
}
/**
@@ -109,6 +127,10 @@
public void onTransitionFinished() {
if (mIsReadyToPlayAnimation) {
mMoveFromCenterWorkspaceAnimation.onTransitionFinished();
+
+ if (mQsbInsettable != null) {
+ mQsbInsettable.setHorizontalInsets(0);
+ }
}
mIsTransitionRunning = false;
@@ -117,6 +139,11 @@
@Override
public void onTransitionProgress(float progress) {
mMoveFromCenterWorkspaceAnimation.onTransitionProgress(progress);
+
+ if (mQsbInsettable != null) {
+ float insetPercentage = comp(progress) * MAX_WIDTH_INSET_FRACTION;
+ mQsbInsettable.setHorizontalInsets(insetPercentage);
+ }
}
}
}
diff --git a/src/com/android/launcher3/util/HorizontalInsettableView.java b/src/com/android/launcher3/util/HorizontalInsettableView.java
new file mode 100644
index 0000000..7979bc0
--- /dev/null
+++ b/src/com/android/launcher3/util/HorizontalInsettableView.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2021 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.launcher3.util;
+
+/**
+ * Allows the implementing view to add insets to the left and right.
+ */
+public interface HorizontalInsettableView {
+
+ /**
+ * Sets left and right insets for the view so it looks like the width of the view is
+ * reduced when inset is increased.
+ *
+ * The inset is calculated based on the width of the view: e.g. when the width of
+ * the view is 100px then if we apply 0.15f horizontal inset percentage the rendered width
+ * of the view will be 70px with 15px of padding on the left and right sides.
+ *
+ * @param insetPercentage width percentage to inset the content from the left and from the right
+ */
+ void setHorizontalInsets(float insetPercentage);
+
+}