| | |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.ImageView; |
| | | import android.widget.RelativeLayout; |
| | | import android.widget.TextView; |
| | | |
| | | import androidx.annotation.NonNull; |
| | |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.enums.UnitType; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.ui.bean.DeviceBean; |
| | | import com.hdl.photovoltaic.widget.SwipeLayout; |
| | | import com.hdl.photovoltaic.ui.bean.CloudInverterDeviceBean; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class DeviceInfoAdapter extends RecyclerView.Adapter<DeviceInfoAdapter.MyViewHolder> { |
| | | |
| | | List<DeviceBean> mList; |
| | | List<CloudInverterDeviceBean> mList; |
| | | |
| | | Context mContext; |
| | | |
| | |
| | | |
| | | @Override |
| | | public void onBindViewHolder(@NonNull MyViewHolder holder, int position) { |
| | | DeviceBean deviceBean = this.mList.get(position); |
| | | CloudInverterDeviceBean deviceBean = this.mList.get(position); |
| | | |
| | | holder.homeNameTv.setText(deviceBean.getHomeNameAndDeviceName()); |
| | | holder.device_details_sn_tv.setText("SN:"+deviceBean.getOsn()); |
| | |
| | | this.mOnclickListener = onClickListener; |
| | | } |
| | | |
| | | public void setList(List<DeviceBean> newData) { |
| | | public void setList(List<CloudInverterDeviceBean> newData) { |
| | | if (this.mList == null) { |
| | | this.mList = new ArrayList<>(); |
| | | } else { |
| | |
| | | } |
| | | |
| | | public interface OnClickListener { |
| | | void onClick(int position, DeviceBean deviceBean); |
| | | void onClick(int position, CloudInverterDeviceBean deviceBean); |
| | | |
| | | } |
| | | } |