Glyph

public final class Glyph implements Parcelable


Defines a glyph, which is the element at the center of a marker icon. By default, this is a circle, but can be configured to have a different color, or set to some text or url. We don't render the glyph when it's explicitly set to the empty string.

Summary

Constants

static final Parcelable.Creator<Glyph>
static final float

The default radius of the glyph in dp.

static final int
DEFAULT_COLOR = -5041134

The default color of the glyph in ARGB format.

static final int
DEFAULT_COLOR_ABGR = -15592269

The default color of the glyph in ABGR format.

static final float

The default x coordinate of the glyph in dp.

static final float

The default y coordinate of the glyph in dp.

Public methods

boolean
static @NonNull Glyph

Creates a glyph instance using the default circle.

static @NonNull Glyph
fromColor(@ColorInt int color)

Creates a glyph instance with a custom color and default circle.

static @NonNull Glyph

Creates a glyph instance with the specified text.

@ColorInt int

Returns the ARGB color of the glyph.

@Nullable ImageView

Returns the ImageView (reference to the PNG image) of the entire glyph contents.

@Nullable String

Returns the text of the glyph.

int
void
setColor(@ColorInt int color)

Sets the ARGB color of the glyph.

void

Sets the ImageView (png image contents of the entire glyph) to draw the image to render the entire glyph contents.

void

Sets the text of the glyph.

void
writeToParcel(@NonNull Parcel out, int flags)

Inherited Constants

From android.os.Parcelable
static final int
static final int

Inherited methods

From android.os.Parcelable
abstract int

Constants

CREATOR

public static final Parcelable.Creator<GlyphCREATOR

DEFAULT_CIRCLE_RADIUS_DP

public static final float DEFAULT_CIRCLE_RADIUS_DP = 5.0f

The default radius of the glyph in dp.

DEFAULT_COLOR

public static final int DEFAULT_COLOR = -5041134

The default color of the glyph in ARGB format.

DEFAULT_COLOR_ABGR

public static final int DEFAULT_COLOR_ABGR = -15592269

The default color of the glyph in ABGR format.

X_COORDINATE_DP

public static final float X_COORDINATE_DP = 13.0f

The default x coordinate of the glyph in dp.

Y_COORDINATE_DP

public static final float Y_COORDINATE_DP = 13.0f

The default y coordinate of the glyph in dp.

Public fields

color

public @ColorInt int color

image

public @Nullable ImageView image

text

public @Nullable String text

Public methods

equals

public boolean equals(@Nullable Object other)

fromCircle

public static @NonNull Glyph fromCircle()

Creates a glyph instance using the default circle.

fromColor

public static @NonNull Glyph fromColor(@ColorInt int color)

Creates a glyph instance with a custom color and default circle.

fromText

public static @NonNull Glyph fromText(@NonNull String text)

Creates a glyph instance with the specified text.

getColor

public @ColorInt int getColor()

Returns the ARGB color of the glyph.

getImage

public @Nullable ImageView getImage()

Returns the ImageView (reference to the PNG image) of the entire glyph contents.

getText

public @Nullable String getText()

Returns the text of the glyph.

hashCode

public int hashCode()

setColor

public void setColor(@ColorInt int color)

Sets the ARGB color of the glyph. Sets a color filter over the image glyph.

setImage

public void setImage(@NonNull ImageView image)

Sets the ImageView (png image contents of the entire glyph) to draw the image to render the entire glyph contents. Replaces all previous glyph context except for color.

setText

public void setText(@NonNull String text)

Sets the text of the glyph. This does not affect the image glyph.

writeToParcel

public void writeToParcel(@NonNull Parcel out, int flags)