From 6fe3eec95cfb153ed7c16c6381623b7e762452c3 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 15 Aug 2019 14:53:41 -0700 Subject: Moving various common executors to a single location Change-Id: I44bca49b8adb6fa22c3b48d10f674e42c28d792c --- .../com/android/quickstep/OverviewCommandHelper.java | 17 +++++++---------- .../com/android/quickstep/TouchInteractionService.java | 5 ----- 2 files changed, 7 insertions(+), 15 deletions(-) (limited to 'go/quickstep/src/com') diff --git a/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java index 0fa3d866f..216972cba 100644 --- a/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +++ b/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java @@ -15,8 +15,8 @@ */ package com.android.quickstep; -import static com.android.systemui.shared.system.ActivityManagerWrapper - .CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; +import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; +import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; import android.annotation.TargetApi; import android.content.Context; @@ -25,7 +25,6 @@ import android.os.SystemClock; import android.view.ViewConfiguration; import com.android.launcher3.BaseDraggingActivity; -import com.android.launcher3.MainThreadExecutor; import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.userevent.nano.LauncherLogProto; import com.android.quickstep.ActivityControlHelper.ActivityInitListener; @@ -43,7 +42,6 @@ public class OverviewCommandHelper { private final Context mContext; private final ActivityManagerWrapper mAM; private final RecentsModel mRecentsModel; - private final MainThreadExecutor mMainThreadExecutor; private final OverviewComponentObserver mOverviewComponentObserver; private long mLastToggleTime; @@ -51,7 +49,6 @@ public class OverviewCommandHelper { public OverviewCommandHelper(Context context, OverviewComponentObserver observer) { mContext = context; mAM = ActivityManagerWrapper.getInstance(); - mMainThreadExecutor = new MainThreadExecutor(); mRecentsModel = RecentsModel.INSTANCE.get(mContext); mOverviewComponentObserver = observer; } @@ -63,19 +60,19 @@ public class OverviewCommandHelper { } mAM.closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS); - mMainThreadExecutor.execute(new RecentsActivityCommand<>()); + MAIN_EXECUTOR.execute(new RecentsActivityCommand<>()); } public void onOverviewShown(boolean triggeredFromAltTab) { - mMainThreadExecutor.execute(new ShowRecentsCommand()); + MAIN_EXECUTOR.execute(new ShowRecentsCommand()); } public void onOverviewHidden() { - mMainThreadExecutor.execute(new HideRecentsCommand()); + MAIN_EXECUTOR.execute(new HideRecentsCommand()); } public void onTip(int actionType, int viewType) { - mMainThreadExecutor.execute(() -> + MAIN_EXECUTOR.execute(() -> UserEventDispatcher.newInstance(mContext).logActionTip(actionType, viewType)); } @@ -161,7 +158,7 @@ public class OverviewCommandHelper { // Otherwise, start overview. mListener = mHelper.createActivityInitListener(provider::onActivityReady); mListener.registerAndStartActivity(mOverviewComponentObserver.getOverviewIntent(), - provider, mContext, mMainThreadExecutor.getHandler(), + provider, mContext, MAIN_EXECUTOR.getHandler(), provider.getRecentsLaunchDuration()); } diff --git a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java index 577b17566..19dd82f7f 100644 --- a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -34,8 +34,6 @@ import android.view.MotionEvent; import com.android.launcher3.Utilities; import com.android.launcher3.compat.UserManagerCompat; -import com.android.launcher3.util.LooperExecutor; -import com.android.launcher3.util.UiThreadHelper; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; @@ -139,9 +137,6 @@ public class TouchInteractionService extends Service { return sConnected; } - public static final LooperExecutor BACKGROUND_EXECUTOR = - new LooperExecutor(UiThreadHelper.getBackgroundLooper()); - private RecentsModel mRecentsModel; private OverviewComponentObserver mOverviewComponentObserver; private OverviewCommandHelper mOverviewCommandHelper; -- cgit v1.2.3 From ddc9622e92fb5a4b211a5942ec679d195dc10d19 Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Wed, 28 Aug 2019 14:46:34 -0700 Subject: Reduces padding of the Overview shelf in no button mode. Before: https://screenshot.googleplex.com/iw6baTCfoy2.png After: https://screenshot.googleplex.com/8CcsQvLhYDo.png Desired: https://b.corp.google.com/action/issues/139551306/attachments/26925873?download=false Test: Examined before and after padding and verified 3-button is unaffected. Fixes: 139551306 Change-Id: Ia416399cf25e7c6c2fb8aa84ad20e7ad74dcd31b --- .../src/com/android/launcher3/uioverrides/states/OverviewState.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'go/quickstep/src/com') diff --git a/go/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/go/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java index d0cfcf97a..212ce9bef 100644 --- a/go/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java +++ b/go/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java @@ -32,6 +32,7 @@ import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7; import static com.android.launcher3.states.RotationHelper.REQUEST_ROTATE; +import android.content.Context; import android.view.View; import com.android.launcher3.DeviceProfile; @@ -115,10 +116,10 @@ public class OverviewState extends LauncherState { } public static float getDefaultSwipeHeight(Launcher launcher) { - return getDefaultSwipeHeight(launcher.getDeviceProfile()); + return getDefaultSwipeHeight(launcher, launcher.getDeviceProfile()); } - public static float getDefaultSwipeHeight(DeviceProfile dp) { + public static float getDefaultSwipeHeight(Context context, DeviceProfile dp) { return dp.allAppsCellHeightPx - dp.allAppsIconTextSizePx; } -- cgit v1.2.3 From 42a9ef0e9f87230930127f25e0ce80b5ea1f603a Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Tue, 24 Sep 2019 16:05:54 -0700 Subject: Move shelf peeking anim code to ShelfPeekAnim class Bug: 126596417 Change-Id: I5ba501b04b3eaf12a20ba1312ef362f9734761c3 Merged-In: I5ba501b04b3eaf12a20ba1312ef362f9734761c3 --- .../com/android/quickstep/util/ShelfPeekAnim.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 go/quickstep/src/com/android/quickstep/util/ShelfPeekAnim.java (limited to 'go/quickstep/src/com') diff --git a/go/quickstep/src/com/android/quickstep/util/ShelfPeekAnim.java b/go/quickstep/src/com/android/quickstep/util/ShelfPeekAnim.java new file mode 100644 index 000000000..1e9ac6fbf --- /dev/null +++ b/go/quickstep/src/com/android/quickstep/util/ShelfPeekAnim.java @@ -0,0 +1,27 @@ +/* + * 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 com.android.launcher3.Launcher; + +/** Empty class, only exists so that l3goWithQuickstepIconRecentsDebug compiles. */ +public class ShelfPeekAnim { + public ShelfPeekAnim(Launcher launcher) { + } + + public enum ShelfAnimState { + } +} -- cgit v1.2.3 From 2785a5996cebaae4df29c1f9e9efcaf2f7b0055f Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Mon, 12 Aug 2019 18:33:48 -0700 Subject: Improve quick switch from home by tracking both x and y motion - Add NoButtonQuickSwitchTouchController which uses BothAxesSwipeDetector to track horizontal and vertical motion. - Initially, we only detect swipe left to right to quick switch (like before), but then we allow swipe up to either go to overview (if you hold) or back home (if you don't hold). - xDisplacement transitions non-overview components out (e.g. shelf and workspace), and translates overview in. - yDisplacement translates overview up and scales it down Bug: 126596417 Change-Id: Id679ad84c08246e205c667a78ed5df00d7276258 Merged-In: Id679ad84c08246e205c667a78ed5df00d7276258 --- go/quickstep/src/com/android/quickstep/util/ShelfPeekAnim.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'go/quickstep/src/com') diff --git a/go/quickstep/src/com/android/quickstep/util/ShelfPeekAnim.java b/go/quickstep/src/com/android/quickstep/util/ShelfPeekAnim.java index 1e9ac6fbf..fb8901388 100644 --- a/go/quickstep/src/com/android/quickstep/util/ShelfPeekAnim.java +++ b/go/quickstep/src/com/android/quickstep/util/ShelfPeekAnim.java @@ -24,4 +24,8 @@ public class ShelfPeekAnim { public enum ShelfAnimState { } + + public boolean isPeeking() { + return false; + } } -- cgit v1.2.3