wjc
2025-04-07 2661d1c7b0a4d77e59f828825246e3e8e3594aa6
app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java
@@ -11,7 +11,6 @@
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
@@ -65,7 +64,6 @@
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
@@ -185,16 +183,16 @@
                viewBinding.unitTv.setText(UnitType.kW);
                viewBinding.unitTextTv.setText(getString(R.string.pv_power));
                viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_39383d));
                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_E6FFFFFF));
                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_FFACACAC));
                viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.v1.setVisibility(View.GONE);
                viewBinding.v2.setVisibility(View.VISIBLE);
@@ -219,16 +217,16 @@
                viewBinding.unitTv.setText(UnitType.kWh);
                viewBinding.unitTextTv.setText(getString(R.string.generation));
                viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_39383d));
                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_E6FFFFFF));
                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_FFACACAC));
                viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.v1.setVisibility(View.GONE);
                viewBinding.v2.setVisibility(View.GONE);
@@ -253,16 +251,16 @@
                viewBinding.unitTv.setText(UnitType.kWh);
                viewBinding.unitTextTv.setText(getString(R.string.generation));
                viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_39383d));
                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_E6FFFFFF));
                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_FFACACAC));
                viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.v1.setVisibility(View.VISIBLE);
                viewBinding.v2.setVisibility(View.GONE);
@@ -285,16 +283,16 @@
                viewBinding.unitTv.setText(UnitType.kWh);
                viewBinding.unitTextTv.setText(getString(R.string.generation));
                viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
                viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_39383d));
                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_E6FFFFFF));
                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_FFACACAC));
                viewBinding.v1.setVisibility(View.VISIBLE);
                viewBinding.v2.setVisibility(View.VISIBLE);
@@ -399,12 +397,12 @@
//                .setTitleText(_mActivity.getString(R.string.time_selectd))//标题文字
                .setOutSideCancelable(true)//点击屏幕,点在控件外部范围时,是否取消显示
                .isCyclic(false)//是否循环滚动
//                .setTitleColor(_mActivity.getColor(R.color.text_E6FFFFFF))//标题文字颜色
                .setSubmitColor(_mActivity.getColor(R.color.text_E6FFFFFF))//确定按钮文字颜色
//                .setTitleColor(_mActivity.getColor(R.color.text_FFACACAC))//标题文字颜色
                .setSubmitColor(_mActivity.getColor(R.color.text_FFACACAC))//确定按钮文字颜色
                .setCancelColor(_mActivity.getColor(R.color.text_FF8E8E8E))//取消按钮文字颜色
                .setTitleBgColor(_mActivity.getColor(R.color.text_FF222222))//标题背景颜色 Night mode
                .setBgColor(_mActivity.getColor(R.color.text_FF222222))//滚轮背景颜色 Night mode
                .setTextColorCenter(_mActivity.getColor(R.color.text_E6FFFFFF)).setDate(selectedDate)// 如果不设置的话,默认是系统时间*/
                .setTextColorCenter(_mActivity.getColor(R.color.text_FFACACAC)).setDate(selectedDate)// 如果不设置的话,默认是系统时间*/
                .setRangDate(startDate, endDate)//起始终止年月日设定
                .setLabel(_mActivity.getString(R.string.year), _mActivity.getString(R.string.month), _mActivity.getString(R.string.day), _mActivity.getString(R.string.hour), _mActivity.getString(R.string.minute), _mActivity.getString(R.string.seconds))//默认设置为年月日时分秒
                .isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
@@ -455,13 +453,13 @@
        viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_39383d));
        viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_E6FFFFFF));
        viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_FFACACAC));
        viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
        viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
        viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
        viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
        viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
        viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
        viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
        viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF));
        viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_FF5B5B5B));
        viewBinding.v1.setVisibility(View.GONE);
        viewBinding.v2.setVisibility(View.VISIBLE);
        viewBinding.v3.setVisibility(View.VISIBLE);
@@ -503,7 +501,7 @@
     * 电站状态概览
     */
    private void getStatusOverview() {
        HdlResidenceLogic.getInstance().getStatusOverview("","","",new CloudCallBeak<StatusOverviewBean>() {
        HdlResidenceLogic.getInstance().getStatusOverview(new CloudCallBeak<StatusOverviewBean>() {
            @Override
            public void onSuccess(StatusOverviewBean statusOverviewBean) {
                if (statusOverviewBean == null) {
@@ -539,7 +537,7 @@
                        }
                        String capacityValue = HdlCommonLogic.divideByOneThousandAndFormat(dataOverBean.getInstalledCapacity()).toString();
                        viewBinding.infoRl1Text1Tv.setText(capacityValue);
                        viewBinding.kwpUnit.setText(HdlCommonLogic.convertWPUnit(dataOverBean.getInstalledCapacity()));
                        viewBinding.kwpUnit.setText(HdlCommonLogic.convertKWPUnit(dataOverBean.getInstalledCapacity()));
                        viewBinding.infoRl1Text3Tv.setText(HdlCommonLogic.convertDoubleValue(dataOverBean.getPower()));
//                        String str = dataOverBean.getPowerRatio() + "%";
@@ -549,7 +547,7 @@
//                        //设置第一部分文字的字体大小
//                        spannableString.setSpan(new AbsoluteSizeSpan((int) UnitConversionUtils.dpToPx(HDLApp.getInstance(), 12)), startIndex, endIndex, 0);
//                        // 创建一个ForegroundColorSpan对象,参数是颜色值
//                        ForegroundColorSpan colorSpan = new ForegroundColorSpan(HDLApp.getInstance().getColor(R.color.text_66FFFFFF));
//                        ForegroundColorSpan colorSpan = new ForegroundColorSpan(HDLApp.getInstance().getColor(R.color.text_FF5B5B5B));
//                        spannableString.setSpan(colorSpan, startIndex, endIndex, 0);
//                        viewBinding.infoRl1FText1Tv.setText(spannableString);
                        viewBinding.infoRl1FText1Tv.setText(dataOverBean.getPowerRatio());