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

Commit 50f9dbd0 authored by Brandon Dayauon's avatar Brandon Dayauon
Browse files

Disable two line text legacy flag.

Will now repurpose the twolinetoggle flag to be the flag that will
make twoline text enabled/disabled.

bug: 316027081
Test: presubmit
manually: https://screenshot.googleplex.com/BsZGCm7DrTZLwG4
Flag: com.android.launcher3.enable_twoline_toggle Staging
Merged-In: Idef427bad6551ae56b13e35393e076b8e000af5a
Change-Id: Idef427bad6551ae56b13e35393e076b8e000af5a
parent 036a83cd
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -138,9 +138,9 @@ public class PredictionRowView<T extends Context & ActivityContext>
        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
        // is not enabled. Otherwise, the extra height will increase by just the textHeight.
        int extraHeight = (FeatureFlags.enableTwolineAllapps() && (!Flags.enableTwolineToggle()
                || (Flags.enableTwolineToggle() && LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(
                        getContext())))) ? textHeight : mTopRowExtraHeight;
        int extraHeight = (Flags.enableTwolineToggle() &&
                LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(getContext()))
                ? textHeight : mTopRowExtraHeight;
        totalHeight += extraHeight;
        return getVisibility() == GONE ? 0 : totalHeight + getPaddingTop() + getPaddingBottom();
    }
+4 −7
Original line number Diff line number Diff line
@@ -285,9 +285,6 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
        mDotParams.scale = 0f;
        mForceHideDot = false;
        setBackground(null);
        if (FeatureFlags.enableTwolineAllapps() || FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get()) {
            setMaxLines(1);
        }

        setTag(null);
        if (mIconLoadRequest != null) {
@@ -299,6 +296,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
        setAlpha(1);
        setScaleY(1);
        setTranslationY(0);
        setMaxLines(1);
        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.
     */
    protected boolean shouldUseTwoLine() {
        return FeatureFlags.enableTwolineAllapps() && isCurrentLanguageEnglish()
                && (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW)
                && (!Flags.enableTwolineToggle() || (Flags.enableTwolineToggle()
                && LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(getContext())));
        return isCurrentLanguageEnglish() && (mDisplay == DISPLAY_ALL_APPS
                || mDisplay == DISPLAY_PREDICTION_ROW) && (Flags.enableTwolineToggle()
                && LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE.get(getContext()));
    }

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

    // TODO(Block 5): Clean up flags
    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.");

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

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

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