Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IGraphicsModule

interface IGraphicsModule
Extends com.amazon.apmf.IStandard UI graphics module This interface acts as an entry point factory for graphics rendering.

Methods

makeFontStyle()

IFontStyle* makeFontStyle(FontWeight weight, FontWidth width, FontSlant slant)
This function creates a new font style object with the specified weight, width, and slant.

Parameters

weight
FontWeight — Required The weight of the font (e.g., Normal, Bold, etc.).
width
FontWidth — Required The width of the font (e.g., Normal, Condensed, etc.).
slant
FontSlant — Required The slant of the font (e.g. Italic, Oblique etc.).

Returns

IFontStyle* the newly created font style object.

makeTextStyleBuilder()

ITextStyleBuilder* makeTextStyleBuilder()
This function creates and returns a new instance of an ITextStyleBuilder, which can be used to build and customize text styles for rendering text.

Returns

ITextStyleBuilder* An ITextStyleBuilder object.

makeAttributedText()

IAttributedText* makeAttributedText(string text, ISpan*[] spans)
This function takes a plain text string and an array of ISpan objects to create an attributed text object. Each span represents a range of the text with specific attributes such as formatting or styling.

Parameters

text
string — Required The plain text content for the attributed text.
spans
ISpan*[] — Required An array of ISpan objects representing the text spans with attributes.

Returns

IAttributedText* An IAttributedText instance representing the attributed text.

makeTextLayoutBuilder()

ITextLayoutBuilder* makeTextLayoutBuilder(float width, IAttributedText* text)
This function creates and returns an ITextLayoutBuilder, which is a tool for constructing text layouts with specific attributes and formatting. You can use the builder to define various text properties and then generate a finalized ITextLayout.

Parameters

width
float — Required Maximum width for the text layout.
text
IAttributedText* — Required Attributed text for the text layout.

Returns

ITextLayoutBuilder* An ITextLayoutBuilder instance for constructing text layouts.

Throws


makeParagraphStyleBuilder()

IParagraphStyleBuilder* makeParagraphStyleBuilder()
This function creates and returns a new instance of an IParagraphStyleBuilder, which can be used to build and customize paragraph styles for rendering text.

Returns

IParagraphStyleBuilder* an IParagraphStyleBuilder object.

makeLineBreakLayoutSpan()

ILayoutSpan* makeLineBreakLayoutSpan(i32 index)
This function creates a layout span that specifies a line break at the specified character index. When applied, this span will cause a line break in the rendered text at the specified index.

Parameters

index
i32 — Required The character index at which the line break should occur.

Returns

ILayoutSpan* A newly created layout span object.

Throws


makeNoLineBreakLayoutSpan()

ILayoutSpan* makeNoLineBreakLayoutSpan(i32 start, i32 end)
This function creates a layout span that represents a continuous span of content without any line breaks within the specified range.

Parameters

start
i32 — Required The starting index of the text range (inclusive).
end
i32 — Required The ending index of the text range (inclusive).

Returns

ILayoutSpan* A newly created layout span object. Note: The indices specified by start and end are inclusive, meaning that the characters at both indices are included in the layout span.

Throws


makeTextStyleSpan()

ITextStyleSpan* makeTextStyleSpan(i32 start, i32 end, ITextStyle* style)
The makeTextStyleSpan method creates a text style span, which represents a portion of text with a specific style, within the given character range.

Parameters

start
i32 — Required The starting index of the text span (inclusive).
end
i32 — Required The ending index of the text span (inclusive).
style
ITextStyle* — Required The text styling to be applied to the span.

Returns

ITextStyleSpan* A newly created text style span object. Note: The character indices are inclusive, meaning that the text span includes characters at both the start and end indices.

Throws


makeOffsetLayer()

IOffsetLayer* makeOffsetLayer(Point offset)
Make a offset layer with offset value

Parameters

offset
Point — Required offset specified

Returns

IOffsetLayer* offset layer

makeTransformLayer()

ITransformLayer* makeTransformLayer(AffineMatrix* matrix)
Make a transform layer

