wjc
2024-12-10 3ccff7173fb73322f7785d8eaedc90a1b5d8765d
app/src/main/java/com/hdl/photovoltaic/widget/DefaultFilteringDialog.java
@@ -1,11 +1,12 @@
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;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.TextView;
import androidx.annotation.NonNull;
@@ -16,8 +17,6 @@
import com.hdl.photovoltaic.databinding.DialogDefaultFilteringBinding;
import com.hdl.photovoltaic.enums.GridType;
import com.hdl.photovoltaic.enums.UnitType;
import com.hdl.photovoltaic.other.HdlCommonLogic;
import com.hdl.photovoltaic.other.HdlDeviceLogic;
import com.hdl.photovoltaic.other.HdlThreadLogic;
public class DefaultFilteringDialog extends BaseDialog {
@@ -47,10 +46,13 @@
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Window window = getWindow();
        if (window != null) {
            window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            window.setGravity(Gravity.BOTTOM);
        }
        viewBinding = DialogDefaultFilteringBinding.inflate(getLayoutInflater());
        setContentView(viewBinding.getRoot());
        //空白处不能取消动画
//        setCanceledOnTouchOutside(true);
        //初始化界面控件
        initView();
        //初始化界面数据
@@ -237,33 +239,21 @@
     */
    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_E6000000));
            viewBinding.text2Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            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_E6000000));
            viewBinding.text4Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            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_E6000000));
            viewBinding.text6Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            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_E6000000));
            viewBinding.text8Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.text8Tv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.text1Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
            viewBinding.text2Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
            viewBinding.text3Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
            viewBinding.text4Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
            viewBinding.text5Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
            viewBinding.text6Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
            viewBinding.text7Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
            viewBinding.text8Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
        } else {
            viewBinding.allTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            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_E6000000));
            viewBinding.offNetworkTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.search_bj_ff05000000));
            viewBinding.offNetworkTv.setTextColor(mContext.getColor(R.color.text_E6000000));
            viewBinding.allTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
            viewBinding.gridConnectedTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
            viewBinding.offNetworkTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
        }
        if (textView != null) {
            textView.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.selected_38c494));
            textView.setTextColor(mContext.getColor(R.color.text_FFFFFFFF));
            textView.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_yes_129));
        }
    }