mac
2024-05-10 43c0a28db7e43959561036dbde0eb5cb37a7e324
2024年05月10日18:25:29

消息搜索还没有完成
3个文件已添加
1个文件已删除
6个文件已修改
3 文件已重命名
986 ■■■■ 已修改文件
app/src/main/AndroidManifest.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/adapter/SearchMessageAdapter.java 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/message/MessageFragment.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java 259 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/message/SearchMessageActivity.java 392 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/aachart/AAChartSymbolConst.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/aachart/BasicChartComposer.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/aachart/CustomStyleChartComposer.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_device_search.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_house_search.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_search_messge.xml 167 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/AndroidManifest.xml
@@ -77,6 +77,9 @@
        android:supportsRtl="true"
        android:theme="@style/Theme.PhotovoltaicDebug">
        <activity
            android:name=".ui.message.SearchMessageActivity"
            android:exported="false" />
        <activity
            android:name=".ui.powerstation.DeviceSearchActivity"
            android:exported="false" />
        <activity
app/src/main/java/com/hdl/photovoltaic/ui/adapter/SearchMessageAdapter.java
New file
@@ -0,0 +1,115 @@
package com.hdl.photovoltaic.ui.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.ui.bean.DeviceBean;
import com.hdl.photovoltaic.widget.SwipeLayout;
import java.util.ArrayList;
import java.util.List;
/**
 * 搜索消息适配器
 */
public class SearchMessageAdapter extends RecyclerView.Adapter<SearchMessageAdapter.MyViewHolder> {
    List<DeviceBean> mList;
    Context mContext;
    OnClickListener mOnclickListener;
    public SearchMessageAdapter(Context context) {
        this.mContext = context;
    }
    @NonNull
    @Override
    public SearchMessageAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View contentItem = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_device_details, parent, false);
        return new SearchMessageAdapter.MyViewHolder(contentItem);
    }
    @Override
    public void onBindViewHolder(@NonNull SearchMessageAdapter.MyViewHolder holder, int position) {
        DeviceBean deviceBean = this.mList.get(position);
        holder.itemView.setTag(position);
        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                try {
                    if (mOnclickListener != null) {
                        mOnclickListener.onClick((int) holder.itemView.getTag(), deviceBean);
                    }
                } catch (Exception ignored) {
                }
            }
        });
    }
    @Override
    public int getItemCount() {
        return this.mList == null ? 0 : this.mList.size();
    }
    public void setOnclickListener(OnClickListener onClickListener) {
        this.mOnclickListener = onClickListener;
    }
    public void setList(List<DeviceBean> newData) {
        if (this.mList == null) {
            this.mList = new ArrayList<>();
        } else {
            this.mList.clear();
        }
        this.mList.addAll(newData);
        notifyDataSetChanged();
    }
    /**
     * 一行布局容器
     */
    static class MyViewHolder extends RecyclerView.ViewHolder {
        public ImageView homeIconIv;//住宅图片
        public TextView homeNameTv;//住宅名称
        public TextView capacityTv;//装机容量
        public TextView powerTv;//发电功率
        public TextView stateTv;//电站状态(连接中,运行,离线,故障);
        public RelativeLayout item_parent_rl;//条目父容器
        public ImageView move_home_iv;//移动电站位置
        public ImageView del_home_iv;//删除电站
        public SwipeLayout item_parent_swipeLayout;//父容器
        public MyViewHolder(@NonNull View itemView) {
            super(itemView);
            homeIconIv = itemView.findViewById(R.id.device_details_image_iv);
            homeNameTv = itemView.findViewById(R.id.device_details_name_tv);
            capacityTv = itemView.findViewById(R.id.device_details_sn_tv);
            powerTv = itemView.findViewById(R.id.power_type_tv);
            stateTv = itemView.findViewById(R.id.fragment_house_list_line_state_tv);
            item_parent_rl = itemView.findViewById(R.id.item_parent_rl);
            move_home_iv = itemView.findViewById(R.id.move_home_iv);
            del_home_iv = itemView.findViewById(R.id.del_home_iv);
            item_parent_swipeLayout = itemView.findViewById(R.id.item_parent_swipeLayout);
        }
    }
    public interface OnClickListener {
        void onClick(int position, DeviceBean deviceBean);
    }
}
app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java
@@ -1,7 +1,7 @@
package com.hdl.photovoltaic.ui.home;
import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureColorfulColumnChart;
import static com.hdl.photovoltaic.ui.powerstation.aachart.CustomStyleChartComposer.configureColorfulColumnChart;
import android.os.Bundle;
import android.text.TextUtils;
@@ -33,6 +33,7 @@
import com.hdl.photovoltaic.ui.bean.DataOverBean;
import com.hdl.photovoltaic.ui.bean.SocialContributionBean;
import com.hdl.photovoltaic.ui.bean.StatisticsBean;
import com.hdl.photovoltaic.ui.powerstation.aachart.BasicChartComposer;
import com.hdl.photovoltaic.utils.TimeUtils;
import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
app/src/main/java/com/hdl/photovoltaic/ui/message/MessageFragment.java
@@ -41,7 +41,7 @@
import java.util.Map;
/**
 * 消息
 * 消息模块界面
 */
