Files
android_translation_layer/src/api-impl/android/view/Choreographer.java
Mis012 0a9591c474 src/api-impl: fix up code style, mainly for code imported from AOSP
used the following (plus manual edits):
`clang-format --style="{BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: true, ColumnLimit: 0}`
2023-06-22 11:45:46 +02:00

26 lines
675 B
Java

package android.view;
public final class Choreographer {
public static interface FrameCallback {
public void doFrame(long frametime_in_nanoseconds);
}
public static Choreographer getInstance() {
return new Choreographer();
}
public void postFrameCallback(Choreographer.FrameCallback callback) {
postFrameCallbackDelayed(callback, 0);
}
public void postFrameCallbackDelayed(final Choreographer.FrameCallback callback, long delayMillis) {
// TODO - do the delay part
// NOTE: if we do this synchronously, it gets stuck
Thread async = new Thread(new Runnable() {
public void run() {
callback.doFrame(System.nanoTime());
} });
async.start();
}
}