Google is committed to advancing racial equity for Black communities. See how.
Added in API level 24

PointerIcon

class PointerIcon : Parcelable
kotlin.Any
   ↳ android.view.PointerIcon

Represents an icon that can be used as a mouse pointer.

Pointer icons can be provided either by the system using system types, or by applications using bitmaps or application resources.

Summary

Constants
static Int

Type constant: alias (indicating an alias of/shortcut to something is to be created.

static Int

Type constant: all-scroll.

static Int

Type constant: Arrow icon.

static Int

Type constant: cell.

static Int

Type constant: context-menu.

static Int

Type constant: copy.

static Int

Type constant: crosshair.

static Int

The default pointer icon.

static Int

Type constant: grab.

static Int

Type constant: grabbing.

static Int

Type constant: hand.

static Int

Type constant: help.

static Int

Type constant: horizontal double arrow mainly for resizing.

static Int

Type constant: no-drop.

static Int

Type constant: Null icon.

static Int

Type constant: text.

static Int

Type constant: diagonal double arrow -- top-left to bottom-right.

static Int

Type constant: diagonal double arrow -- top-right to bottom-left.

static Int

Type constant: vertical double arrow mainly for resizing.

static Int

Type constant: vertical-text.

static Int

Type constant: wait.

static Int

Type constant: zoom-in.

static Int

Type constant: zoom-out.

Inherited constants
Public methods
static PointerIcon!
create(bitmap: Bitmap, hotSpotX: Float, hotSpotY: Float)

Creates a custom pointer icon from the given bitmap and hotspot information.

Int

Boolean
equals(other: Any?)

static PointerIcon!
getSystemIcon(context: Context, type: Int)

Gets a system pointer icon for the given type.

static PointerIcon!
load(resources: Resources, resourceId: Int)

Loads a custom pointer icon from an XML resource.

Unit
writeToParcel(out: Parcel!, flags: Int)

Properties
static Parcelable.Creator<PointerIcon!>

Constants

TYPE_ALIAS

Added in API level 24
static val TYPE_ALIAS: Int

Type constant: alias (indicating an alias of/shortcut to something is to be created.

Value: 1010

TYPE_ALL_SCROLL

Added in API level 24
static val TYPE_ALL_SCROLL: Int

Type constant: all-scroll.

Value: 1013

TYPE_ARROW

Added in API level 24
static val TYPE_ARROW: Int

Type constant: Arrow icon. (Default mouse pointer)

Value: 1000

TYPE_CELL

Added in API level 24
static val TYPE_CELL: Int

Type constant: cell.

Value: 1006

TYPE_CONTEXT_MENU

Added in API level 24
static val TYPE_CONTEXT_MENU: Int

Type constant: context-menu.

Value: 1001

TYPE_COPY

Added in API level 24
static val TYPE_COPY: Int

Type constant: copy.

Value: 1011

TYPE_CROSSHAIR

Added in API level 24
static val TYPE_CROSSHAIR: Int

Type constant: crosshair.

Value: 1007

TYPE_DEFAULT

Added in API level 24
static val TYPE_DEFAULT: Int

The default pointer icon.

Value: 1000

TYPE_GRAB

Added in API level 24
static val TYPE_GRAB: Int

Type constant: grab.

Value: 1020

TYPE_GRABBING

Added in API level 24
static val TYPE_GRABBING: Int

Type constant: grabbing.

Value: 1021

TYPE_HAND

Added in API level 24
static val TYPE_HAND: Int

Type constant: hand.

Value: 1002

TYPE_HELP

Added in API level 24
static val TYPE_HELP: Int

Type constant: help.

Value: 1003

TYPE_HORIZONTAL_DOUBLE_ARROW

Added in API level 24
static val TYPE_HORIZONTAL_DOUBLE_ARROW: Int

Type constant: horizontal double arrow mainly for resizing.

Value: 1014

TYPE_NO_DROP

Added in API level 24
static val TYPE_NO_DROP: Int

Type constant: no-drop.

Value: 1012

TYPE_NULL

Added in API level 24
static val TYPE_NULL: Int

Type constant: Null icon. It has no bitmap.

Value: 0

TYPE_TEXT

Added in API level 24
static val TYPE_TEXT: Int

Type constant: text.

Value: 1008

TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW

Added in API level 24
static val TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW: Int

Type constant: diagonal double arrow -- top-left to bottom-right.

Value: 1017

TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW

Added in API level 24
static val TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW: Int

Type constant: diagonal double arrow -- top-right to bottom-left.

Value: 1016

TYPE_VERTICAL_DOUBLE_ARROW

Added in API level 24
static val TYPE_VERTICAL_DOUBLE_ARROW: Int

Type constant: vertical double arrow mainly for resizing.

Value: 1015

TYPE_VERTICAL_TEXT

Added in API level 24
static val TYPE_VERTICAL_TEXT: Int

Type constant: vertical-text.

Value: 1009

TYPE_WAIT

Added in API level 24
static val TYPE_WAIT: Int

Type constant: wait.

Value: 1004

TYPE_ZOOM_IN

Added in API level 24
static val TYPE_ZOOM_IN: Int

Type constant: zoom-in.

Value: 1018

TYPE_ZOOM_OUT

Added in API level 24
static val TYPE_ZOOM_OUT: Int

Type constant: zoom-out.

Value: 1019

Public methods

create

Added in API level 24
static fun create(
    bitmap: Bitmap,
    hotSpotX: Float,
    hotSpotY: Float
): PointerIcon!

Creates a custom pointer icon from the given bitmap and hotspot information.

Parameters
bitmap Bitmap: The bitmap for the icon. This value cannot be null.
hotSpotX Float: The X offset of the pointer icon hotspot in the bitmap. Must be within the [0, bitmap.getWidth()) range.
hotSpotY Float: The Y offset of the pointer icon hotspot in the bitmap. Must be within the [0, bitmap.getHeight()) range.
Return
PointerIcon! A pointer icon for this bitmap.
Exceptions
java.lang.IllegalArgumentException if bitmap is null, or if the x/y hotspot parameters are invalid.

describeContents

Added in API level 24
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 24
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getSystemIcon

Added in API level 24
static fun getSystemIcon(
    context: Context,
    type: Int
): PointerIcon!

Gets a system pointer icon for the given type. If typeis not recognized, returns the default pointer icon.

Parameters
context Context: The context. This value cannot be null.
type Int: The pointer icon type.
Return
PointerIcon! The pointer icon.
Exceptions
java.lang.IllegalArgumentException if context is null.

load

Added in API level 24
static fun load(
    resources: Resources,
    resourceId: Int
): PointerIcon!

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 Resources: The resources object. This value cannot be null.
resourceId Int: The resource id.
Return
PointerIcon! The pointer icon.
Exceptions
java.lang.IllegalArgumentException if resources is null.
android.content.res.Resources.NotFoundException if the resource was not found or the drawable linked in the resource was not found.

writeToParcel

Added in API level 24
fun writeToParcel(
    out: Parcel!,
    flags: Int
): Unit
Parameters
dest The Parcel in which the object should be written.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 24
static val CREATOR: Parcelable.Creator<PointerIcon!>