hxb
2022-11-24 535d69817e83737f3da6250fc6fb70da25fc1a4c
AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/DeviceDetailMainFragment.java
@@ -55,6 +55,7 @@
    private IGetDeviceInfoCallBack.IModifyDeviceName modifyNameListener;
    private String fromWhere;
    private TextView tvDeploymentTip;
    private TextView tvFormat_sd;
    public static DeviceDetailMainFragment newInstance() {
        DeviceDetailMainFragment fragment = new DeviceDetailMainFragment();
@@ -92,11 +93,13 @@
        tvDeviceVersion = view.findViewById(R.id.tv_device_version);
        tvCurrentWifi = view.findViewById(R.id.tv_current_wifi);
        rlCurWifi = view.findViewById(R.id.rl_cur_wifi);
        tvFormat_sd =view.findViewById(R.id.tvFormat_sd);
        rlDeployment.setOnClickListener(this);
        rlDetele.setOnClickListener(this);
        rlDeviceDetail.setOnClickListener(this);
        rlCurWifi.setOnClickListener(this);
        tvFormat_sd.setOnClickListener(this);
        DeviceDetailActivity deviceDetailActivity = (DeviceDetailActivity) getActivity();
        deviceDetailActivity.tvTitle.setText(getResources().getString(R.string.lc_demo_device_detail_title));
        if (arguments == null) {
@@ -271,6 +274,25 @@
            deviceDetailService.unBindDevice(deviceUnBindData, this);*/
            deviceDetailService.deletePermission(deviceListBean.deviceId,null,this);
        }
        else if(id==R.id.tvFormat_sd){
            deviceDetailActivity.rlLoading.setVisibility(View.VISIBLE);
            DeviceDetailService deviceDetailService = ClassInstanceManager.newInstance().getDeviceDetailService();
         /*   DeviceUnBindData deviceUnBindData = new DeviceUnBindData();
            deviceUnBindData.data.deviceId = deviceListBean.deviceId;
            deviceDetailService.unBindDevice(deviceUnBindData, this);*/
            deviceDetailService.recoverSDCard(deviceListBean.deviceId, new IGetDeviceInfoCallBack.IRecoverSDCardCallBack() {
                @Override
                public void onSuccess(String result) {
                    deviceDetailActivity.rlLoading.setVisibility(View.GONE);
                }
                @Override
                public void onError(Throwable throwable) {
                    deviceDetailActivity.rlLoading.setVisibility(View.GONE);
                }
            });
        }
    }
    @Override