Loading core/java/android/view/View.java +1 −7 Original line number Diff line number Diff line Loading @@ -13844,13 +13844,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal */ public Insets getLayoutInsets() { if (mLayoutInsets == null) { if (mBackground == null) { mLayoutInsets = Insets.NONE; } else { Rect insetRect = new Rect(); boolean hasInsets = mBackground.getLayoutInsets(insetRect); mLayoutInsets = hasInsets ? Insets.of(insetRect) : Insets.NONE; } mLayoutInsets = (mBackground == null) ? Insets.NONE : mBackground.getLayoutInsets(); } return mLayoutInsets; } graphics/java/android/graphics/Insets.java +1 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ public class Insets { * @return an Insets instance with the appropriate values */ public static Insets of(Rect r) { return of(r.left, r.top, r.right, r.bottom); return (r == null) ? NONE : of(r.left, r.top, r.right, r.bottom); } /** Loading graphics/java/android/graphics/drawable/Drawable.java +4 −7 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.graphics.drawable; import android.graphics.Insets; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -706,16 +707,12 @@ public abstract class Drawable { /** * Return in insets the layout insets suggested by this Drawable for use with alignment * operations during layout. Positive values move toward the * center of the Drawable. Returns true if this drawable * actually has a layout insets, else false. When false is returned, the padding * is always set to 0. * operations during layout. * * @hide */ public boolean getLayoutInsets(Rect insets) { insets.set(0, 0, 0, 0); return false; public Insets getLayoutInsets() { return Insets.NONE; } /** Loading graphics/java/android/graphics/drawable/DrawableContainer.java +3 −6 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.graphics.drawable; import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Insets; import android.graphics.PixelFormat; import android.graphics.Rect; import android.os.SystemClock; Loading Loading @@ -94,12 +95,8 @@ public class DrawableContainer extends Drawable implements Drawable.Callback { * @hide */ @Override public boolean getLayoutInsets(Rect insets) { if (mCurrDrawable != null) { return mCurrDrawable.getLayoutInsets(insets); } else { return super.getLayoutInsets(insets); } public Insets getLayoutInsets() { return (mCurrDrawable == null) ? Insets.NONE : mCurrDrawable.getLayoutInsets(); } @Override Loading graphics/java/android/graphics/drawable/NinePatchDrawable.java +5 −9 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Insets; import android.graphics.NinePatch; import android.graphics.Paint; import android.graphics.PixelFormat; Loading Loading @@ -224,13 +225,8 @@ public class NinePatchDrawable extends Drawable { * @hide */ @Override public boolean getLayoutInsets(Rect insets) { Rect layoutInsets = mNinePatchState.mLayoutInsets; if (layoutInsets == null) { return super.getLayoutInsets(insets); } insets.set(layoutInsets); return true; public Insets getLayoutInsets() { return mNinePatchState.mLayoutInsets; } @Override Loading Loading @@ -390,7 +386,7 @@ public class NinePatchDrawable extends Drawable { private final static class NinePatchState extends ConstantState { final NinePatch mNinePatch; final Rect mPadding; final Rect mLayoutInsets; final Insets mLayoutInsets; final boolean mDither; int mChangingConfigurations; int mTargetDensity = DisplayMetrics.DENSITY_DEFAULT; Loading @@ -406,7 +402,7 @@ public class NinePatchDrawable extends Drawable { NinePatchState(NinePatch ninePatch, Rect rect, Rect layoutInsets, boolean dither) { mNinePatch = ninePatch; mPadding = rect; mLayoutInsets = layoutInsets; mLayoutInsets = Insets.of(layoutInsets); mDither = dither; } Loading Loading
core/java/android/view/View.java +1 −7 Original line number Diff line number Diff line Loading @@ -13844,13 +13844,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal */ public Insets getLayoutInsets() { if (mLayoutInsets == null) { if (mBackground == null) { mLayoutInsets = Insets.NONE; } else { Rect insetRect = new Rect(); boolean hasInsets = mBackground.getLayoutInsets(insetRect); mLayoutInsets = hasInsets ? Insets.of(insetRect) : Insets.NONE; } mLayoutInsets = (mBackground == null) ? Insets.NONE : mBackground.getLayoutInsets(); } return mLayoutInsets; }
graphics/java/android/graphics/Insets.java +1 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ public class Insets { * @return an Insets instance with the appropriate values */ public static Insets of(Rect r) { return of(r.left, r.top, r.right, r.bottom); return (r == null) ? NONE : of(r.left, r.top, r.right, r.bottom); } /** Loading
graphics/java/android/graphics/drawable/Drawable.java +4 −7 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.graphics.drawable; import android.graphics.Insets; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -706,16 +707,12 @@ public abstract class Drawable { /** * Return in insets the layout insets suggested by this Drawable for use with alignment * operations during layout. Positive values move toward the * center of the Drawable. Returns true if this drawable * actually has a layout insets, else false. When false is returned, the padding * is always set to 0. * operations during layout. * * @hide */ public boolean getLayoutInsets(Rect insets) { insets.set(0, 0, 0, 0); return false; public Insets getLayoutInsets() { return Insets.NONE; } /** Loading
graphics/java/android/graphics/drawable/DrawableContainer.java +3 −6 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.graphics.drawable; import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Insets; import android.graphics.PixelFormat; import android.graphics.Rect; import android.os.SystemClock; Loading Loading @@ -94,12 +95,8 @@ public class DrawableContainer extends Drawable implements Drawable.Callback { * @hide */ @Override public boolean getLayoutInsets(Rect insets) { if (mCurrDrawable != null) { return mCurrDrawable.getLayoutInsets(insets); } else { return super.getLayoutInsets(insets); } public Insets getLayoutInsets() { return (mCurrDrawable == null) ? Insets.NONE : mCurrDrawable.getLayoutInsets(); } @Override Loading
graphics/java/android/graphics/drawable/NinePatchDrawable.java +5 −9 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Insets; import android.graphics.NinePatch; import android.graphics.Paint; import android.graphics.PixelFormat; Loading Loading @@ -224,13 +225,8 @@ public class NinePatchDrawable extends Drawable { * @hide */ @Override public boolean getLayoutInsets(Rect insets) { Rect layoutInsets = mNinePatchState.mLayoutInsets; if (layoutInsets == null) { return super.getLayoutInsets(insets); } insets.set(layoutInsets); return true; public Insets getLayoutInsets() { return mNinePatchState.mLayoutInsets; } @Override Loading Loading @@ -390,7 +386,7 @@ public class NinePatchDrawable extends Drawable { private final static class NinePatchState extends ConstantState { final NinePatch mNinePatch; final Rect mPadding; final Rect mLayoutInsets; final Insets mLayoutInsets; final boolean mDither; int mChangingConfigurations; int mTargetDensity = DisplayMetrics.DENSITY_DEFAULT; Loading @@ -406,7 +402,7 @@ public class NinePatchDrawable extends Drawable { NinePatchState(NinePatch ninePatch, Rect rect, Rect layoutInsets, boolean dither) { mNinePatch = ninePatch; mPadding = rect; mLayoutInsets = layoutInsets; mLayoutInsets = Insets.of(layoutInsets); mDither = dither; } Loading