Kotlinify ChoreographerProvider (#43840)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43840

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55731748

fbshipit-source-id: f43c687f44b351ade907be4dcd55518b5bef913d
This commit is contained in:
Fabrizio Cucci
2024-04-04 03:43:38 -07:00
committed by Facebook GitHub Bot
parent 9d51bfdc14
commit 13cdd480ea
@@ -5,7 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.internal;
package com.facebook.react.internal
import android.view.Choreographer.FrameCallback
public interface ChoreographerProvider {
/**
@@ -13,13 +15,12 @@ public interface ChoreographerProvider {
* android.view.Choreographer or a mock one for testing purposes, or override built-in
* android.view.Choreographer's behaviors.
*/
interface Choreographer {
public interface Choreographer {
/** Posts a frame callback to run on the next frame. */
void postFrameCallback(android.view.Choreographer.FrameCallback callback);
public fun postFrameCallback(callback: FrameCallback)
/** Removes a previously posted frame callback. */
void removeFrameCallback(android.view.Choreographer.FrameCallback callback);
public fun removeFrameCallback(callback: FrameCallback)
}
/**
@@ -27,5 +28,5 @@ public interface ChoreographerProvider {
*
* @return An instance of Choreographer.
*/
Choreographer getChoreographer();
public fun getChoreographer(): Choreographer
}