# MagnificationConfig.Builder

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

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/accessibilityservice/MagnificationConfig.Builder "View this page in Java")  

```
class Builder
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                       ||
| ↳ | [android.accessibilityservice.MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) |

Builder for creating[MagnificationConfig](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig)objects.

## Summary

|                                                                    Public constructors                                                                     ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#Builder())`()` Creates a new Builder. |

|                                                                                                                                                                                                                      Public methods                                                                                                                                                                                                                       ||
|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MagnificationConfig](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig)                  | [build](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#build())`()` Builds and returns a[MagnificationConfig](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig)                                          |
| [MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) | [setActivated](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#setActivated(kotlin.Boolean))`(`activated:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets magnification activated state.                    |
| [MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) | [setCenterX](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#setCenterX(kotlin.Float))`(`centerX:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` Sets the X coordinate of the center of the magnification viewport. |
| [MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) | [setCenterY](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#setCenterY(kotlin.Float))`(`centerY:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` Sets the Y coordinate of the center of the magnification viewport. |
| [MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) | [setMode](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#setMode(kotlin.Int))`(`mode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the magnification mode.                                                      |
| [MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) | [setScale](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#setScale(kotlin.Float))`(`scale:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` Sets the magnification scale.                                            |

## Public constructors

### Builder

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

```
Builder()
```

Creates a new Builder.

## Public methods

### build

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

```
fun build(): MagnificationConfig
```

Builds and returns a[MagnificationConfig](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig)

|                                                                       Return                                                                        ||
|------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [MagnificationConfig](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig) | This value cannot be`null`. |

### setActivated

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

```
fun setActivated(activated: Boolean): MagnificationConfig.Builder
```

Sets magnification activated state.

|                                                            Parameters                                                             ||
|-------------|----------------------------------------------------------------------------------------------------------------------|
| `activated` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html):The magnification activated state |

|                                                                                      Return                                                                                       ||
|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
| [MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) | This builder This value cannot be`null`. |

### setCenterX

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

```
fun setCenterX(centerX: Float): MagnificationConfig.Builder
```

Sets the X coordinate of the center of the magnification viewport. The controlling magnifier will apply the given position.

|                                                                                                                                                         Parameters                                                                                                                                                         ||
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `centerX` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):the screen-relative X coordinate around which to center and scale that is in the range \[0, screenWidth\], or[Float.NaN](https://developer.android.com/reference/kotlin/java/lang/Float.html#NaN:kotlin.Float)to leave unchanged |

|                                                                                      Return                                                                                       ||
|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
| [MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) | This builder This value cannot be`null`. |

### setCenterY

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

```
fun setCenterY(centerY: Float): MagnificationConfig.Builder
```

Sets the Y coordinate of the center of the magnification viewport. The controlling magnifier will apply the given position.

|                                                                                                                                                         Parameters                                                                                                                                                          ||
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `centerY` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):the screen-relative Y coordinate around which to center and scale that is in the range \[0, screenHeight\], or[Float.NaN](https://developer.android.com/reference/kotlin/java/lang/Float.html#NaN:kotlin.Float)to leave unchanged |

|                                                                                      Return                                                                                       ||
|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
| [MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) | This builder This value cannot be`null`. |

### setMode

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

```
fun setMode(mode: Int): MagnificationConfig.Builder
```

Sets the magnification mode.

|                                                                                                                                                                                                                                                                                                                                                                                       Parameters                                                                                                                                                                                                                                                                                                                                                                                        ||
|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `mode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The magnification mode Value is[android.accessibilityservice.MagnificationConfig#MAGNIFICATION_MODE_DEFAULT](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig#MAGNIFICATION_MODE_DEFAULT:kotlin.Int),[android.accessibilityservice.MagnificationConfig#MAGNIFICATION_MODE_FULLSCREEN](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig#MAGNIFICATION_MODE_FULLSCREEN:kotlin.Int), or[android.accessibilityservice.MagnificationConfig#MAGNIFICATION_MODE_WINDOW](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig#MAGNIFICATION_MODE_WINDOW:kotlin.Int) |

|                                                                                      Return                                                                                       ||
|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
| [MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) | This builder This value cannot be`null`. |

### setScale

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

```
fun setScale(scale: Float): MagnificationConfig.Builder
```

Sets the magnification scale.

|                                                                                   Parameters                                                                                    ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `scale` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):The magnification scale, in the range \[1, 8\] Value is between 1.0f and 8.0f inclusive |

|                                                                                      Return                                                                                       ||
|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
| [MagnificationConfig.Builder](https://developer.android.com/reference/kotlin/android/accessibilityservice/MagnificationConfig.Builder#) | This builder This value cannot be`null`. |