-
public final class PointerIconCompatHelper for accessing features in PointerIcon in a backwards compatible fashion.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intTYPE_NULLpublic final static intTYPE_ARROWpublic final static intTYPE_CONTEXT_MENUpublic final static intTYPE_HANDpublic final static intTYPE_HELPpublic final static intTYPE_WAITpublic final static intTYPE_CELLpublic final static intTYPE_CROSSHAIRpublic final static intTYPE_TEXTpublic final static intTYPE_VERTICAL_TEXTpublic final static intTYPE_ALIASpublic final static intTYPE_COPYpublic final static intTYPE_NO_DROPpublic final static intTYPE_ALL_SCROLLpublic final static intTYPE_HORIZONTAL_DOUBLE_ARROWpublic final static intTYPE_VERTICAL_DOUBLE_ARROWpublic final static intTYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROWpublic final static intTYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROWpublic final static intTYPE_ZOOM_INpublic final static intTYPE_ZOOM_OUTpublic final static intTYPE_GRABpublic final static intTYPE_GRABBINGpublic final static intTYPE_DEFAULT
-
Method Summary
Modifier and Type Method Description ObjectgetPointerIcon()static PointerIconCompatgetSystemIcon(Context context, int style)Gets a system pointer icon for the given style.If style is not recognized, returns the default pointer icon. static PointerIconCompatcreate(Bitmap bitmap, float hotSpotX, float hotSpotY)Creates a custom pointer from the given bitmap and hotspot information. static PointerIconCompatload(Resources resources, int resourceId)Loads a custom pointer icon from an XML resource. -
-
Method Detail
-
getPointerIcon
Object getPointerIcon()
-
getSystemIcon
static PointerIconCompat getSystemIcon(Context context, int style)
Gets a system pointer icon for the given style.If style is not recognized, returns the default pointer icon.
- Parameters:
context- The context.style- The pointer icon style.
-
create
static PointerIconCompat create(Bitmap bitmap, float hotSpotX, float hotSpotY)
Creates a custom pointer from the given bitmap and hotspot information.
- Parameters:
bitmap- The bitmap for the icon.hotSpotX- The X offset of the pointer icon hotspot in the bitmap.Must be within the [0, bitmap.getWidth()) range.hotSpotY- The Y offset of the pointer icon hotspot in the bitmap.Must be within the [0, bitmap.getHeight()) range.
-
load
static PointerIconCompat load(Resources resources, int resourceId)
Loads a custom pointer icon from an XML resource.
The XML resource should have the following form:
<?xml version="1.0" encoding="utf-8"?><pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"android:bitmap="@drawable/my_pointer_bitmap"android:hotSpotX="24"android:hotSpotY="24" />- Parameters:
resources- The resources object.resourceId- The resource id.
-
-
-
-