From 30859ca8f2175475d2c666353bc27f3b2ceede53 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期四, 22 八月 2024 13:43:47 +0800 Subject: [PATCH] 2024年08月22日13:43:45 --- app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 51 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java b/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java index 1d5e8b3..89fcca9 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java @@ -1,6 +1,7 @@ package com.hdl.photovoltaic.ui.newC; +import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.View; @@ -11,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; +import com.google.gson.Gson; import com.google.gson.JsonObject; import com.hdl.linkpm.sdk.core.exception.HDLException; import com.hdl.photovoltaic.R; @@ -104,7 +106,7 @@ private void initEvent() { //杩斿洖鎸夐挳 - viewBinding.toolbarTopMessageCenterListRl.topBackBtn.setOnClickListener(new View.OnClickListener() { + viewBinding.toolbarTopMessageCenterListRl.topBackLl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { clearCacheData(); @@ -148,7 +150,7 @@ viewBinding.allGradeTitleIv.setBackgroundResource(R.drawable.down); viewBinding.allTimeTitleIv.setBackgroundResource(R.drawable.down); List<String> stringList = getTypeList(FilterType.deviceType); - TypeTitleListDialog typeTitleListDialog = new TypeTitleListDialog(_mActivity, stringList); + TypeTitleListDialog typeTitleListDialog = new TypeTitleListDialog(_mActivity, stringList, viewBinding.allDeviceTitleTv.getText().toString()); typeTitleListDialog.show(); typeTitleListDialog.setOnListener(new TypeTitleListDialog.OnClickListener() { @Override @@ -159,6 +161,14 @@ mDeviceTypeFilterValue = findFilterValueString(title); loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue); + } + }); + typeTitleListDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + viewBinding.allDeviceTitleIv.setBackgroundResource(R.drawable.down); + viewBinding.allGradeTitleIv.setBackgroundResource(R.drawable.down); + viewBinding.allTimeTitleIv.setBackgroundResource(R.drawable.down); } }); @@ -173,7 +183,7 @@ viewBinding.allGradeTitleIv.setBackgroundResource(R.drawable.up); viewBinding.allTimeTitleIv.setBackgroundResource(R.drawable.down); List<String> stringList = getTypeList(FilterType.type); - TypeTitleListDialog typeTitleListDialog = new TypeTitleListDialog(_mActivity, stringList); + TypeTitleListDialog typeTitleListDialog = new TypeTitleListDialog(_mActivity, stringList, viewBinding.allGradeTitleTv.getText().toString()); typeTitleListDialog.show(); typeTitleListDialog.setOnListener(new TypeTitleListDialog.OnClickListener() { @Override @@ -182,6 +192,14 @@ mTypeFilterKye = FilterType.type; mTypeFilterValue = findFilterValueString(title); loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue); + } + }); + typeTitleListDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + viewBinding.allDeviceTitleIv.setBackgroundResource(R.drawable.down); + viewBinding.allGradeTitleIv.setBackgroundResource(R.drawable.down); + viewBinding.allTimeTitleIv.setBackgroundResource(R.drawable.down); } }); } @@ -194,7 +212,7 @@ viewBinding.allGradeTitleIv.setBackgroundResource(R.drawable.down); viewBinding.allTimeTitleIv.setBackgroundResource(R.drawable.up); List<String> stringList = getTypeList(FilterType.timeType); - TypeTitleListDialog typeTitleListDialog = new TypeTitleListDialog(_mActivity, stringList); + TypeTitleListDialog typeTitleListDialog = new TypeTitleListDialog(_mActivity, stringList, viewBinding.allTimeTitleTv.getText().toString()); typeTitleListDialog.show(); typeTitleListDialog.setOnListener(new TypeTitleListDialog.OnClickListener() { @Override @@ -203,6 +221,14 @@ mTimeTypeFilterKye = FilterType.timeType; mTimeTypeFilterValue = findFilterValueString(title); loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue); + } + }); + typeTitleListDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + viewBinding.allDeviceTitleIv.setBackgroundResource(R.drawable.down); + viewBinding.allGradeTitleIv.setBackgroundResource(R.drawable.down); + viewBinding.allTimeTitleIv.setBackgroundResource(R.drawable.down); } }); } @@ -215,6 +241,15 @@ if (isAlarmDeviceClick) { return;//闃叉澶氭鐐瑰嚮 } + mDeviceTypeFilterKye = FilterType.deviceType; + mDeviceTypeFilterValue = FilterType.all; + mTypeFilterKye = FilterType.all; + mTypeFilterValue = FilterType.all; + mTimeTypeFilterKye = FilterType.all; + mTimeTypeFilterValue = FilterType.all; + viewBinding.allDeviceTitleTv.setText(getString(R.string.alarm_all_device)); + viewBinding.allGradeTitleTv.setText(getString(R.string.alarm_all_grade)); + viewBinding.allTimeTitleTv.setText(getString(R.string.alarm_all_time)); isAlarmDeviceClick = true; refreshBottomStyle(true); loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue); @@ -227,6 +262,15 @@ if (!isAlarmDeviceClick) { return;//闃叉澶氭鐐瑰嚮 } + mDeviceTypeFilterKye = FilterType.deviceType; + mDeviceTypeFilterValue = FilterType.all; + mTypeFilterKye = FilterType.all; + mTypeFilterValue = FilterType.all; + mTimeTypeFilterKye = FilterType.all; + mTimeTypeFilterValue = FilterType.all; + viewBinding.allDeviceTitleTv.setText(getString(R.string.alarm_all_device)); + viewBinding.allGradeTitleTv.setText(getString(R.string.alarm_all_grade)); + viewBinding.allTimeTitleTv.setText(getString(R.string.alarm_all_time)); isAlarmDeviceClick = false; refreshBottomStyle(false); loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue); @@ -270,7 +314,7 @@ @Override public void onClick(int position, MessageBean messageBean) { Intent intent = new Intent(); - intent.putExtra("msgId", messageBean.getMsgId().toString()); + intent.putExtra("messageBean", new Gson().toJson(messageBean)); intent.setClass(_mActivity, MessageInfoActivity.class); startActivity(intent); } @@ -281,13 +325,13 @@ private void initView() { viewBinding.toolbarTopMessageCenterListRl.getRoot().setBackgroundColor(getColor(R.color.text_FFFFFFFF)); - viewBinding.toolbarTopMessageCenterListRl.topBackBtn.setVisibility(View.VISIBLE); + viewBinding.toolbarTopMessageCenterListRl.topBackLl.setVisibility(View.VISIBLE); viewBinding.toolbarTopMessageCenterListRl.topLeftIv.setImageResource(R.drawable.back_c); viewBinding.toolbarTopMessageCenterListRl.topTitleTv.setText(R.string.set_message_center); viewBinding.toolbarTopMessageCenterListRl.topMoreBtn.setVisibility(View.VISIBLE); viewBinding.toolbarTopMessageCenterListRl.topMoreIv.setImageResource(R.drawable.clearall); //榛樿閫変腑鍏ㄩ儴璁惧 - viewBinding.allDeviceTitleIv.setBackgroundResource(R.drawable.up); + viewBinding.allDeviceTitleIv.setBackgroundResource(R.drawable.down); viewBinding.allGradeTitleIv.setBackgroundResource(R.drawable.down); viewBinding.allTimeTitleIv.setBackgroundResource(R.drawable.down); refreshBottomStyle(true); -- Gitblit v1.8.0