wxr
2022-11-24 2af932533ef851bf983385244e9912976dbd4daa
AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/DeviceListActivity.java
@@ -19,7 +19,6 @@
import com.common.openapi.MethodConst;
import com.common.openapi.entity.DeviceDetailListData;
import com.common.openapi.entity.DeviceListData;
import com.hdl.HdlToLc;
import com.lechange.demo.R;
import com.lechange.demo.adapter.DeviceListAdapter;
import com.lechange.demo.view.LcPullToRefreshRecyclerView;
@@ -27,6 +26,7 @@
import com.lechange.pulltorefreshlistview.PullToRefreshBase;
import com.mm.android.deviceaddmodule.LCDeviceEngine;
import com.mm.android.deviceaddmodule.mobilecommon.utils.LogUtil;
import com.utils.HdlToLcUtils;
import java.util.ArrayList;
import java.util.Iterator;
@@ -39,7 +39,7 @@
    private RecyclerView mRecyclerView;
    private List<DeviceDetailListData.ResponseData.DeviceListBean> datas = new ArrayList<>();
    private DeviceListAdapter deviceListAdapter;
//    private LinearLayout llAdd;
    private LinearLayout llAdd;
    private LinearLayout llBack;
    private RelativeLayout rlNoDevice;
    //乐橙分页index
@@ -53,16 +53,16 @@
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_device_list);
        initView();
        HdlToLc.requestPermission();
        HdlToLcUtils.getInstance().requestPermission();
    }
    private void initView() {
//        llAdd = findViewById(R.id.ll_add);
        llAdd = findViewById(R.id.ll_add);
        llBack = findViewById(R.id.ll_back);
        rlNoDevice = findViewById(R.id.rl_no_device);
        deviceList = findViewById(R.id.device_list);
        deviceList.setOnRefreshListener(this);
//        llAdd.setOnClickListener(this);
        llAdd.setOnClickListener(this);
        llBack.setOnClickListener(this);
        refreshState(false);
        mRecyclerView = deviceList.getRefreshableView();
@@ -271,12 +271,12 @@
        int id = v.getId();
        if (id == R.id.ll_back) {
            finish();
//        } else if (id == R.id.ll_add) {
//            try {
//                LCDeviceEngine.newInstance().addDevice(this);
//            } catch (Exception e) {
//                e.printStackTrace();
//            }
        } else if (id == R.id.ll_add) {
            try {
                LCDeviceEngine.newInstance().addDevice(this);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}