mac
2024-05-20 b1f617d201ada34081aefc38414813cbf521fed5
2024年05月20日20:26:17

备份一下代码
7个文件已修改
70 ■■■■ 已修改文件
app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/message/MessageFragment.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/message/SearchMessageActivity.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_device_search.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_house_search.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_search_messge.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_search_message.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java
@@ -24,6 +24,7 @@
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.databinding.FragmentHomePageBinding;
import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch;
import com.hdl.photovoltaic.enums.PowerStationStatus;
import com.hdl.photovoltaic.enums.TimeType;
import com.hdl.photovoltaic.enums.UnitType;
import com.hdl.photovoltaic.listener.CloudCallBeak;
@@ -114,6 +115,33 @@
                HdlUniLogic.getInstance().openUniMP(HDLUniMP.UNI_EVENT_OPEN_HOME_CREATION, null);
            }
        });
        //全部
        viewBinding.homeAllIl.parentLl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            }
        });
        //故障
        viewBinding.homeFaultsIl.parentLl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            }
        });
        //离线
        viewBinding.homeOfflineIl.parentLl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            }
        });
        //待接入
        viewBinding.homeConnectedIl.parentLl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            }
        });
        //时间选择器
        viewBinding.yearMonthDayTv.setOnClickListener(new View.OnClickListener() {
            @Override
app/src/main/java/com/hdl/photovoltaic/ui/message/MessageFragment.java
@@ -117,7 +117,14 @@
        viewBinding.messageSearchCl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String messageStateType;
                if (isAlarmDeviceClick) {
                    messageStateType = MessageStateType.untreated;
                } else {
                    messageStateType = MessageStateType.processed;
                }
                Intent intent = new Intent();
                intent.putExtra("MessageStateType", messageStateType);
                intent.setClass(_mActivity, SearchMessageActivity.class);
                startActivity(intent);
            }
@@ -236,8 +243,23 @@
            @Override
            public void onClick(int position, String title) {
                textView.setText(title);
                switch (filterType) {
                    case FilterType.deviceType: {
                        mDeviceTypeFilterKye = filterType;
                        mDeviceTypeFilterValue = findFilterValueString(title);
                    }
                    break;
                    case FilterType.type: {
                        mTypeFilterKye = filterType;
                        mTypeFilterValue = findFilterValueString(title);
                    }
                    break;
                    case FilterType.timeType: {
                mTimeTypeFilterKye = filterType;
                mTimeTypeFilterValue = findFilterValueString(title);
                    }
                    break;
                }
                loadNextPageMessageList(true, 1, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue, true);
            }
        });
app/src/main/java/com/hdl/photovoltaic/ui/message/SearchMessageActivity.java
@@ -56,6 +56,8 @@
    List<String> searchHistoryTitleList = new ArrayList<>();
    String mMessageStateType = "";
    @Override
    public Object getContentView() {
        viewBinding = ActivitySearchMessgeBinding.inflate(getLayoutInflater());
@@ -65,6 +67,7 @@
    @Override
    public void onBindView(Bundle savedInstanceState) {
        setStatusBarTranslucent();
        mMessageStateType = getIntent().getStringExtra("MessageStateType");
        //历史记录文件夹创建
        HdlFileLogic.getInstance().createFileDir(HdlFileLogic.getInstance().getCurrentUserRootPath());
        //初始化数据
@@ -288,7 +291,7 @@
        HdlMessageLogic.getInstance().getPageNoMessageList(
                "",
                pageNo,
                "",
                mMessageStateType,
                "",
                "",
                "",
@@ -380,6 +383,7 @@
     * 添加历史记录
     */
    private void addSearchTextToList() {
        int maxValue = 10;
        for (int i = 0; i < searchHistoryTitleList.size(); i++) {
            if (searchHistoryTitleList.get(i).equals(currSearchText)) {
                searchHistoryTitleList.remove(searchHistoryTitleList.get(i));
@@ -388,9 +392,9 @@
        searchHistoryTitleList.add(currSearchText);
        // 倒序排列数据(搜索最后排在前面)
        Collections.reverse(searchHistoryTitleList);
        if (searchHistoryTitleList.size() > 10) {
        if (searchHistoryTitleList.size() > maxValue) {
            //历史记录不能超出10
            searchHistoryTitleList.remove(searchHistoryTitleList.get(11));
            searchHistoryTitleList.remove(searchHistoryTitleList.get(maxValue + 1));
        }
    }
app/src/main/res/layout/activity_device_search.xml
@@ -62,7 +62,7 @@
                android:layout_toEndOf="@+id/power_station_search_iv"
                android:background="@null"
                android:gravity="start|center_vertical"
                android:hint="Search the power station"
                android:hint="@string/enter_the_device_sn_and_device_name"
                android:textColor="@color/text_E6000000"
                android:textColorHint="@color/text_66000000"
                android:textSize="@dimen/text_14" />
app/src/main/res/layout/activity_house_search.xml
@@ -61,7 +61,7 @@
                android:layout_toEndOf="@+id/power_station_search_iv"
                android:background="@null"
                android:gravity="start|center_vertical"
                android:hint="Search the power station"
                android:hint="@string/search_station"
                android:textColor="@color/text_E6000000"
                android:textColorHint="@color/text_66000000"
                android:textSize="@dimen/text_14" />
app/src/main/res/layout/activity_search_messge.xml
@@ -61,7 +61,7 @@
                android:layout_toEndOf="@+id/message_search_iv"
                android:background="@null"
                android:gravity="start|center_vertical"
                android:hint="Search the power station"
                android:hint="@string/enter_alarm_name"
                android:textColor="@color/text_E6000000"
                android:textColorHint="@color/text_66000000"
                android:textSize="@dimen/text_14" />
app/src/main/res/layout/item_search_message.xml
@@ -9,16 +9,14 @@
        android:layout_width="@dimen/dp_18"
        android:layout_height="@dimen/dp_18"
        android:layout_marginStart="@dimen/dp_16"
        android:layout_marginTop="@dimen/dp_28"
        android:src="@drawable/search_path"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_height="@dimen/dp_99"
        android:layout_marginStart="@dimen/dp_57"
        android:layout_marginTop="@dimen/dp_28"
        android:layout_marginEnd="@dimen/dp_21"
        android:background="@drawable/bj_13fffffff"
        app:layout_constraintEnd_toEndOf="parent"