管灌系统巡查员智能手机App
zuoxiao
2025-02-21 092bf21368ea824e9dc22467166960219165dc00
1.我的界面每个item添加点击效果。
2.更新本地数据添加二次确认。
2个文件已修改
2个文件已添加
58 ■■■■ 已修改文件
app/src/main/java/com/dayu/pipirrapp/fragment/MyFragment.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/drawable/bg_loading_dialog.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/drawable/my_item_ripple.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/fragment_my.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dayu/pipirrapp/fragment/MyFragment.java
@@ -46,7 +46,7 @@
    }
    private void initView() {
        binding.changePS.setOnClickListener(v -> {
        binding.changePSRL.setOnClickListener(v -> {
            Intent intent = new Intent(MyFragment.this.getContext(), ChangePSActivity.class);
            MyFragment.this.getActivity().startActivity(intent);
        });
@@ -96,14 +96,24 @@
            Intent intent = new Intent(MyFragment.this.getContext(), IssueListActivity.class);
            MyFragment.this.getActivity().startActivity(intent);
        });
        binding.refreshDataTV.setOnClickListener(v -> {
        binding.refreshDataRL.setOnClickListener(v -> {
            ConfirmDialog confirmDialog = new ConfirmDialog(MyFragment.this.getActivity(), "确定更新本地数据吗?", (confirmDialog1, v12) -> {
                try {
                    LiveEventBus.get(CommonKeyName.refreshData).post(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            });
            confirmDialog.show();
            // 发送刷新事件通知MapFragment刷新数据
            LiveEventBus.get(CommonKeyName.refreshData).post(true);
        });
        binding.inspectListRL.setOnClickListener(v -> {
            Intent intent = new Intent(MyFragment.this.getContext(), InspectListActivity.class);
            MyFragment.this.getActivity().startActivity(intent);
        });
        binding.versionRL.setOnClickListener(v -> {
        });
    }
    private void initData() {
app/src/main/res/drawable/bg_loading_dialog.xml
New file
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#88000000" />
    <corners android:radius="8dp" />
</shape>
app/src/main/res/drawable/my_item_ripple.xml
New file
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="?android:attr/colorControlHighlight">
    <!-- 背景形状及颜色 -->
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@color/white" /> <!-- 背景色 -->
            <corners android:radius="10dp" /> <!-- 圆角半径 -->
        </shape>
    </item>
    <!-- 掩码效果,用于控制波纹范围(可选) -->
    <item android:id="@android:id/mask">
        <shape android:shape="rectangle">
            <solid android:color="@color/text_color" /> <!-- 掩码颜色 -->
        </shape>
    </item>
</ripple>
app/src/main/res/layout/fragment_my.xml
@@ -82,12 +82,13 @@
        android:id="@+id/issueListRL"
        android:layout_width="match_parent"
        android:layout_height="@dimen/item_height"
        android:background="@drawable/my_item_ripple"
        android:layout_below="@+id/headRL_top">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="@dimen/item_height"
            android:background="@color/white"
            android:gravity="center_vertical"
            android:paddingLeft="30dp"
            android:text="问题列表"
@@ -106,12 +107,13 @@
        android:id="@+id/inspectListRL"
        android:layout_width="match_parent"
        android:layout_height="@dimen/item_height"
        android:layout_marginTop="1dp"
        android:background="@drawable/my_item_ripple"
        android:layout_below="@+id/issueListRL">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="@dimen/item_height"
            android:background="@color/white"
            android:gravity="center_vertical"
            android:paddingLeft="30dp"
            android:text="巡检记录"
@@ -129,9 +131,10 @@
    </RelativeLayout>
    <RelativeLayout
        android:id="@+id/passwordRL"
        android:id="@+id/changePSRL"
        android:layout_width="match_parent"
        android:layout_height="@dimen/item_height"
        android:background="@drawable/my_item_ripple"
        android:layout_below="@+id/inspectListRL"
        android:layout_marginTop="1dp">
@@ -159,14 +162,14 @@
        android:id="@+id/refreshDataRL"
        android:layout_width="match_parent"
        android:layout_height="@dimen/item_height"
        android:layout_below="@+id/passwordRL"
        android:background="@drawable/my_item_ripple"
        android:layout_below="@+id/changePSRL"
        android:layout_marginTop="1dp">
        <TextView
            android:id="@+id/refreshDataTV"
            android:layout_width="match_parent"
            android:layout_height="@dimen/item_height"
            android:background="@color/white"
            android:gravity="center_vertical"
            android:paddingLeft="30dp"
            android:text="更新本地数据"
@@ -185,6 +188,7 @@
        android:id="@+id/cleanDataRL"
        android:layout_width="match_parent"
        android:layout_height="@dimen/item_height"
        android:background="@drawable/my_item_ripple"
        android:layout_below="@+id/refreshDataRL"
        android:layout_marginTop="1dp">
@@ -192,7 +196,6 @@
            android:id="@+id/cleanData"
            android:layout_width="match_parent"
            android:layout_height="@dimen/item_height"
            android:background="@color/white"
            android:gravity="center_vertical"
            android:paddingLeft="30dp"
            android:text="清除缓存"
@@ -212,6 +215,7 @@
        android:id="@+id/loginOutRL"
        android:layout_width="match_parent"
        android:layout_height="@dimen/item_height"
        android:background="@drawable/my_item_ripple"
        android:layout_below="@+id/cleanDataRL"
        android:layout_marginTop="1dp">
@@ -219,7 +223,6 @@
            android:layout_width="match_parent"
            android:layout_height="@dimen/item_height"
            android:background="@color/white"
            android:gravity="center_vertical"
            android:paddingLeft="30dp"
            android:text="退出登录"
@@ -240,13 +243,13 @@
        android:id="@+id/versionRL"
        android:layout_width="match_parent"
        android:layout_height="@dimen/item_height"
        android:background="@drawable/my_item_ripple"
        android:layout_below="@+id/loginOutRL"
        android:layout_marginTop="1dp">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="@dimen/item_height"
            android:background="@color/white"
            android:gravity="center_vertical"
            android:paddingLeft="30dp"
            android:text="当前版本"