基本调通 回调
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user