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 IUiScaleSettings

interface IUiScaleSettings
Extends com.amazon.apmf.IStandard The IUiScaleSettings interface provides APIs to query UI scale settings and calculate scaled sizes for UI elements.

Methods

getUiScaleSetting()

UiScaleSetting getUiScaleSetting()
Query the current UI scale setting.

Returns

UiScaleSetting The current UI scale setting level SCALE_SETTING_1 to SCALE_SETTING_9, where SCALE_SETTING_1 is default.

addUiScaleSettingListener()

com.amazon.apmf.ISubscription* addUiScaleSettingListener(IUiScaleSettingListener* listener)
Add a UI scale setting listener.

Parameters

listener
IUiScaleSettingListener* — Required the listener’s onUiScaleSettingChanged() method is called when the UI scale setting changes.

Returns

com.amazon.apmf.ISubscription* a ISubscription instance representing a registration of an event listener and can be used to end the delivery of any further events to the listener.

getScaledSize()

i32 getScaledSize(i32 originalSize, ItemScalingType itemScalingType, i32 maxSize, i32 minSize)
Calculates the scaled size for a UI element based on its original dimensions.

Parameters

originalSize
i32 — Required The base size of the element in density-independent pixels (DP)
itemScalingType
ItemScalingType — Required The scaling behavior of the element
maxSize
i32 — Required Maximum size limit for the scaled result
minSize
i32 — Required Minimum size limit, primarily for whitespace elements

Returns

i32 The calculated size in DP after applying scaling rules

Throws


getScalingMultiplier()

float getScalingMultiplier(i32 originalSize, ItemScalingType itemScalingType, i32 maxSize, i32 minSize)
Calculates a scaling multiplier for UI elements based on their original size. Use this method rather than getScaledSize() when you need to apply the same scaling rate to related values, like the height and width of an image.

Parameters

originalSize
i32 — Required The base size of the element in density-independent pixels (DP)
itemScalingType
ItemScalingType — Required The scaling behavior of the element
maxSize
i32 — Required Maximum size limit for scaling calculations
minSize
i32 — Required Minimum size limit, primarily for whitespace elements

Returns

float A scaling multiplier to apply to the element’s original size to calculate the recommended increased size. The multiplier will be a positive floating point number greater than 0.

Throws


Last modified on October 29, 2026