{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

MagnifierStyle


Specifies how a magnifier should create the underlying Magnifier widget. These properties should not be changed while a magnifier is showing, since the magnifier will be dismissed and recreated with the new properties which will cause it to disappear for at least a frame.

Not all magnifier features are supported on all platforms. The isSupported property will return false for styles that cannot be fully supported on the given platform.

Summary

Public companion properties

MagnifierStyle

A MagnifierStyle with all default values.

android
MagnifierStyle

A MagnifierStyle that uses the system defaults for text magnification.

android

Public constructors

@ExperimentalFoundationApi
MagnifierStyle(
    size: DpSize,
    cornerRadius: Dp,
    elevation: Dp,
    clippingEnabled: Boolean,
    fishEyeEnabled: Boolean
)
android

Public functions

open operator Boolean
equals(other: Any?)
android
open Int
android
open String
android

Public properties

Boolean

Returns true if this style is supported by this version of the platform.

android

Public companion properties

Default

@ExperimentalFoundationApi
val DefaultMagnifierStyle

A MagnifierStyle with all default values.

TextDefault

@ExperimentalFoundationApi
val TextDefaultMagnifierStyle

A MagnifierStyle that uses the system defaults for text magnification.

Different versions of Android may use different magnifier styles for magnifying text, so using this configuration ensures that the correct style is used to match the system.

Public constructors

MagnifierStyle

@ExperimentalFoundationApi
MagnifierStyle(
    size: DpSize = DpSize.Unspecified,
    cornerRadius: Dp = Dp.Unspecified,
    elevation: Dp = Dp.Unspecified,
    clippingEnabled: Boolean = true,
    fishEyeEnabled: Boolean = false
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

isSupported

val isSupportedBoolean

Returns true if this style is supported by this version of the platform. When false is returned, it may be either because the Magnifier widget is not supported at all because the platform is too old, or because a particular style flag (e.g. fishEyeEnabled) is not supported on the current platform. Default and TextDefault styles are supported on all platforms with SDK version 28 and higher.