mac
2024-05-30 7e79979359bf5d3438afac05458e454c4786d50b
app/src/main/java/com/hdl/photovoltaic/widget/DefaultFilteringDialog.java
@@ -1,5 +1,7 @@
package com.hdl.photovoltaic.widget;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
@@ -45,16 +47,24 @@
        viewBinding = DialogDefaultFilteringBinding.inflate(getLayoutInflater());
        setContentView(viewBinding.getRoot());
        //空白处不能取消动画
        setCanceledOnTouchOutside(false);
//        setCanceledOnTouchOutside(true);
        //初始化界面控件
        initView();
        //初始化界面数据
//        initData(mMinValue, mMaxValue, mStateValue);
        //初始化界面控件的事件
        initEvent();
    }
    private void initEvent() {
        viewBinding.clickRl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        viewBinding.affirmLl.setOnClickListener(new View.OnClickListener() {
            @Override
@@ -167,7 +177,7 @@
            @Override
            public void onClick(View v) {
                setBackgroundColor(viewBinding.allTv, TitleType.GridConnectedState);
                setSelectedText(viewBinding.allTv.getTag().toString());
                mStateValue = GridType.All;
            }
        });
        viewBinding.gridConnectedTv.setOnClickListener(new View.OnClickListener() {
@@ -175,7 +185,7 @@
            @Override
            public void onClick(View v) {
                setBackgroundColor(viewBinding.gridConnectedTv, TitleType.GridConnectedState);
                setSelectedText(viewBinding.gridConnectedTv.getTag().toString());
                mStateValue = GridType.FULL_GRID;
            }
        });
        viewBinding.offNetworkTv.setOnClickListener(new View.OnClickListener() {
@@ -183,7 +193,7 @@
            @Override
            public void onClick(View v) {
                setBackgroundColor(viewBinding.offNetworkTv, TitleType.GridConnectedState);
                setSelectedText(viewBinding.offNetworkTv.getTag().toString());
                mStateValue = GridType.OFFLINE;
            }
        });
@@ -207,8 +217,6 @@
                minValue = min_max[0];
                maxValue = min_max[1];
            }
        } else {
            mStateValue = value;
        }
        viewBinding.minEt.setText(minValue);
@@ -225,28 +233,28 @@
    private void setBackgroundColor(TextView textView, TitleType titleType) {
        if (titleType == TitleType.string_capacity) {
            viewBinding.text1Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.text1Tv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.text1Tv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.text2Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.text2Tv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.text2Tv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.text3Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.text3Tv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.text3Tv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.text4Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.text4Tv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.text4Tv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.text5Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.text5Tv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.text5Tv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.text6Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.text6Tv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.text6Tv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.text7Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.text7Tv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.text7Tv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.text8Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.text8Tv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.text8Tv.setTextColor(mContext.getColor(R.color.text_E6000000));
        } else {
            viewBinding.allTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.allTv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.allTv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.gridConnectedTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.gridConnectedTv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.gridConnectedTv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.offNetworkTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.offNetworkTv.setTextColor(mContext.getColor(R.color.text_90000000));
            viewBinding.offNetworkTv.setTextColor(mContext.getColor(R.color.text_E6000000));
        }
        if (textView != null) {
            textView.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.selected_38c494));