Loading quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +11 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.allapps.FloatingHeaderRow; import com.android.launcher3.allapps.FloatingHeaderView; import com.android.launcher3.anim.AlphaUpdateListener; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.keyboard.FocusIndicatorHelper; import com.android.launcher3.keyboard.FocusIndicatorHelper.SimpleFocusIndicatorHelper; import com.android.launcher3.model.data.ItemInfo; Loading Loading @@ -105,12 +106,22 @@ public class PredictionRowView<T extends Context & ActivityContext> mActivityContext.getAppsView().getAppsStore().unregisterIconContainer(this); } } // Set the predicted row in All Apps' text line to 1. if (FeatureFlags.ENABLE_TWOLINE_ALLAPPS.get() || FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get()) { for (int i = 0; i < getChildCount(); i++) { BubbleTextView icon = (BubbleTextView) getChildAt(i); icon.setMaxLines(1); } } } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(getExpectedHeight(), MeasureSpec.EXACTLY)); updateVisibility(); } @Override Loading src/com/android/launcher3/BubbleTextView.java +11 −4 Original line number Diff line number Diff line Loading @@ -398,6 +398,15 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, || mDisplay == DISPLAY_TASKBAR; } /** * Only if actual text can be displayed in two line, the {@code true} value will be effective. */ protected boolean shouldUseTwoLine() { return (FeatureFlags.ENABLE_TWOLINE_ALLAPPS.get() && mDisplay == DISPLAY_ALL_APPS) || (FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get() && mDisplay == DISPLAY_SEARCH_RESULT); } @UiThread @VisibleForTesting public void applyLabel(ItemInfoWithIcon info) { Loading Loading @@ -667,10 +676,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, setPadding(getPaddingLeft(), (height - cellHeightPx) / 2, getPaddingRight(), getPaddingBottom()); } // only apply two line for all_apps if (((FeatureFlags.ENABLE_TWOLINE_ALLAPPS.get() && mDisplay == DISPLAY_ALL_APPS) || (FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get() && mDisplay == DISPLAY_SEARCH_RESULT)) && (mLastOriginalText != null)) { // Only apply two line for all_apps and device search only if necessary. if (shouldUseTwoLine() && (mLastOriginalText != null)) { CharSequence modifiedString = modifyTitleToSupportMultiLine( MeasureSpec.getSize(widthMeasureSpec) - getCompoundPaddingLeft() - getCompoundPaddingRight(), Loading Loading
quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +11 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.allapps.FloatingHeaderRow; import com.android.launcher3.allapps.FloatingHeaderView; import com.android.launcher3.anim.AlphaUpdateListener; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.keyboard.FocusIndicatorHelper; import com.android.launcher3.keyboard.FocusIndicatorHelper.SimpleFocusIndicatorHelper; import com.android.launcher3.model.data.ItemInfo; Loading Loading @@ -105,12 +106,22 @@ public class PredictionRowView<T extends Context & ActivityContext> mActivityContext.getAppsView().getAppsStore().unregisterIconContainer(this); } } // Set the predicted row in All Apps' text line to 1. if (FeatureFlags.ENABLE_TWOLINE_ALLAPPS.get() || FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get()) { for (int i = 0; i < getChildCount(); i++) { BubbleTextView icon = (BubbleTextView) getChildAt(i); icon.setMaxLines(1); } } } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(getExpectedHeight(), MeasureSpec.EXACTLY)); updateVisibility(); } @Override Loading
src/com/android/launcher3/BubbleTextView.java +11 −4 Original line number Diff line number Diff line Loading @@ -398,6 +398,15 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, || mDisplay == DISPLAY_TASKBAR; } /** * Only if actual text can be displayed in two line, the {@code true} value will be effective. */ protected boolean shouldUseTwoLine() { return (FeatureFlags.ENABLE_TWOLINE_ALLAPPS.get() && mDisplay == DISPLAY_ALL_APPS) || (FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get() && mDisplay == DISPLAY_SEARCH_RESULT); } @UiThread @VisibleForTesting public void applyLabel(ItemInfoWithIcon info) { Loading Loading @@ -667,10 +676,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, setPadding(getPaddingLeft(), (height - cellHeightPx) / 2, getPaddingRight(), getPaddingBottom()); } // only apply two line for all_apps if (((FeatureFlags.ENABLE_TWOLINE_ALLAPPS.get() && mDisplay == DISPLAY_ALL_APPS) || (FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get() && mDisplay == DISPLAY_SEARCH_RESULT)) && (mLastOriginalText != null)) { // Only apply two line for all_apps and device search only if necessary. if (shouldUseTwoLine() && (mLastOriginalText != null)) { CharSequence modifiedString = modifyTitleToSupportMultiLine( MeasureSpec.getSize(widthMeasureSpec) - getCompoundPaddingLeft() - getCompoundPaddingRight(), Loading