Initial Taskbar drag-n-drop support for search results.

- Includes initial support for obtaining PendingIntent for ITEM_TYPE_SEARCH_ACTION.
- Custom pre-drag conditions for search results can be provided through TaskbarSearchSessionController.
- Added detection for telling when DragView shift animation ends for
  pre-drag condition usage.

Test: Manual
Bug: 289261756
Flag: ENABLE_ALL_APPS_SEARCH_IN_TASKBAR
Change-Id: I52510a6f3ee49968134ecb591ef7c4df711b9d3d
This commit is contained in:
Brian Isganitis
2023-07-10 16:51:48 -04:00
parent 19c22c20b2
commit 3346e19b3b
5 changed files with 99 additions and 23 deletions
@@ -15,11 +15,14 @@
*/
package com.android.launcher3.taskbar.allapps;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.R;
import com.android.launcher3.appprediction.PredictionRowView;
import com.android.launcher3.dragndrop.DragOptions.PreDragCondition;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.taskbar.TaskbarControllers;
@@ -208,4 +211,12 @@ public final class TaskbarAllAppsController {
// Allow null-pointer since this should only be null if the apps view is not showing.
return mAppsView.getActiveRecyclerView().computeVerticalScrollOffset();
}
/** @see TaskbarSearchSessionController#createPreDragConditionForSearch(View) */
@Nullable
public PreDragCondition createPreDragConditionForSearch(View view) {
return mSearchSessionController != null
? mSearchSessionController.createPreDragConditionForSearch(view)
: null;
}
}