Share via


DevicePolicyResourcesManager.GetDrawable Method

Definition

Overloads

GetDrawable(String, String, ISupplier)

Returns the appropriate updated drawable for the drawableId with style drawableStyle if one was set using setDrawables, otherwise returns the drawable from defaultDrawableLoader.

GetDrawable(String, String, String, ISupplier)

Similar to #getDrawable(String, String, Supplier), but also accepts a drawableSource which could result in returning a different drawable than #getDrawable(String, String, Supplier) if an override was set for that specific source.

GetDrawable(String, String, ISupplier)

Returns the appropriate updated drawable for the drawableId with style drawableStyle if one was set using setDrawables, otherwise returns the drawable from defaultDrawableLoader.

[Android.Runtime.Register("getDrawable", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/function/Supplier;)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_Ljava_lang_String_Ljava_lang_String_Ljava_util_function_Supplier_Handler", ApiSince=33)]
public virtual Android.Graphics.Drawables.Drawable? GetDrawable (string drawableId, string drawableStyle, Java.Util.Functions.ISupplier defaultDrawableLoader);
[<Android.Runtime.Register("getDrawable", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/function/Supplier;)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_Ljava_lang_String_Ljava_lang_String_Ljava_util_function_Supplier_Handler", ApiSince=33)>]
abstract member GetDrawable : string * string * Java.Util.Functions.ISupplier -> Android.Graphics.Drawables.Drawable
override this.GetDrawable : string * string * Java.Util.Functions.ISupplier -> Android.Graphics.Drawables.Drawable

Parameters

drawableId
String

The drawable ID to get the updated resource for.

drawableStyle
String

The drawable style to use.

defaultDrawableLoader
ISupplier

To get the default drawable if no updated drawable was set for the provided params.

Returns

Attributes

Remarks

Returns the appropriate updated drawable for the drawableId with style drawableStyle if one was set using setDrawables, otherwise returns the drawable from defaultDrawableLoader.

Also returns the drawable from defaultDrawableLoader if drawableId is DevicePolicyResources#UNDEFINED.

Calls to this API will not return null unless no updated drawable was found and the call to defaultDrawableLoader returned null.

This API uses the screen density returned from Resources#getConfiguration(), to set a different value use #getDrawableForDensity(String, String, int, Supplier).

Callers should register for DevicePolicyManager#ACTION_DEVICE_POLICY_RESOURCE_UPDATED to get notified when a resource has been updated.

Note that each call to this API loads the resource from the package that called setDrawables to set the updated resource.

Java documentation for android.app.admin.DevicePolicyResourcesManager.getDrawable(java.lang.String, java.lang.String, java.util.function.Supplier<android.graphics.drawable.Drawable>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetDrawable(String, String, String, ISupplier)

Similar to #getDrawable(String, String, Supplier), but also accepts a drawableSource which could result in returning a different drawable than #getDrawable(String, String, Supplier) if an override was set for that specific source.

[Android.Runtime.Register("getDrawable", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/function/Supplier;)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_util_function_Supplier_Handler", ApiSince=33)]
public virtual Android.Graphics.Drawables.Drawable? GetDrawable (string drawableId, string drawableStyle, string drawableSource, Java.Util.Functions.ISupplier defaultDrawableLoader);
[<Android.Runtime.Register("getDrawable", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/function/Supplier;)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_util_function_Supplier_Handler", ApiSince=33)>]
abstract member GetDrawable : string * string * string * Java.Util.Functions.ISupplier -> Android.Graphics.Drawables.Drawable
override this.GetDrawable : string * string * string * Java.Util.Functions.ISupplier -> Android.Graphics.Drawables.Drawable

Parameters

drawableId
String

The drawable ID to get the updated resource for.

drawableStyle
String

The drawable style to use.

drawableSource
String

The source for the caller.

defaultDrawableLoader
ISupplier

To get the default drawable if no updated drawable was set for the provided params.

Returns

Attributes

Remarks

Similar to #getDrawable(String, String, Supplier), but also accepts a drawableSource which could result in returning a different drawable than #getDrawable(String, String, Supplier) if an override was set for that specific source.

If drawableSource is DevicePolicyResources#UNDEFINED, it returns the appropriate string for drawableId and drawableStyle similar to #getDrawable(String, String, Supplier).

Calls to this API will not return null unless no updated drawable was found and the call to defaultDrawableLoader returned null.

Callers should register for DevicePolicyManager#ACTION_DEVICE_POLICY_RESOURCE_UPDATED to get notified when a resource has been updated.

Java documentation for android.app.admin.DevicePolicyResourcesManager.getDrawable(java.lang.String, java.lang.String, java.lang.String, java.util.function.Supplier<android.graphics.drawable.Drawable>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to