Loading graphics/java/android/graphics/drawable/Drawable.java +14 −4 Original line number Diff line number Diff line Loading @@ -913,16 +913,26 @@ public abstract class Drawable { protected void onBoundsChange(Rect bounds) {} /** * Return the intrinsic width of the underlying drawable object. Returns * -1 if it has no intrinsic width, such as with a solid color. * Returns the drawable's intrinsic width. * <p> * Intrinsic width is the width at which the drawable would like to be laid * out, including any inherent padding. If the drawable has no intrinsic * width, such as a solid color, this method returns -1. * * @return the intrinsic width, or -1 if no intrinsic width */ public int getIntrinsicWidth() { return -1; } /** * Return the intrinsic height of the underlying drawable object. Returns * -1 if it has no intrinsic height, such as with a solid color. * Returns the drawable's intrinsic height. * <p> * Intrinsic height is the height at which the drawable would like to be * laid out, including any inherent padding. If the drawable has no * intrinsic height, such as a solid color, this method returns -1. * * @return the intrinsic height, or -1 if no intrinsic height */ public int getIntrinsicHeight() { return -1; Loading graphics/java/android/graphics/drawable/InsetDrawable.java +10 −2 Original line number Diff line number Diff line Loading @@ -222,12 +222,20 @@ public class InsetDrawable extends DrawableWrapper { @Override public int getIntrinsicWidth() { return getDrawable().getIntrinsicWidth() + mState.mInsetLeft + mState.mInsetRight; final int childWidth = getDrawable().getIntrinsicWidth(); if (childWidth < 0) { return -1; } return childWidth + mState.mInsetLeft + mState.mInsetRight; } @Override public int getIntrinsicHeight() { return getDrawable().getIntrinsicHeight() + mState.mInsetTop + mState.mInsetBottom; final int childHeight = getDrawable().getIntrinsicHeight(); if (childHeight < 0) { return -1; } return childHeight + mState.mInsetTop + mState.mInsetBottom; } @Override Loading Loading
graphics/java/android/graphics/drawable/Drawable.java +14 −4 Original line number Diff line number Diff line Loading @@ -913,16 +913,26 @@ public abstract class Drawable { protected void onBoundsChange(Rect bounds) {} /** * Return the intrinsic width of the underlying drawable object. Returns * -1 if it has no intrinsic width, such as with a solid color. * Returns the drawable's intrinsic width. * <p> * Intrinsic width is the width at which the drawable would like to be laid * out, including any inherent padding. If the drawable has no intrinsic * width, such as a solid color, this method returns -1. * * @return the intrinsic width, or -1 if no intrinsic width */ public int getIntrinsicWidth() { return -1; } /** * Return the intrinsic height of the underlying drawable object. Returns * -1 if it has no intrinsic height, such as with a solid color. * Returns the drawable's intrinsic height. * <p> * Intrinsic height is the height at which the drawable would like to be * laid out, including any inherent padding. If the drawable has no * intrinsic height, such as a solid color, this method returns -1. * * @return the intrinsic height, or -1 if no intrinsic height */ public int getIntrinsicHeight() { return -1; Loading
graphics/java/android/graphics/drawable/InsetDrawable.java +10 −2 Original line number Diff line number Diff line Loading @@ -222,12 +222,20 @@ public class InsetDrawable extends DrawableWrapper { @Override public int getIntrinsicWidth() { return getDrawable().getIntrinsicWidth() + mState.mInsetLeft + mState.mInsetRight; final int childWidth = getDrawable().getIntrinsicWidth(); if (childWidth < 0) { return -1; } return childWidth + mState.mInsetLeft + mState.mInsetRight; } @Override public int getIntrinsicHeight() { return getDrawable().getIntrinsicHeight() + mState.mInsetTop + mState.mInsetBottom; final int childHeight = getDrawable().getIntrinsicHeight(); if (childHeight < 0) { return -1; } return childHeight + mState.mInsetTop + mState.mInsetBottom; } @Override Loading