/**@class android.graphics.drawable.Icon implements android.os.Parcelable @extends java.lang.Object An umbrella container for several serializable graphics representations, including Bitmaps, compressed bitmap images (e.g. JPG or PNG), and drawable resources (including vectors). <a href="https://developer.android.com/training/displaying-bitmaps/index.html">Much ink</a> has been spilled on the best way to load images, and many clients may have different needs when it comes to threading and fetching. This class is therefore focused on encapsulation rather than behavior. */ var Icon = { /** An icon that was created using {@link android.graphics.drawable.Icon#createWithBitmap(Bitmap)}. @see #getType */ TYPE_BITMAP : "1", /** An icon that was created using {@link android.graphics.drawable.Icon#createWithResource}. @see #getType */ TYPE_RESOURCE : "2", /** An icon that was created using {@link android.graphics.drawable.Icon#createWithData(byte[], int, int)}. @see #getType */ TYPE_DATA : "3", /** An icon that was created using {@link android.graphics.drawable.Icon#createWithContentUri} or {@link android.graphics.drawable.Icon#createWithFilePath(String)}. @see #getType */ TYPE_URI : "4", /** An icon that was created using {@link android.graphics.drawable.Icon#createWithAdaptiveBitmap}. @see #getType */ TYPE_ADAPTIVE_BITMAP : "5", /**@hide */ MIN_ASHMEM_ICON_SIZE : "131072", /***/ CREATOR : "null", /**Gets the type of the icon provided. <p> Note that new types may be added later, so callers should guard against other types being returned. */ getType : function( ) {}, /** @return {Object {android.graphics.Bitmap}} The {@link android.graphics.Bitmap} held by this {@link #TYPE_BITMAP} Icon. @hide */ getBitmap : function( ) {}, /** @return {Number} The length of the compressed bitmap byte array held by this {@link #TYPE_DATA} Icon. @hide */ getDataLength : function( ) {}, /** @return {Number} The offset into the byte array held by this {@link #TYPE_DATA} Icon at which valid compressed bitmap data is found. @hide */ getDataOffset : function( ) {}, /** @return {Number} The byte array held by this {@link #TYPE_DATA} Icon ctonaining compressed bitmap data. @hide */ getDataBytes : function( ) {}, /** @return {Object {android.content.res.Resources}} The {@link android.content.res.Resources} for this {@link #TYPE_RESOURCE} Icon. @hide */ getResources : function( ) {}, /**Gets the package used to create this icon. <p> Only valid for icons of type {@link #TYPE_RESOURCE}. Note: This package may not be available if referenced in the future, and it is up to the caller to ensure safety if this package is re-used and/or persisted. */ getResPackage : function( ) {}, /**Gets the resource used to create this icon. <p> Only valid for icons of type {@link #TYPE_RESOURCE}. Note: This resource may not be available if the application changes at all, and it is up to the caller to ensure safety if this resource is re-used and/or persisted. */ getResId : function( ) {}, /** @return {String} The URI (as a String) for this {@link #TYPE_URI} Icon. @hide */ getUriString : function( ) {}, /**Gets the uri used to create this icon. <p> Only valid for icons of type {@link #TYPE_URI}. Note: This uri may not be available in the future, and it is up to the caller to ensure safety if this uri is re-used and/or persisted. */ getUri : function( ) {}, /**Invokes {@link #loadDrawable}(Context) on the given {@link android.os.Handler Handler} and then sends <code>andThen</code> to the same Handler when finished. @param {Object {Context}} context {@link android.content.Context Context} in which to load the drawable; see {@link #loadDrawable(Context)} @param {Object {Message}} andThen {@link android.os.Message} to send to its target once the drawable is available. The {@link android.os.Message#obj obj} property is populated with the Drawable. */ loadDrawableAsync : function( ) {}, /**Invokes {@link #loadDrawable}(Context) on a background thread and notifies the <code> {@link android.graphics.drawable.Icon.OnDrawableLoadedListener#onDrawableLoaded listener} </code> on the {@code handler} when finished. @param {Object {Context}} context {@link Context Context} in which to load the drawable; see {@link #loadDrawable(Context)} @param {Object {Icon.OnDrawableLoadedListener}} listener to be {@link OnDrawableLoadedListener#onDrawableLoaded notified} when {@link #loadDrawable(Context)} finished @param {Object {Handler}} handler {@link Handler} on which to notify the {@code listener} */ loadDrawableAsync : function( ) {}, /**Returns a Drawable that can be used to draw the image inside this Icon, constructing it if necessary. Depending on the type of image, this may not be something you want to do on the UI thread, so consider using {@link #loadDrawableAsync(Context, Message) loadDrawableAsync} instead. @param {Object {Context}} context {@link android.content.Context Context} in which to load the drawable; used to access {@link android.content.res.Resources Resources}, for example. @return {Object {android.graphics.drawable.Drawable}} A fresh instance of a drawable for this image, yours to keep. */ loadDrawable : function( ) {}, /**Load the requested resources under the given userId, if the system allows it, before actually loading the drawable. @hide */ loadDrawableAsUser : function( ) {}, /**Puts the memory used by this instance into Ashmem memory, if possible. @hide */ convertToAshmem : function( ) {}, /**Writes a serialized version of an Icon to the specified stream. @param {Object {OutputStream}} stream The stream on which to serialize the Icon. @hide */ writeToStream : function( ) {}, /**Create an Icon from the specified stream. @param {Object {InputStream}} stream The input stream from which to reconstruct the Icon. @hide */ createFromStream : function( ) {}, /**Compares if this icon is constructed from the same resources as another icon. Note that this is an inexpensive operation and doesn't do deep Bitmap equality comparisons. @param {Object {Icon}} otherIcon the other icon @return {Boolean} whether this icon is the same as the another one @hide */ sameAs : function( ) {}, /**Create an Icon pointing to a drawable resource. @param {Object {Context}} context The context for the application whose resources should be used to resolve the given resource ID. @param {Number} resId ID of the drawable resource */ createWithResource : function( ) {}, /**Version of createWithResource that takes Resources. Do not use. @hide */ createWithResource : function( ) {}, /**Create an Icon pointing to a drawable resource. @param {String} resPackage Name of the package containing the resource in question @param {Number} resId ID of the drawable resource */ createWithResource : function( ) {}, /**Create an Icon pointing to a bitmap in memory. @param {Object {Bitmap}} bits A valid {@link android.graphics.Bitmap} object */ createWithBitmap : function( ) {}, /**Create an Icon pointing to a bitmap in memory that follows the icon design guideline defined by {@link android.graphics.drawable.AdaptiveIconDrawable}. @param {Object {Bitmap}} bits A valid {@link android.graphics.Bitmap} object */ createWithAdaptiveBitmap : function( ) {}, /**Create an Icon pointing to a compressed bitmap stored in a byte array. @param {Object {byte[]}} data Byte array storing compressed bitmap data of a type that {@link android.graphics.BitmapFactory} can decode (see {@link android.graphics.Bitmap.CompressFormat}). @param {Number} offset Offset into <code>data</code> at which the bitmap data starts @param {Number} length Length of the bitmap data */ createWithData : function( ) {}, /**Create an Icon pointing to an image file specified by URI. @param {String} uri A uri referring to local content:// or file:// image data. */ createWithContentUri : function( ) {}, /**Create an Icon pointing to an image file specified by URI. @param {Object {Uri}} uri A uri referring to local content:// or file:// image data. */ createWithContentUri : function( ) {}, /**Store a color to use whenever this Icon is drawn. @param {Number} tint a color, as in {@link Drawable#setTint(int)} @return {Object {android.graphics.drawable.Icon}} this same object, for use in chained construction */ setTint : function( ) {}, /**Store a color to use whenever this Icon is drawn. @param {Object {ColorStateList}} tintList as in {@link Drawable#setTintList(ColorStateList)}, null to remove tint @return {Object {android.graphics.drawable.Icon}} this same object, for use in chained construction */ setTintList : function( ) {}, /**Store a blending mode to use whenever this Icon is drawn. @param {Object {PorterDuff.Mode}} mode a blending mode, as in {@link Drawable#setTintMode(PorterDuff.Mode)}, may be null @return {Object {android.graphics.drawable.Icon}} this same object, for use in chained construction */ setTintMode : function( ) {}, /**Store a blending mode to use whenever this Icon is drawn. @param {Object {BlendMode}} mode a blending mode, as in {@link Drawable#setTintMode(PorterDuff.Mode)}, may be null @return {Object {android.graphics.drawable.Icon}} this same object, for use in chained construction */ setTintBlendMode : function( ) {}, /** @hide */ hasTint : function( ) {}, /**Create an Icon pointing to an image file specified by path. @param {String} path A path to a file that contains compressed bitmap data of a type that {@link android.graphics.BitmapFactory} can decode. */ createWithFilePath : function( ) {}, /** */ toString : function( ) {}, /**Parcelable interface */ describeContents : function( ) {}, /** */ writeToParcel : function( ) {}, /**Scale down a bitmap to a given max width and max height. The scaling will be done in a uniform way @param {Object {Bitmap}} bitmap the bitmap to scale down @param {Number} maxWidth the maximum width allowed @param {Number} maxHeight the maximum height allowed @return {Object {android.graphics.Bitmap}} the scaled bitmap if necessary or the original bitmap if no scaling was needed @hide */ scaleDownIfNecessary : function( ) {}, /**Scale down this icon to a given max width and max height. The scaling will be done in a uniform way and currently only bitmaps are supported. @param {Number} maxWidth the maximum width allowed @param {Number} maxHeight the maximum height allowed @hide */ scaleDownIfNecessary : function( ) {}, };