Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69aa9a07 authored by Brandon Dayauon's avatar Brandon Dayauon Committed by Android (Google) Code Review
Browse files

Merge "Disable two line text legacy flag." into main

parents 2b97a7cd 68c18236
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -138,9 +138,9 @@ public class PredictionRowView<T extends Context & ActivityContext>
        int totalHeight = iconHeight + iconPadding + textHeight + mVerticalPadding * 2;
        int totalHeight = iconHeight + iconPadding + textHeight + mVerticalPadding * 2;
        // Prediction row height will be 4dp bigger than the regular apps in A-Z list when two line
        // Prediction row height will be 4dp bigger than the regular apps in A-Z list when two line
        // is not enabled. Otherwise, the extra height will increase by just the textHeight.
        // is not enabled. Otherwise, the extra height will increase by just the textHeight.
        int extraHeight = (FeatureFlags.enableTwolineAllapps() && (!Flags.enableTwolineToggle()
        int extraHeight = (Flags.enableTwolineToggle() &&
                || (Flags.enableTwolineToggle() && LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(
                LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(getContext()))
                        getContext())))) ? textHeight : mTopRowExtraHeight;
                ? textHeight : mTopRowExtraHeight;
        totalHeight += extraHeight;
        totalHeight += extraHeight;
        return getVisibility() == GONE ? 0 : totalHeight + getPaddingTop() + getPaddingBottom();
        return getVisibility() == GONE ? 0 : totalHeight + getPaddingTop() + getPaddingBottom();
    }
    }
+4 −7
Original line number Original line Diff line number Diff line
@@ -285,9 +285,6 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
        mDotParams.scale = 0f;
        mDotParams.scale = 0f;
        mForceHideDot = false;
        mForceHideDot = false;
        setBackground(null);
        setBackground(null);
        if (FeatureFlags.enableTwolineAllapps() || FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get()) {
            setMaxLines(1);
        }


        setTag(null);
        setTag(null);
        if (mIconLoadRequest != null) {
        if (mIconLoadRequest != null) {
@@ -299,6 +296,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
        setAlpha(1);
        setAlpha(1);
        setScaleY(1);
        setScaleY(1);
        setTranslationY(0);
        setTranslationY(0);
        setMaxLines(1);
        setVisibility(VISIBLE);
        setVisibility(VISIBLE);
    }
    }


@@ -428,10 +426,9 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
     * Only if actual text can be displayed in two line, the {@code true} value will be effective.
     * Only if actual text can be displayed in two line, the {@code true} value will be effective.
     */
     */
    protected boolean shouldUseTwoLine() {
    protected boolean shouldUseTwoLine() {
        return FeatureFlags.enableTwolineAllapps() && isCurrentLanguageEnglish()
        return isCurrentLanguageEnglish() && (mDisplay == DISPLAY_ALL_APPS
                && (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW)
                || mDisplay == DISPLAY_PREDICTION_ROW) && (Flags.enableTwolineToggle()
                && (!Flags.enableTwolineToggle() || (Flags.enableTwolineToggle()
                && LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(getContext()));
                && LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(getContext())));
    }
    }


    protected boolean isCurrentLanguageEnglish() {
    protected boolean isCurrentLanguageEnglish() {
+2 −3
Original line number Original line Diff line number Diff line
@@ -1233,9 +1233,8 @@ public class DeviceProfile {
        if (isVerticalLayout && !mIsResponsiveGrid) {
        if (isVerticalLayout && !mIsResponsiveGrid) {
            hideWorkspaceLabelsIfNotEnoughSpace();
            hideWorkspaceLabelsIfNotEnoughSpace();
        }
        }
        if (FeatureFlags.enableTwolineAllapps()
        if ((Flags.enableTwolineToggle()
                && (!Flags.enableTwolineToggle() || (Flags.enableTwolineToggle()
                && LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(context))) {
                && LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(context)))) {
            // Add extra textHeight to the existing allAppsCellHeight.
            // Add extra textHeight to the existing allAppsCellHeight.
            allAppsCellHeightPx += Utilities.calculateTextHeight(allAppsIconTextSizePx);
            allAppsCellHeightPx += Utilities.calculateTextHeight(allAppsIconTextSizePx);
        }
        }
+3 −4
Original line number Original line Diff line number Diff line
@@ -223,10 +223,9 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        switch (viewType) {
        switch (viewType) {
            case VIEW_TYPE_ICON:
            case VIEW_TYPE_ICON:
                int layout = (FeatureFlags.enableTwolineAllapps() &&
                int layout = (Flags.enableTwolineToggle()
                        (!Flags.enableTwolineToggle() || (Flags.enableTwolineToggle()
                        && LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(
                        && LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(
                                        mActivityContext.getApplicationContext()))))
                                mActivityContext.getApplicationContext()))
                        ? R.layout.all_apps_icon_twoline : R.layout.all_apps_icon;
                        ? R.layout.all_apps_icon_twoline : R.layout.all_apps_icon;
                BubbleTextView icon = (BubbleTextView) mLayoutInflater.inflate(
                BubbleTextView icon = (BubbleTextView) mLayoutInflater.inflate(
                        layout, parent, false);
                        layout, parent, false);
+2 −5
Original line number Original line Diff line number Diff line
@@ -165,7 +165,7 @@ public final class FeatureFlags {


    // TODO(Block 5): Clean up flags
    // TODO(Block 5): Clean up flags
    public static final BooleanFlag ENABLE_TWOLINE_DEVICESEARCH = getDebugFlag(201388851,
    public static final BooleanFlag ENABLE_TWOLINE_DEVICESEARCH = getDebugFlag(201388851,
            "ENABLE_TWOLINE_DEVICESEARCH", ENABLED,
            "ENABLE_TWOLINE_DEVICESEARCH", DISABLED,
            "Enable two line label for icons with labels on device search.");
            "Enable two line label for icons with labels on device search.");


    public static final BooleanFlag ENABLE_ICON_IN_TEXT_HEADER = getDebugFlag(270395143,
    public static final BooleanFlag ENABLE_ICON_IN_TEXT_HEADER = getDebugFlag(270395143,
@@ -281,10 +281,7 @@ public final class FeatureFlags {


    // Aconfig migration complete for ENABLE_TWOLINE_ALLAPPS.
    // Aconfig migration complete for ENABLE_TWOLINE_ALLAPPS.
    public static final BooleanFlag ENABLE_TWOLINE_ALLAPPS = getDebugFlag(270390937,
    public static final BooleanFlag ENABLE_TWOLINE_ALLAPPS = getDebugFlag(270390937,
            "ENABLE_TWOLINE_ALLAPPS", ENABLED, "Enables two line label inside all apps.");
            "ENABLE_TWOLINE_ALLAPPS", DISABLED, "Enables two line label inside all apps.");
    public static boolean enableTwolineAllapps() {
        return ENABLE_TWOLINE_ALLAPPS.get() || Flags.enableTwolineAllapps();
    }


    public static final BooleanFlag IME_STICKY_SNACKBAR_EDU = getDebugFlag(270391693,
    public static final BooleanFlag IME_STICKY_SNACKBAR_EDU = getDebugFlag(270391693,
            "IME_STICKY_SNACKBAR_EDU", ENABLED, "Show sticky IME edu in AllApps");
            "IME_STICKY_SNACKBAR_EDU", ENABLED, "Show sticky IME edu in AllApps");
Loading