public class MessageFragment extends CustomBaseFragment {
@@ -84,6 +84,7 @@
    private void initEvent() {
        //发生中
        viewBinding.messageTabNascentTitleTv.setOnClickListener(new View.OnClickListener() {
            @Override
@@ -110,6 +111,15 @@
                viewBinding.messageTabRecoverTitleTv.setTextAppearance(R.style.Text20Style);
                viewBinding.allClearTv.setVisibility(View.GONE);
                loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue, true);
            }
        });
        //搜索消息
        viewBinding.messageSearchCl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(_mActivity, SearchMessageActivity.class);
                startActivity(intent);
            }
        });
@@ -284,6 +294,12 @@
                HdlLogLogic.print("正在点击【消息】");
            }
        } else if (eventBus.getTopic().equals(ConstantManage.message_function_push_post)) {
            if (eventBus.getType().equals(MessageStateType.untreated)) {
                updateListData();
            }/* else if (eventBus.getType().equals(MessageStateType.processed)) {
                updateListData();
            }*/
        }
    }
app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java
@@ -1,7 +1,6 @@
package com.hdl.photovoltaic.ui.message;
import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
@@ -91,8 +90,8 @@
                            type = _mActivity.getString(R.string.message_alarm);
                            drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.alarm_ffb300);
                        } else if (mMessageBean.getType().equals(MessageAlarmStateType.event)) {
                            type = _mActivity.getString(R.string.event);
                            drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.alarm_ffb300);
                            type = _mActivity.getString(R.string.loading_title_tip);
                            drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.state_b9b9b9);
                        }
                        viewBinding.messageInfoAlarmStateTv.setText(type);
                        viewBinding.messageInfoAlarmStateTv.setBackground(drawable);
@@ -186,8 +185,6 @@
                            sendEventBus();
                        }
                        finish();
                    }
                    @Override
app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java
File was deleted
app/src/main/java/com/hdl/photovoltaic/ui/message/SearchMessageActivity.java
New file
@@ -0,0 +1,392 @@
package com.hdl.photovoltaic.ui.message;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.hdl.linkpm.sdk.core.exception.HDLException;
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.base.CustomBaseActivity;
import com.hdl.photovoltaic.bean.PageNumberObject;
import com.hdl.photovoltaic.databinding.ActivitySearchMessgeBinding;
import com.hdl.photovoltaic.enums.ShowErrorMode;
import com.hdl.photovoltaic.listener.CloudCallBeak;
import com.hdl.photovoltaic.other.HdlDeviceLogic;
import com.hdl.photovoltaic.other.HdlFileLogic;
import com.hdl.photovoltaic.other.HdlLogLogic;
import com.hdl.photovoltaic.other.HdlThreadLogic;
import com.hdl.photovoltaic.ui.adapter.SearchHistoryAdapter;
import com.hdl.photovoltaic.ui.adapter.SearchMessageAdapter;
import com.hdl.photovoltaic.ui.bean.DeviceBean;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
 * 消息搜索界面
 */
