File was renamed from app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseListFragment.java |
| | |
| | | import android.content.pm.PackageManager; |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | import android.widget.LinearLayout; |
| | | import android.widget.TextView; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.appcompat.content.res.AppCompatResources; |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | |
| | | /** |
| | | * 电站和设备-界面 |
| | | */ |
| | | public class HouseListFragment extends CustomBaseFragment { |
| | | public class HouseAndDeviceFragment extends CustomBaseFragment { |
| | | private FragmentHouseListBinding viewBinding; |
| | | private HouseInfoAdapter houseInfoAdapter; |
| | | |
| | |
| | | viewBinding.powerStationLabelParent.setVisibility(View.GONE);//电站标签【父容器】隐藏 |
| | | viewBinding.deviceLabelParent.setVisibility(View.VISIBLE);//设备标签【父容器】显示 |
| | | loadNextPageDeviceList(true, 1, true); |
| | | } |
| | | }); |
| | | //全部 |
| | | viewBinding.powerStationAllIl.parentLl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | selectedStationStyle(viewBinding.powerStationAllIl.parentLl, viewBinding.powerStationAllIl.stationTotalTv, viewBinding.powerStationAllIl.stationTitleTv, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | //故障 |
| | | viewBinding.powerStationFaultsIl.parentLl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | selectedStationStyle(viewBinding.powerStationFaultsIl.parentLl, viewBinding.powerStationFaultsIl.stationTotalTv, viewBinding.powerStationFaultsIl.stationTitleTv, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | //离线 |
| | | viewBinding.hpowerStationOfflineIl.parentLl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | selectedStationStyle(viewBinding.hpowerStationOfflineIl.parentLl, viewBinding.hpowerStationOfflineIl.stationTotalTv, viewBinding.hpowerStationOfflineIl.stationTitleTv, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | //待接入 |
| | | viewBinding.powerStationConnectedIl.parentLl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | selectedStationStyle(viewBinding.powerStationConnectedIl.parentLl, viewBinding.powerStationConnectedIl.stationTotalTv, viewBinding.powerStationConnectedIl.stationTitleTv, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | |
| | |
| | | viewBinding.powerStationFaultsIl.stationTitleTv.setText(getString(R.string.my_power_station_malfunction)); |
| | | viewBinding.hpowerStationOfflineIl.stationTitleTv.setText(getString(R.string.my_power_station_off_line)); |
| | | viewBinding.powerStationConnectedIl.stationTitleTv.setText(getString(R.string.to_be_added)); |
| | | |
| | | selectedStationStyle(viewBinding.powerStationAllIl.parentLl, viewBinding.powerStationAllIl.stationTotalTv, viewBinding.powerStationAllIl.stationTitleTv, true); |
| | | //电站标签 |
| | | houseInfoAdapter = new HouseInfoAdapter(_mActivity); |
| | | viewBinding.fragmentHouseSrlListRc.setLayoutManager(new LinearLayoutManager(_mActivity)); |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 显示选中状态样式 |
| | | * |
| | | * @param linearLayout 组件 |
| | | * @param numberTv 组件 |
| | | * @param titleTv 组件 |
| | | * @param isShowSelectedStatus 是否显示状态样式 |
| | | */ |
| | | private void selectedStationStyle(LinearLayout linearLayout, TextView numberTv, TextView titleTv, boolean isShowSelectedStatus) { |
| | | viewBinding.powerStationAllIl.parentLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); |
| | | viewBinding.powerStationFaultsIl.parentLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); |
| | | viewBinding.hpowerStationOfflineIl.parentLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); |
| | | viewBinding.powerStationConnectedIl.parentLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); |
| | | |
| | | viewBinding.powerStationAllIl.stationTotalTv.setTextColor(getResources().getColor(R.color.text_E6000000, null)); |
| | | viewBinding.powerStationAllIl.stationTitleTv.setTextColor(getResources().getColor(R.color.text_66000000, null)); |
| | | |
| | | viewBinding.powerStationFaultsIl.stationTotalTv.setTextColor(getResources().getColor(R.color.text_E6000000, null)); |
| | | viewBinding.powerStationFaultsIl.stationTitleTv.setTextColor(getResources().getColor(R.color.text_66000000, null)); |
| | | |
| | | viewBinding.hpowerStationOfflineIl.stationTotalTv.setTextColor(getResources().getColor(R.color.text_E6000000, null)); |
| | | viewBinding.hpowerStationOfflineIl.stationTitleTv.setTextColor(getResources().getColor(R.color.text_66000000, null)); |
| | | |
| | | viewBinding.powerStationConnectedIl.stationTotalTv.setTextColor(getResources().getColor(R.color.text_E6000000, null)); |
| | | viewBinding.powerStationConnectedIl.stationTitleTv.setTextColor(getResources().getColor(R.color.text_66000000, null)); |
| | | |
| | | |
| | | if (isShowSelectedStatus) { |
| | | linearLayout.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.selected_8_38c494)); |
| | | numberTv.setTextColor(getResources().getColor(R.color.text_FFFFFFFF, null)); |
| | | titleTv.setTextColor(getResources().getColor(R.color.text_FFFFFFFF, null)); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void initData() { |
| | | if (isClickPowerStationLabel) { |
| | | this.houseListBeanIDList = new ArrayList<>(); |