Initial commit
This commit is contained in:
498
sources/com/ubt/jimu/blockly/view/DialogBlocklyWebView.java
Normal file
498
sources/com/ubt/jimu/blockly/view/DialogBlocklyWebView.java
Normal file
@@ -0,0 +1,498 @@
|
||||
package com.ubt.jimu.blockly.view;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.dialog.IDialogListener;
|
||||
import com.ubt.jimu.base.dialog.SimpleQuestionDialog;
|
||||
import com.ubt.jimu.base.entities.Course;
|
||||
import com.ubt.jimu.blockly.JimuRobot;
|
||||
import com.ubt.jimu.blockly.Utils;
|
||||
import com.ubt.jimu.blockly.command.JimuBlocklyCommand;
|
||||
import com.ubt.jimu.blockly.command.JimuJavascriptInterface;
|
||||
import com.ubt.jimu.blockly.command.JimuUnityCommand;
|
||||
import com.ubt.jimu.blockly.command.UnityCommandController;
|
||||
import com.ubt.jimu.blockly.exception.BlocklyEvent;
|
||||
import com.ubt.jimu.blockly.exception.JimuRobotMessage;
|
||||
import com.ubt.jimu.blockly.feature.sensor.DeviceDirection;
|
||||
import com.ubt.jimu.diy.view.BrowseCompletedActivity;
|
||||
import com.ubt.jimu.diy.view.DiyBrowseActivity;
|
||||
import com.ubt.jimu.unity.bluetooth.ConnectionStatus;
|
||||
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
||||
import com.ubt.jimu.utils.JsonHelper;
|
||||
import com.ubt.jimu.utils.PackageHelper;
|
||||
import com.ubt.jimu.utils.SPUtils;
|
||||
import com.ubtech.utils.AndroidVersionCheckUtils;
|
||||
import com.ubtech.view.widget.ToastView;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DialogBlocklyWebView extends Fragment {
|
||||
public static final String BASE_URL = "https://jimu.ubtrobot.com";
|
||||
public static String CODE = "code";
|
||||
public static String STEP = "step";
|
||||
private final String TAG = DialogBlocklyWebView.class.getSimpleName();
|
||||
private int bleState;
|
||||
private JimuBlocklyCommand blocklyObj;
|
||||
private Course course;
|
||||
private DeviceDirection direction;
|
||||
private SimpleQuestionDialog exceptionDialog;
|
||||
protected ImageView imgNextStep;
|
||||
protected ImageView imgPreviousStep;
|
||||
private ImageView imgWait;
|
||||
private JimuUnityCommand javaInterface;
|
||||
private JimuJavascriptInterface javascriptInterface;
|
||||
private String jimuRobotJSON;
|
||||
protected View llBrowseStep;
|
||||
private LinearLayout llWait;
|
||||
private JimuRobot mJimuRobot;
|
||||
private long modelId;
|
||||
private int moduleType;
|
||||
private Animation rotateAnimaLow;
|
||||
protected TextView tvStep;
|
||||
private JimuWebChromeClient webChromeClient;
|
||||
private WebView webView;
|
||||
private JimuWebViewClient webViewClient;
|
||||
|
||||
private void bleDisconnected(BlocklyEvent blocklyEvent) {
|
||||
commonTips((String) blocklyEvent.getMessage(), 2);
|
||||
JimuBlocklyCommand jimuBlocklyCommand = this.blocklyObj;
|
||||
if (jimuBlocklyCommand == null || jimuBlocklyCommand.getJimuRobot() == null) {
|
||||
return;
|
||||
}
|
||||
this.blocklyObj.getJimuRobot().setBlueState(ConnectionStatus.DIS_CONNECT.getStatus());
|
||||
this.bleState = ConnectionStatus.DIS_CONNECT.getStatus();
|
||||
}
|
||||
|
||||
public static DialogBlocklyWebView getInstance(String str, int i, long j, int i2, int i3, int i4, Course course) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("jimuRobotJSON", str);
|
||||
bundle.putInt("bleState", i);
|
||||
bundle.putLong("modelId", j);
|
||||
bundle.putInt("moduleType", i2);
|
||||
bundle.putInt(CODE, i3);
|
||||
bundle.putInt(STEP, i4);
|
||||
bundle.putSerializable("course", course);
|
||||
DialogBlocklyWebView dialogBlocklyWebView = new DialogBlocklyWebView();
|
||||
dialogBlocklyWebView.setArguments(bundle);
|
||||
return dialogBlocklyWebView;
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
if (this.mJimuRobot == null) {
|
||||
this.mJimuRobot = (JimuRobot) JsonHelper.a(this.jimuRobotJSON, (Class<?>) JimuRobot.class);
|
||||
this.mJimuRobot.setBlueState(this.bleState);
|
||||
this.mJimuRobot.setServerModelId(this.modelId);
|
||||
}
|
||||
if (1007 == getArguments().getInt(CODE)) {
|
||||
this.llBrowseStep.setOnTouchListener(new View.OnTouchListener() { // from class: com.ubt.jimu.blockly.view.DialogBlocklyWebView.1
|
||||
@Override // android.view.View.OnTouchListener
|
||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
final int i = getArguments().getInt(STEP);
|
||||
this.llBrowseStep.setVisibility(0);
|
||||
this.imgPreviousStep.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.blockly.view.DialogBlocklyWebView.2
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
DiyBrowseActivity.start(DialogBlocklyWebView.this.getActivity(), i - 1, UnityActivity.modelBrowse);
|
||||
((UnityActivity) DialogBlocklyWebView.this.getActivity()).setIsBack(true);
|
||||
((UnityActivity) DialogBlocklyWebView.this.getActivity()).closeBlockly();
|
||||
}
|
||||
});
|
||||
this.imgNextStep.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.blockly.view.DialogBlocklyWebView.3
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
BrowseCompletedActivity.start(DialogBlocklyWebView.this.getActivity());
|
||||
SPUtils.b(String.format(DiyBrowseActivity.DIYSTEP, DialogBlocklyWebView.this.mJimuRobot.getModelId()), -5);
|
||||
((UnityActivity) DialogBlocklyWebView.this.getActivity()).setIsBack(true);
|
||||
((UnityActivity) DialogBlocklyWebView.this.getActivity()).closeBlockly();
|
||||
}
|
||||
});
|
||||
this.tvStep.setText(String.format("%s/%s", String.valueOf(i), String.valueOf(i)));
|
||||
} else {
|
||||
this.llBrowseStep.setVisibility(8);
|
||||
}
|
||||
this.blocklyObj = new JimuBlocklyCommand(this.webView, (UnityActivity) getActivity(), this.mJimuRobot);
|
||||
this.blocklyObj.setModuleType(this.moduleType);
|
||||
this.javascriptInterface = new JimuJavascriptInterface(this.webView, getActivity(), this.mJimuRobot);
|
||||
this.javascriptInterface.setDialogBlocklyWebView(this);
|
||||
this.javascriptInterface.setCourse(this.course);
|
||||
this.webChromeClient = new JimuWebChromeClient();
|
||||
this.webViewClient = new JimuWebViewClient(getActivity(), this.blocklyObj);
|
||||
this.webViewClient.setDialog(this);
|
||||
this.webView.removeJavascriptInterface("blocklyObj");
|
||||
this.webView.addJavascriptInterface(this.javascriptInterface, "blocklyObj");
|
||||
this.webView.setWebViewClient(this.webViewClient);
|
||||
this.webView.setWebChromeClient(this.webChromeClient);
|
||||
if (1 != this.moduleType) {
|
||||
this.webView.loadUrl("file:///" + Utils.baseUrl + "teachMaterial/index.html");
|
||||
} else if (this.course != null) {
|
||||
this.webView.loadUrl("file:///" + Utils.baseUrl + "teachOldCourse/course.html");
|
||||
} else {
|
||||
this.webView.loadUrl("file:///" + Utils.baseUrl + "teachCourse/course.html");
|
||||
}
|
||||
this.javaInterface = new JimuUnityCommand(this.webView);
|
||||
showWait();
|
||||
}
|
||||
|
||||
private void initWebView() {
|
||||
PackageHelper.a("CHANNEL_ID");
|
||||
this.webView.getSettings().setTextZoom(100);
|
||||
this.webView.getSettings().setDisplayZoomControls(false);
|
||||
this.webView.getSettings().setSupportZoom(false);
|
||||
this.webView.getSettings().setUseWideViewPort(false);
|
||||
this.webView.getSettings().setJavaScriptEnabled(true);
|
||||
this.webView.getSettings().setLoadWithOverviewMode(true);
|
||||
if (AndroidVersionCheckUtils.c()) {
|
||||
this.webView.getSettings().setAllowUniversalAccessFromFileURLs(true);
|
||||
}
|
||||
if (AndroidVersionCheckUtils.d()) {
|
||||
this.webView.getSettings().setMediaPlaybackRequiresUserGesture(false);
|
||||
}
|
||||
this.webView.getSettings().setAllowContentAccess(true);
|
||||
this.webView.getSettings().setAllowFileAccess(true);
|
||||
this.webView.getSettings().setDatabaseEnabled(true);
|
||||
this.webView.getSettings().setDomStorageEnabled(true);
|
||||
this.webView.getSettings().setAppCacheEnabled(false);
|
||||
this.webView.getSettings().setCacheMode(2);
|
||||
this.webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
this.webView.setScrollContainer(false);
|
||||
}
|
||||
|
||||
private void setJSResult(final String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return;
|
||||
}
|
||||
this.webView.post(new Runnable() { // from class: com.ubt.jimu.blockly.view.DialogBlocklyWebView.8
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
DialogBlocklyWebView.this.webView.loadUrl(str);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showException(String str) {
|
||||
JimuBlocklyCommand jimuBlocklyCommand = this.blocklyObj;
|
||||
if (jimuBlocklyCommand != null) {
|
||||
jimuBlocklyCommand.stopSensorTimer("");
|
||||
}
|
||||
this.javaInterface.jsShowException("Error");
|
||||
this.exceptionDialog = SimpleQuestionDialog.newInstance(str);
|
||||
this.exceptionDialog.setListener(new IDialogListener() { // from class: com.ubt.jimu.blockly.view.DialogBlocklyWebView.7
|
||||
@Override // com.ubt.jimu.base.dialog.IDialogListener
|
||||
public void onCancle() {
|
||||
UnityActivity.communityWithUnity(DialogBlocklyWebView.this.getActivity(), UnityCommandController.SHOW_EXCEPTION_CALLBACK, "0");
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.dialog.IDialogListener
|
||||
public void onOk() {
|
||||
UnityActivity.communityWithUnity(DialogBlocklyWebView.this.getActivity(), UnityCommandController.SHOW_EXCEPTION_CALLBACK, "1");
|
||||
DialogBlocklyWebView.this.showWait();
|
||||
if (DialogBlocklyWebView.this.blocklyObj != null) {
|
||||
DialogBlocklyWebView.this.blocklyObj.startSensorTimer(DialogBlocklyWebView.this.blocklyObj.getQueryUrl(), DialogBlocklyWebView.this.blocklyObj.getQueryCallback());
|
||||
}
|
||||
}
|
||||
});
|
||||
this.exceptionDialog.show(getFragmentManager(), "");
|
||||
}
|
||||
|
||||
public void blueConnectCallBack(String str) {
|
||||
JimuRobot jimuRobot = (JimuRobot) JsonHelper.a(str, (Class<?>) JimuRobot.class);
|
||||
if (jimuRobot != null) {
|
||||
this.mJimuRobot.setLights(jimuRobot.getLights());
|
||||
this.mJimuRobot.setGyroscopeId(jimuRobot.getGyroscopeId());
|
||||
this.mJimuRobot.setInfraredId(jimuRobot.getInfraredId());
|
||||
this.mJimuRobot.setTouchId(jimuRobot.getTouchId());
|
||||
this.mJimuRobot.setIsLithium(jimuRobot.getIsLithium());
|
||||
this.mJimuRobot.setUltrasonicId(jimuRobot.getUltrasonicId());
|
||||
this.mJimuRobot.setColorId(jimuRobot.getColorId());
|
||||
this.mJimuRobot.setUnicornId(jimuRobot.getUnicornId());
|
||||
jimuRobot.setBlueState(this.mJimuRobot.getBlueState());
|
||||
String a = JsonHelper.a(jimuRobot);
|
||||
JimuUnityCommand jimuUnityCommand = this.javaInterface;
|
||||
if (jimuUnityCommand != null) {
|
||||
jimuUnityCommand.blueConnectCallBack(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void chargeProtected(String str) {
|
||||
JimuUnityCommand jimuUnityCommand = this.javaInterface;
|
||||
if (jimuUnityCommand != null) {
|
||||
jimuUnityCommand.chargeProtected(str);
|
||||
}
|
||||
}
|
||||
|
||||
public void commonTips(String str, int i) {
|
||||
ToastView.a(getActivity(), str, i == 2 ? ToastView.Type.ERROR : i == 1 ? ToastView.Type.SUCCESS : ToastView.Type.NORMAL).a();
|
||||
}
|
||||
|
||||
public DeviceDirection getDirection() {
|
||||
return this.direction;
|
||||
}
|
||||
|
||||
public int getModuleType() {
|
||||
return this.moduleType;
|
||||
}
|
||||
|
||||
public void hideWait() {
|
||||
Animation animation = this.rotateAnimaLow;
|
||||
if (animation != null) {
|
||||
animation.cancel();
|
||||
}
|
||||
this.llWait.postDelayed(new Runnable() { // from class: com.ubt.jimu.blockly.view.DialogBlocklyWebView.6
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
DialogBlocklyWebView.this.llWait.setVisibility(8);
|
||||
}
|
||||
}, 100L);
|
||||
}
|
||||
|
||||
public void jsShowException(String str) {
|
||||
JimuUnityCommand jimuUnityCommand = this.javaInterface;
|
||||
if (jimuUnityCommand != null) {
|
||||
jimuUnityCommand.jsShowException(str);
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyKeyboardHidden(String str) {
|
||||
JimuUnityCommand jimuUnityCommand = this.javaInterface;
|
||||
if (jimuUnityCommand != null) {
|
||||
jimuUnityCommand.notifyKeyboardHidden(str);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments != null) {
|
||||
this.jimuRobotJSON = arguments.getString("jimuRobotJSON");
|
||||
this.bleState = arguments.getInt("bleState");
|
||||
this.modelId = arguments.getLong("modelId");
|
||||
this.moduleType = arguments.getInt("moduleType");
|
||||
this.course = (Course) arguments.getSerializable("course");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
View inflate = layoutInflater.inflate(R.layout.dialog_blockly_webview, (ViewGroup) null);
|
||||
this.webView = (WebView) inflate.findViewById(R.id.webView);
|
||||
this.llWait = (LinearLayout) inflate.findViewById(R.id.ll_wait);
|
||||
this.imgWait = (ImageView) inflate.findViewById(R.id.wait_img);
|
||||
this.llBrowseStep = inflate.findViewById(R.id.llStep);
|
||||
this.imgPreviousStep = (ImageView) inflate.findViewById(R.id.imgPreviousStep);
|
||||
this.imgNextStep = (ImageView) inflate.findViewById(R.id.imgNextStep);
|
||||
this.tvStep = (TextView) inflate.findViewById(R.id.tvStep);
|
||||
initWebView();
|
||||
initView();
|
||||
this.llWait.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.blockly.view.DialogBlocklyWebView.4
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
DialogBlocklyWebView.this.llWait.setVisibility(8);
|
||||
}
|
||||
});
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onDestroy() {
|
||||
WebView webView = this.webView;
|
||||
if (webView != null) {
|
||||
webView.stopLoading();
|
||||
this.webView.clearHistory();
|
||||
this.webView.removeAllViews();
|
||||
this.webView.destroy();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageEvent(BlocklyEvent blocklyEvent) {
|
||||
switch (blocklyEvent.getType()) {
|
||||
case 1001:
|
||||
JimuRobotMessage jimuRobotMessage = (JimuRobotMessage) blocklyEvent.getMessage();
|
||||
if (jimuRobotMessage != null) {
|
||||
commonTips(jimuRobotMessage.getMsg(), jimuRobotMessage.getLevel());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1002:
|
||||
showException((String) blocklyEvent.getMessage());
|
||||
break;
|
||||
case 1003:
|
||||
bleDisconnected(blocklyEvent);
|
||||
break;
|
||||
case 1004:
|
||||
setJSResult((String) blocklyEvent.getMessage());
|
||||
break;
|
||||
case 1006:
|
||||
this.bleState = ConnectionStatus.DIS_CONNECT.getStatus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onPause() {
|
||||
SimpleQuestionDialog simpleQuestionDialog = this.exceptionDialog;
|
||||
if (simpleQuestionDialog != null && simpleQuestionDialog.isVisible()) {
|
||||
this.exceptionDialog.dismiss();
|
||||
}
|
||||
super.onPause();
|
||||
WebView webView = this.webView;
|
||||
if (webView != null) {
|
||||
try {
|
||||
webView.getClass().getMethod("onPause", new Class[0]).invoke(this.webView, null);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchMethodException e2) {
|
||||
e2.printStackTrace();
|
||||
} catch (InvocationTargetException e3) {
|
||||
e3.printStackTrace();
|
||||
} catch (Exception e4) {
|
||||
e4.printStackTrace();
|
||||
}
|
||||
}
|
||||
stopQueryTimer();
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
WebView webView = this.webView;
|
||||
if (webView != null) {
|
||||
try {
|
||||
webView.getClass().getMethod("onResume", new Class[0]).invoke(this.webView, null);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchMethodException e2) {
|
||||
e2.printStackTrace();
|
||||
} catch (InvocationTargetException e3) {
|
||||
e3.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
EventBus.b().c(this);
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onStop() {
|
||||
EventBus.b().d(this);
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
public void refreshAllServo(String str, String str2) {
|
||||
JimuRobot jimuRobot = this.mJimuRobot;
|
||||
if (jimuRobot != null) {
|
||||
jimuRobot.setServo(str);
|
||||
this.mJimuRobot.setCircleServos(str2);
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshDirection(DeviceDirection deviceDirection) {
|
||||
this.direction = deviceDirection;
|
||||
}
|
||||
|
||||
public void setBlueState(int i) {
|
||||
JimuRobot jimuRobot = this.mJimuRobot;
|
||||
if (jimuRobot != null) {
|
||||
jimuRobot.setBlueState(i);
|
||||
}
|
||||
setJSResult("BLEStateChanged", String.valueOf(i));
|
||||
}
|
||||
|
||||
public void showInfraredRef(String str, String str2) {
|
||||
JimuUnityCommand jimuUnityCommand = this.javaInterface;
|
||||
if (jimuUnityCommand != null) {
|
||||
jimuUnityCommand.showInfraredRef(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
public void showWait() {
|
||||
if (this.rotateAnimaLow == null) {
|
||||
this.rotateAnimaLow = AnimationUtils.loadAnimation(getActivity(), R.anim.anima_dialog_wait);
|
||||
}
|
||||
this.llWait.setVisibility(0);
|
||||
this.imgWait.startAnimation(this.rotateAnimaLow);
|
||||
((AnimationDrawable) this.imgWait.getBackground()).start();
|
||||
this.webView.postDelayed(new Runnable() { // from class: com.ubt.jimu.blockly.view.DialogBlocklyWebView.5
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
DialogBlocklyWebView.this.hideWait();
|
||||
}
|
||||
}, 10000L);
|
||||
}
|
||||
|
||||
public void stopQueryTimer() {
|
||||
JimuBlocklyCommand jimuBlocklyCommand = this.blocklyObj;
|
||||
if (jimuBlocklyCommand != null) {
|
||||
jimuBlocklyCommand.stopSensorTimer("");
|
||||
}
|
||||
}
|
||||
|
||||
public void updateJimuRobot(String str) {
|
||||
JimuRobot jimuRobot;
|
||||
JimuRobot jimuRobot2 = (JimuRobot) JsonHelper.a(str, (Class<?>) JimuRobot.class);
|
||||
if (jimuRobot2 == null || (jimuRobot = this.mJimuRobot) == null) {
|
||||
return;
|
||||
}
|
||||
jimuRobot.setGyroscopeId(jimuRobot2.getGyroscopeId());
|
||||
this.mJimuRobot.setInfraredId(jimuRobot2.getInfraredId());
|
||||
this.mJimuRobot.setLights(jimuRobot2.getLights());
|
||||
this.mJimuRobot.setTouchId(jimuRobot2.getTouchId());
|
||||
this.mJimuRobot.setMotor(jimuRobot2.getMotor());
|
||||
this.mJimuRobot.setIsLithium(jimuRobot2.getIsLithium());
|
||||
this.mJimuRobot.setUltrasonicId(jimuRobot2.getUltrasonicId());
|
||||
this.mJimuRobot.setColorId(jimuRobot2.getColorId());
|
||||
this.mJimuRobot.setUnicornId(jimuRobot2.getUnicornId());
|
||||
}
|
||||
|
||||
public void wakeupBlockly(String str, int i, String str2, String str3) {
|
||||
JimuUnityCommand jimuUnityCommand = this.javaInterface;
|
||||
if (jimuUnityCommand != null) {
|
||||
jimuUnityCommand.wakeupBlockly(str, i, str2, str3);
|
||||
}
|
||||
}
|
||||
|
||||
public void setJSResult(String str, String... strArr) {
|
||||
Utils.setJSResult(this.webView, str, strArr);
|
||||
}
|
||||
|
||||
public void refreshAllServo(String str) {
|
||||
this.javaInterface.refreshAllServo(str);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user