| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | 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
|
| | |
| | | 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();
|
| | |
| | | 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();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|