public class SearchMessageActivity extends CustomBaseActivity {
    private ActivitySearchMessgeBinding viewBinding;
    SearchMessageAdapter searchMessageAdapter;//设备适配器
    SearchHistoryAdapter searchHistoryAdapter;//历史记录适配器
    private List<DeviceBean> deviceList = new ArrayList<>();
    private int currentHouseListPage = 0; // 当前电站列表页码
    private int currentHouseListTotal = 0; // 电站列表总页码
    private boolean isHouseLoadingMore = false; // 标记电站列表正在加载更多数据
    private String currSearchText;
    List<String> searchHistoryTitleList = new ArrayList<>();
    @Override
    public Object getContentView() {
        viewBinding = ActivitySearchMessgeBinding.inflate(getLayoutInflater());
        return viewBinding.getRoot();
    }
    @Override
    public void onBindView(Bundle savedInstanceState) {
        setStatusBarTranslucent();
        //历史记录文件夹创建
        HdlFileLogic.getInstance().createFileDir(HdlFileLogic.getInstance().getCurrentUserRootPath());
        //初始化数据
        initData();
        //初始化
        initView();
        //初始化界面监听器
        initEvent();
    }
    private void initData() {
        try {
            String json = HdlFileLogic.getInstance().readFile(getHistoryFileNamePath());
            if (TextUtils.isEmpty(json)) {
                return;
            }
            searchHistoryTitleList = new Gson().fromJson(json, new TypeToken<List<String>>() {
            }.getType());
        } catch (Exception ignored) {
        }
    }
    private void initEvent() {
        //后退
        viewBinding.backRl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        viewBinding.messageSearchEt.addTextChangedListener(textWatcher);
        //搜索
        viewBinding.powerStationSearchTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //搜索关键字
                currSearchText = viewBinding.messageSearchEt.getText().toString().replace(" ", "");
                if (TextUtils.isEmpty(currSearchText)) {
                    HdlThreadLogic.toast(_mActivity, R.string.search_content_null);
                    return;
                }
                viewBinding.historyListParent.setVisibility(View.GONE);
                viewBinding.listParent.setVisibility(View.VISIBLE);
                addSearchTextToList();
                loadNextPageHouseList(true, 1, true);
            }
        });
        //下拉箭头颜色
        viewBinding.listSrl.setColorSchemeResources(R.color.text_FF245EC3);
        //下拉读取
        viewBinding.listSrl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {
                viewBinding.listSrl.setRefreshing(false);
                loadNextPageHouseList(true, 1, true);
            }
        });
        //上拉读取
        viewBinding.listRcv.addOnScrollListener(new RecyclerView.OnScrollListener() {
            @Override
            public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
                LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
                if (layoutManager == null) {
                    return;
                }
                int visibleItemCount = layoutManager.getChildCount();
                int totalItemCount = layoutManager.getItemCount();
                int firstVisibleItemPosition = layoutManager.findFirstVisibleItemPosition();
                if (visibleItemCount > 0 && visibleItemCount + firstVisibleItemPosition == totalItemCount) {
                    if (!isHouseLoadingMore) {
                        // 滑动到了底部,执行相应的操作
                        HdlLogLogic.print("--->滑动到了底部");
                        loadNextPageHouseList(false, ++currentHouseListPage, false);
                    }
                }
            }
        });
        //清除
        viewBinding.powerStationClearIv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                currSearchText = "";
                viewBinding.messageSearchEt.setText("");
                viewBinding.historyListParent.setVisibility(View.VISIBLE);
                viewBinding.listParent.setVisibility(View.GONE);
                searchHistoryAdapter.setList(searchHistoryTitleList);
                clearData();
            }
        });
        //删除
        viewBinding.messageDelIv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                searchHistoryTitleList = new ArrayList<>();
                searchHistoryAdapter.setList(searchHistoryTitleList);
                HdlFileLogic.getInstance().deleteFile(getHistoryFileNamePath());
            }
        });
        //历史记录点击事件
        searchHistoryAdapter.setOnclickListener(new SearchHistoryAdapter.OnClickListener() {
            @Override
            public void onClick(int position, String title) {
                viewBinding.messageSearchEt.setText(title);
            }
        });
        //电站点击是事件
        searchMessageAdapter.setOnclickListener(new SearchMessageAdapter.OnClickListener() {
            @Override
            public void onClick(int position, DeviceBean deviceBean) {
            }
        });
    }
    private void initView() {
        viewBinding.historyListParent.setVisibility(View.VISIBLE);
        viewBinding.listParent.setVisibility(View.GONE);
        viewBinding.powerStationClearIv.setVisibility(View.GONE);
        //初始化历史记录适配器
        searchHistoryAdapter = new SearchHistoryAdapter(_mActivity);
        viewBinding.historyListRcv.setLayoutManager(new LinearLayoutManager(_mActivity));
        viewBinding.historyListRcv.setAdapter(searchHistoryAdapter);
        searchHistoryAdapter.setList(searchHistoryTitleList);
        //初始化电站适配器
        searchMessageAdapter = new SearchMessageAdapter(_mActivity);
        viewBinding.listRcv.setLayoutManager(new LinearLayoutManager(_mActivity));
        viewBinding.listRcv.setAdapter(searchMessageAdapter);
    }
    /**
     * 输入电站名称进行过滤
     */
    private final TextWatcher textWatcher = new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        }
        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
        }
        @Override
        public void afterTextChanged(Editable s) {
            String et = viewBinding.messageSearchEt.getText().toString().replace(" ", "");
            if (TextUtils.isEmpty(et)) {
                viewBinding.powerStationClearIv.setVisibility(View.GONE);
            } else {
                viewBinding.powerStationClearIv.setVisibility(View.VISIBLE);
            }
            viewBinding.messageSearchEt.setSelection(viewBinding.messageSearchEt.length());
        }
    };
    /**
     * 物理按键返回事件
     */
    @Override
    public void onBackPressed() {
        super.onBackPressed();
    }
    @Override
    protected void onDestroy() {
        viewBinding.messageSearchEt.removeTextChangedListener(textWatcher);
        if (searchHistoryTitleList.size() > 0) {
            HdlFileLogic.getInstance().deleteFile(getHistoryFileNamePath());
            HdlFileLogic.getInstance().appendFile(getHistoryFileNamePath(), new Gson().toJson(searchHistoryTitleList));
        }
        super.onDestroy();
    }
    /**
     * 刷新UI(设备)
     *
     * @param isRefreshing 表示是下拉刷新的
     */
    private void loadNextPageHouseList(boolean isRefreshing, long pageNo, boolean isClear) {
        //搜索关键字
        if (TextUtils.isEmpty(currSearchText)) {
            return;
        }
        if (isClear) {
            clearData();
        }
        //第一页读取数据强制读取
        if (pageNo > 1 && currentHouseListPage > currentHouseListTotal) {
            --currentHouseListPage;
            //当前页不能大于总页数
            return;
        }
        isHouseLoadingMore = true;//标记读取状态
        if (isRefreshing) {
            showLoading();
        }
        //获取云端上设备列表
        HdlDeviceLogic.getInstance().getPowerStationDeviceList(currSearchText, pageNo, 20, new CloudCallBeak<PageNumberObject<DeviceBean>>() {
            @Override
            public void onSuccess(PageNumberObject<DeviceBean> deviceClass) {
                HdlThreadLogic.runMainThread(new Runnable() {
                    @Override
                    public void run() {
                        if (isRefreshing) {
                            hideLoading();
                        }
                        isHouseLoadingMore = false;
                        if (deviceClass != null) {
                            currentHouseListTotal = (int) deviceClass.getTotalPage();
                            currentHouseListPage = (int) deviceClass.getPageNo();
                            //更新缓存
                            setDeviceList(deviceClass.getList());
                            if (searchMessageAdapter != null) {
                                initData();
                                //更新UI
                                searchMessageAdapter.setList(deviceList);
                            }
                        }
                    }
                }, _mActivity, ShowErrorMode.YES);
            }
            @Override
            public void onFailure(HDLException e) {
                HdlThreadLogic.runMainThread(new Runnable() {
                    @Override
                    public void run() {
                        if (currentHouseListPage > 1) {
                            --currentHouseListPage;
                        }
                        isHouseLoadingMore = false;
                        if (isRefreshing) {
                            hideLoading();
                        }
                    }
                }, _mActivity, ShowErrorMode.YES);
            }
        });
    }
    private void clearData() {
        if (deviceList != null && deviceList.size() > 0) {
            deviceList.clear();
        }
    }
    public void setDeviceList(List<DeviceBean> list) {
        if (list == null || list.size() == 0) {
            return;
        }
        if (this.deviceList.size() == 0) {
            this.deviceList.addAll(list);
            return;
        }
        for (int i = 0; i < list.size(); i++) {
            this.setSingleDevice(list.get(i));
        }
    }
    /**
     * 添加设备到列表里面
     *
     * @param deviceBean -设备对象
     */
    public void setSingleDevice(DeviceBean deviceBean) {
        try {
            if (deviceBean == null) {
                return;
            }
            boolean if_boolean = false;
            for (int i = 0; i < deviceList.size(); i++) {
                if (deviceList.get(i).getHomeId().equals(deviceBean.getHomeId())) {
                    //存在替换
                    deviceList.remove(i);
                    deviceList.add(i, deviceBean);
                    if_boolean = true;
                    break;
                }
            }
            if (!if_boolean) {
                //没有添加
                this.deviceList.add(deviceBean);
            }
        } catch (Exception e) {
            String mes = e.getMessage();
            HdlLogLogic.print("--->" + mes);
        }
    }
    /**
     * 添加历史记录
     */
    private void addSearchTextToList() {
        for (int i = 0; i < searchHistoryTitleList.size(); i++) {
            if (searchHistoryTitleList.get(i).equals(currSearchText)) {
                searchHistoryTitleList.remove(searchHistoryTitleList.get(i));
            }
        }
        searchHistoryTitleList.add(currSearchText);
        // 倒序排列数据(搜索最后排在前面)
        Collections.reverse(searchHistoryTitleList);
        if (searchHistoryTitleList.size() > 10) {
            //历史记录不能超出10
            searchHistoryTitleList.remove(searchHistoryTitleList.get(11));
        }
    }
    /**
     * 获取【搜索历史记录文件】全路径
     */
    public String getHistoryFileNamePath() {
        return HdlFileLogic.getInstance().getCurrentUserRootPath() + "/message.txt";
    }
}
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/aachart/AAChartSymbolConst.java
File was renamed from app/src/main/java/com/hdl/photovoltaic/ui/home/AAChartSymbolConst.java
@@ -1,4 +1,4 @@
package com.hdl.photovoltaic.ui.home;
package com.hdl.photovoltaic.ui.powerstation.aachart;
import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartSymbolType;
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/aachart/BasicChartComposer.java
File was renamed from app/src/main/java/com/hdl/photovoltaic/ui/home/BasicChartComposer.java
@@ -1,4 +1,4 @@
package com.hdl.photovoltaic.ui.home;
package com.hdl.photovoltaic.ui.powerstation.aachart;
import static com.github.AAChartModel.AAChartCore.AATools.AAColor.AARgba;
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/aachart/CustomStyleChartComposer.java
File was renamed from app/src/main/java/com/hdl/photovoltaic/ui/home/CustomStyleChartComposer.java
@@ -1,10 +1,10 @@
package com.hdl.photovoltaic.ui.home;
package com.hdl.photovoltaic.ui.powerstation.aachart;
import static com.github.AAChartModel.AAChartCore.AATools.AAColor.AARgba;
import static com.hdl.photovoltaic.ui.home.AAChartSymbolConst.base64Symbol;
import static com.hdl.photovoltaic.ui.home.AAChartSymbolConst.imageSymbol;
import static com.hdl.photovoltaic.ui.home.AAChartSymbolConst.predefinedSymbol1;
import static com.hdl.photovoltaic.ui.home.AAChartSymbolConst.predefinedSymbol2;
import static com.hdl.photovoltaic.ui.powerstation.aachart.AAChartSymbolConst.base64Symbol;
import static com.hdl.photovoltaic.ui.powerstation.aachart.AAChartSymbolConst.imageSymbol;
import static com.hdl.photovoltaic.ui.powerstation.aachart.AAChartSymbolConst.predefinedSymbol1;
import static com.hdl.photovoltaic.ui.powerstation.aachart.AAChartSymbolConst.predefinedSymbol2;
import com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartModel;
import com.github.AAChartModel.AAChartCore.AAChartCreator.AASeriesElement;
app/src/main/res/layout/activity_device_search.xml
@@ -91,7 +91,7 @@
    </RelativeLayout>
    <!--历史记录-->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/history_list_parent"
        android:layout_width="match_parent"
