| | |
| | | |
| | | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.enums.PowerStationStatus; |
| | | import com.hdl.photovoltaic.enums.UnitType; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.other.HdlDeviceLogic; |
| | |
| | | private List<HouseIdBean> mList; |
| | | private final Context mContext; |
| | | private OnclickListener noOnclickListener;//点击了的监听器 |
| | | |
| | | String mPowerStationStatus; |
| | | |
| | | /** |
| | | * 收集SwipeLayout数组,要一键全部打开; |
| | |
| | | } |
| | | |
| | | |
| | | public void setList(List<HouseIdBean> newData) { |
| | | public void setList(List<HouseIdBean> newData, String powerStationStatus) { |
| | | mPowerStationStatus = powerStationStatus; |
| | | if (this.mList == null) { |
| | | this.mList = new ArrayList<>(); |
| | | } else { |
| | |
| | | * @param state_value 电站状态(1:正常(运行),2:离线,3:连接中,4:故障,5:离线有故障) |
| | | */ |
| | | private void setTextViewStyle(TextView textView, int state_value) { |
| | | |
| | | String text = mContext.getString(R.string.my_power_station_operation); |
| | | Drawable drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_06b92a); |
| | | switch (state_value) { |
| | | case 1: { |
| | | text = mContext.getString(R.string.my_power_station_operation); |
| | | if (mPowerStationStatus.equals(PowerStationStatus.All)) { |
| | | switch (state_value) { |
| | | case 1: { |
| | | text = mContext.getString(R.string.my_power_station_operation); |
| | | } |
| | | break; |
| | | |
| | | } |
| | | break; |
| | | case 2: { |
| | | text = mContext.getString(R.string.my_power_station_off_line); |
| | | drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_b9b9b9); |
| | | } |
| | | break; |
| | | case 3: { |
| | | text = mContext.getString(R.string.my_power_station_connecting); |
| | | drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_ffb300); |
| | | } |
| | | break; |
| | | case 4: |
| | | case 5: |
| | | { |
| | | text = mContext.getString(R.string.my_power_station_malfunction); |
| | | drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_e34343); |
| | | } |
| | | //5:离线有故障Offline_fault |
| | | break; |
| | | case 2: { |
| | | text = mContext.getString(R.string.my_power_station_off_line); |
| | | drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_b9b9b9); |
| | | } |
| | | break; |
| | | case 3: { |
| | | text = mContext.getString(R.string.my_power_station_connecting); |
| | | drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_ffb300); |
| | | } |
| | | break; |
| | | case 4: |
| | | case 5: { |
| | | text = mContext.getString(R.string.my_power_station_malfunction); |
| | | drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_e34343); |
| | | } |
| | | //5:离线有故障Offline_fault |
| | | break; |
| | | // case 5: { |
| | | // text = mContext.getString(R.string.Offline_fault); |
| | | // drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_e34343); |
| | | // } |
| | | // break; |
| | | } |
| | | } else if (mPowerStationStatus.equals(PowerStationStatus.malfunction)) { |
| | | text = mContext.getString(R.string.my_power_station_malfunction); |
| | | drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_e34343); |
| | | } else if (mPowerStationStatus.equals(PowerStationStatus.off)) { |
| | | text = mContext.getString(R.string.my_power_station_off_line); |
| | | drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_b9b9b9); |
| | | } |
| | | textView.setText(text); |
| | | textView.setBackground(drawable); |