Update Drawable API to expose getOpticalBounds method as well as
the Insets class Updated all Drawable implementations to remove the @hide annotation Fixes: 78942648 Test: Re-run CtsGraphicsTestCases and updated Drawable CTS tests to verify getOpticalBounds implementations Change-Id: Id9b6bbbe15173e310bbf44184b4678fb29ef1cd8
This commit is contained in:
@@ -966,6 +966,10 @@ package android {
|
||||
field public static final int onClick = 16843375; // 0x101026f
|
||||
field public static final int oneshot = 16843159; // 0x1010197
|
||||
field public static final int opacity = 16843550; // 0x101031e
|
||||
field public static final int opticalInsetBottom = 16844170; // 0x101058a
|
||||
field public static final int opticalInsetLeft = 16844167; // 0x1010587
|
||||
field public static final int opticalInsetRight = 16844169; // 0x1010589
|
||||
field public static final int opticalInsetTop = 16844168; // 0x1010588
|
||||
field public static final int order = 16843242; // 0x10101ea
|
||||
field public static final int orderInCategory = 16843231; // 0x10101df
|
||||
field public static final int ordering = 16843490; // 0x10102e2
|
||||
@@ -13748,6 +13752,16 @@ package android.graphics {
|
||||
field public static final int YV12 = 842094169; // 0x32315659
|
||||
}
|
||||
|
||||
public class Insets {
|
||||
method public static android.graphics.Insets of(int, int, int, int);
|
||||
method public static android.graphics.Insets of(android.graphics.Rect);
|
||||
field public static final android.graphics.Insets NONE;
|
||||
field public final int bottom;
|
||||
field public final int left;
|
||||
field public final int right;
|
||||
field public final int top;
|
||||
}
|
||||
|
||||
public class Interpolator {
|
||||
ctor public Interpolator(int);
|
||||
ctor public Interpolator(int, int);
|
||||
@@ -14714,6 +14728,7 @@ package android.graphics.drawable {
|
||||
method public int getMinimumHeight();
|
||||
method public int getMinimumWidth();
|
||||
method public abstract int getOpacity();
|
||||
method public android.graphics.Insets getOpticalInsets();
|
||||
method public void getOutline(android.graphics.Outline);
|
||||
method public boolean getPadding(android.graphics.Rect);
|
||||
method public int[] getState();
|
||||
|
||||
@@ -1095,19 +1095,16 @@ Landroid/graphics/drawable/AnimatedStateListDrawable$AnimatedStateListState;->mT
|
||||
Landroid/graphics/drawable/AnimatedStateListDrawable;->mState:Landroid/graphics/drawable/AnimatedStateListDrawable$AnimatedStateListState;
|
||||
Landroid/graphics/drawable/AnimatedVectorDrawable$VectorDrawableAnimatorRT;->callOnFinished(Landroid/graphics/drawable/AnimatedVectorDrawable$VectorDrawableAnimatorRT;I)V
|
||||
Landroid/graphics/drawable/AnimationDrawable;->mCurFrame:I
|
||||
Landroid/graphics/drawable/BitmapDrawable;->getOpticalInsets()Landroid/graphics/Insets;
|
||||
Landroid/graphics/drawable/BitmapDrawable;->getTint()Landroid/content/res/ColorStateList;
|
||||
Landroid/graphics/drawable/BitmapDrawable;->getTintMode()Landroid/graphics/PorterDuff$Mode;
|
||||
Landroid/graphics/drawable/BitmapDrawable;->mTargetDensity:I
|
||||
Landroid/graphics/drawable/BitmapDrawable;->setBitmap(Landroid/graphics/Bitmap;)V
|
||||
Landroid/graphics/drawable/ColorDrawable$ColorState;->mUseColor:I
|
||||
Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets;
|
||||
Landroid/graphics/drawable/Drawable;->inflateWithAttributes(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/content/res/TypedArray;I)V
|
||||
Landroid/graphics/drawable/Drawable;->mCallback:Ljava/lang/ref/WeakReference;
|
||||
Landroid/graphics/drawable/Drawable;->parseTintMode(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuff$Mode;
|
||||
Landroid/graphics/drawable/DrawableContainer$DrawableContainerState;->mConstantPadding:Landroid/graphics/Rect;
|
||||
Landroid/graphics/drawable/DrawableContainer$DrawableContainerState;->mDrawables:[Landroid/graphics/drawable/Drawable;
|
||||
Landroid/graphics/drawable/DrawableContainer;->getOpticalInsets()Landroid/graphics/Insets;
|
||||
Landroid/graphics/drawable/DrawableContainer;->mDrawableContainerState:Landroid/graphics/drawable/DrawableContainer$DrawableContainerState;
|
||||
Landroid/graphics/drawable/DrawableInflater;->mClassLoader:Ljava/lang/ClassLoader;
|
||||
Landroid/graphics/drawable/GradientDrawable$GradientState;->mAngle:I
|
||||
@@ -1129,7 +1126,6 @@ Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeWidth:I
|
||||
Landroid/graphics/drawable/GradientDrawable$GradientState;->mThickness:I
|
||||
Landroid/graphics/drawable/GradientDrawable$GradientState;->mThicknessRatio:F
|
||||
Landroid/graphics/drawable/GradientDrawable$GradientState;->mWidth:I
|
||||
Landroid/graphics/drawable/GradientDrawable;->getOpticalInsets()Landroid/graphics/Insets;
|
||||
Landroid/graphics/drawable/GradientDrawable;->mFillPaint:Landroid/graphics/Paint;
|
||||
Landroid/graphics/drawable/GradientDrawable;->mGradientState:Landroid/graphics/drawable/GradientDrawable$GradientState;
|
||||
Landroid/graphics/drawable/GradientDrawable;->mPadding:Landroid/graphics/Rect;
|
||||
@@ -1170,10 +1166,6 @@ Landroid/graphics/GraphicBuffer;->createFromExisting(IIIIJ)Landroid/graphics/Gra
|
||||
Landroid/graphics/GraphicBuffer;->CREATOR:Landroid/os/Parcelable$Creator;
|
||||
Landroid/graphics/GraphicBuffer;->mNativeObject:J
|
||||
Landroid/graphics/ImageDecoder;->postProcessAndRelease(Landroid/graphics/Canvas;)I
|
||||
Landroid/graphics/Insets;->bottom:I
|
||||
Landroid/graphics/Insets;->left:I
|
||||
Landroid/graphics/Insets;->right:I
|
||||
Landroid/graphics/Insets;->top:I
|
||||
Landroid/graphics/LinearGradient;->mColors:[I
|
||||
Landroid/graphics/Matrix;->native_instance:J
|
||||
Landroid/graphics/Movie;-><init>(J)V
|
||||
|
||||
@@ -5734,17 +5734,13 @@
|
||||
<!-- When a tint color is set, specifies its Porter-Duff blending mode. The
|
||||
default value is src_in, which treats the drawable as an alpha mask. -->
|
||||
<attr name="tintMode" />
|
||||
<!-- Left optical inset.
|
||||
@hide Until optical insets are fully supported. -->
|
||||
<!-- Left optical inset. -->
|
||||
<attr name="opticalInsetLeft" />
|
||||
<!-- Top optical inset.
|
||||
@hide Until optical insets are fully supported. -->
|
||||
<!-- Top optical inset. -->
|
||||
<attr name="opticalInsetTop" />
|
||||
<!-- Right optical inset.
|
||||
@hide Until optical insets are fully supported. -->
|
||||
<!-- Right optical inset. -->
|
||||
<attr name="opticalInsetRight" />
|
||||
<!-- Bottom optical inset.
|
||||
@hide Until optical insets are fully supported. -->
|
||||
<!-- Bottom optical inset. -->
|
||||
<attr name="opticalInsetBottom" />
|
||||
</declare-styleable>
|
||||
|
||||
@@ -6243,17 +6239,13 @@
|
||||
<!-- The opacity of the whole vector drawable, as a value between 0
|
||||
(completely transparent) and 1 (completely opaque). -->
|
||||
<attr name="alpha" />
|
||||
<!-- Left optical inset.
|
||||
@hide Until optical insets are fully supported. -->
|
||||
<!-- Left optical inset. -->
|
||||
<attr name="opticalInsetLeft" format="dimension" />
|
||||
<!-- Top optical inset.
|
||||
@hide Until optical insets are fully supported. -->
|
||||
<!-- Top optical inset. -->
|
||||
<attr name="opticalInsetTop" format="dimension" />
|
||||
<!-- Right optical inset.
|
||||
@hide Until optical insets are fully supported. -->
|
||||
<!-- Right optical inset. -->
|
||||
<attr name="opticalInsetRight" format="dimension" />
|
||||
<!-- Bottom optical inset.
|
||||
@hide Until optical insets are fully supported. -->
|
||||
<!-- Bottom optical inset. -->
|
||||
<attr name="opticalInsetBottom" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
@@ -2903,6 +2903,10 @@
|
||||
<eat-comment />
|
||||
|
||||
<public-group type="attr" first-id="0x01010587">
|
||||
<public name="opticalInsetLeft" />
|
||||
<public name="opticalInsetTop" />
|
||||
<public name="opticalInsetRight" />
|
||||
<public name="opticalInsetBottom" />
|
||||
</public-group>
|
||||
|
||||
<public-group type="style" first-id="0x010302e2">
|
||||
|
||||
@@ -3379,4 +3379,9 @@
|
||||
<java-symbol type="id" name="user_loading" />
|
||||
|
||||
<java-symbol type="string" name="battery_saver_description_with_learn_more" />
|
||||
|
||||
<java-symbol type="attr" name="opticalInsetLeft" />
|
||||
<java-symbol type="attr" name="opticalInsetTop" />
|
||||
<java-symbol type="attr" name="opticalInsetRight" />
|
||||
<java-symbol type="attr" name="opticalInsetBottom" />
|
||||
</resources>
|
||||
|
||||
@@ -23,7 +23,6 @@ package android.graphics;
|
||||
* <p>
|
||||
* Insets are immutable so may be treated as values.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public class Insets {
|
||||
public static final Insets NONE = new Insets(0, 0, 0, 0);
|
||||
|
||||
@@ -57,6 +57,8 @@ import android.view.View;
|
||||
import com.android.internal.R;
|
||||
import com.android.internal.util.VirtualRefBasePtr;
|
||||
|
||||
import dalvik.annotation.optimization.FastNative;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
@@ -64,7 +66,6 @@ import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import dalvik.annotation.optimization.FastNative;
|
||||
|
||||
/**
|
||||
* This class animates properties of a {@link android.graphics.drawable.VectorDrawable} with
|
||||
@@ -515,7 +516,6 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable2 {
|
||||
mAnimatedVectorState.mVectorDrawable.getOutline(outline);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public Insets getOpticalInsets() {
|
||||
return mAnimatedVectorState.mVectorDrawable.getOpticalInsets();
|
||||
|
||||
@@ -23,7 +23,6 @@ import android.content.res.Resources;
|
||||
import android.content.res.Resources.Theme;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.BitmapShader;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
@@ -627,9 +626,6 @@ public class BitmapDrawable extends Drawable {
|
||||
mDstRectAndInsetsDirty = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
public Insets getOpticalInsets() {
|
||||
updateDstRectAndInsetsIfDirty();
|
||||
|
||||
@@ -1088,7 +1088,6 @@ public abstract class Drawable {
|
||||
* Return in insets the layout insets suggested by this Drawable for use with alignment
|
||||
* operations during layout.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public @NonNull Insets getOpticalInsets() {
|
||||
return Insets.NONE;
|
||||
|
||||
@@ -120,9 +120,6 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
public Insets getOpticalInsets() {
|
||||
if (mCurrDrawable != null) {
|
||||
|
||||
@@ -251,7 +251,6 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb
|
||||
return mDrawable != null && mDrawable.getPadding(padding);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public Insets getOpticalInsets() {
|
||||
return mDrawable != null ? mDrawable.getOpticalInsets() : Insets.NONE;
|
||||
|
||||
@@ -1698,7 +1698,6 @@ public class GradientDrawable extends Drawable {
|
||||
return mGradientState.mHeight;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public Insets getOpticalInsets() {
|
||||
return mGradientState.mOpticalInsets;
|
||||
|
||||
@@ -16,11 +16,6 @@
|
||||
|
||||
package android.graphics.drawable;
|
||||
|
||||
import com.android.internal.R;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.content.res.Resources;
|
||||
@@ -35,6 +30,11 @@ import android.util.AttributeSet;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.TypedValue;
|
||||
|
||||
import com.android.internal.R;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@@ -240,7 +240,6 @@ public class InsetDrawable extends DrawableWrapper {
|
||||
| mTmpInsetRect.top | mTmpInsetRect.bottom) != 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public Insets getOpticalInsets() {
|
||||
final Insets contentInsets = super.getOpticalInsets();
|
||||
|
||||
@@ -299,9 +299,6 @@ public class NinePatchDrawable extends Drawable {
|
||||
super.getOutline(outline);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
public Insets getOpticalInsets() {
|
||||
final Insets opticalInsets = mOpticalInsets;
|
||||
|
||||
@@ -46,6 +46,9 @@ import android.util.Xml;
|
||||
import com.android.internal.R;
|
||||
import com.android.internal.util.VirtualRefBasePtr;
|
||||
|
||||
import dalvik.annotation.optimization.FastNative;
|
||||
import dalvik.system.VMRuntime;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
@@ -56,9 +59,6 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Stack;
|
||||
|
||||
import dalvik.annotation.optimization.FastNative;
|
||||
import dalvik.system.VMRuntime;
|
||||
|
||||
/**
|
||||
* This lets you create a drawable based on an XML vector graphic.
|
||||
* <p/>
|
||||
@@ -543,7 +543,6 @@ public class VectorDrawable extends Drawable {
|
||||
return mDpiScaledHeight;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public Insets getOpticalInsets() {
|
||||
if (mDpiScaledDirty) {
|
||||
|
||||
Reference in New Issue
Block a user