Parameters

matrix
AffineMatrix* — Required transform matrix

Returns

ITransformLayer* TransformLayer

makeDrawableLayer()

IDrawableLayer* makeDrawableLayer(IDrawableLayerDelegate* t)
Return drawable layer which draws on canvas

Parameters

t
IDrawableLayerDelegate* — Required Custom callback to draw on canvas

Returns

IDrawableLayer* DrawableLayer Note: The delegate can be retrieved later using IDrawableLayer2::getDelegate.

makeClipRRectLayer()

IClipRRectLayer* makeClipRRectLayer(RRect* rRect)
Make ClipRRectLayer which clips canvas intersecting with RRect with antialiased enabled by default.

Parameters

rRect
RRect* — Required clipping RRect

Returns

IClipRRectLayer* ClipRRectLayer

makeClipRectLayer()

IClipRectLayer* makeClipRectLayer(Rect* rect)
Make ClipRectLayer which clips canvas intersecting with Rect with antialiased enabled by default.

Parameters

rect
Rect* — Required clipping Rect

Returns

IClipRectLayer* ClipRectLayer

makeOpacityLayer()

IOpacityLayer* makeOpacityLayer(float opacity)
Make opacity layer

Parameters

opacity
float — Required set opacity value

Returns

IOpacityLayer* OpacityLayer

makePlaceholderLayer()

IPlaceholderLayer* makePlaceholderLayer()
This method creates a new instance of IPlaceholderLayer, which is a ILayer subclass that does not affect the drawing but provides notifications for its size, position, and invalidation status.

Returns

IPlaceholderLayer* IPlaceholderLayer The newly created IPlaceholderLayer instance.

makeShadowBuilder()

IShadowBuilder* makeShadowBuilder()
Creates a new IShadowBuilder object. This function creates and returns a new instance of an IShadowBuilder, which can be used to build and customize shadows of the view.

Returns

IShadowBuilder* An IShadowBuilder object.

tryGetUIRunLoop()

IRunLoop? tryGetUIRunLoop()
This function is used to retrieve the IRunLoop associated with the UI/main thread.

Returns

IRunLoop? The return value is optional and might be absent. The IRunLoop instance associated with the UI/main thread. NULL may be returned if an IRunLoop has not yet been initialized for the UI/main thread.

makePathBuilder()

IPathBuilder* makePathBuilder()
This method creates and returns a new instance of an IPathBuilder which can be used to build and customize Path object for drawing.

Returns

IPathBuilder* An IPathBuilder object.

makePaint()

IPaint* makePaint()
This method creates and returns a new instance of an IPaint, which can be used for drawing.

Returns

IPaint* An IPaint object.

makeBlendModeColorFilter()

IColorFilter* makeBlendModeColorFilter(Color* color, BlendMode blendMode)
Create a IColorFilter with given Color and BlendMode

Parameters

color
Color* — Required Color value of the color filter
blendMode
BlendMode — Required BlendMode of the color filter

Returns

IColorFilter* IColorFilter blend mode color filter instance

makeColorMatrixColorFilter()

IColorFilter* makeColorMatrixColorFilter(ColorMatrix* colorMatrix)
This function creates an instance of a IColorFilter with given 4x5 ColorMatrix

Parameters

colorMatrix
ColorMatrix* — Required to 4x5 ColorMatrix

Returns

IColorFilter* Newly created IColorFilter instance

makeBlurMaskFilter()

IMaskFilter* makeBlurMaskFilter(float raidus, BlurStyle style)
This function creates an instance of a IMaskFilter that applies a blur effect to masks with the given radius and BlurStyle.

Parameters

raidus
float — Required The radius of the blur effect. Larger values produce a more pronounced blur.
style
BlurStyle — Required The style of the blur effect, defining its appearance.

Returns

IMaskFilter* Newly created IMaskFilter.

makeDashPathEffect()

IPathEffect* makeDashPathEffect(float[] intervals, float phase)
This method creates a new instance of IPathEffect with the specified dash intervals and phase.

Parameters

