Kaynağa Gözat

upgrade: 人员列表优化

xwh 3 hafta önce
ebeveyn
işleme
a7d6de5250

+ 2 - 2
app/build.gradle

@@ -16,8 +16,8 @@ android {
         applicationId "com.hanghui.senic"
         minSdkVersion 22
         targetSdkVersion 22
-        versionCode 143
-        versionName "1.3.0.241218"
+        versionCode 145
+        versionName "1.3.1.241220"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         ndk {
             abiFilters "armeabi-v7a"   //armeabi-v7a 'arm64-v8a'

+ 7 - 9
app/src/main/java/com/hanghui/senic/activity/setup/PersonnelDataActivity.java

@@ -83,14 +83,12 @@ public class PersonnelDataActivity extends BaseActivity implements View.OnClickL
                     dataList = FaceApi.getInstance().getAllUserList();
                      final int tempTotalSize = dataList.size();
                     post(() -> {
-                        if (!isSearching && mAdapter != null) {
+                        if (!isSearching && mAdapter != null && dataList != null
+                            /*&& tempTotalSize > totalSize*/) {
                             mAdapter.setList(dataList);
-                            mAdapter.notifyDataSetChanged();
-                            if (dataList != null && tempTotalSize > totalSize) {
-                                totalSize=tempTotalSize;
-                                if(setUPIncloud_title!=null) {
-                                    setUPIncloud_title.setText("人员数据(" + totalSize + ")");
-                                }
+                            totalSize = tempTotalSize;
+                            if (setUPIncloud_title != null) {
+                                setUPIncloud_title.setText("人员数据(" + totalSize + ")");
                             }
                         }
                         removeMessages(WHAT_REFRESH);
@@ -215,7 +213,7 @@ public class PersonnelDataActivity extends BaseActivity implements View.OnClickL
                 //关闭软键盘
                 KeyboardsUtils.hintKeyBoards(personnelData_inquire);
                 try {
-                    if(mAdapter.getList() == null ||mAdapter.getList().size() ==0){
+                    if(dataList == null ||dataList.size() ==0){
                         Toast.makeText(this, "暂无人员数据,请稍后重试~", Toast.LENGTH_SHORT).show();
                         return;
                     }
@@ -236,7 +234,7 @@ public class PersonnelDataActivity extends BaseActivity implements View.OnClickL
         if (StringIsNull.IsStringNull(id) && StringIsNull.IsStringNull(cardNumber) && StringIsNull.IsStringNull(name)
                 && StringIsNull.IsStringNull(idNumber) && StringIsNull.IsStringNull(phone)){
             mHandler.removeMessages(WHAT_REFRESH);
-            mHandler.sendEmptyMessageDelayed(WHAT_REFRESH,1000);
+            mHandler.sendEmptyMessageDelayed(WHAT_REFRESH,1000); //标题会在延迟1秒后更新
             isSearching = false;
            return dataList;
         }