Freigeben über


AccessibilityService.MagnificationController.SetCenter Method

Definition

Sets the center of the magnified viewport.

[Android.Runtime.Register("setCenter", "(FFZ)Z", "", ApiSince=24)]
public bool SetCenter (float centerX, float centerY, bool animate);
[<Android.Runtime.Register("setCenter", "(FFZ)Z", "", ApiSince=24)>]
member this.SetCenter : single * single * bool -> bool

Parameters

centerX
Single

the unscaled screen-relative X coordinate on which to center the viewport

centerY
Single

the unscaled screen-relative Y coordinate on which to center the viewport

animate
Boolean

true to animate from the current viewport center or false to set the center immediately

Returns

true on success, false on failure

Attributes

Remarks

Sets the center of the magnified viewport.

<strong>Note:</strong> If the service is not yet connected (e.g. AccessibilityService#onServiceConnected() has not yet been called) or the service has been disconnected, this method will have no effect and return false.

<strong>Note:</strong> This legacy API sets the center of full-screen magnification. To set the center of the specified magnifier, use #setMagnificationConfig instead.

This member is deprecated. Use #setMagnificationConfig(MagnificationConfig, boolean) instead

Java documentation for android.accessibilityservice.AccessibilityService.MagnificationController.setCenter(float, float, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to