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

Commit 04ee7956 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Add the ability to enable/disable marquee fading per device"

parents 5857bcea 68055456
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -220,6 +220,7 @@ public class ViewConfiguration {
    private final int mMaximumDrawingCacheSize;
    private final int mOverscrollDistance;
    private final int mOverflingDistance;
    private final boolean mFadingMarqueeEnabled;

    private boolean sHasPermanentMenuKey;
    private boolean sHasPermanentMenuKeySet;
@@ -246,6 +247,7 @@ public class ViewConfiguration {
        mMaximumDrawingCacheSize = MAXIMUM_DRAWING_CACHE_SIZE;
        mOverscrollDistance = OVERSCROLL_DISTANCE;
        mOverflingDistance = OVERFLING_DISTANCE;
        mFadingMarqueeEnabled = true;
    }

    /**
@@ -297,6 +299,9 @@ public class ViewConfiguration {
                sHasPermanentMenuKey = false;
            }
        }

        mFadingMarqueeEnabled = res.getBoolean(
                com.android.internal.R.bool.config_ui_enableFadingMarquee);
    }

    /**
@@ -673,4 +678,12 @@ public class ViewConfiguration {
    public boolean hasPermanentMenuKey() {
        return sHasPermanentMenuKey;
    }

    /**
     * @hide
     * @return Whether or not marquee should use fading edges.
     */
    public boolean isFadingMarqueeEnabled() {
        return mFadingMarqueeEnabled;
    }
}
+4 −2
Original line number Diff line number Diff line
@@ -999,7 +999,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                setEllipsize(TextUtils.TruncateAt.END);
                break;
            case 4:
                setHorizontalFadingEdgeEnabled(true);
                setHorizontalFadingEdgeEnabled(
                        ViewConfiguration.get(context).isFadingMarqueeEnabled());
                setEllipsize(TextUtils.TruncateAt.MARQUEE);
                break;
        }
@@ -3067,7 +3068,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

        if (text instanceof Spanned &&
            ((Spanned) text).getSpanStart(TextUtils.TruncateAt.MARQUEE) >= 0) {
            setHorizontalFadingEdgeEnabled(true);
            setHorizontalFadingEdgeEnabled(
                    ViewConfiguration.get(mContext).isFadingMarqueeEnabled());
            setEllipsize(TextUtils.TruncateAt.MARQUEE);
        }

+3 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@
         specified for -large and -xlarge configurations. -->
    <dimen name="config_prefDialogWidth">320dp</dimen>

    <!-- Enables or disables fading edges when marquee is enabled in TextView. -->
    <bool name="config_ui_enableFadingMarquee">true</bool>

    <!-- Whether dialogs should close automatically when the user touches outside
         of them.  This should not normally be modified. -->
    <bool name="config_closeDialogWhenTouchOutside">false</bool>