intervals
float[] — Required An array of floating-point values representing the intervals of the dash pattern.
phase
float — Required The phase offset of the dash pattern.

Returns

IPathEffect* Newly created IPathEffect instance.

makeLinearGradientShader()

IShader* makeLinearGradientShader(Point start, Point end, Color[] colors, TileMode tileMode, float[]? positions, AffineMatrix? matrix)
Creates a new instance of IShader with the specified parameters. This function creates a new instance of IShader, which represents a linear gradient shader, with the provided start and end points, array of colors, and tile mode.

Parameters

start
Point — Required The starting point of the linear gradient.
end
Point — Required The ending point of the linear gradient.
colors
Color[] — Required An array of colors defining the gradient’s color stops.
tileMode
TileMode — Required The tile mode to be used for the gradient (e.g., clamp, repeat, mirror).
positions
float[]? — Optional The relative positions {0..1} of each corresponding color in the colors array. If this is null, the the colors are distributed evenly along the gradient line.
matrix
AffineMatrix? — Optional set the matrix object for the shader

Returns

IShader* A pointer to the newly created IShader instance.

makeRadialGradientShader()

IShader* makeRadialGradientShader(Point center, float radius, Color[] colors, TileMode tileMode, float[]? positions, AffineMatrix? matrix)
Creates a new instance of IShader with the specified parameters. This function creates a new instance of IShader, which represents a radial gradient shader, with the provided start and end points, array of colors, positions of each corresponding color and tile mode.

Parameters

center
Point — Required The center of the circle for this gradient.
radius
float — Required The radius of the circle for this gradient.
colors
Color[] — Required Holds memory for colors of size count distributed between the center and edge of the circle.
tileMode
TileMode — Required The tile mode to be used for the gradient (e.g., clamp, repeat, mirror).
positions
float[]? — Optional The values must begin with 0, end with 1.0, and intermediate values must be strictly increasing.
matrix
AffineMatrix? — Optional set the matrix object for the shader

Returns

IShader* A pointer to the newly created IShader instance.

getMemoryCacheManager()

IMemoryCacheManager* getMemoryCacheManager()
Gets the instance of IMemoryCacheManager

Returns

IMemoryCacheManager* pointer to IMemoryCacheManager

makeTypefaceFromFile()

ITypeface* makeTypefaceFromFile(string filePath)
This method creates an ITypeface instance from a font file. The client is responsible for ensuring that the specified path is accessible by the platform. For example, on Android, necessary permissions should be added in AndroidManifest.xml to access the storage directory.

Parameters

filePath
string — Required The absolute path to the font file.

Returns

ITypeface* An ITypeface instance representing the created typeface.

Throws

  • InvalidArgumentError — If there is an issue accessing the specified font file (e.g., file not found, insufficient permissions, or invalid path)

makeTypefaceFromAssets()

ITypeface* makeTypefaceFromAssets(string assetPath)
This method creates an ITypeface instance from a path of the asset relative to the application assets directory.

Parameters

assetPath
string — Required The path to the font asset relative to the application assets directory.

Returns

ITypeface* An ITypeface instance representing the created typeface.

Throws

  • InvalidArgumentError — If there is an issue accessing the specified font file (e.g., file not found, insufficient permissions, or invalid path)

makeTypefaceFromName()

ITypeface* makeTypefaceFromName(string familyName, IFontStyle* fontStyle)
This method creates an ITypeface instance that most closely matches the requested familyName and fontStyle. It it fails to create a typeface with the given family name and styling, it will fallback to default system typeface.

Parameters

familyName
string — Required The name of the font family.
fontStyle
IFontStyle* — Required An IFontStyle object representing the desired font style.

Returns

ITypeface* An ITypeface object.

makeFont()

IFont* makeFont(ITypeface* typeface, float size)
This method creates an IFont instance with the specified ITypeface instance and size.

Parameters

typeface
ITypeface* — Required An ITypeface object representing the ITypeface.
size
float — Required The desired size of the font.

Returns

IFont* An IFont object representing the created font.

Throws


Last modified on October 29, 2026