From 2174b0ad2e09e341fe275ec9e9415bd1c26b7288 Mon Sep 17 00:00:00 2001 From: helencheuk Date: Tue, 2 Jan 2024 23:20:09 +0000 Subject: [PATCH] Update BubbleTextView height to match parent so focus outline drawn could be fully displayed Design doc: go/launcher-focus-outline Before: BubbleTextView height is larger than its parent, outline is cropped https://screenshot.googleplex.com/dYXjWAHS4VzPQdJ After: BubbleTextView has the same height as its parent Prediction Row, outline is fully shown https://screenshot.googleplex.com/3eMxPwxiHs9JTTq Bug: 310953377 Test: Manual Flag: ACONFIG com.android.launcher3.enable_focus_outline Development Change-Id: I7bfa4da3b67b4a4abc4dfe9df560dda8d7e9b1bd --- .../launcher3/appprediction/PredictionRowView.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java index 1440498e15..ea1d286ee3 100644 --- a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +++ b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java @@ -23,6 +23,7 @@ import android.os.Build; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.widget.LinearLayout; import androidx.annotation.NonNull; @@ -31,6 +32,7 @@ import androidx.annotation.Nullable; import com.android.launcher3.BubbleTextView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener; +import com.android.launcher3.Flags; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.allapps.FloatingHeaderRow; @@ -199,8 +201,12 @@ public class PredictionRowView icon.setOnFocusChangeListener(mFocusHelper); LayoutParams lp = (LayoutParams) icon.getLayoutParams(); - // Ensure the all apps icon height matches the workspace icons in portrait mode. - lp.height = mActivityContext.getDeviceProfile().allAppsCellHeightPx; + if (Flags.enableFocusOutline()) { + lp.height = ViewGroup.LayoutParams.MATCH_PARENT; + } else { + // Ensure the all apps icon height matches the workspace icons in portrait mode. + lp.height = mActivityContext.getDeviceProfile().allAppsCellHeightPx; + } lp.width = 0; lp.weight = 1; addView(icon);