@@ -136,7 +136,7 @@
            app:layout_constraintTop_toTopOf="parent" />
    </androidx.constraintlayout.widget.ConstraintLayout>
    <!--搜索数据-->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/list_parent"
        android:layout_width="match_parent"
app/src/main/res/layout/activity_house_search.xml
@@ -90,7 +90,7 @@
    </RelativeLayout>
    <!--历史记录-->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/history_list_parent"
        android:layout_width="match_parent"
@@ -135,7 +135,7 @@
            app:layout_constraintTop_toTopOf="parent" />
    </androidx.constraintlayout.widget.ConstraintLayout>
    <!--搜索数据-->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/list_parent"
        android:layout_width="match_parent"
app/src/main/res/layout/activity_search_messge.xml
New file
@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/text_F5F7FA"
    tools:context=".ui.message.SearchMessageActivity">
    <!--搜索-->
    <RelativeLayout
        android:id="@+id/message_search_cl"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dp_35"
        android:layout_marginTop="@dimen/dp_48"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">
        <RelativeLayout
            android:id="@+id/back_rl"
            android:layout_width="@dimen/dp_50"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/message_back_iv"
                android:layout_width="@dimen/dp_10"
                android:layout_height="@dimen/dp_17"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:layout_marginStart="@dimen/dp_16"
                android:src="@drawable/search_back" />
        </RelativeLayout>
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginStart="@dimen/dp_7"
            android:layout_marginEnd="@dimen/dp_21"
            android:layout_toStartOf="@+id/power_station_search_tv"
            android:layout_toEndOf="@+id/back_rl"
            android:background="@drawable/search_bj_ff05000000">
            <ImageView
                android:id="@+id/message_search_iv"
                android:layout_width="@dimen/dp_18"
                android:layout_height="@dimen/dp_18"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:layout_marginStart="@dimen/dp_13"
                android:src="@drawable/search_path" />
            <EditText
                android:id="@+id/message_search_et"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_alignParentEnd="true"
                android:layout_centerVertical="true"
                android:layout_marginStart="@dimen/dp_11"
                android:layout_marginEnd="@dimen/dp_40"
                android:layout_toEndOf="@+id/message_search_iv"
                android:background="@null"
                android:gravity="start|center_vertical"
                android:hint="Search the power station"
                android:textColor="@color/text_90000000"
                android:textColorHint="@color/text_40000000"
                android:textSize="@dimen/text_14" />
            <ImageView
                android:id="@+id/power_station_clear_iv"
                android:layout_width="@dimen/dp_20"
                android:layout_height="@dimen/dp_20"
                android:layout_alignParentEnd="true"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/dp_13"
                android:src="@drawable/clear" />
        </RelativeLayout>
        <TextView
            android:id="@+id/power_station_search_tv"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="@dimen/dp_21"
            android:gravity="center"
            android:text="@string/search"
            android:textColor="@color/text_90000000"
            android:textSize="@dimen/text_16" />
    </RelativeLayout>
    <!--历史记录-->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/history_list_parent"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/message_search_cl">
        <TextView
            android:id="@+id/history_list_title_tv"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/dp_23"
            android:layout_marginStart="@dimen/dp_16"
            android:layout_marginTop="@dimen/dp_23"
            android:layout_marginEnd="@dimen/dp_21"
            android:text="@string/history_search"
            android:textColor="@color/text_90000000"
            android:textSize="@dimen/text_16"
            android:textStyle="bold"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
        <ImageView
            android:id="@+id/message_del_iv"
            android:layout_width="@dimen/dp_26"
            android:layout_height="@dimen/dp_26"
            android:layout_marginTop="@dimen/dp_21"
            android:layout_marginEnd="@dimen/dp_16"
            android:src="@drawable/history_del"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/history_list_rcv"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginTop="67dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
    </androidx.constraintlayout.widget.ConstraintLayout>
    <!--搜索数据-->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/list_parent"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="@dimen/dp_30"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/message_search_cl">
        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
            android:id="@+id/list_srl"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">
            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/list_rcv"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>