Loading core/java/android/widget/TextView.java +8 −2 Original line number Diff line number Diff line Loading @@ -10821,8 +10821,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener && mSavedMarqueeModeLayout.getLineWidth(0) > width)); } /** * @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) private void startMarquee() { protected void startMarquee() { // Do not ellipsize EditText if (getKeyListener() != null) return; Loading @@ -10848,7 +10851,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } } private void stopMarquee() { /** * @hide */ protected void stopMarquee() { if (mMarquee != null && !mMarquee.isStopped()) { mMarquee.stop(); } Loading packages/SystemUI/res/layout/qs_tile_label.xml +4 −4 Original line number Diff line number Diff line Loading @@ -26,9 +26,9 @@ android:layout_marginEnd="0dp" android:layout_gravity="center_vertical | start"> <TextView <com.android.systemui.util.SafeMarqueeTextView android:id="@+id/tile_label" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start" android:textDirection="locale" Loading @@ -37,9 +37,9 @@ android:singleLine="true" android:textAppearance="@style/TextAppearance.QS.TileLabel"/> <TextView <com.android.systemui.util.SafeMarqueeTextView android:id="@+id/app_label" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start" android:textDirection="locale" Loading packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +7 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.res.Configuration import android.content.res.Resources.ID_NULL import android.graphics.drawable.Drawable import android.graphics.drawable.RippleDrawable import android.os.Trace import android.service.quicksettings.Tile import android.text.TextUtils import android.util.Log Loading Loading @@ -163,6 +164,12 @@ open class QSTileViewImpl @JvmOverloads constructor( updateResources() } override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { Trace.traceBegin(Trace.TRACE_TAG_APP, "QSTileViewImpl#onMeasure") super.onMeasure(widthMeasureSpec, heightMeasureSpec) Trace.endSection() } override fun resetOverride() { heightOverride = HeightOverrideable.NO_OVERRIDE updateHeight() Loading packages/SystemUI/src/com/android/systemui/util/AutoMarqueeTextView.java +1 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.util; import android.content.Context; import android.text.TextUtils; import android.util.AttributeSet; import android.widget.TextView; /** * TextView that changes its ellipsize value with its visibility. Loading @@ -27,7 +26,7 @@ import android.widget.TextView; * The View responds to changes in user-visibility to change its ellipsize from MARQUEE to END * and back. Useful for TextView that need to marquee forever. */ public class AutoMarqueeTextView extends TextView { public class AutoMarqueeTextView extends SafeMarqueeTextView { private boolean mAggregatedVisible = false; Loading packages/SystemUI/src/com/android/systemui/util/SafeMarqueeTextView.kt 0 → 100644 +44 −0 Original line number Diff line number Diff line package com.android.systemui.util import android.annotation.SuppressLint import android.content.Context import android.util.AttributeSet import android.view.ViewGroup import android.widget.TextView /** * A TextField that doesn't relayout when changing from marquee to ellipsis. */ @SuppressLint("AppCompatCustomView") open class SafeMarqueeTextView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0 ) : TextView(context, attrs, defStyleAttr, defStyleRes) { private var safelyIgnoreLayout = false private val hasStableWidth get() = layoutParams.width != ViewGroup.LayoutParams.WRAP_CONTENT override fun requestLayout() { if (safelyIgnoreLayout) { return } super.requestLayout() } override fun startMarquee() { val wasIgnoring = safelyIgnoreLayout safelyIgnoreLayout = hasStableWidth super.startMarquee() safelyIgnoreLayout = wasIgnoring } override fun stopMarquee() { val wasIgnoring = safelyIgnoreLayout safelyIgnoreLayout = hasStableWidth super.stopMarquee() safelyIgnoreLayout = wasIgnoring } } No newline at end of file Loading
core/java/android/widget/TextView.java +8 −2 Original line number Diff line number Diff line Loading @@ -10821,8 +10821,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener && mSavedMarqueeModeLayout.getLineWidth(0) > width)); } /** * @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) private void startMarquee() { protected void startMarquee() { // Do not ellipsize EditText if (getKeyListener() != null) return; Loading @@ -10848,7 +10851,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } } private void stopMarquee() { /** * @hide */ protected void stopMarquee() { if (mMarquee != null && !mMarquee.isStopped()) { mMarquee.stop(); } Loading
packages/SystemUI/res/layout/qs_tile_label.xml +4 −4 Original line number Diff line number Diff line Loading @@ -26,9 +26,9 @@ android:layout_marginEnd="0dp" android:layout_gravity="center_vertical | start"> <TextView <com.android.systemui.util.SafeMarqueeTextView android:id="@+id/tile_label" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start" android:textDirection="locale" Loading @@ -37,9 +37,9 @@ android:singleLine="true" android:textAppearance="@style/TextAppearance.QS.TileLabel"/> <TextView <com.android.systemui.util.SafeMarqueeTextView android:id="@+id/app_label" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start" android:textDirection="locale" Loading
packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +7 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.res.Configuration import android.content.res.Resources.ID_NULL import android.graphics.drawable.Drawable import android.graphics.drawable.RippleDrawable import android.os.Trace import android.service.quicksettings.Tile import android.text.TextUtils import android.util.Log Loading Loading @@ -163,6 +164,12 @@ open class QSTileViewImpl @JvmOverloads constructor( updateResources() } override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { Trace.traceBegin(Trace.TRACE_TAG_APP, "QSTileViewImpl#onMeasure") super.onMeasure(widthMeasureSpec, heightMeasureSpec) Trace.endSection() } override fun resetOverride() { heightOverride = HeightOverrideable.NO_OVERRIDE updateHeight() Loading
packages/SystemUI/src/com/android/systemui/util/AutoMarqueeTextView.java +1 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.util; import android.content.Context; import android.text.TextUtils; import android.util.AttributeSet; import android.widget.TextView; /** * TextView that changes its ellipsize value with its visibility. Loading @@ -27,7 +26,7 @@ import android.widget.TextView; * The View responds to changes in user-visibility to change its ellipsize from MARQUEE to END * and back. Useful for TextView that need to marquee forever. */ public class AutoMarqueeTextView extends TextView { public class AutoMarqueeTextView extends SafeMarqueeTextView { private boolean mAggregatedVisible = false; Loading
packages/SystemUI/src/com/android/systemui/util/SafeMarqueeTextView.kt 0 → 100644 +44 −0 Original line number Diff line number Diff line package com.android.systemui.util import android.annotation.SuppressLint import android.content.Context import android.util.AttributeSet import android.view.ViewGroup import android.widget.TextView /** * A TextField that doesn't relayout when changing from marquee to ellipsis. */ @SuppressLint("AppCompatCustomView") open class SafeMarqueeTextView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0 ) : TextView(context, attrs, defStyleAttr, defStyleRes) { private var safelyIgnoreLayout = false private val hasStableWidth get() = layoutParams.width != ViewGroup.LayoutParams.WRAP_CONTENT override fun requestLayout() { if (safelyIgnoreLayout) { return } super.requestLayout() } override fun startMarquee() { val wasIgnoring = safelyIgnoreLayout safelyIgnoreLayout = hasStableWidth super.startMarquee() safelyIgnoreLayout = wasIgnoring } override fun stopMarquee() { val wasIgnoring = safelyIgnoreLayout safelyIgnoreLayout = hasStableWidth super.stopMarquee() safelyIgnoreLayout = wasIgnoring } } No newline at end of file