From a22574aa66ef8e122d2d332d60acfe9e0320d160 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Thu, 18 Mar 2021 22:37:33 -0700 Subject: [PATCH] Remove cursor when edit text no longer has focus Bug: 180142918 Test: manual Change-Id: I9a58ef605b145889e30cb42e99f0b98e16af1e46 Signed-off-by: Hyunyoung Song --- .../allapps/AllAppsRecyclerView.java | 1 + .../allapps/AllAppsSectionDecorator.java | 25 ------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java index f307a53bc0..66575eb289 100644 --- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java +++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java @@ -189,6 +189,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView { case SCROLL_STATE_DRAGGING: mgr.logger().sendToInteractionJankMonitor( LAUNCHER_ALLAPPS_VERTICAL_SWIPE_BEGIN, this); + requestFocus(); getWindowInsetsController().hide(WindowInsets.Type.ime()); break; case SCROLL_STATE_IDLE: diff --git a/src/com/android/launcher3/allapps/AllAppsSectionDecorator.java b/src/com/android/launcher3/allapps/AllAppsSectionDecorator.java index 7fcd6ec16f..0bd2f44cc9 100644 --- a/src/com/android/launcher3/allapps/AllAppsSectionDecorator.java +++ b/src/com/android/launcher3/allapps/AllAppsSectionDecorator.java @@ -22,13 +22,11 @@ import android.graphics.Path; import android.graphics.RectF; import android.view.View; -import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.graphics.ColorUtils; import androidx.recyclerview.widget.RecyclerView; import com.android.launcher3.R; -import com.android.launcher3.allapps.AllAppsGridAdapter.AppsGridLayoutManager; import com.android.launcher3.allapps.search.SearchAdapterProvider; import com.android.launcher3.allapps.search.SectionDecorationInfo; import com.android.launcher3.util.Themes; @@ -68,28 +66,6 @@ public class AllAppsSectionDecorator extends RecyclerView.ItemDecoration { } } - // Fallback logic in case non of the SearchTarget is labeled as focused item. - private void drawDecoration(@NonNull Canvas c, - @NonNull SectionDecorationHandler decorationHandler, - @NonNull RecyclerView parent) { - if (decorationHandler.mIsFullWidth) { - decorationHandler.mBounds.left = parent.getPaddingLeft(); - decorationHandler.mBounds.right = parent.getWidth() - parent.getPaddingRight(); - } - if (mAppsView.getFloatingHeaderView().getFocusedChild() == null - && mAppsView.getApps().getFocusedChild() != null) { - int index = mAppsView.getApps().getFocusedChildIndex(); - AppsGridLayoutManager layoutManager = (AppsGridLayoutManager) - mAppsView.getActiveRecyclerView().getLayoutManager(); - if (layoutManager.findFirstVisibleItemPosition() <= index - && index < parent.getChildCount()) { - RecyclerView.ViewHolder vh = parent.findViewHolderForAdapterPosition(index); - if (vh != null) decorationHandler.onFocusDraw(c, vh.itemView); - } - } - decorationHandler.reset(); - } - /** * Handles grouping and drawing of items in the same all apps sections. */ @@ -136,7 +112,6 @@ public class AllAppsSectionDecorator extends RecyclerView.ItemDecoration { */ public void onGroupDraw(Canvas canvas, View view) { if (view == null) return; - mPaint.setColor(mFillcolor); mBounds.set(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()); onDraw(canvas);