Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#nestedclasses) \| [Constants](https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#constants) \| [Inherited Constants](https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#inhconstants) \| [Fields](https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#lfields) \| [Methods](https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#inhmethods)

# MagnificationConfig

*** ** * ** ***


`
public

final

class
MagnificationConfig
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.accessibilityservice.MagnificationConfig |

<br />

*** ** * ** ***

This class describes the magnification config for `https://developer.android.com/reference/android/accessibilityservice/AccessibilityService` to control the
magnification.


When the magnification config uses `https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#MAGNIFICATION_MODE_DEFAULT`,
`https://developer.android.com/reference/android/accessibilityservice/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 `https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#MAGNIFICATION_MODE_FULLSCREEN`.
`https://developer.android.com/reference/android/accessibilityservice/AccessibilityService` will be able to control full-screen magnifier on the display.


When the magnification config uses `https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#MAGNIFICATION_MODE_WINDOW` and the platform
supports `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_WINDOW_MAGNIFICATION` feature.
`https://developer.android.com/reference/android/accessibilityservice/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
`https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig.Builder`, the configs should be current values or default values. And the center
position ordinarily is the center of the screen.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig.Builder` Builder for creating `https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig` objects. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#MAGNIFICATION_MODE_DEFAULT` The controlling magnification mode. |
| `int` | `https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#MAGNIFICATION_MODE_FULLSCREEN` The controlling magnification mode. |
| `int` | `https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#MAGNIFICATION_MODE_WINDOW` The controlling magnification mode. |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/android/os/Parcelable` |---|---| | `int` | `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. | | `int` | `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig>` | `https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#CREATOR` |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` float` | ` https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#getCenterX()() ` Returns the screen-relative X coordinate of the center of the magnification viewport. |
| ` float` | ` https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#getCenterY()() ` Returns the screen-relative Y coordinate of the center of the magnification viewport. |
| ` int` | ` https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#getMode()() ` Returns the magnification mode that is the current activated mode or the controlling mode of the config. |
| ` float` | ` https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#getScale()() ` Returns the magnification scale of the controlling magnifier |
| ` boolean` | ` https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#isActivated()() ` Returns the activated state of the controlling magnifier. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel parcel, int flags) ` Flatten this object in to a Parcel. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||
| From interface ` https://developer.android.com/reference/android/os/Parcelable ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. | | ` abstract void` | ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### MAGNIFICATION_MODE_DEFAULT

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MAGNIFICATION_MODE_DEFAULT
```

The controlling magnification mode. It controls the activated magnifier.

<br />

Constant Value:

0
(0x00000000)


### MAGNIFICATION_MODE_FULLSCREEN

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MAGNIFICATION_MODE_FULLSCREEN
```

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

<br />

Constant Value:

1
(0x00000001)


### MAGNIFICATION_MODE_WINDOW

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MAGNIFICATION_MODE_WINDOW
```

The controlling magnification mode. It is valid if the platform supports
`https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_WINDOW_MAGNIFICATION` feature.

<br />

Constant Value:

2
(0x00000002)


## Fields

### CREATOR

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<MagnificationConfig> CREATOR
```

<br />

<br />

**See also:**

- `https://developer.android.com/reference/android/os/Parcelable.Creator`

## Public methods

### describeContents

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getCenterX

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getCenterX ()
```

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

<br />

| Returns ||
|---|---|
| `float` | The X coordinate <br /> |

### getCenterY

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getCenterY ()
```

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

<br />

| Returns ||
|---|---|
| `float` | The Y coordinate <br /> |

### getMode

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMode ()
```

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

<br />

| Returns ||
|---|---|
| `int` | The magnification mode <br /> |

### getScale

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getScale ()
```

Returns the magnification scale of the controlling magnifier

<br />

| Returns ||
|---|---|
| `float` | The magnification scale <br /> |

### isActivated

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isActivated ()
```

Returns the activated state of the controlling magnifier. The controlling magnifier can be
activated even if the scale returned by `https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig#getScale()` equals to 1.0.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the magnifier is activated and showing on screen, `false` otherwise. <br /> |

### toString

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### writeToParcel

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel parcel, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `parcel` | `Parcel`: This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |