Added in API level 24

AccessibilityService.MagnificationController.OnMagnificationChangedListener

public static interface AccessibilityService.MagnificationController.OnMagnificationChangedListener

android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener


Listener for changes in the state of magnification.

Summary

Public methods

default void onMagnificationChanged(AccessibilityService.MagnificationController controller, Region region, MagnificationConfig config)

Called when the magnified region, mode, scale, or center changes of all magnification modes.

abstract void onMagnificationChanged(AccessibilityService.MagnificationController controller, Region region, float scale, float centerX, float centerY)

This method was deprecated in API level 33. Override onMagnificationChanged(android.accessibilityservice.AccessibilityService.MagnificationController, android.graphics.Region, android.accessibilityservice.MagnificationConfig) instead

Public methods

onMagnificationChanged

Added in API level 33
public void onMagnificationChanged (AccessibilityService.MagnificationController controller, 
                Region region, 
                MagnificationConfig config)

Called when the magnified region, mode, scale, or center changes of all magnification modes.

Note: This method can be overridden to listen to the magnification changes of all magnification modes then the legacy callback would not receive the notifications. Skipping calling super when overriding this method results in onMagnificationChanged(android.accessibilityservice.AccessibilityService.MagnificationController, android.graphics.Region, float, float, float) not getting called.

Parameters
controller AccessibilityService.MagnificationController: the magnification controller This value cannot be null.

region Region: the magnification region If the config mode is MagnificationConfig#MAGNIFICATION_MODE_FULLSCREEN, it is the region of the screen currently active for magnification. that is the same region as AccessibilityService.MagnificationController.getMagnificationRegion(). If the config mode is MagnificationConfig#MAGNIFICATION_MODE_WINDOW, it is the region of screen projected on the magnification window. This value cannot be null.

config MagnificationConfig: The magnification config. That has the controlling magnification mode, the new scale and the new screen-relative center position This value cannot be null.

onMagnificationChanged

Added in API level 24
Deprecated in API level 33
public abstract void onMagnificationChanged (AccessibilityService.MagnificationController controller, 
                Region region, 
                float scale, 
                float centerX, 
                float centerY)

This method was deprecated in API level 33.
Override onMagnificationChanged(android.accessibilityservice.AccessibilityService.MagnificationController, android.graphics.Region, android.accessibilityservice.MagnificationConfig) instead

Called when the magnified region, scale, or center changes.

Note: This legacy callback notifies only full-screen magnification change.

Parameters
controller AccessibilityService.MagnificationController: the magnification controller This value cannot be null.

region Region: the magnification region This value cannot be null.

scale float: the new scale

centerX float: the new X coordinate, in unscaled coordinates, around which magnification is focused

centerY float: the new Y coordinate, in unscaled coordinates, around which magnification is focused