Added in API level 33

MagnificationConfig


class MagnificationConfig : Parcelable
kotlin.Any
   ↳ android.accessibilityservice.MagnificationConfig

This class describes the magnification config for AccessibilityService to control the magnification.

When the magnification config uses MAGNIFICATION_MODE_DEFAULT, AccessibilityService will be able to control the activated magnifier on the display. If there is no magnifier activated, it controls the last-activated magnification mode. If there is no magnifier activated before, it controls full-screen magnifier by default.

When the magnification config uses MAGNIFICATION_MODE_FULLSCREEN. AccessibilityService will be able to control full-screen magnifier on the display.

When the magnification config uses MAGNIFICATION_MODE_WINDOW and the platform supports android.content.pm.PackageManager#FEATURE_WINDOW_MAGNIFICATION feature. AccessibilityService will be able to control window magnifier on the display.

If the other magnification configs, scale centerX and centerY, are not set by the Builder, the configs should be current values or default values. And the center position ordinarily is the center of the screen.

Summary

Nested classes

Builder for creating MagnificationConfig objects.

Constants
static Int

The controlling magnification mode.

static Int

The controlling magnification mode.

static Int

The controlling magnification mode.

Inherited constants
Public methods
Int

Float

Returns the screen-relative X coordinate of the center of the magnification viewport.

Float

Returns the screen-relative Y coordinate of the center of the magnification viewport.

Int

Returns the magnification mode that is the current activated mode or the controlling mode of the config.

Float

Returns the magnification scale of the controlling magnifier

Boolean

Returns the activated state of the controlling magnifier.

String

Returns a string representation of the object.

Unit
writeToParcel(parcel: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<MagnificationConfig!>

Constants

MAGNIFICATION_MODE_DEFAULT

Added in API level 33
static val MAGNIFICATION_MODE_DEFAULT: Int

The controlling magnification mode. It controls the activated magnifier.

Value: 0

MAGNIFICATION_MODE_FULLSCREEN

Added in API level 33
static val MAGNIFICATION_MODE_FULLSCREEN: Int

The controlling magnification mode. It controls full-screen magnifier.

Value: 1

MAGNIFICATION_MODE_WINDOW

Added in API level 33
static val MAGNIFICATION_MODE_WINDOW: Int

The controlling magnification mode. It is valid if the platform supports android.content.pm.PackageManager#FEATURE_WINDOW_MAGNIFICATION feature.

Value: 2

Public methods

describeContents

Added in API level 33
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

getCenterX

Added in API level 33
fun getCenterX(): Float

Returns the screen-relative X coordinate of the center of the magnification viewport.

Return
Float The X coordinate

getCenterY

Added in API level 33
fun getCenterY(): Float

Returns the screen-relative Y coordinate of the center of the magnification viewport.

Return
Float The Y coordinate

getMode

Added in API level 33
fun getMode(): Int

Returns the magnification mode that is the current activated mode or the controlling mode of the config.

Return
Int The magnification mode

getScale

Added in API level 33
fun getScale(): Float

Returns the magnification scale of the controlling magnifier

Return
Float The magnification scale

isActivated

Added in API level 34
fun isActivated(): Boolean

Returns the activated state of the controlling magnifier. The controlling magnifier can be activated even if the scale returned by MagnificationConfig.getScale() equals to 1.0.

Return
Boolean true if the magnifier is activated and showing on screen, false otherwise.

toString

Added in API level 33
fun toString(): String

Returns a string representation of the object.

Return
String This value cannot be null.

writeToParcel

Added in API level 33
fun writeToParcel(
    parcel: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written. This value cannot be null.
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
parcel Parcel: This value cannot be null.

Properties

CREATOR

Added in API level 33
static val CREATOR: Parcelable.Creator<MagnificationConfig!>