Share via


IUiTranslationStateCallback Interface

Definition

Callback for listening to UI Translation state changes.

[Android.Runtime.Register("android/view/translation/UiTranslationStateCallback", "", "Android.Views.Translation.IUiTranslationStateCallbackInvoker", ApiSince=31)]
public interface IUiTranslationStateCallback : Android.Runtime.IJavaObject, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/view/translation/UiTranslationStateCallback", "", "Android.Views.Translation.IUiTranslationStateCallbackInvoker", ApiSince=31)>]
type IUiTranslationStateCallback = interface
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Attributes
Implements

Remarks

Callback for listening to UI Translation state changes. See UiTranslationManager#registerUiTranslationStateCallback(Executor, UiTranslationStateCallback).

Prior to Android version android.os.Build.VERSION_CODES#TIRAMISU: <ul> <li>Callback methods <em>without</em> packageName are invoked. Apps with minSdkVersion lower than android.os.Build.VERSION_CODES#TIRAMISU<em>must</em> implement those methods if they want to handle the events.</li> <li>Callback methods for a particular event <em>may</em> be called multiple times consecutively, even when the translation state has not changed (e.g., #onStarted(ULocale, ULocale, String) may be called multiple times even after translation has already started).</li> </ul>

In Android version android.os.Build.VERSION_CODES#TIRAMISU and later: <ul> <li>If both methods with and without packageName are implemented (e.g., #onFinished() and #onFinished(String), only the one <em>with</em> packageName will be called.</li> <li>Callback methods for a particular event will <em>not</em> be called multiple times consecutively. They will only be called when the translation state has actually changed (e.g., from "started" to "paused"). Note: "resumed" is not considered a separate state from "started", so #onResumed(ULocale, ULocale, String) will never be called after #onStarted(ULocale, ULocale, String).<</li> </ul>

Java documentation for android.view.translation.UiTranslationStateCallback.

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.

Properties

Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)
JniIdentityHashCode

Returns the value of java.lang.System.identityHashCode() for the wrapped instance.

(Inherited from IJavaPeerable)
JniManagedPeerState

State of the managed peer.

(Inherited from IJavaPeerable)
JniPeerMembers

Member access and invocation support.

(Inherited from IJavaPeerable)
PeerReference

Returns a JniObjectReference of the wrapped Java object instance.

(Inherited from IJavaPeerable)

Methods

Disposed()

Called when the instance has been disposed.

(Inherited from IJavaPeerable)
DisposeUnlessReferenced()

If there are no outstanding references to this instance, then calls Dispose(); otherwise, does nothing.

(Inherited from IJavaPeerable)
Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
OnFinished()

The UI Translation session has ended.

OnFinished(String)

The UI Translation session has ended.

OnPaused()

The system is requesting that the application temporarily show the UI contents in their original language.

OnPaused(String)

The system is requesting that the application temporarily show the UI contents in their original language.

OnResumed(ULocale, ULocale, String)
OnResumed(ULocale, ULocale)

The system is requesting that the application restore from the temporarily paused state and show the content in translated language.

OnStarted(ULocale, ULocale, String)
OnStarted(ULocale, ULocale)

The system is requesting translation of the UI from sourceLocale to targetLocale.

SetJniIdentityHashCode(Int32)

Set the value returned by JniIdentityHashCode.

(Inherited from IJavaPeerable)
SetJniManagedPeerState(JniManagedPeerStates) (Inherited from IJavaPeerable)
SetPeerReference(JniObjectReference)

Set the value returned by PeerReference.

(Inherited from IJavaPeerable)
UnregisterFromRuntime()

Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations.

(Inherited from IJavaPeerable)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to