Freigeben über


DevicePolicyResourcesManager.GetDrawableForDensity Method

Definition

Overloads

GetDrawableForDensity(String, String, Int32, ISupplier)

Similar to #getDrawable(String, String, Supplier), but also accepts density.

GetDrawableForDensity(String, String, String, Int32, ISupplier)

Similar to #getDrawable(String, String, String, Supplier), but also accepts density.

GetDrawableForDensity(String, String, Int32, ISupplier)

Similar to #getDrawable(String, String, Supplier), but also accepts density.

[Android.Runtime.Register("getDrawableForDensity", "(Ljava/lang/String;Ljava/lang/String;ILjava/util/function/Supplier;)Landroid/graphics/drawable/Drawable;", "GetGetDrawableForDensity_Ljava_lang_String_Ljava_lang_String_ILjava_util_function_Supplier_Handler", ApiSince=33)]
public virtual Android.Graphics.Drawables.Drawable? GetDrawableForDensity (string drawableId, string drawableStyle, int density, Java.Util.Functions.ISupplier defaultDrawableLoader);
[<Android.Runtime.Register("getDrawableForDensity", "(Ljava/lang/String;Ljava/lang/String;ILjava/util/function/Supplier;)Landroid/graphics/drawable/Drawable;", "GetGetDrawableForDensity_Ljava_lang_String_Ljava_lang_String_ILjava_util_function_Supplier_Handler", ApiSince=33)>]
abstract member GetDrawableForDensity : string * string * int * Java.Util.Functions.ISupplier -> Android.Graphics.Drawables.Drawable
override this.GetDrawableForDensity : string * string * int * 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.

density
Int32

The desired screen density indicated by the resource as found in DisplayMetrics. A value of 0 means to use the density returned from Resources#getConfiguration().

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 density. See Resources#getDrawableForDensity(int, int, Resources.Theme).

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.getDrawableForDensity(java.lang.String, java.lang.String, int, 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

GetDrawableForDensity(String, String, String, Int32, ISupplier)

Similar to #getDrawable(String, String, String, Supplier), but also accepts density.

[Android.Runtime.Register("getDrawableForDensity", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/util/function/Supplier;)Landroid/graphics/drawable/Drawable;", "GetGetDrawableForDensity_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_ILjava_util_function_Supplier_Handler", ApiSince=33)]
public virtual Android.Graphics.Drawables.Drawable? GetDrawableForDensity (string drawableId, string drawableStyle, string drawableSource, int density, Java.Util.Functions.ISupplier defaultDrawableLoader);
[<Android.Runtime.Register("getDrawableForDensity", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/util/function/Supplier;)Landroid/graphics/drawable/Drawable;", "GetGetDrawableForDensity_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_ILjava_util_function_Supplier_Handler", ApiSince=33)>]
abstract member GetDrawableForDensity : string * string * string * int * Java.Util.Functions.ISupplier -> Android.Graphics.Drawables.Drawable
override this.GetDrawableForDensity : string * string * string * int * 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.

density
Int32

The desired screen density indicated by the resource as found in DisplayMetrics. A value of 0 means to use the density returned from Resources#getConfiguration().

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, String, Supplier), but also accepts density. See Resources#getDrawableForDensity(int, int, Resources.Theme).

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.getDrawableForDensity(java.lang.String, java.lang.String, java.lang.String, int, 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