Loading core/java/android/view/View.java +10 −10 Original line number Diff line number Diff line Loading @@ -15363,11 +15363,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, public void invalidateDrawable(Drawable drawable) { if (verifyDrawable(drawable)) { if (drawable == mBackground && mBackgroundDisplayList != null) { // If we're using a background display list, we only need to // invalidate the display list and notify the parent to redraw. // We'll need to redraw the display list. mBackgroundDisplayList.clear(); invalidateViewProperty(true, false); } else { } final Rect dirty = drawable.getBounds(); final int scrollX = mScrollX; final int scrollY = mScrollY; Loading @@ -15376,7 +15375,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, dirty.right + scrollX, dirty.bottom + scrollY); } } } /** * Schedules an action on a drawable to occur at a specified time. Loading @@ -15386,6 +15384,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param when the time at which the action must occur. Uses the * {@link SystemClock#uptimeMillis} timebase. */ @Override public void scheduleDrawable(Drawable who, Runnable what, long when) { if (verifyDrawable(who) && what != null) { final long delay = when - SystemClock.uptimeMillis(); Loading @@ -15405,6 +15404,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param who the recipient of the action * @param what the action to cancel */ @Override public void unscheduleDrawable(Drawable who, Runnable what) { if (verifyDrawable(who) && what != null) { if (mAttachInfo != null) { core/java/android/widget/TextView.java +14 −2 Original line number Diff line number Diff line Loading @@ -4814,6 +4814,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener @Override public void invalidateDrawable(Drawable drawable) { boolean handled = false; if (verifyDrawable(drawable)) { final Rect dirty = drawable.getBounds(); int scrollX = mScrollX; Loading @@ -4831,6 +4833,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener scrollX += mPaddingLeft; scrollY += compoundPaddingTop + (vspace - drawables.mDrawableHeightLeft) / 2; handled = true; } else if (drawable == drawables.mDrawableRight) { final int compoundPaddingTop = getCompoundPaddingTop(); final int compoundPaddingBottom = getCompoundPaddingBottom(); Loading @@ -4838,6 +4841,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener scrollX += (mRight - mLeft - mPaddingRight - drawables.mDrawableSizeRight); scrollY += compoundPaddingTop + (vspace - drawables.mDrawableHeightRight) / 2; handled = true; } else if (drawable == drawables.mDrawableTop) { final int compoundPaddingLeft = getCompoundPaddingLeft(); final int compoundPaddingRight = getCompoundPaddingRight(); Loading @@ -4845,6 +4849,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener scrollX += compoundPaddingLeft + (hspace - drawables.mDrawableWidthTop) / 2; scrollY += mPaddingTop; handled = true; } else if (drawable == drawables.mDrawableBottom) { final int compoundPaddingLeft = getCompoundPaddingLeft(); final int compoundPaddingRight = getCompoundPaddingRight(); Loading @@ -4852,14 +4857,21 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener scrollX += compoundPaddingLeft + (hspace - drawables.mDrawableWidthBottom) / 2; scrollY += (mBottom - mTop - mPaddingBottom - drawables.mDrawableSizeBottom); handled = true; } } if (handled) { invalidate(dirty.left + scrollX, dirty.top + scrollY, dirty.right + scrollX, dirty.bottom + scrollY); } } if (!handled) { super.invalidateDrawable(drawable); } } @Override public boolean hasOverlappingRendering() { // horizontal fading edge causes SaveLayerAlpha, which doesn't support alpha modulation Loading Loading
core/java/android/view/View.java +10 −10 Original line number Diff line number Diff line Loading @@ -15363,11 +15363,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, public void invalidateDrawable(Drawable drawable) { if (verifyDrawable(drawable)) { if (drawable == mBackground && mBackgroundDisplayList != null) { // If we're using a background display list, we only need to // invalidate the display list and notify the parent to redraw. // We'll need to redraw the display list. mBackgroundDisplayList.clear(); invalidateViewProperty(true, false); } else { } final Rect dirty = drawable.getBounds(); final int scrollX = mScrollX; final int scrollY = mScrollY; Loading @@ -15376,7 +15375,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, dirty.right + scrollX, dirty.bottom + scrollY); } } } /** * Schedules an action on a drawable to occur at a specified time. Loading @@ -15386,6 +15384,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param when the time at which the action must occur. Uses the * {@link SystemClock#uptimeMillis} timebase. */ @Override public void scheduleDrawable(Drawable who, Runnable what, long when) { if (verifyDrawable(who) && what != null) { final long delay = when - SystemClock.uptimeMillis(); Loading @@ -15405,6 +15404,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param who the recipient of the action * @param what the action to cancel */ @Override public void unscheduleDrawable(Drawable who, Runnable what) { if (verifyDrawable(who) && what != null) { if (mAttachInfo != null) {
core/java/android/widget/TextView.java +14 −2 Original line number Diff line number Diff line Loading @@ -4814,6 +4814,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener @Override public void invalidateDrawable(Drawable drawable) { boolean handled = false; if (verifyDrawable(drawable)) { final Rect dirty = drawable.getBounds(); int scrollX = mScrollX; Loading @@ -4831,6 +4833,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener scrollX += mPaddingLeft; scrollY += compoundPaddingTop + (vspace - drawables.mDrawableHeightLeft) / 2; handled = true; } else if (drawable == drawables.mDrawableRight) { final int compoundPaddingTop = getCompoundPaddingTop(); final int compoundPaddingBottom = getCompoundPaddingBottom(); Loading @@ -4838,6 +4841,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener scrollX += (mRight - mLeft - mPaddingRight - drawables.mDrawableSizeRight); scrollY += compoundPaddingTop + (vspace - drawables.mDrawableHeightRight) / 2; handled = true; } else if (drawable == drawables.mDrawableTop) { final int compoundPaddingLeft = getCompoundPaddingLeft(); final int compoundPaddingRight = getCompoundPaddingRight(); Loading @@ -4845,6 +4849,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener scrollX += compoundPaddingLeft + (hspace - drawables.mDrawableWidthTop) / 2; scrollY += mPaddingTop; handled = true; } else if (drawable == drawables.mDrawableBottom) { final int compoundPaddingLeft = getCompoundPaddingLeft(); final int compoundPaddingRight = getCompoundPaddingRight(); Loading @@ -4852,14 +4857,21 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener scrollX += compoundPaddingLeft + (hspace - drawables.mDrawableWidthBottom) / 2; scrollY += (mBottom - mTop - mPaddingBottom - drawables.mDrawableSizeBottom); handled = true; } } if (handled) { invalidate(dirty.left + scrollX, dirty.top + scrollY, dirty.right + scrollX, dirty.bottom + scrollY); } } if (!handled) { super.invalidateDrawable(drawable); } } @Override public boolean hasOverlappingRendering() { // horizontal fading edge causes SaveLayerAlpha, which doesn't support alpha modulation Loading