diff --git a/quickstep/src/com/android/launcher3/model/AppEventProducer.java b/quickstep/src/com/android/launcher3/model/AppEventProducer.java index 1305bbc7b2..7c29c5b4c6 100644 --- a/quickstep/src/com/android/launcher3/model/AppEventProducer.java +++ b/quickstep/src/com/android/launcher3/model/AppEventProducer.java @@ -271,9 +271,6 @@ public class AppEventProducer implements StatsLogConsumer { case ALL_APPS_CONTAINER: { return "all-apps"; } - case SEARCH_RESULT_CONTAINER: { - return "search-results"; - } case PREDICTED_HOTSEAT_CONTAINER: { return "predictions/hotseat"; } @@ -293,6 +290,16 @@ public class AppEventProducer implements StatsLogConsumer { } return "folder"; } + case SEARCH_RESULT_CONTAINER: + return "search-results"; + case EXTENDED_CONTAINERS: { + switch(ci.getExtendedContainers().getContainerCase()) { + case DEVICE_SEARCH_RESULT_CONTAINER: + case CORRECTED_DEVICE_SEARCH_RESULT_CONTAINER: + return "search-results"; + } + } + default: // fall out } return ""; } diff --git a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java index 7794d27d26..e82c900734 100644 --- a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java +++ b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java @@ -329,6 +329,8 @@ public class QuickstepModelDelegate extends ModelDelegate { } if (state.predictor != null) { state.predictor.notifyAppTargetEvent(event); + Log.d(TAG, "notifyAppTargetEvent action=" + event.getAction() + + " launchLocation=" + event.getLaunchLocation()); } } diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index f9b749ee14..e15aa92cf1 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -322,11 +322,11 @@ public abstract class BaseActivityInterface callback) { mSecondTask = taskView; - launchTasks(mInitialTask, mSecondTask, mStagePosition, callback); + launchTasks(mInitialTask, mSecondTask, mStagePosition, callback, + false /* freezeTaskList */); } /** * @param stagePosition representing location of task1 */ public void launchTasks(Task task1, Task task2, @StagePosition int stagePosition, - Consumer callback) { + Consumer callback, boolean freezeTaskList) { // Assume initial task is for top/left part of screen final int[] taskIds = stagePosition == STAGE_POSITION_TOP_OR_LEFT ? new int[]{task1.key.id, task2.key.id} @@ -105,8 +108,13 @@ public class SplitSelectStateController { 300, 150, ActivityThread.currentActivityThread().getApplicationThread()); - mSystemUiProxy.startTasksWithLegacyTransition(taskIds[0], null /* mainOptions */, - taskIds[1], null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT, adapter); + ActivityOptions mainOpts = ActivityOptions.makeBasic(); + if (freezeTaskList) { + mainOpts.setFreezeRecentTasksReordering(); + } + mSystemUiProxy.startTasksWithLegacyTransition(taskIds[0], mainOpts.toBundle(), + taskIds[1], null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT, + adapter); } } diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index 280b5d76b7..146d2355f1 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -101,6 +101,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { private int mOrientationStateId; private StagedSplitBounds mStagedSplitBounds; private boolean mDrawsBelowRecents; + private boolean mIsGridTask; public TaskViewSimulator(Context context, BaseActivityInterface sizeStrategy) { mContext = context; @@ -140,18 +141,23 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { if (mDp == null) { return 1; } - Rect fullTaskSize = new Rect(); - mSizeStrategy.calculateTaskSize(mContext, mDp, fullTaskSize); + if (mIsGridTask) { + mSizeStrategy.calculateGridTaskSize(mContext, mDp, mTaskRect, + mOrientationState.getOrientationHandler()); + } else { + mSizeStrategy.calculateTaskSize(mContext, mDp, mTaskRect); + } + Rect fullTaskSize; if (mStagedSplitBounds != null) { // The task rect changes according to the staged split task sizes, but recents // fullscreen scale and pivot remains the same since the task fits into the existing // sized task space bounds - mSizeStrategy.calculateTaskSize(mContext, mDp, mTaskRect); + fullTaskSize = new Rect(mTaskRect); mOrientationState.getOrientationHandler() .setSplitTaskSwipeRect(mDp, mTaskRect, mStagedSplitBounds, mStagePosition); } else { - mTaskRect.set(fullTaskSize); + fullTaskSize = mTaskRect; } return mOrientationState.getFullScreenScaleAndPivot(fullTaskSize, mDp, mPivot); } @@ -204,6 +210,13 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mDrawsBelowRecents = drawsBelowRecents; } + /** + * Sets whether the task is part of overview grid and not being focused. + */ + public void setIsGridTask(boolean isGridTask) { + mIsGridTask = isGridTask; + } + /** * Adds animation for all the components corresponding to transition from an app to overview. */ diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java index 5a86464498..e2ffa18315 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java @@ -15,6 +15,8 @@ import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageView; +import androidx.annotation.Nullable; + import com.android.launcher3.InsettableFrameLayout; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAnimUtils; @@ -51,11 +53,11 @@ public class FloatingTaskView extends FrameLayout { this(context, null); } - public FloatingTaskView(Context context, AttributeSet attrs) { + public FloatingTaskView(Context context, @Nullable AttributeSet attrs) { this(context, attrs, 0); } - public FloatingTaskView(Context context, AttributeSet attrs, int defStyleAttr) { + public FloatingTaskView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mLauncher = Launcher.getLauncher(context); mIsRtl = Utilities.isRtl(getResources()); diff --git a/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java b/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java index 88b11a0884..463ed4bd9c 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java @@ -30,6 +30,8 @@ import android.view.ViewGroup; import android.view.ViewTreeObserver.OnGlobalLayoutListener; import android.widget.FrameLayout; +import androidx.annotation.Nullable; + import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.Utilities; @@ -68,11 +70,11 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, this(context, null); } - public FloatingWidgetView(Context context, AttributeSet attrs) { + public FloatingWidgetView(Context context, @Nullable AttributeSet attrs) { this(context, attrs, 0); } - public FloatingWidgetView(Context context, AttributeSet attrs, int defStyleAttr) { + public FloatingWidgetView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mLauncher = Launcher.getLauncher(context); mListenerView = new ListenerView(context, attrs); diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java index eace227c5c..ebc6cc4b0f 100644 --- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java +++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java @@ -14,7 +14,6 @@ import androidx.annotation.Nullable; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.util.RunnableList; -import com.android.launcher3.util.SplitConfigurationOptions; import com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds; import com.android.launcher3.util.TransformingTouchDelegate; import com.android.quickstep.RecentsModel; @@ -157,14 +156,15 @@ public class GroupedTaskView extends TaskView { @Override public RunnableList launchTaskAnimated() { getRecentsView().getSplitPlaceholder().launchTasks(mTask, mSecondaryTask, - STAGE_POSITION_TOP_OR_LEFT, null /*callback*/); + STAGE_POSITION_TOP_OR_LEFT, null /*callback*/, + false /* freezeTaskList */); return null; } @Override public void launchTask(@NonNull Consumer callback, boolean freezeTaskList) { getRecentsView().getSplitPlaceholder().launchTasks(mTask, mSecondaryTask, - STAGE_POSITION_TOP_OR_LEFT, callback); + STAGE_POSITION_TOP_OR_LEFT, callback, freezeTaskList); } @Override @@ -241,4 +241,10 @@ public class GroupedTaskView extends TaskView { taskIconHeight, mPrimaryTempRect, mSecondaryTempRect, isRtl, deviceProfile, mSplitBoundsConfig); } + + @Override + protected void updateSnapshotRadius() { + super.updateSnapshotRadius(); + mSnapshotView2.setFullscreenParams(mCurrentFullscreenParams); + } } diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java index 715d30e4af..5d6b6563f7 100644 --- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java +++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java @@ -30,6 +30,8 @@ import android.util.AttributeSet; import android.view.MotionEvent; import android.view.Surface; +import androidx.annotation.Nullable; + import com.android.launcher3.BaseQuickstepLauncher; import com.android.launcher3.LauncherState; import com.android.launcher3.statehandlers.DepthController; @@ -49,11 +51,11 @@ public class LauncherRecentsView extends RecentsView + + + diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 2cf929f6dd..78f3f11aea 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -104,8 +104,9 @@ 2dp 128dp 150dp - 8dp + 6dp + 2dp 2dp diff --git a/res/values/strings.xml b/res/values/strings.xml index e215c20311..5f53d4e24a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -40,9 +40,9 @@ Split screen - Pin to top - Pin to left - Pin to right + Split top + Split left + Split right diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java index f089551588..d5c9a53f12 100644 --- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java +++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java @@ -41,6 +41,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.BubbleTextView; import com.android.launcher3.R; +import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.model.data.AppInfo; import com.android.launcher3.model.data.ItemInfoWithIcon; import com.android.launcher3.util.PackageManagerHelper; @@ -273,6 +274,8 @@ public class AllAppsGridAdapter extends // The intent to send off to the market app, updated each time the search query changes. private Intent mMarketSearchIntent; + private final int mExtraHeight; + public AllAppsGridAdapter(BaseDraggingActivity launcher, LayoutInflater inflater, AlphabeticalAppsList apps, BaseAdapterProvider[] adapterProviders) { Resources res = launcher.getResources(); @@ -288,6 +291,7 @@ public class AllAppsGridAdapter extends mAdapterProviders = adapterProviders; setAppsPerRow(mLauncher.getDeviceProfile().numShownAllAppsColumns); + mExtraHeight = launcher.getResources().getDimensionPixelSize(R.dimen.all_apps_height_extra); } public void setAppsPerRow(int appsPerRow) { @@ -347,14 +351,19 @@ public class AllAppsGridAdapter extends public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { switch (viewType) { case VIEW_TYPE_ICON: + int layout = !FeatureFlags.ENABLE_TWOLINE_ALLAPPS.get() ? R.layout.all_apps_icon + : R.layout.all_apps_icon_twoline; BubbleTextView icon = (BubbleTextView) mLayoutInflater.inflate( - R.layout.all_apps_icon, parent, false); + layout, parent, false); icon.setLongPressTimeoutFactor(1f); icon.setOnFocusChangeListener(mIconFocusListener); icon.setOnClickListener(mOnIconClickListener); icon.setOnLongClickListener(mOnIconLongClickListener); // Ensure the all apps icon height matches the workspace icons in portrait mode. icon.getLayoutParams().height = mLauncher.getDeviceProfile().allAppsCellHeightPx; + if (FeatureFlags.ENABLE_TWOLINE_ALLAPPS.get()) { + icon.getLayoutParams().height += mExtraHeight; + } return new ViewHolder(icon); case VIEW_TYPE_EMPTY_SEARCH: return new ViewHolder(mLayoutInflater.inflate(R.layout.all_apps_empty_search, diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index d3629947c8..e24ea6623f 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -94,6 +94,9 @@ public final class FeatureFlags { public static final BooleanFlag ENABLE_ONE_SEARCH = new DeviceFlag("ENABLE_ONE_SEARCH", false, "Use homescreen search box to complete allApps searches"); + public static final BooleanFlag ENABLE_TWOLINE_ALLAPPS = getDebugFlag( + "ENABLE_TWOLINE_ALLAPPS", false, "Enables two line label inside all apps."); + public static final BooleanFlag ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING = new DeviceFlag( "ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING", true, "Allows on device search in all apps logging"); diff --git a/src_plugins/com/android/systemui/plugins/OneSearch.java b/src_plugins/com/android/systemui/plugins/OneSearch.java index 29826c39e3..13a956bd80 100644 --- a/src_plugins/com/android/systemui/plugins/OneSearch.java +++ b/src_plugins/com/android/systemui/plugins/OneSearch.java @@ -28,7 +28,7 @@ import java.util.ArrayList; @ProvidesInterface(action = OneSearch.ACTION, version = OneSearch.VERSION) public interface OneSearch extends Plugin { String ACTION = "com.android.systemui.action.PLUGIN_ONE_SEARCH"; - int VERSION = 4; + int VERSION = 5; /** * Get the content provider warmed up. @@ -37,10 +37,18 @@ public interface OneSearch extends Plugin { /** * Get the suggest search target list for the query. + * * @param query The query to get the search suggests for. */ ArrayList getSuggests(Parcelable query); /** Get image bitmap with the URL. */ Parcelable getImageBitmap(String imageUrl); + + /** + * Notifies search events to plugin + * + * @param event the SearchTargetEvent event created due to user action + */ + void notifyEvent(Parcelable event); }