Loading core/java/android/view/ViewConfiguration.java +13 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -246,6 +247,7 @@ public class ViewConfiguration { mMaximumDrawingCacheSize = MAXIMUM_DRAWING_CACHE_SIZE; mOverscrollDistance = OVERSCROLL_DISTANCE; mOverflingDistance = OVERFLING_DISTANCE; mFadingMarqueeEnabled = true; } /** Loading Loading @@ -297,6 +299,9 @@ public class ViewConfiguration { sHasPermanentMenuKey = false; } } mFadingMarqueeEnabled = res.getBoolean( com.android.internal.R.bool.config_ui_enableFadingMarquee); } /** Loading Loading @@ -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; } } core/java/android/widget/TextView.java +4 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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); } Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -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> Loading Loading
core/java/android/view/ViewConfiguration.java +13 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -246,6 +247,7 @@ public class ViewConfiguration { mMaximumDrawingCacheSize = MAXIMUM_DRAWING_CACHE_SIZE; mOverscrollDistance = OVERSCROLL_DISTANCE; mOverflingDistance = OVERFLING_DISTANCE; mFadingMarqueeEnabled = true; } /** Loading Loading @@ -297,6 +299,9 @@ public class ViewConfiguration { sHasPermanentMenuKey = false; } } mFadingMarqueeEnabled = res.getBoolean( com.android.internal.R.bool.config_ui_enableFadingMarquee); } /** Loading Loading @@ -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; } }
core/java/android/widget/TextView.java +4 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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); } Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -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> Loading