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

Commit 46cff234 authored by John Reck's avatar John Reck Committed by Android (Google) Code Review
Browse files

Merge "Don't animate TextView marquee if not visible"

parents a6978c8f 2a12f6b0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -15012,8 +15012,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    /**
     * @return true if this view and all ancestors are visible as of the last
     * {@link #onVisibilityAggregated(boolean)} call.
     *
     * @hide
     */
    boolean isAggregatedVisible() {
    public boolean isAggregatedVisible() {
        return (mPrivateFlags3 & PFLAG3_AGGREGATED_VISIBLE) != 0;
    }
+10 −3
Original line number Diff line number Diff line
@@ -10636,8 +10636,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            return;
        }
        if ((mMarquee == null || mMarquee.isStopped()) && (isFocused() || isSelected())
                && getLineCount() == 1 && canMarquee()) {
        if ((mMarquee == null || mMarquee.isStopped()) && isAggregatedVisible()
                && (isFocused() || isSelected()) && getLineCount() == 1 && canMarquee()) {
            if (mMarqueeFadeMode == MARQUEE_FADE_SWITCH_SHOW_ELLIPSIS) {
                mMarqueeFadeMode = MARQUEE_FADE_SWITCH_SHOW_FADE;
@@ -11096,6 +11096,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        }
    }
    @Override
    public void onVisibilityAggregated(boolean isVisible) {
        super.onVisibilityAggregated(isVisible);
        startStopMarquee(isVisible);
    }
    /**
     * Use {@link BaseInputConnection#removeComposingSpans
     * BaseInputConnection.removeComposingSpans()} to remove any IME composing
@@ -13749,7 +13755,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            mChoreographer.removeFrameCallback(mTickCallback);
            final TextView textView = mView.get();
            if (textView != null && (textView.isFocused() || textView.isSelected())) {
            if (textView != null && textView.isAggregatedVisible()
                    && (textView.isFocused() || textView.isSelected())) {
                long currentMs = mChoreographer.getFrameTime();
                long deltaMs = currentMs - mLastAnimationMs;
                mLastAnimationMs = currentMs;