import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.graphics.TintedDrawableSpan;
import com.android.launcher3.keyboard.FocusedItemDecorator;
+import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.util.ComponentKey;
import java.nio.charset.Charset;
*/
public void addApps(List<AppInfo> apps) {
mApps.addApps(apps);
+ mSearchBarController.refreshSearchResult();
}
/**
*/
public void updateApps(List<AppInfo> apps) {
mApps.updateApps(apps);
+ mSearchBarController.refreshSearchResult();
}
/**
*/
public void removeApps(List<AppInfo> apps) {
mApps.removeApps(apps);
+ mSearchBarController.refreshSearchResult();
}
public void setSearchBarVisible(boolean visible) {
/**
* Returns whether the view itself will handle the touch event or not.
*/
- public boolean shouldContainerScroll(float x, float y) {
+ public boolean shouldContainerScroll(MotionEvent ev) {
int[] point = new int[2];
- point[0] = (int) x;
- point[1] = (int) y;
+ point[0] = (int) ev.getX();
+ point[1] = (int) ev.getY();
Utilities.mapCoordInSelfToDescendent(mAppsRecyclerView, this, point);
- // if the MotionEvent is inside the thumb, container should not be pulled down.
+ // IF the MotionEvent is inside the search box, and the container keeps on receiving
+ // touch input, container should move down.
+ if (mLauncher.getDragLayer().isEventOverView(mSearchContainer, ev)) {
+ return true;
+ }
+
+ // IF the MotionEvent is inside the thumb, container should not be pulled down.
if (mAppsRecyclerView.getScrollBar().isNearThumb(point[0], point[1])) {
return false;
}
+
+ // IF a shortcuts container is open, container should not be pulled down.
+ if (mLauncher.getOpenShortcutsContainer() != null) {
+ return false;
+ }
+
// IF scroller is at the very top OR there is no scroll bar because there is probably not
// enough items to scroll, THEN it's okay for the container to be pulled down.
if (mAppsRecyclerView.getScrollBar().getThumbOffset().y <= 0) {
mAppsRecyclerView.preMeasureViews(mAdapter);
mAdapter.setIconFocusListener(focusedItemDecorator.getFocusListener());
- // TODO(hyunyoungs): clean up setting the content and the reveal view.
if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) {
getRevealView().setVisibility(View.VISIBLE);
+ getContentView().setVisibility(View.VISIBLE);
+ getContentView().setBackground(null);
}
}
MarginLayoutParams mlp = (MarginLayoutParams) mAppsRecyclerView.getLayoutParams();
Rect insets = mLauncher.getDragLayer().getInsets();
- getContentView().setPadding(0, 0, 0, insets.bottom);
+ getContentView().setPadding(0, 0, 0, 0);
int height = insets.top + grid.hotseatCellHeightPx;
mlp.topMargin = height;
if (!mLauncher.isDraggingEnabled()) return false;
// Start the drag
- mLauncher.getWorkspace().beginDragShared(v, this, false);
+ mLauncher.getWorkspace().beginDragShared(v, this, new DragOptions());
// Enter spring loaded mode
mLauncher.enterSpringLoadedDragMode();
mSearchQueryBuilder.clearSpans();
Selection.setSelection(mSearchQueryBuilder, 0);
}
+
+ @Override
+ public void fillInLaunchSourceData(View v, ItemInfo info, Target target, Target targetParent) {
+ targetParent.containerType = mAppsRecyclerView.getContainerType(v);
+ }
}