基本调通 回调

This commit is contained in:
xsl
2025-11-29 23:44:22 +08:00
parent 1859706412
commit 835f768a4a
8 changed files with 311 additions and 76 deletions
@@ -272,6 +272,15 @@ public class FaceActivity extends GameActivity implements FaceLandmarkerHelper.L
SetCppInitArg(json);
}
public interface CallbackInterface {
void OnLoadActionFinished(String result);
}
protected native String PreReadAction(String motion, CallbackInterface callback);
protected String PreLoadAction(String json, CallbackInterface callback){
return PreReadAction(json, callback);
}
protected native void ChangeStateCpp(String json);
protected void ChangeState(String json){
Log.i("FaceActivity", "ChangeState:" + json);
@@ -4,13 +4,12 @@ import org.json.JSONObject;
public class InitArg {
public int action_fps;
public float zoom;
public Motion motion;
public String toJson() {
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("action_fps", action_fps);
jsonObject.put("zoom", zoom);
jsonObject.put("motion", motion.toJsonObject());
return jsonObject.toString();
} catch (Exception e) {
e.printStackTrace();