| | |
| | | |
| | | import android.os.Bundle; |
| | | import android.os.SystemClock; |
| | | import android.text.SpannableString; |
| | | import android.text.Spanned; |
| | | import android.text.TextUtils; |
| | | import android.text.style.AbsoluteSizeSpan; |
| | | import android.text.style.ClickableSpan; |
| | | import android.text.style.ForegroundColorSpan; |
| | | import android.text.style.StyleSpan; |
| | | import android.view.View; |
| | | |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.appcompat.content.res.AppCompatResources; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | | |
| | |
| | | import com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartView; |
| | | import com.github.AAChartModel.AAChartCore.AAChartCreator.AAMoveOverEventMessageModel; |
| | | import com.hdl.linkpm.sdk.core.exception.HDLException; |
| | | import com.hdl.photovoltaic.HDLApp; |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.base.CustomBaseFragment; |
| | | import com.hdl.photovoltaic.config.ConstantManage; |
| | |
| | | import com.hdl.photovoltaic.ui.home.aachart.BasicChartComposer; |
| | | import com.hdl.photovoltaic.uni.HDLUniMP; |
| | | import com.hdl.photovoltaic.utils.TimeUtils; |
| | | import com.hdl.photovoltaic.utils.UnitConversionUtils; |
| | | import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | |
| | | viewBinding.infoRl1Text2Tv.setText(installed_capacity); |
| | | String generated_power = getString(R.string.generated_power) + "(" + UnitType.kW + ")"; |
| | | viewBinding.infoRl1Text4Tv.setText(generated_power); |
| | | String generation = getString(R.string.generation) + "(" + UnitType.kWh + ")"; |
| | | String generation = getString(R.string.generation) + "/" + UnitType.kWh; |
| | | viewBinding.homePageStationInfoRl1TitleTv.setText(generation); |
| | | |
| | | viewBinding.homePageStationInfoRl2DayIc.dataTypeTv.setText(R.string.day_power_generation); |
| | |
| | | // 取消粘性事件 |
| | | EventBus.getDefault().removeStickyEvent(eventBus); |
| | | HdlLogLogic.print("正在点击【首页】"); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | viewBinding.infoRl1Text1Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getInstalledCapacity())); |
| | | viewBinding.infoRl1Text3Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getPower(),UnitType.kW,false)); |
| | | viewBinding.infoRl1FText1Tv.setText(dataOverBean.getPowerRatio()); |
| | | viewBinding.infoRl1Text3Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getPower(), UnitType.kW, false)); |
| | | |
| | | String str = dataOverBean.getPowerRatio() + "%"; |
| | | int startIndex = str.lastIndexOf("%"); |
| | | int endIndex = str.lastIndexOf("%") + 1; |
| | | SpannableString spannableString = new SpannableString(str); |
| | | //设置第一部分文字的字体大小 |
| | | spannableString.setSpan(new AbsoluteSizeSpan((int) UnitConversionUtils.dpToPx(HDLApp.getInstance(), 12)), startIndex, endIndex, 0); |
| | | // 创建一个ForegroundColorSpan对象,参数是颜色值 |
| | | ForegroundColorSpan colorSpan = new ForegroundColorSpan(HDLApp.getInstance().getColor(R.color.text_191919)); |
| | | spannableString.setSpan(colorSpan, startIndex, endIndex, 0); |
| | | |
| | | viewBinding.infoRl1FText1Tv.setText(spannableString); |
| | | |
| | | viewBinding.homePageStationInfoRl2DayIc.dataTv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getTodayElectricity())); |
| | | viewBinding.homePageStationInfoRl2MonIc.dataTv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getMonthElectricity())); |