diff --git a/quickstep/res/layout/taskbar.xml b/quickstep/res/layout/taskbar.xml
index 83ad9f33e5..94d7d2bba0 100644
--- a/quickstep/res/layout/taskbar.xml
+++ b/quickstep/res/layout/taskbar.xml
@@ -42,6 +42,7 @@
android:layout_height="match_parent"
android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
+ android:paddingTop="@dimen/taskbar_contextual_padding_top"
android:gravity="center_vertical"
android:layout_gravity="start"/>
@@ -62,6 +63,7 @@
android:layout_height="match_parent"
android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
+ android:paddingTop="@dimen/taskbar_contextual_padding_top"
android:gravity="center_vertical"
android:layout_gravity="end"/>
diff --git a/quickstep/res/layout/taskbar_contextual_button.xml b/quickstep/res/layout/taskbar_contextual_button.xml
index cbbbfabc45..4ffb8d81dc 100644
--- a/quickstep/res/layout/taskbar_contextual_button.xml
+++ b/quickstep/res/layout/taskbar_contextual_button.xml
@@ -15,9 +15,7 @@
-->
\ No newline at end of file
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index e903377101..a6a6bbd158 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -165,8 +165,10 @@
54dp
16dp
16dp
- 48dp
- 16dp
+ 8dp
+ 44dp
+ 40dp
+ 42dp
35dp
24dp
220dp
diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
index 6bc49ed076..16dcf465ca 100644
--- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
@@ -62,7 +62,6 @@ import java.util.stream.Stream;
public class LauncherTaskbarUIController extends TaskbarUIController {
private final BaseQuickstepLauncher mLauncher;
- private final TaskbarStateHandler mTaskbarStateHandler;
private final TaskbarActivityContext mContext;
private final TaskbarDragLayer mTaskbarDragLayer;
@@ -96,6 +95,14 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
private TaskbarKeyguardController mKeyguardController;
private LauncherState mTargetStateOverride = null;
+ private final DeviceProfile.OnDeviceProfileChangeListener mProfileChangeListener =
+ new DeviceProfile.OnDeviceProfileChangeListener() {
+ @Override
+ public void onDeviceProfileChanged(DeviceProfile dp) {
+ mControllers.taskbarViewController.onRotationChanged(
+ mLauncher.getDeviceProfile());
+ }
+ };
public LauncherTaskbarUIController(
BaseQuickstepLauncher launcher, TaskbarActivityContext context) {
@@ -104,7 +111,6 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
mTaskbarView = mTaskbarDragLayer.findViewById(R.id.taskbar_view);
mLauncher = launcher;
- mTaskbarStateHandler = mLauncher.getTaskbarStateHandler();
}
@Override
@@ -129,6 +135,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
onStashedInAppChanged(mLauncher.getDeviceProfile());
mLauncher.addOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
mLauncher.getStateManager().addStateListener(mStateListener);
+ mLauncher.addOnDeviceProfileChangeListener(mProfileChangeListener);
}
@Override
@@ -141,6 +148,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
mLauncher.getStateManager().removeStateListener(mStateListener);
mLauncher.getHotseat().setIconsAlpha(1f);
mLauncher.setTaskbarUIController(null);
+ mLauncher.removeOnDeviceProfileChangeListener(mProfileChangeListener);
}
@Override
diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
index 4b75db4fbe..67bec49fb4 100644
--- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
@@ -95,6 +95,9 @@ public class NavbarButtonsViewController {
private final ViewGroup mEndContextualContainer;
private final ViewGroup mStartContextualContainer;
+ private final AnimatedFloat mTaskbarNavButtonTranslationY = new AnimatedFloat(
+ this::updateNavButtonTranslationY);
+
// Initialized in init.
private TaskbarControllers mControllers;
private View mA11yButton;
@@ -133,8 +136,7 @@ public class NavbarButtonsViewController {
mControllers.navButtonController, R.id.ime_switcher);
mPropertyHolders.add(new StatePropertyHolder(imeSwitcherButton,
flags -> ((flags & MASK_IME_SWITCHER_VISIBLE) == MASK_IME_SWITCHER_VISIBLE)
- && ((flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0)
- && ((flags & FLAG_A11Y_VISIBLE) == 0)));
+ && ((flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0)));
mPropertyHolders.add(new StatePropertyHolder(
mControllers.taskbarViewController.getTaskbarIconAlpha()
@@ -305,6 +307,11 @@ public class NavbarButtonsViewController {
}
}
+ /** Use to set the translationY for the all nav+contextual buttons */
+ public AnimatedFloat getTaskbarNavButtonTranslationY() {
+ return mTaskbarNavButtonTranslationY;
+ }
+
/**
* Does not call {@link #applyState()}. Don't forget to!
*/
@@ -323,6 +330,10 @@ public class NavbarButtonsViewController {
}
}
+ private void updateNavButtonTranslationY() {
+ mNavButtonsView.setTranslationY(mTaskbarNavButtonTranslationY.value);
+ }
+
private ImageView addButton(@DrawableRes int drawableId, @TaskbarButton int buttonType,
ViewGroup parent, TaskbarNavButtonController navButtonController, @IdRes int id) {
return addButton(drawableId, buttonType, parent, navButtonController, id,
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index ed09fa5984..ff04799c92 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -60,6 +60,7 @@ public class TaskbarViewController {
this::updateTranslationY);
private final AnimatedFloat mTaskbarIconTranslationYForStash = new AnimatedFloat(
this::updateTranslationY);
+ private AnimatedFloat mTaskbarNavButtonTranslationY;
private final TaskbarModelCallbacks mModelCallbacks;
@@ -88,6 +89,8 @@ public class TaskbarViewController {
mModelCallbacks.init(controllers);
LauncherAppState.getInstance(mActivity).getModel().addCallbacksAndLoad(mModelCallbacks);
+ mTaskbarNavButtonTranslationY =
+ controllers.navbarButtonsViewController.getTaskbarNavButtonTranslationY();
}
public void onDestroy() {
@@ -214,6 +217,7 @@ public class TaskbarViewController {
int offsetY = launcherDp.getTaskbarOffsetY();
setter.setFloat(mTaskbarIconTranslationYForHome, VALUE, -offsetY, LINEAR);
+ setter.setFloat(mTaskbarNavButtonTranslationY, VALUE, -offsetY, LINEAR);
int collapsedHeight = mActivity.getDefaultTaskbarWindowHeight();
int expandedHeight = Math.max(collapsedHeight,
@@ -238,6 +242,14 @@ public class TaskbarViewController {
return controller;
}
+ public void onRotationChanged(DeviceProfile deviceProfile) {
+ if (areIconsVisible()) {
+ // We only translate on rotation when on home
+ return;
+ }
+ mTaskbarNavButtonTranslationY.updateValue(-deviceProfile.getTaskbarOffsetY());
+ }
+
/**
* Callbacks for {@link TaskbarView} to interact with its controller.
*/
diff --git a/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java b/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java
index c9909cc2a1..aa26645eb9 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java
@@ -57,13 +57,13 @@ public class ApiWrapper {
if (SysUINavigationMode.INSTANCE.get(context).getMode() == Mode.THREE_BUTTONS) {
Resources res = context.getResources();
/*
- * 2 (left + right) x Padding +
* 3 nav buttons +
- * Little space at the end for contextual buttons
+ * Little space at the end for contextual buttons +
+ * Little space between icons and nav buttons
*/
- return 2 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_spacing)
- + 3 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size)
- + res.getDimensionPixelSize(R.dimen.taskbar_contextual_button_margin);
+ return 3 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size)
+ + res.getDimensionPixelSize(R.dimen.taskbar_contextual_button_margin)
+ + res.getDimensionPixelSize(R.dimen.taskbar_hotseat_nav_spacing);
} else {
return 0;
}
diff --git a/quickstep/src/com/android/quickstep/GestureState.java b/quickstep/src/com/android/quickstep/GestureState.java
index aabba66386..99f1dc75a9 100644
--- a/quickstep/src/com/android/quickstep/GestureState.java
+++ b/quickstep/src/com/android/quickstep/GestureState.java
@@ -122,10 +122,6 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL
public static final int STATE_RECENTS_ANIMATION_ENDED =
getFlagForIndex("STATE_RECENTS_ANIMATION_ENDED");
- // Called when we create an overscroll window when swiping right to left on the most recent app
- public static final int STATE_OVERSCROLL_WINDOW_CREATED =
- getFlagForIndex("STATE_OVERSCROLL_WINDOW_CREATED");
-
// Called when RecentsView stops scrolling and settles on a TaskView.
public static final int STATE_RECENTS_SCROLLING_FINISHED =
getFlagForIndex("STATE_RECENTS_SCROLLING_FINISHED");
diff --git a/quickstep/src/com/android/quickstep/OverscrollPluginFactory.java b/quickstep/src/com/android/quickstep/OverscrollPluginFactory.java
deleted file mode 100644
index 4c261abc7a..0000000000
--- a/quickstep/src/com/android/quickstep/OverscrollPluginFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2020 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;
-
-import static com.android.launcher3.util.MainThreadInitializedObject.forOverride;
-
-import com.android.launcher3.R;
-import com.android.launcher3.util.MainThreadInitializedObject;
-import com.android.launcher3.util.ResourceBasedOverride;
-import com.android.systemui.plugins.OverscrollPlugin;
-
-/**
- * Resource overrideable factory for forcing a local overscroll plugin.
- * Override {@link R.string#overscroll_plugin_factory_class} to set a different class.
- */
-public class OverscrollPluginFactory implements ResourceBasedOverride {
- public static final MainThreadInitializedObject INSTANCE = forOverride(
- OverscrollPluginFactory.class,
- R.string.overscroll_plugin_factory_class);
-
- /**
- * Get the plugin that is defined locally in launcher, as opposed to a dynamic side loaded one.
- */
- public OverscrollPlugin getLocalOverscrollPlugin() {
- return null;
- }
-}
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index bb8473bc1d..46b228ed30 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -40,7 +40,6 @@ import android.app.PendingIntent;
import android.app.RemoteAction;
import android.app.Service;
import android.content.ComponentName;
-import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@@ -90,7 +89,6 @@ import com.android.quickstep.inputconsumers.AssistantInputConsumer;
import com.android.quickstep.inputconsumers.DeviceLockedInputConsumer;
import com.android.quickstep.inputconsumers.OneHandedModeInputConsumer;
import com.android.quickstep.inputconsumers.OtherActivityInputConsumer;
-import com.android.quickstep.inputconsumers.OverscrollInputConsumer;
import com.android.quickstep.inputconsumers.OverviewInputConsumer;
import com.android.quickstep.inputconsumers.OverviewWithoutFocusInputConsumer;
import com.android.quickstep.inputconsumers.ResetGestureInputConsumer;
@@ -103,8 +101,6 @@ import com.android.quickstep.util.LauncherSplitScreenListener;
import com.android.quickstep.util.ProtoTracer;
import com.android.quickstep.util.ProxyScreenStatusProvider;
import com.android.quickstep.util.SplitScreenBounds;
-import com.android.systemui.plugins.OverscrollPlugin;
-import com.android.systemui.plugins.PluginListener;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -129,8 +125,8 @@ import java.util.LinkedList;
* Service connected by system-UI for handling touch interaction.
*/
@TargetApi(Build.VERSION_CODES.R)
-public class TouchInteractionService extends Service implements PluginListener,
- ProtoTraceable {
+public class TouchInteractionService extends Service
+ implements ProtoTraceable {
private static final String TAG = "TouchInteractionService";
@@ -149,8 +145,6 @@ public class TouchInteractionService extends Service implements PluginListener mSquaredSlop)) {
- mPassedSlop = true;
- mStartDragPos.set(mLastPos.x, mLastPos.y);
- mGestureState.setState(GestureState.STATE_OVERSCROLL_WINDOW_CREATED);
- }
-
- boolean becomeActive = mPassedSlop && !mPassedActiveThreshold && isOverscrolled()
- && (squaredDist > mSquaredActiveThreshold);
- if (becomeActive) {
- debugPrint("Past slop and past threshold, set active");
- mPassedActiveThreshold = true;
- setActive(ev);
- }
-
- if (mPassedActiveThreshold) {
- debugPrint("ACTION_MOVE Relaying touch event");
- mPlugin.onTouchEvent(ev, getHorizontalDistancePx(), getVerticalDistancePx(),
- (int) Math.sqrt(mSquaredFinishThreshold), mFlingDistanceThresholdPx,
- mFlingVelocityThresholdPx, getDeviceState(), getUnderlyingActivity());
- }
-
- break;
- }
- case ACTION_CANCEL:
- case ACTION_UP:
- debugPrint("ACTION_UP");
- if (mPassedActiveThreshold) {
- debugPrint("ACTION_UP Relaying touch event");
-
- mPlugin.onTouchEvent(ev, getHorizontalDistancePx(), getVerticalDistancePx(),
- (int) Math.sqrt(mSquaredFinishThreshold), mFlingDistanceThresholdPx,
- mFlingVelocityThresholdPx, getDeviceState(), getUnderlyingActivity());
- }
-
-
- mPassedSlop = false;
- mPassedActiveThreshold = false;
- mState = STATE_INACTIVE;
- break;
- }
-
- if (mState != STATE_ACTIVE) {
- mDelegate.onMotionEvent(ev);
- }
- }
-
- private boolean isOverscrolled() {
- if (mRecentsView == null) {
- BaseDraggingActivity activity = mGestureState.getActivityInterface()
- .getCreatedActivity();
- if (activity != null) {
- mRecentsView = activity.getOverviewPanel();
- }
- }
-
- // Make sure there isn't an app to quick switch to on our right
- int maxIndex = 0;
-
- boolean atRightMostApp = mRecentsView == null
- || (mRecentsView.getRunningTaskIndex() <= maxIndex);
-
- // Check if the gesture is within our angle threshold of horizontal
- float deltaY = abs(mLastPos.y - mDownPos.y);
- float deltaX = mLastPos.x - mDownPos.x;
-
- boolean angleInBounds = (Math.toDegrees(Math.atan2(deltaY, abs(deltaX))) < mAngleThreshold);
-
- boolean overscrollVisible = mPlugin.blockOtherGestures();
- boolean overscrollInvisibleAndLeftSwipe = !overscrollVisible && deltaX < 0;
- boolean gestureDirectionMatchesVisibility = overscrollVisible
- || overscrollInvisibleAndLeftSwipe;
- return atRightMostApp && angleInBounds && gestureDirectionMatchesVisibility;
- }
-
- private String getDeviceState() {
- String deviceState = OverscrollPlugin.DEVICE_STATE_UNKNOWN;
- int consumerType = mDelegate.getType();
- if (((consumerType & InputConsumer.TYPE_OVERVIEW) > 0)
- || ((consumerType & InputConsumer.TYPE_OVERVIEW_WITHOUT_FOCUS)) > 0) {
- deviceState = OverscrollPlugin.DEVICE_STATE_LAUNCHER;
- } else if ((consumerType & InputConsumer.TYPE_OTHER_ACTIVITY) > 0) {
- deviceState = OverscrollPlugin.DEVICE_STATE_APP;
- } else if (((consumerType & InputConsumer.TYPE_RESET_GESTURE) > 0)
- || ((consumerType & InputConsumer.TYPE_DEVICE_LOCKED) > 0)) {
- deviceState = OverscrollPlugin.DEVICE_STATE_LOCKED;
- }
-
- return deviceState;
- }
-
- private int getHorizontalDistancePx() {
- return (int) (mLastPos.x - mDownPos.x);
- }
-
- private int getVerticalDistancePx() {
- return (int) (mLastPos.y - mDownPos.y);
- }
-
- private @NonNull String getUnderlyingActivity() {
- // Overly defensive, got guidance on code review that something in the chain of
- // `mGestureState.getRunningTask().topActivity` can be null and thus cause a null pointer
- // exception to be thrown, but we aren't sure which part can be null.
- if ((mGestureState == null) || (mGestureState.getRunningTask() == null)
- || (mGestureState.getRunningTask().topActivity == null)) {
- return "";
- }
- return mGestureState.getRunningTask().topActivity.flattenToString();
- }
-}
diff --git a/res/values-pa/strings.xml b/res/values-pa/strings.xml
index b6acb97f0e..d56d898627 100644
--- a/res/values-pa/strings.xml
+++ b/res/values-pa/strings.xml
@@ -41,7 +41,7 @@
"%1$s, %2$s"
"ਵਿਜੇਟ"
"ਖੋਜੋ"
- "ਖੋਜ ਬਾਕਸ ਤੋਂ ਸਪੱਸ਼ਟ ਲਿਖਤ"
+ "ਖੋਜ ਬਾਕਸ ਤੋਂ ਲਿਖਤ ਕਲੀਅਰ ਕਰੋ"
"ਵਿਜੇਟ ਜਾਂ ਸ਼ਾਰਟਕੱਟ ਉਪਲਬਧ ਨਹੀਂ ਹਨ"
"ਕੋਈ ਵੀ ਵਿਜੇਟ ਜਾਂ ਸ਼ਾਰਟਕੱਟ ਨਹੀਂ ਮਿਲਿਆ"
"ਨਿੱਜੀ"
@@ -115,7 +115,7 @@
"ਹਟਾਓ"
"ਖੋਜੋ"
"ਇਹ ਐਪ ਇੰਸਟੌਲ ਨਹੀਂ ਕੀਤਾ ਹੋਇਆ ਹੈ।"
- "ਇਸ ਪ੍ਰਤੀਕ ਲਈ ਐਪ ਸਥਾਪਤ ਨਹੀਂ ਕੀਤਾ ਹੋਇਆ ਹੈ। ਤੁਸੀਂ ਇਸਨੂੰ ਹਟਾ ਸਕਦੇ ਹੋ ਜਾਂ ਐਪ ਖੋਜ ਸਕਦੇ ਹੋ ਅਤੇ ਇਸਨੂੰ ਮੈਨੂਅਲੀ ਸਥਾਪਤ ਕਰ ਸਕਦੇ ਹੋ।"
+ "ਇਸ ਪ੍ਰਤੀਕ ਲਈ ਐਪ ਸਥਾਪਤ ਨਹੀਂ ਕੀਤੀ ਹੋਈ ਹੈ। ਤੁਸੀਂ ਇਸਨੂੰ ਹਟਾ ਸਕਦੇ ਹੋ ਜਾਂ ਐਪ ਨੂੰ ਹੱਥੀਂ ਖੋਜ ਕੇ ਉਸਨੂੰ ਸਥਾਪਤ ਕਰ ਸਕਦੇ ਹੋ।"
"%1$s ਨੂੰ ਸਥਾਪਤ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ, %2$s ਪੂਰਾ ਹੋਇਆ"
"%1$s ਡਾਉਨਲੋਡ ਹੋਰ ਰਿਹਾ ਹੈ, %2$s ਸੰਪੂਰਣ"
"%1$s ਸਥਾਪਤ ਕਰਨ ਦੀ ਉਡੀਕ ਕਰ ਰਿਹਾ ਹੈ"
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 92aa6784e8..08f0089438 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -154,12 +154,7 @@
-
-
-
-
-
-
+
@@ -241,10 +236,7 @@
-
-
-
-
+
diff --git a/res/xml/device_profiles.xml b/res/xml/device_profiles.xml
index 256999cd7f..e030f81098 100644
--- a/res/xml/device_profiles.xml
+++ b/res/xml/device_profiles.xml
@@ -121,7 +121,7 @@
launcher:minHeightDps="694"
launcher:iconImageSize="56"
launcher:iconTextSize="14.4"
- launcher:canBeDefault="split_display" />
+ launcher:canBeDefault="true" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/xml/size_limits_80x104.xml b/res/xml/size_limits_80x104.xml
deleted file mode 100644
index 41786644fb..0000000000
--- a/res/xml/size_limits_80x104.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 9da2b798b8..521d8f4562 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -66,7 +66,6 @@ import com.android.launcher3.model.data.SearchActionItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.util.SafeCloseable;
import com.android.launcher3.views.ActivityContext;
-import com.android.launcher3.views.BubbleTextHolder;
import com.android.launcher3.views.IconLabelDotView;
import java.text.NumberFormat;
@@ -163,6 +162,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
private HandlerRunnable mIconLoadRequest;
private boolean mEnableIconUpdateAnimation = false;
+ private ItemInfoUpdateReceiver mItemInfoUpdateReceiver;
public BubbleTextView(Context context) {
this(context, null, 0);
@@ -240,6 +240,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
mDotParams.scale = 0f;
mForceHideDot = false;
setBackground(null);
+ mItemInfoUpdateReceiver = null;
}
private void cancelDotScaleAnim() {
@@ -337,13 +338,18 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
setDownloadStateContentDescription(info, info.getProgressLevel());
}
- private void setItemInfo(ItemInfo itemInfo) {
+ private void setItemInfo(ItemInfoWithIcon itemInfo) {
setTag(itemInfo);
- if (getParent() instanceof BubbleTextHolder) {
- ((BubbleTextHolder) getParent()).onItemInfoChanged(itemInfo);
+ if (mItemInfoUpdateReceiver != null) {
+ mItemInfoUpdateReceiver.reapplyItemInfo(itemInfo);
}
}
+ public void setItemInfoUpdateReceiver(
+ ItemInfoUpdateReceiver itemInfoUpdateReceiver) {
+ mItemInfoUpdateReceiver = itemInfoUpdateReceiver;
+ }
+
@UiThread
protected void applyIconAndLabel(ItemInfoWithIcon info) {
boolean useTheme = mDisplay == DISPLAY_WORKSPACE || mDisplay == DISPLAY_FOLDER
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 1b2f177ff2..d844b877a7 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015 The Android Open Source Project
+ * 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.
@@ -70,11 +70,6 @@ public class InvariantDeviceProfile {
public static final MainThreadInitializedObject INSTANCE =
new MainThreadInitializedObject<>(InvariantDeviceProfile::new);
- private static final int DEFAULT_TRUE = -1;
- private static final int DEFAULT_SPLIT_DISPLAY = 2;
- private static final int GRID_ENABLED_ALL_DISPLAYS = 0;
- private static final int GRID_ENABLED_SINGLE_DISPLAY = 1;
-
private static final String KEY_IDP_GRID_NAME = "idp_grid_name";
private static final float ICON_SIZE_DEFINED_IN_APP_DP = 48;
@@ -393,7 +388,9 @@ public class InvariantDeviceProfile {
private static ArrayList getPredefinedDeviceProfiles(
Context context, String gridName, boolean isSplitDisplay, boolean allowDisabledGrid) {
ArrayList profiles = new ArrayList<>();
- try (XmlResourceParser parser = context.getResources().getXml(R.xml.device_profiles)) {
+ int xmlResource = isSplitDisplay ? R.xml.device_profiles_split : R.xml.device_profiles;
+
+ try (XmlResourceParser parser = context.getResources().getXml(xmlResource)) {
final int depth = parser.getDepth();
int type;
while (((type = parser.next()) != XmlPullParser.END_TAG ||
@@ -411,8 +408,7 @@ public class InvariantDeviceProfile {
if ((type == XmlPullParser.START_TAG) && "display-option".equals(
parser.getName())) {
profiles.add(new DisplayOption(gridOption, context,
- Xml.asAttributeSet(parser),
- isSplitDisplay ? DEFAULT_SPLIT_DISPLAY : DEFAULT_TRUE));
+ Xml.asAttributeSet(parser)));
}
}
}
@@ -450,7 +446,9 @@ public class InvariantDeviceProfile {
*/
public List parseAllGridOptions(Context context) {
List result = new ArrayList<>();
- try (XmlResourceParser parser = context.getResources().getXml(R.xml.device_profiles)) {
+ int xmlResource = isSplitDisplay ? R.xml.device_profiles_split : R.xml.device_profiles;
+
+ try (XmlResourceParser parser = context.getResources().getXml(xmlResource)) {
final int depth = parser.getDepth();
int type;
while (((type = parser.next()) != XmlPullParser.END_TAG
@@ -702,11 +700,7 @@ public class InvariantDeviceProfile {
devicePaddingId = a.getResourceId(
R.styleable.GridDisplayOption_devicePaddingId, 0);
- final int enabledInt =
- a.getInteger(R.styleable.GridDisplayOption_gridEnabled,
- GRID_ENABLED_ALL_DISPLAYS);
- isEnabled = enabledInt == GRID_ENABLED_ALL_DISPLAYS
- || enabledInt == GRID_ENABLED_SINGLE_DISPLAY && !isSplitDisplay;
+ isEnabled = a.getBoolean(R.styleable.GridDisplayOption_gridEnabled, true);
a.recycle();
extraAttrs = Themes.createValueMap(context, attrs,
@@ -732,17 +726,15 @@ public class InvariantDeviceProfile {
private final float[] iconSizes = new float[COUNT_SIZES];
private final float[] textSizes = new float[COUNT_SIZES];
- DisplayOption(GridOption grid, Context context, AttributeSet attrs, int defaultFlagValue) {
+ DisplayOption(GridOption grid, Context context, AttributeSet attrs) {
this.grid = grid;
- TypedArray a = context.obtainStyledAttributes(
- attrs, R.styleable.ProfileDisplayOption);
+ TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ProfileDisplayOption);
minWidthDps = a.getFloat(R.styleable.ProfileDisplayOption_minWidthDps, 0);
minHeightDps = a.getFloat(R.styleable.ProfileDisplayOption_minHeightDps, 0);
- canBeDefault = a.getInt(R.styleable.ProfileDisplayOption_canBeDefault, 0)
- == defaultFlagValue;
+ canBeDefault = a.getBoolean(R.styleable.ProfileDisplayOption_canBeDefault, false);
float x;
float y;
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index f38f66282a..ee6f51ed05 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -60,6 +60,7 @@ import com.android.launcher3.pm.InstallSessionTracker;
import com.android.launcher3.pm.PackageInstallInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.shortcuts.ShortcutRequest;
+import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.PackageUserKey;
@@ -346,6 +347,12 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi
public void addCallbacks(Callbacks callbacks) {
Preconditions.assertUIThread();
synchronized (mCallbacksList) {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.NULL_INT_SET, "addCallbacks pointer: "
+ + callbacks
+ + ", name: "
+ + callbacks.getClass().getName(), new Exception());
+ }
mCallbacksList.add(callbacks);
}
}
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index df09f29241..7ba9935b13 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -461,6 +461,13 @@ public class LauncherProvider extends ContentProvider {
app.getModel().forceReload();
return null;
}
+ case LauncherSettings.Settings.METHOD_CLEAR_WORKSPACE:
+ {
+ Bundle result = new Bundle();
+ result.putIntArray(LauncherSettings.Settings.EXTRA_VALUE, clearWorkspace()
+ .toArray());
+ return result;
+ }
}
return null;
}
@@ -497,6 +504,30 @@ public class LauncherProvider extends ContentProvider {
}
}
+ /**
+ * Deletes any items from the DB apart from hotseat.
+ * @return Ids of deleted items.
+ */
+ private IntArray clearWorkspace() {
+ SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ try (SQLiteTransaction t = new SQLiteTransaction(db)) {
+ String selection = LauncherSettings.Favorites.CONTAINER + " <> "
+ + LauncherSettings.Favorites.CONTAINER_HOTSEAT;
+
+ IntArray itemIds = LauncherDbUtils.queryIntArray(db, Favorites.TABLE_NAME,
+ Favorites._ID, selection, null, null);
+ if (!itemIds.isEmpty()) {
+ db.delete(Favorites.TABLE_NAME, Utilities.createDbSelectionQuery(
+ LauncherSettings.Favorites._ID, itemIds), null);
+ }
+ t.commit();
+ return itemIds;
+ } catch (SQLException ex) {
+ Log.e(TAG, ex.getMessage(), ex);
+ return new IntArray();
+ }
+ }
+
@Thunk static void addModifiedTime(ContentValues values) {
values.put(LauncherSettings.Favorites.MODIFIED, System.currentTimeMillis());
}
diff --git a/src/com/android/launcher3/LauncherSettings.java b/src/com/android/launcher3/LauncherSettings.java
index 048aaaa3bf..bf9cd92b24 100644
--- a/src/com/android/launcher3/LauncherSettings.java
+++ b/src/com/android/launcher3/LauncherSettings.java
@@ -392,6 +392,8 @@ public class LauncherSettings {
public static final String METHOD_SWITCH_DATABASE = "switch_database";
+ public static final String METHOD_CLEAR_WORKSPACE = "clear_workspace";
+
public static final String EXTRA_VALUE = "value";
public static final String EXTRA_DB_NAME = "db_name";
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index ec077de64e..7bf4e8de11 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -72,12 +72,6 @@ public final class FeatureFlags {
"PROMISE_APPS_NEW_INSTALLS", true,
"Adds a promise icon to the home screen for new install sessions.");
- public static final BooleanFlag QUICKSTEP_SPRINGS = getDebugFlag(
- "QUICKSTEP_SPRINGS", true, "Enable springs for quickstep animations");
-
- public static final BooleanFlag UNSTABLE_SPRINGS = getDebugFlag(
- "UNSTABLE_SPRINGS", false, "Enable unstable springs for quickstep animations");
-
public static final BooleanFlag ENABLE_LOCAL_COLOR_POPUPS = getDebugFlag(
"ENABLE_LOCAL_COLOR_POPUPS", false, "Enable local color extraction for popups.");
@@ -122,16 +116,6 @@ public final class FeatureFlags {
public static final BooleanFlag ENABLE_PREDICTION_DISMISS = getDebugFlag(
"ENABLE_PREDICTION_DISMISS", true, "Allow option to dimiss apps from predicted list");
- public static final BooleanFlag ENABLE_QUICK_CAPTURE_GESTURE = getDebugFlag(
- "ENABLE_QUICK_CAPTURE_GESTURE", true, "Swipe from right to left to quick capture");
-
- public static final BooleanFlag ENABLE_QUICK_CAPTURE_WINDOW = getDebugFlag(
- "ENABLE_QUICK_CAPTURE_WINDOW", false, "Use window to host quick capture");
-
- public static final BooleanFlag FORCE_LOCAL_OVERSCROLL_PLUGIN = getDebugFlag(
- "FORCE_LOCAL_OVERSCROLL_PLUGIN", false,
- "Use a launcher-provided OverscrollPlugin if available");
-
public static final BooleanFlag ASSISTANT_GIVES_LAUNCHER_FOCUS = getDebugFlag(
"ASSISTANT_GIVES_LAUNCHER_FOCUS", false,
"Allow Launcher to handle nav bar gestures while Assistant is running over it");
diff --git a/src/com/android/launcher3/model/BaseLoaderResults.java b/src/com/android/launcher3/model/BaseLoaderResults.java
index 3cae1e1e53..d270cc56a1 100644
--- a/src/com/android/launcher3/model/BaseLoaderResults.java
+++ b/src/com/android/launcher3/model/BaseLoaderResults.java
@@ -177,7 +177,9 @@ public abstract class BaseLoaderResults {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NULL_INT_SET, "bind (1) currentScreenIds: "
+ currentScreenIds
- + ", mCallBacks: "
+ + ", pointer: "
+ + mCallbacks
+ + ", name: "
+ mCallbacks.getClass().getName());
}
filterCurrentWorkspaceItems(currentScreenIds, mWorkspaceItems, currentWorkspaceItems,
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index 5f8a4d4f3c..61d488c91b 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -21,7 +21,6 @@ import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;
-import static com.android.launcher3.config.FeatureFlags.UNSTABLE_SPRINGS;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAPPS;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW;
@@ -217,7 +216,7 @@ public abstract class AbstractStateChangeTouchController
mFlingBlockCheck.blockFling();
}
}
- if (mToState == LauncherState.ALL_APPS && !UNSTABLE_SPRINGS.get()) {
+ if (mToState == LauncherState.ALL_APPS) {
mAllAppsOvershootStarted = true;
// 1f, value when all apps container hit the top
mLauncher.getAppsView().onPull(progress - 1f, progress - 1f);
@@ -333,7 +332,7 @@ public abstract class AbstractStateChangeTouchController
anim.setFloatValues(startProgress, endProgress);
updateSwipeCompleteAnimation(anim, duration, targetState, velocity, fling);
mCurrentAnimation.dispatchOnStart();
- if (targetState == LauncherState.ALL_APPS && !UNSTABLE_SPRINGS.get()) {
+ if (targetState == LauncherState.ALL_APPS) {
if (mAllAppsOvershootStarted) {
mLauncher.getAppsView().onRelease();
mAllAppsOvershootStarted = false;
diff --git a/src/com/android/launcher3/views/BubbleTextHolder.java b/src/com/android/launcher3/views/BubbleTextHolder.java
index 78aac06b72..42701c6c3d 100644
--- a/src/com/android/launcher3/views/BubbleTextHolder.java
+++ b/src/com/android/launcher3/views/BubbleTextHolder.java
@@ -16,12 +16,14 @@
package com.android.launcher3.views;
import com.android.launcher3.BubbleTextView;
+import com.android.launcher3.icons.IconCache;
import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.model.data.ItemInfoWithIcon;
/**
* Views that contain {@link BubbleTextView} should implement this interface.
*/
-public interface BubbleTextHolder {
+public interface BubbleTextHolder extends IconCache.ItemInfoUpdateReceiver {
BubbleTextView getBubbleText();
/**
@@ -29,6 +31,6 @@ public interface BubbleTextHolder {
*
* @param itemInfo the new itemInfo
*/
- default void onItemInfoChanged(ItemInfo itemInfo) {
- }
+ @Override
+ default void reapplyItemInfo(ItemInfoWithIcon itemInfo){};
}
diff --git a/src_plugins/com/android/systemui/plugins/OverscrollPlugin.java b/src_plugins/com/android/systemui/plugins/OverscrollPlugin.java
deleted file mode 100644
index a434d078bc..0000000000
--- a/src_plugins/com/android/systemui/plugins/OverscrollPlugin.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.systemui.plugins;
-
-import android.view.MotionEvent;
-
-import com.android.systemui.plugins.annotations.ProvidesInterface;
-
-/**
- * Implement this interface to receive a callback when the user swipes right
- * to left on the gesture area. It won't fire if the user has quick switched to a previous app
- * (swiped right) and the current app isn't yet the active one (i.e., if swiping left would take
- * the user to a more recent app).
- */
-@ProvidesInterface(action = com.android.systemui.plugins.OverscrollPlugin.ACTION,
- version = com.android.systemui.plugins.OverscrollPlugin.VERSION)
-public interface OverscrollPlugin extends Plugin {
-
- String ACTION = "com.android.systemui.action.PLUGIN_LAUNCHER_OVERSCROLL";
- int VERSION = 4;
-
- String DEVICE_STATE_LOCKED = "Locked";
- String DEVICE_STATE_LAUNCHER = "Launcher";
- String DEVICE_STATE_APP = "App";
- String DEVICE_STATE_UNKNOWN = "Unknown";
-
- /**
- * @return true if the plugin is active and will accept overscroll gestures
- */
- boolean isActive();
-
- /**
- * Called when a touch has been recognized as an overscroll gesture.
- * @param horizontalDistancePx Horizontal distance from the last finger location to the finger
- * location when it first touched the screen.
- * @param verticalDistancePx Horizontal distance from the last finger location to the finger
- * location when it first touched the screen.
- * @param thresholdPx Minimum distance for gesture.
- * @param flingDistanceThresholdPx Minimum distance for gesture by fling.
- * @param flingVelocityThresholdPx Minimum velocity for gesture by fling.
- * @param deviceState String representing the current device state
- * @param underlyingActivity String representing the currently active Activity
- */
- void onTouchEvent(MotionEvent event,
- int horizontalDistancePx,
- int verticalDistancePx,
- int thresholdPx,
- int flingDistanceThresholdPx,
- int flingVelocityThresholdPx,
- String deviceState,
- String underlyingActivity);
-
- /**
- * @return `true` if overscroll gesture handling should override all other gestures.
- */
- boolean blockOtherGestures();
-
- /**
- * @return `true` if the overscroll gesture can pan the underlying app.
- */
- boolean allowsUnderlyingActivityOverscroll();
-}
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 0ffbeeb95e..da6551cce0 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -288,13 +288,14 @@ public abstract class AbstractLauncherUiTest {
}
/**
- * Removes all icons from homescreen and hotseat.
+ * Removes all items from workspace and populate default hotseat.
*/
- public void clearHomescreen() throws Throwable {
+ public void clearWorkspace() {
+ // First clear data to ensure hotseat is populated.
+ clearLauncherData();
+ // Next make provider call to clear everything apart from hotseat.
LauncherSettings.Settings.call(mTargetContext.getContentResolver(),
- LauncherSettings.Settings.METHOD_CREATE_EMPTY_DB);
- LauncherSettings.Settings.call(mTargetContext.getContentResolver(),
- LauncherSettings.Settings.METHOD_CLEAR_EMPTY_DB_FLAG);
+ LauncherSettings.Settings.METHOD_CLEAR_WORKSPACE);
resetLoaderState();
}
diff --git a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java
index 5ea5d6588a..34dddf5c11 100644
--- a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java
@@ -85,7 +85,7 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest {
* @param acceptConfig accept the config activity
*/
private void runTest(boolean acceptConfig) throws Throwable {
- clearHomescreen();
+ clearWorkspace();
mDevice.pressHome();
final Widgets widgets = mLauncher.getWorkspace().openAllWidgets();
diff --git a/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java
index dad4f2b045..3696755eb4 100644
--- a/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java
@@ -47,7 +47,7 @@ public class AddWidgetTest extends AbstractLauncherUiTest {
@Test
@PortraitLandscape
public void testDragIcon() throws Throwable {
- clearHomescreen();
+ clearWorkspace();
mDevice.pressHome();
final LauncherAppWidgetProviderInfo widgetInfo =
@@ -81,7 +81,7 @@ public class AddWidgetTest extends AbstractLauncherUiTest {
@Test
@PortraitLandscape
public void testDragCustomShortcut() throws Throwable {
- clearHomescreen();
+ clearWorkspace();
mDevice.pressHome();
mLauncher.getWorkspace().openAllWidgets()
.getWidget("com.android.launcher3.testcomponent.CustomShortcutConfigActivity")
diff --git a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
index ccbb662055..270c2ec432 100644
--- a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
@@ -125,7 +125,7 @@ public class RequestPinItemTest extends AbstractLauncherUiTest {
private void runTest(String activityMethod, boolean isWidget, ItemOperator itemMatcher,
Intent... commandIntents) throws Throwable {
- clearHomescreen();
+ clearWorkspace();
mDevice.pressHome();
// Open Pin item activity