Snap for 10850711 from 096466ef30 to udc-qpr1-release

Change-Id: I02b191ab1c206c505239e3254f693ca0cd9d0120
This commit is contained in:
Android Build Coastguard Worker committed 2023-09-23 01:23:39 +00:00
commit a2eb1edb18
6 files changed
+50 -22

No files matched your search

@@ -16,8 +16,6 @@
package com.android.launcher3.appprediction;
import static com.android.launcher3.BubbleTextView.DISPLAY_PREDICTION_ROW;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
@@ -189,7 +187,7 @@ public class PredictionRowView<T extends Context & ActivityContext>
LayoutInflater inflater = mActivityContext.getAppsView().getLayoutInflater();
while (getChildCount() < mNumPredictedAppsPerRow) {
BubbleTextView icon = (BubbleTextView) inflater.inflate(
R.layout.all_apps_icon, this, false);
R.layout.all_apps_prediction_row_icon, this, false);
icon.setOnClickListener(mActivityContext.getItemOnClickListener());
icon.setOnLongClickListener(mActivityContext.getAllAppsItemLongClickListener());
icon.setLongPressTimeoutFactor(1f);
@@ -211,7 +209,6 @@ public class PredictionRowView<T extends Context & ActivityContext>
icon.reset();
if (predictionCount > i) {
icon.setVisibility(View.VISIBLE);
icon.setDisplay(DISPLAY_PREDICTION_ROW);
icon.applyFromWorkspaceItem(mPredictedApps.get(i));
} else {
icon.setVisibility(predictionCount == 0 ? GONE : INVISIBLE);
@@ -198,24 +198,24 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
}
val imeInsetsSize = getInsetsForGravity(taskbarHeightForIme, gravity)
// When in gesture nav, report the stashed height to the IME, to allow hiding the
// IME navigation bar.
val imeInsetsSize = if (ENABLE_HIDE_IME_CAPTION_BAR && context.isGestureNav) {
getInsetsForGravity(controllers.taskbarStashController.stashedHeight, gravity);
} else {
getInsetsForGravity(taskbarHeightForIme, gravity)
}
val imeInsetsSizeOverride =
if (!ENABLE_HIDE_IME_CAPTION_BAR) {
arrayOf(
InsetsFrameProvider.InsetsSizeOverride(
TYPE_INPUT_METHOD,
imeInsetsSize
),
)
} else {
arrayOf()
}
arrayOf(
InsetsFrameProvider.InsetsSizeOverride(TYPE_INPUT_METHOD, imeInsetsSize),
)
// Use 0 tappableElement insets for the VoiceInteractionWindow when gesture nav is enabled.
val visInsetsSizeForTappableElement =
if (context.isGestureNav) getInsetsForGravity(0, gravity)
else getInsetsForGravity(tappableHeight, gravity)
val insetsSizeOverrideForTappableElement =
imeInsetsSizeOverride + arrayOf(
arrayOf(
InsetsFrameProvider.InsetsSizeOverride(TYPE_INPUT_METHOD, imeInsetsSize),
InsetsFrameProvider.InsetsSizeOverride(
TYPE_VOICE_INTERACTION,
visInsetsSizeForTappableElement
@@ -224,7 +224,7 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
if ((context.isGestureNav || TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW)
&& provider.type == tappableElement()) {
provider.insetsSizeOverrides = insetsSizeOverrideForTappableElement
} else if (provider.type != systemGestures() && imeInsetsSizeOverride.isNotEmpty()) {
} else if (provider.type != systemGestures()) {
// We only override insets at the bottom of the screen
provider.insetsSizeOverrides = imeInsetsSizeOverride
}
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2023 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<com.android.launcher3.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res-auto"
style="@style/BaseIcon.AllApps"
android:id="@+id/icon"
launcher:iconDisplay="prediction_row"
launcher:centerVertically="true" />
+1
View File
@@ -86,6 +86,7 @@
<enum name="search_result_tall" value="6" />
<enum name="search_result_small" value="7" />
<enum name="prediction_row" value="8" />
<enum name="search_result_app_row" value="9" />
</attr>
<attr name="centerVertically" format="boolean" />
</declare-styleable>
+11 -4
View File
@@ -99,8 +99,9 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
private static final int DISPLAY_FOLDER = 2;
protected static final int DISPLAY_TASKBAR = 5;
public static final int DISPLAY_SEARCH_RESULT = 6;
private static final int DISPLAY_SEARCH_RESULT_SMALL = 7;
public static final int DISPLAY_SEARCH_RESULT_SMALL = 7;
public static final int DISPLAY_PREDICTION_ROW = 8;
public static final int DISPLAY_SEARCH_RESULT_APP_ROW = 9;
private static final float MIN_LETTER_SPACING = -0.05f;
private static final int MAX_SEARCH_LOOP_COUNT = 20;
@@ -214,7 +215,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
setCompoundDrawablePadding(grid.iconDrawablePaddingPx);
defaultIconSize = grid.iconSizePx;
setCenterVertically(grid.iconCenterVertically);
} else if (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW) {
} else if (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW
|| mDisplay == DISPLAY_SEARCH_RESULT_APP_ROW) {
setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.allAppsIconTextSizePx);
setCompoundDrawablePadding(grid.allAppsIconDrawablePaddingPx);
defaultIconSize = grid.allAppsIconSizePx;
@@ -1104,8 +1106,13 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
}
public boolean isDisplaySearchResult() {
return mDisplay == DISPLAY_SEARCH_RESULT ||
mDisplay == DISPLAY_SEARCH_RESULT_SMALL;
return mDisplay == DISPLAY_SEARCH_RESULT
|| mDisplay == DISPLAY_SEARCH_RESULT_SMALL
|| mDisplay == DISPLAY_SEARCH_RESULT_APP_ROW;
}
public int getIconDisplay() {
return mDisplay;
}
@Override
@@ -16,6 +16,8 @@
package com.android.launcher3.graphics;
import static com.android.launcher3.BubbleTextView.DISPLAY_SEARCH_RESULT_APP_ROW;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@@ -100,7 +102,8 @@ public class DragPreviewProvider {
height = mView.getHeight();
}
if (mView instanceof BubbleTextView) {
if (mView instanceof BubbleTextView btv
&& btv.getIconDisplay() == DISPLAY_SEARCH_RESULT_APP_ROW) {
FastBitmapDrawable icon = ((BubbleTextView) mView).getIcon();
Drawable drawable = icon.getConstantState().newDrawable();
float xInset = (float) blurSizeOutline / (float) (width + blurSizeOutline);