Jelajahi Sumber

首页搜索功能;完善gps巡逻;

lichao 1 bulan lalu
induk
melakukan
af1c691d03
22 mengubah file dengan 1027 tambahan dan 141 penghapusan
  1. 1 0
      app/src/main/AndroidManifest.xml
  2. 4 4
      app/src/main/java/com/zkjc/policedemo/app/database/DbAdapter.java
  3. 2 0
      app/src/main/java/com/zkjc/policedemo/app/service/XlfkService.java
  4. 41 0
      app/src/main/java/com/zkjc/policedemo/di/component/SearchAppComponent.java
  5. 30 0
      app/src/main/java/com/zkjc/policedemo/di/module/SearchAppModule.java
  6. 30 0
      app/src/main/java/com/zkjc/policedemo/mvp/contract/SearchAppContract.java
  7. 46 0
      app/src/main/java/com/zkjc/policedemo/mvp/model/SearchAppModel.java
  8. 29 8
      app/src/main/java/com/zkjc/policedemo/mvp/model/entity/PathRecordEntity.java
  9. 131 54
      app/src/main/java/com/zkjc/policedemo/mvp/model/entity/RkxxEntity.java
  10. 83 0
      app/src/main/java/com/zkjc/policedemo/mvp/presenter/SearchAppPresenter.java
  11. 17 18
      app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/AddCzrkActivity.java
  12. 17 17
      app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/AddZzrkActivity.java
  13. 0 2
      app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/MainActivity.java
  14. 390 0
      app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/SearchAppActivity.java
  15. 5 3
      app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/XlfkActivity.java
  16. 16 21
      app/src/main/java/com/zkjc/policedemo/mvp/ui/adapter/XljlAdapter.java
  17. 6 2
      app/src/main/java/com/zkjc/policedemo/mvp/ui/fragment/HomeFragment.java
  18. TEMPAT SAMPAH
      app/src/main/res/drawable-xxxhdpi/btn_closed_light.png
  19. TEMPAT SAMPAH
      app/src/main/res/drawable-xxxhdpi/btn_search_black.png
  20. 53 0
      app/src/main/res/layout/activity_search_app.xml
  21. 19 0
      app/src/main/res/layout/fragment_home.xml
  22. 107 12
      app/src/main/res/layout/item_xljl.xml

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -95,6 +95,7 @@
         android:networkSecurityConfig="@xml/network_security_config"
         android:supportsRtl="true"
         android:theme="@style/AppTheme">
+        <activity android:name=".mvp.ui.activity.SearchAppActivity" />
         <activity android:name=".mvp.ui.activity.RecordShowActivity" />
         <activity android:name=".mvp.ui.activity.XljlActivity" />
         <activity android:name=".mvp.ui.activity.WtfwListActivity" />

+ 4 - 4
app/src/main/java/com/zkjc/policedemo/app/database/DbAdapter.java

@@ -133,8 +133,8 @@ public class DbAdapter {
 					.getColumnIndex(DbAdapter.KEY_DISTANCE)));
 			record.setDuration(allRecordCursor.getString(allRecordCursor
 					.getColumnIndex(DbAdapter.KEY_DURATION)));
-			record.setStartTime(allRecordCursor.getString(allRecordCursor
-					.getColumnIndex(DbAdapter.KEY_DATE)));
+/*			record.setStartTime(allRecordCursor.getString(allRecordCursor
+					.getColumnIndex(DbAdapter.KEY_DATE)));*/
 			String lines = allRecordCursor.getString(allRecordCursor
 					.getColumnIndex(DbAdapter.KEY_LINE));
 			record.setPathLinePoints(MapUtil.parseLocations(lines));
@@ -169,8 +169,8 @@ public class DbAdapter {
 					.getColumnIndex(DbAdapter.KEY_DISTANCE)));
 			record.setDuration(cursor.getString(cursor
 					.getColumnIndex(DbAdapter.KEY_DURATION)));
-			record.setStartTime(cursor.getString(cursor
-					.getColumnIndex(DbAdapter.KEY_DATE)));
+/*			record.setStartTime(cursor.getString(cursor
+					.getColumnIndex(DbAdapter.KEY_DATE)));*/
 			String lines = cursor.getString(cursor
 					.getColumnIndex(DbAdapter.KEY_LINE));
 			record.setPathLinePoints(MapUtil.parseLocations(lines));

+ 2 - 0
app/src/main/java/com/zkjc/policedemo/app/service/XlfkService.java

@@ -8,6 +8,7 @@ import android.content.Context;
 import android.content.Intent;
 import android.os.IBinder;
 import android.os.PowerManager;
+import android.util.Log;
 
 import androidx.annotation.Nullable;
 
@@ -32,6 +33,7 @@ public class XlfkService extends Service {
     @Override
     public void onCreate() {
         super.onCreate();
+        Log.e("eee", "XlfkService oncreate is run !!!!!");
         //增加电源控制
         PowerManager pm= (PowerManager) getSystemService(Context.POWER_SERVICE);
         wakeLock =pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, XlfkActivity.class.getName());

+ 41 - 0
app/src/main/java/com/zkjc/policedemo/di/component/SearchAppComponent.java

@@ -0,0 +1,41 @@
+package com.zkjc.policedemo.di.component;
+
+import dagger.BindsInstance;
+import dagger.Component;
+
+import com.jess.arms.di.component.AppComponent;
+
+import com.zkjc.policedemo.di.module.SearchAppModule;
+import com.zkjc.policedemo.mvp.contract.SearchAppContract;
+
+import com.jess.arms.di.scope.ActivityScope;
+import com.zkjc.policedemo.mvp.ui.activity.SearchAppActivity;
+
+
+/**
+ * ================================================
+ * Description:
+ * <p>
+ * Created by MVPArmsTemplate on 11/11/2024 16:12
+ * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
+ * <a href="https://github.com/JessYanCoding">Follow me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
+ * ================================================
+ */
+@ActivityScope
+@Component(modules = SearchAppModule.class, dependencies = AppComponent.class)
+public interface SearchAppComponent {
+    void inject(SearchAppActivity activity);
+
+    @Component.Builder
+    interface Builder {
+        @BindsInstance
+        SearchAppComponent.Builder view(SearchAppContract.View view);
+
+        SearchAppComponent.Builder appComponent(AppComponent appComponent);
+
+        SearchAppComponent build();
+    }
+}

+ 30 - 0
app/src/main/java/com/zkjc/policedemo/di/module/SearchAppModule.java

@@ -0,0 +1,30 @@
+package com.zkjc.policedemo.di.module;
+
+import com.jess.arms.di.scope.ActivityScope;
+
+import dagger.Binds;
+import dagger.Module;
+import dagger.Provides;
+
+import com.zkjc.policedemo.mvp.contract.SearchAppContract;
+import com.zkjc.policedemo.mvp.model.SearchAppModel;
+
+
+/**
+ * ================================================
+ * Description:
+ * <p>
+ * Created by MVPArmsTemplate on 11/11/2024 16:12
+ * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
+ * <a href="https://github.com/JessYanCoding">Follow me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
+ * ================================================
+ */
+@Module
+public abstract class SearchAppModule {
+
+    @Binds
+    abstract SearchAppContract.Model bindSearchAppModel(SearchAppModel model);
+}

+ 30 - 0
app/src/main/java/com/zkjc/policedemo/mvp/contract/SearchAppContract.java

@@ -0,0 +1,30 @@
+package com.zkjc.policedemo.mvp.contract;
+
+import com.jess.arms.mvp.IView;
+import com.jess.arms.mvp.IModel;
+
+
+/**
+ * ================================================
+ * Description:
+ * <p>
+ * Created by MVPArmsTemplate on 11/11/2024 16:12
+ * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
+ * <a href="https://github.com/JessYanCoding">Follow me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
+ * ================================================
+ */
+public interface SearchAppContract {
+    //对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
+    interface View extends IView {
+
+        void getMenuSuccess(String result);
+    }
+
+    //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
+    interface Model extends IModel {
+
+    }
+}

+ 46 - 0
app/src/main/java/com/zkjc/policedemo/mvp/model/SearchAppModel.java

@@ -0,0 +1,46 @@
+package com.zkjc.policedemo.mvp.model;
+
+import android.app.Application;
+
+import com.google.gson.Gson;
+import com.jess.arms.integration.IRepositoryManager;
+import com.jess.arms.mvp.BaseModel;
+
+import com.jess.arms.di.scope.ActivityScope;
+
+import javax.inject.Inject;
+
+import com.zkjc.policedemo.mvp.contract.SearchAppContract;
+
+
+/**
+ * ================================================
+ * Description:
+ * <p>
+ * Created by MVPArmsTemplate on 11/11/2024 16:12
+ * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
+ * <a href="https://github.com/JessYanCoding">Follow me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
+ * ================================================
+ */
+@ActivityScope
+public class SearchAppModel extends BaseModel implements SearchAppContract.Model {
+    @Inject
+    Gson mGson;
+    @Inject
+    Application mApplication;
+
+    @Inject
+    public SearchAppModel(IRepositoryManager repositoryManager) {
+        super(repositoryManager);
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        this.mGson = null;
+        this.mApplication = null;
+    }
+}

+ 29 - 8
app/src/main/java/com/zkjc/policedemo/mvp/model/entity/PathRecordEntity.java

@@ -135,22 +135,43 @@ public class PathRecordEntity {
 
 	public static class PathRecord implements Serializable {
 
-		//巡逻路线  xllx
+		// 巡逻路线  xllx
 		//巡逻里程数  xllcs
 		//巡逻开始时间  startTime
 		//巡逻结束时间  endTime
 		//巡逻照片  zp
+		//起点地址 qddz
+		//终点地址 zddz
+		//巡逻面积 xlmj
 		private PathLocation startPoint;
 		private PathLocation endPoint;
-		private List<PathLocation> pathLinePoints;
+		private List<PathLocation> pathLinePoints = new ArrayList<>();
 		private String xllcs;
 		private String duration;
 		private String averagespeed;
-		private String startTime;
-		private String endTime;
+		private long startTime;
+		private long endTime;
 		private String zp;
 		private long id = 0;
 		private String xllx;
+		private String qddz;
+		private String zddz;
+
+		public String getQddz() {
+			return qddz;
+		}
+
+		public void setQddz(String qddz) {
+			this.qddz = qddz;
+		}
+
+		public String getZddz() {
+			return zddz;
+		}
+
+		public void setZddz(String zddz) {
+			this.zddz = zddz;
+		}
 
 		public String getZp() {
 			return zp;
@@ -216,19 +237,19 @@ public class PathRecordEntity {
 			this.averagespeed = averagespeed;
 		}
 
-		public String getStartTime() {
+		public long getStartTime() {
 			return startTime;
 		}
 
-		public void setStartTime(String startTime) {
+		public void setStartTime(long startTime) {
 			this.startTime = startTime;
 		}
 
-		public String getEndTime() {
+		public long getEndTime() {
 			return endTime;
 		}
 
-		public void setEndTime(String endTime) {
+		public void setEndTime(long endTime) {
 			this.endTime = endTime;
 		}
 

+ 131 - 54
app/src/main/java/com/zkjc/policedemo/mvp/model/entity/RkxxEntity.java

@@ -42,29 +42,114 @@ public class RkxxEntity {
     }
 
     public static class Rkxx {
-        private String xm;
+        //fzXm,  姓名
+        //fzDh,   电话
+        //hjdz,  地址
+        //fzDw,   单位
+        //fzZp,  照片
+        //ryxb,  性别
+        //rydz,  地址编码
+        //rd.pcsjgdm,  派出所代码
+        //rd.dqm,  地区码
+        //rd.pcsjgmc,  派出所名称
+        //hjdssq,  户籍地省市区
+        //ry_mz,  民族
+        //ry_mz_dm,  民族代码
+        //ry_hyzk,  婚姻状况
+        //ry_hyzk_dm,  婚姻状况代码
+        //ry_whcd,  文化程度
+        //ry_whcd_dm,  文化程度代码
+        //ry_zzmm,  政治面貌
+        //ry_zzmm_dm,  政治面貌代码
+        //ry_byzk,  兵役状况
+        //ry_byzk_dm,  兵役状况代码
+        //jzdpcs,  居住地派出所
+        //jzdpcsdm  居住地派出所代码
+        private String fzXm;
         private String rk_jbxxly;
-        private String lxdh;
+        private String fzDh;
         private String csrq;
-        private String mzdm;
-        private String mz;
-        private String hjdz_qhnxxdz;
-        private int xbdm;
+        private String ry_mz_dm;
+        private String ry_mz;
+        private String hjdz;
+        private String ryxb;
         private String zjxydm;
         private String zjxy;
-        private String hyzkdm;
-        private String hyzk;
-        private String byzkdm;
-        private String byzk;
+        private String ry_hyzk_dm;
+        private String ry_hyzk;
+        private String ry_byzk_dm;
+        private String ry_byzk;
         private String xldm;
         private String xl;
+        private String fzDw;
+        private String fzZp;
+        private String ry_whcd;
+        private String ry_whcd_dm;
+        private String ry_zzmm;
+        private String ry_zzmm_dm;
 
-        public String getMz() {
-            return mz;
+        public String getRyxb() {
+            return ryxb;
         }
 
-        public void setMz(String mz) {
-            this.mz = mz;
+        public void setRyxb(String ryxb) {
+            this.ryxb = ryxb;
+        }
+
+        public String getFzDw() {
+            return fzDw;
+        }
+
+        public void setFzDw(String fzDw) {
+            this.fzDw = fzDw;
+        }
+
+        public String getFzZp() {
+            return fzZp;
+        }
+
+        public void setFzZp(String fzZp) {
+            this.fzZp = fzZp;
+        }
+
+        public String getRy_whcd() {
+            return ry_whcd;
+        }
+
+        public void setRy_whcd(String ry_whcd) {
+            this.ry_whcd = ry_whcd;
+        }
+
+        public String getRy_whcd_dm() {
+            return ry_whcd_dm;
+        }
+
+        public void setRy_whcd_dm(String ry_whcd_dm) {
+            this.ry_whcd_dm = ry_whcd_dm;
+        }
+
+        public String getRy_zzmm() {
+            return ry_zzmm;
+        }
+
+        public void setRy_zzmm(String ry_zzmm) {
+            this.ry_zzmm = ry_zzmm;
+        }
+
+        public String getRy_zzmm_dm() {
+            return ry_zzmm_dm;
+        }
+
+        public void setRy_zzmm_dm(String ry_zzmm_dm) {
+            this.ry_zzmm_dm = ry_zzmm_dm;
+        }
+
+        public String getRy_mz() {
+            return ry_mz;
+        }
+
+        public void setRy_mz(String ry_mz) {
+            this.ry_mz = ry_mz;
         }
 
         public String getZjxy() {
@@ -75,20 +160,20 @@ public class RkxxEntity {
             this.zjxy = zjxy;
         }
 
-        public String getHyzk() {
-            return hyzk;
+        public String getRy_hyzk() {
+            return ry_hyzk;
         }
 
-        public void setHyzk(String hyzk) {
-            this.hyzk = hyzk;
+        public void setRy_hyzk(String ry_hyzk) {
+            this.ry_hyzk = ry_hyzk;
         }
 
-        public String getByzk() {
-            return byzk;
+        public String getRy_byzk() {
+            return ry_byzk;
         }
 
-        public void setByzk(String byzk) {
-            this.byzk = byzk;
+        public void setRy_byzk(String ry_byzk) {
+            this.ry_byzk = ry_byzk;
         }
 
         public String getXl() {
@@ -107,20 +192,20 @@ public class RkxxEntity {
             this.zjxydm = zjxydm;
         }
 
-        public String getHyzkdm() {
-            return hyzkdm;
+        public String getRy_hyzk_dm() {
+            return ry_hyzk_dm;
         }
 
-        public void setHyzkdm(String hyzkdm) {
-            this.hyzkdm = hyzkdm;
+        public void setRy_hyzk_dm(String ry_hyzk_dm) {
+            this.ry_hyzk_dm = ry_hyzk_dm;
         }
 
-        public String getByzkdm() {
-            return byzkdm;
+        public String getRy_byzk_dm() {
+            return ry_byzk_dm;
         }
 
-        public void setByzkdm(String byzkdm) {
-            this.byzkdm = byzkdm;
+        public void setRy_byzk_dm(String ry_byzk_dm) {
+            this.ry_byzk_dm = ry_byzk_dm;
         }
 
         public String getXldm() {
@@ -131,28 +216,20 @@ public class RkxxEntity {
             this.xldm = xldm;
         }
 
-        public String getHjdz_qhnxxdz() {
-            return hjdz_qhnxxdz;
-        }
-
-        public void setHjdz_qhnxxdz(String hjdz_qhnxxdz) {
-            this.hjdz_qhnxxdz = hjdz_qhnxxdz;
-        }
-
-        public int getXbdm() {
-            return xbdm;
+        public String getHjdz() {
+            return hjdz;
         }
 
-        public void setXbdm(int xbdm) {
-            this.xbdm = xbdm;
+        public void setHjdz(String hjdz) {
+            this.hjdz = hjdz;
         }
 
-        public String getXm() {
-            return xm;
+        public String getFzXm() {
+            return fzXm;
         }
 
-        public void setXm(String xm) {
-            this.xm = xm;
+        public void setFzXm(String fzXm) {
+            this.fzXm = fzXm;
         }
 
         public String getRk_jbxxly() {
@@ -163,12 +240,12 @@ public class RkxxEntity {
             this.rk_jbxxly = rk_jbxxly;
         }
 
-        public String getLxdh() {
-            return lxdh;
+        public String getFzDh() {
+            return fzDh;
         }
 
-        public void setLxdh(String lxdh) {
-            this.lxdh = lxdh;
+        public void setFzDh(String fzDh) {
+            this.fzDh = fzDh;
         }
 
         public String getCsrq() {
@@ -179,12 +256,12 @@ public class RkxxEntity {
             this.csrq = csrq;
         }
 
-        public String getMzdm() {
-            return mzdm;
+        public String getRy_mz_dm() {
+            return ry_mz_dm;
         }
 
-        public void setMzdm(String mzdm) {
-            this.mzdm = mzdm;
+        public void setRy_mz_dm(String ry_mz_dm) {
+            this.ry_mz_dm = ry_mz_dm;
         }
     }
 }

+ 83 - 0
app/src/main/java/com/zkjc/policedemo/mvp/presenter/SearchAppPresenter.java

@@ -0,0 +1,83 @@
+package com.zkjc.policedemo.mvp.presenter;
+
+import android.app.Application;
+
+import com.jess.arms.integration.AppManager;
+import com.jess.arms.di.scope.ActivityScope;
+import com.jess.arms.mvp.BasePresenter;
+import com.jess.arms.http.imageloader.ImageLoader;
+
+import me.jessyan.rxerrorhandler.core.RxErrorHandler;
+
+import javax.inject.Inject;
+
+import com.zkjc.common.utils.Utils;
+import com.zkjc.policedemo.app.utils.CommonInterFace;
+import com.zkjc.policedemo.app.utils.ReqToBus;
+import com.zkjc.policedemo.mvp.contract.SearchAppContract;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * ================================================
+ * Description:
+ * <p>
+ * Created by MVPArmsTemplate on 11/11/2024 16:12
+ * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
+ * <a href="https://github.com/JessYanCoding">Follow me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
+ * ================================================
+ */
+@ActivityScope
+public class SearchAppPresenter extends BasePresenter<SearchAppContract.Model, SearchAppContract.View> {
+    @Inject
+    RxErrorHandler mErrorHandler;
+    @Inject
+    Application mApplication;
+    @Inject
+    ImageLoader mImageLoader;
+    @Inject
+    AppManager mAppManager;
+
+    @Inject
+    public SearchAppPresenter(SearchAppContract.Model model, SearchAppContract.View rootView) {
+        super(model, rootView);
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        this.mErrorHandler = null;
+        this.mAppManager = null;
+        this.mImageLoader = null;
+        this.mApplication = null;
+    }
+
+    public void getMenuData(Map<String, String> map) {
+        Map<String, Object> map1 = new HashMap<>();
+        map1.put("className", "glInfoController");
+        map1.put("methodName", "getAppByUserRole");
+        map1.put("params", map);
+        ReqToBus.getInstance().init(mApplication).getRequest(map1, new CommonInterFace() {
+            @Override
+            public void onSuccess(String result) {
+                if (mRootView != null)
+                    mRootView.getMenuSuccess(result);
+            }
+
+            @Override
+            public void onError(Throwable throwable) {
+                Utils.getInstances().dismissDialog();
+            }
+
+            @Override
+            public void onFinsh() {
+
+            }
+        });
+    }
+}

+ 17 - 18
app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/AddCzrkActivity.java

@@ -9,7 +9,6 @@ import android.os.Bundle;
 import android.text.Editable;
 import android.text.TextUtils;
 import android.text.TextWatcher;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
@@ -1371,27 +1370,27 @@ public class AddCzrkActivity extends ZkjcBaseActivity<AddCzrkPresenter> implemen
             } else {
                 mHasRkxx = true;
                 RkxxEntity.Rkxx rkxx = list.get(0);
-                etXm.setText(rkxx.getXm());
-                if (rkxx.getXbdm() == 1) {
+                etXm.setText(rkxx.getFzXm());
+                if ("男".equals(rkxx.getRyxb())) {
                     rbMan.setChecked(true);
                 } else {
                     rbWoman.setChecked(true);
                 }
-                etDh.setText(rkxx.getLxdh());
+                etDh.setText(rkxx.getFzDh());
                 csrq.setText(rkxx.getCsrq());
-                etHjdz.setText(rkxx.getHjdz_qhnxxdz());
+                etHjdz.setText(rkxx.getHjdz());
 
                 if (!TextUtils.isEmpty(rkxx.getZjxy())) {
                     zjxy.setText(rkxx.getZjxy());
                     mSelectZjxy = new Fwtd();
-                    mSelectZjxy.setValue(rkxx.getByzkdm());
+                    mSelectZjxy.setValue(rkxx.getRy_byzk_dm());
                     mSelectZjxy.setLabel(rkxx.getZjxy());
                 } 
-                if (!TextUtils.isEmpty(rkxx.getHyzk())) {
-                    hyzk.setText(rkxx.getHyzk());
+                if (!TextUtils.isEmpty(rkxx.getRy_hyzk())) {
+                    hyzk.setText(rkxx.getRy_hyzk());
                     mSelectHyzk = new Fwtd();
-                    mSelectHyzk.setValue(rkxx.getHyzkdm());
-                    mSelectHyzk.setLabel(rkxx.getHyzk());
+                    mSelectHyzk.setValue(rkxx.getRy_hyzk_dm());
+                    mSelectHyzk.setLabel(rkxx.getRy_hyzk());
                 } 
                 if (!TextUtils.isEmpty(rkxx.getXl())) {
                     whcd.setText(rkxx.getXl());
@@ -1399,17 +1398,17 @@ public class AddCzrkActivity extends ZkjcBaseActivity<AddCzrkPresenter> implemen
                     mSelectWhcd.setValue(rkxx.getXldm());
                     mSelectWhcd.setLabel(rkxx.getXl());
                 } 
-                if (!TextUtils.isEmpty(rkxx.getByzk())) {
-                    byqk.setText(rkxx.getByzk());
+                if (!TextUtils.isEmpty(rkxx.getRy_byzk())) {
+                    byqk.setText(rkxx.getRy_byzk());
                     mSelectByzk = new Fwtd();
-                    mSelectByzk.setValue(rkxx.getByzkdm());
-                    mSelectByzk.setLabel(rkxx.getByzk());
+                    mSelectByzk.setValue(rkxx.getRy_byzk_dm());
+                    mSelectByzk.setLabel(rkxx.getRy_byzk());
                 }
-                if (!TextUtils.isEmpty(rkxx.getMz())) {
-                    tvMz.setText(rkxx.getMz());
+                if (!TextUtils.isEmpty(rkxx.getRy_mz())) {
+                    tvMz.setText(rkxx.getRy_mz());
                     mSelectMz = new Fwtd();
-                    mSelectMz.setValue(rkxx.getMzdm());
-                    mSelectMz.setLabel(rkxx.getMz());
+                    mSelectMz.setValue(rkxx.getRy_mz_dm());
+                    mSelectMz.setLabel(rkxx.getRy_mz());
                 }
 
 //                etXm.setEnabled(false);

+ 17 - 17
app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/AddZzrkActivity.java

@@ -1458,27 +1458,27 @@ public class AddZzrkActivity extends ZkjcBaseActivity<AddJzrkPresenter> implemen
             } else {
                 mHasRkxx = true;
                 RkxxEntity.Rkxx rkxx = list.get(0);
-                etXm.setText(rkxx.getXm());
-                if (rkxx.getXbdm() == 1) {
+                etXm.setText(rkxx.getFzXm());
+                if ("男".equals(rkxx.getRyxb())) {
                     rbMan.setChecked(true);
                 } else {
                     rbWoman.setChecked(true);
                 }
-                etDh.setText(rkxx.getLxdh());
+                etDh.setText(rkxx.getFzDh());
                 csrq.setText(rkxx.getCsrq());
-                etHjdz.setText(rkxx.getHjdz_qhnxxdz());
+                etHjdz.setText(rkxx.getHjdz());
 
                 if (!TextUtils.isEmpty(rkxx.getZjxy())) {
                     zjxy.setText(rkxx.getZjxy());
                     mSelectZjxy = new Fwtd();
-                    mSelectZjxy.setValue(rkxx.getByzkdm());
+                    mSelectZjxy.setValue(rkxx.getRy_byzk_dm());
                     mSelectZjxy.setLabel(rkxx.getZjxy());
                 }
-                if (!TextUtils.isEmpty(rkxx.getHyzk())) {
-                    hyzk.setText(rkxx.getHyzk());
+                if (!TextUtils.isEmpty(rkxx.getRy_hyzk())) {
+                    hyzk.setText(rkxx.getRy_hyzk());
                     mSelectHyzk = new Fwtd();
-                    mSelectHyzk.setValue(rkxx.getHyzkdm());
-                    mSelectHyzk.setLabel(rkxx.getHyzk());
+                    mSelectHyzk.setValue(rkxx.getRy_hyzk_dm());
+                    mSelectHyzk.setLabel(rkxx.getRy_hyzk());
                 }
                 if (!TextUtils.isEmpty(rkxx.getXl())) {
                     whcd.setText(rkxx.getXl());
@@ -1486,17 +1486,17 @@ public class AddZzrkActivity extends ZkjcBaseActivity<AddJzrkPresenter> implemen
                     mSelectWhcd.setValue(rkxx.getXldm());
                     mSelectWhcd.setLabel(rkxx.getXl());
                 }
-                if (!TextUtils.isEmpty(rkxx.getByzk())) {
-                    byqk.setText(rkxx.getByzk());
+                if (!TextUtils.isEmpty(rkxx.getRy_byzk())) {
+                    byqk.setText(rkxx.getRy_byzk());
                     mSelectByzk = new Fwtd();
-                    mSelectByzk.setValue(rkxx.getByzkdm());
-                    mSelectByzk.setLabel(rkxx.getByzk());
+                    mSelectByzk.setValue(rkxx.getRy_byzk_dm());
+                    mSelectByzk.setLabel(rkxx.getRy_byzk());
                 }
-                if (!TextUtils.isEmpty(rkxx.getMz())) {
-                    tvMz.setText(rkxx.getMz());
+                if (!TextUtils.isEmpty(rkxx.getRy_mz())) {
+                    tvMz.setText(rkxx.getRy_mz());
                     mSelectMz = new Fwtd();
-                    mSelectMz.setValue(rkxx.getMzdm());
-                    mSelectMz.setLabel(rkxx.getMz());
+                    mSelectMz.setValue(rkxx.getRy_mz_dm());
+                    mSelectMz.setLabel(rkxx.getRy_mz());
                 }
 
 //                etXm.setEnabled(false);

+ 0 - 2
app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/MainActivity.java

@@ -160,8 +160,6 @@ public class MainActivity extends BaseActivity<MainPresenter> implements MainCon
         System.out.println("当前版本" + ApkUtils.getVersionCode(this));
         String packageName = getPackageName();
         Log.d("packageName", "initView: " + packageName);
-        //service = new Intent(this, LocationService.class);
-        // startService(service);
 
     }
 

+ 390 - 0
app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/SearchAppActivity.java

@@ -0,0 +1,390 @@
+package com.zkjc.policedemo.mvp.ui.activity;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.media.Image;
+import android.os.Bundle;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.ImageView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.amap.api.maps.MapsInitializer;
+import com.google.gson.Gson;
+import com.hjq.toast.ToastUtils;
+import com.jess.arms.base.BaseActivity;
+import com.jess.arms.di.component.AppComponent;
+import com.jess.arms.utils.ArmsUtils;
+
+import com.zkjc.common.base.ZkjcBaseActivity;
+import com.zkjc.common.utils.ApkUtils;
+import com.zkjc.policedemo.app.utils.FileUtils;
+import com.zkjc.policedemo.app.utils.ShareInfo;
+import com.zkjc.policedemo.di.component.DaggerSearchAppComponent;
+import com.zkjc.policedemo.mvp.contract.SearchAppContract;
+import com.zkjc.policedemo.mvp.model.api.Api;
+import com.zkjc.policedemo.mvp.model.entity.MenuEntity;
+import com.zkjc.policedemo.mvp.presenter.SearchAppPresenter;
+
+import com.zkjc.policedemo.R;
+import com.zkjc.policedemo.mvp.ui.adapter.BaseRecycleAdapter;
+import com.zkjc.policedemo.mvp.ui.adapter.HomeAppAdapter;
+
+
+import org.jetbrains.annotations.NotNull;
+import org.json.JSONObject;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import butterknife.BindView;
+import io.dcloud.feature.sdk.DCUniMPSDK;
+import io.dcloud.feature.sdk.Interface.IUniMP;
+import io.dcloud.feature.unimp.config.UniMPOpenConfiguration;
+import io.reactivex.Observable;
+import io.reactivex.ObservableEmitter;
+import io.reactivex.ObservableOnSubscribe;
+import io.reactivex.Observer;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.disposables.Disposable;
+import io.reactivex.schedulers.Schedulers;
+
+import static com.jess.arms.utils.Preconditions.checkNotNull;
+
+
+/**
+ * ================================================
+ * Description:
+ * <p>
+ * Created by MVPArmsTemplate on 11/11/2024 16:12
+ * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
+ * <a href="https://github.com/JessYanCoding">Follow me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
+ * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
+ * ================================================
+ */
+public class SearchAppActivity extends ZkjcBaseActivity<SearchAppPresenter> implements SearchAppContract.View {
+
+    @BindView(R.id.search_et_content)
+    EditText etContent;
+    @BindView(R.id.search_iv_clear)
+    ImageView ivClear;
+    @BindView(R.id.recycler_view)
+    RecyclerView recyclerView;
+
+    @Override
+    public void setupActivityComponent(@NonNull AppComponent appComponent) {
+        DaggerSearchAppComponent //如找不到该类,请编译一下项目
+                .builder()
+                .appComponent(appComponent)
+                .view(this)
+                .build()
+                .inject(this);
+    }
+
+    @Override
+    public int initView(@Nullable Bundle savedInstanceState) {
+        return R.layout.activity_search_app; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
+    }
+
+    @Override
+    public void initData(@Nullable Bundle savedInstanceState) {
+        recyclerView.setLayoutManager(new GridLayoutManager(this, 4));
+        ivClear.setOnClickListener(v -> {
+            etContent.setText("");
+        });
+        etContent.addTextChangedListener(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) {
+                if (!TextUtils.isEmpty(s)) {
+                    Map<String, String> map = new HashMap<>();
+                    map.put("appName", s.toString());
+                    mPresenter.getMenuData(map);
+                }
+            }
+        });
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void showMessage(@NonNull String message) {
+        checkNotNull(message);
+        ArmsUtils.snackbarText(message);
+    }
+
+    @Override
+    public void launchActivity(@NonNull Intent intent) {
+        checkNotNull(intent);
+        ArmsUtils.startActivity(intent);
+    }
+
+    @Override
+    public void killMyself() {
+        finish();
+    }
+
+    @Override
+    public void getMenuSuccess(String result) {
+        try {
+            MenuEntity entity = new Gson().fromJson(result, MenuEntity.class);
+            if (entity.getCode() == 200) {
+                List<MenuEntity.DataBean> menus = entity.getData();
+                recyclerView.setLayoutManager(new GridLayoutManager(this, 4));
+                HomeAppAdapter menuAdapter = new HomeAppAdapter(menus);
+                recyclerView.setAdapter(menuAdapter);
+                menuAdapter.setListener(new BaseRecycleAdapter.OnRecyclerViewListenerV2() {
+                    @Override
+                    public void onItemClick(View view, int position) {
+                        MenuEntity.DataBean bean = menus.get(position);
+                        switch (bean.getSort()) {
+                            case "1": // 入户走访
+                                ArmsUtils.startActivity(RhzfMainNewActivity.class);
+                                break;
+                            case "2": // 矛盾纠纷
+                                ArmsUtils.startActivity(MdjfActivity.class);
+                                break;
+                            case "3": // 消防检查
+                                ArmsUtils.startActivity(XfjcLbActivity.class);
+                                break;
+                            case "4": // 警务室(站)
+                                ArmsUtils.startActivity(JwsLbActivity.class);
+                                break;
+                            case "5": // 任务核查
+                                ArmsUtils.startActivity(RwhcActivity.class);
+                                break;
+                            case "6": // 标准地址
+                                break;
+                            case "7": // 巡逻防控
+                                File file = new File(FileUtils.getGdMapFilePath() + "/data_v6/map/a56");
+                                if (file.exists()) {
+                                    ArmsUtils.startActivity(XlfkActivity.class);
+                                } else {
+                                    Observable.create(new ObservableOnSubscribe<Void>(){
+                                        @Override
+                                        public void subscribe(ObservableEmitter<Void> emitter) throws Exception {
+                                            try {
+                                                UnZipAssetsFolder(SearchAppActivity.this, "map.zip", FileUtils.getGdMapFilePath() + "/data_v6");
+                                            } catch (Exception e) {
+                                                e.printStackTrace();
+                                            }
+                                        }
+                                    }).subscribeOn(Schedulers.io())
+                                            .observeOn(AndroidSchedulers.mainThread())
+                                            .subscribe(new Observer<Void>() {
+                                                @Override
+                                                public void onSubscribe(Disposable d) {
+
+                                                }
+
+                                                @Override
+                                                public void onNext(Void list) {
+                                                    ArmsUtils.startActivity(XlfkActivity.class);
+                                                }
+
+                                                @Override
+                                                public void onError(Throwable e) {
+                                                }
+
+                                                @Override
+                                                public void onComplete() {
+                                                }
+                                            });
+                                }
+
+
+
+                                break;
+                            case "8": // 审批
+                                ArmsUtils.startActivity(FjGlySpActivity.class);
+                                break;
+                            case "9": // 反馈提示
+                                ArmsUtils.startActivity(FktsActivity.class);
+                                break;
+                            case "10": // 矛盾指派
+                                break;
+                            case "11": // 风险排查
+                                ArmsUtils.startActivity(FxpcListActivity.class);
+                                break;
+                            case "12": // 任务下发
+                                ArmsUtils.startActivity(RwxfLbActivity.class);
+                                break;
+                            case "13": // 外国人核查
+                                ArmsUtils.startActivity(WgrHcActivity.class);
+                                break;
+                            case "14": // 上门服务
+                                ArmsUtils.startActivity(SmfwListActivity.class);
+                                break;
+                            case "15": // 委托服务
+                                ArmsUtils.startActivity(WtfwListActivity.class);
+                                break;
+                            case "16": // 预约服务
+                                ArmsUtils.startActivity(YyfwListActivity.class);
+                                break;
+                            case "201": // 辖区概况
+                                openUnitApp("__UNI__0308C60");
+                                break;
+                            case "202": // 物建信息员
+                                openUnitApp("__UNI__EF18237");
+                                break;
+                            case "203": // 办事指南
+                                openUnitApp("__UNI__02E5E40");
+                                break;
+                            case "204": // 任务下发反馈
+                                ArmsUtils.startActivity(RwxfLbActivity.class);
+                                break;
+                            case "99": // 更多
+//                                ToastUtils.show("功能开发中");
+//                                openUnitApp("__UNI__0308C60");
+                                break;
+                            default:
+                                break;
+                        }
+                    }
+
+                    @Override
+                    public boolean onItemLongClick(View view, int position) {
+                        return false;
+                    }
+                });
+            } else {
+                ToastUtils.show(entity.getMsg());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    private void openUnitApp(String name) {
+        try {
+            UniMPOpenConfiguration uniMPOpenConfiguration = new UniMPOpenConfiguration();
+//                                        uniMPOpenConfiguration.extraData.put("darkmode", "auto");
+            ShareInfo shareInfo = getShareInfo();
+
+//            uniMPOpenConfiguration.extraData.put("data", new Gson().toJson(shareInfo));
+            uniMPOpenConfiguration.extraData.put("data", new JSONObject(new Gson().toJson(shareInfo)));
+            uniMPOpenConfiguration.extraData.put("internet", !ApkUtils.isSqjw(this));
+            SharedPreferences sys = getSharedPreferences("sys", Context.MODE_PRIVATE);
+            String userName = sys.getString("zh", "");
+            String password = sys.getString("mm", "");
+            uniMPOpenConfiguration.extraData.put("xwkjUserName", userName);
+            uniMPOpenConfiguration.extraData.put("xwkjPassword", password);
+            uniMPOpenConfiguration.extraData.put("appId", "1846809831194980354");
+
+            Log.e("eee", uniMPOpenConfiguration.extraData.toString());
+//                                    DCUniMPSDK.getInstance().openUniMP(getActivity(), packageName, uniMPOpenConfiguration);
+
+//                                    IUniMP uniMP = DCUniMPSDK.getInstance().openUniMP(getActivity(),"__UNI__B61D13B");
+            IUniMP unimp = DCUniMPSDK.getInstance().openUniMP(this, name, uniMPOpenConfiguration);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @NotNull
+    private ShareInfo getShareInfo() {
+        ShareInfo shareInfo = new ShareInfo();
+        shareInfo.setAppCredential("应用凭证");
+        shareInfo.setDataObjId("资源id");
+        shareInfo.setDepCode("220000000000");
+        shareInfo.setDepName("吉林省公安厅");
+        shareInfo.setMobile("13122223331");
+        shareInfo.setPersonCode("106470");
+        shareInfo.setPersonId("410000000000");
+        shareInfo.setPersonIdentifier("12010119610707201X");
+        shareInfo.setPersonName("张胜男");
+        shareInfo.setPersonType("10");
+        shareInfo.setPolice("101470");
+        shareInfo.setSex("男");
+        shareInfo.setFields("data");
+        shareInfo.setNetworkCode("3");
+        List<ShareInfo.Resource> resourceList = new ArrayList<>();
+        ShareInfo.Resource resource = new ShareInfo.Resource();
+
+        resource.setResourceAddress(ApkUtils.isSqjw(this) ? "http://20.3.1.162:9105/drs/ppc/v1/appQuery.do" : Api.APP_DOMAIN);
+        resource.setResourceRegionalismCode("220000000000");
+        resource.setResourceId(" 120000000000-3-0100-b0e037d83ecc4d43be788a5e9ddcbbe5");
+        resource.setResourceServiceType("10");
+        resourceList.add(resource);
+        shareInfo.setResourceList(resourceList);
+        shareInfo.setUserCredential("用户凭证");
+        return shareInfo;
+    }
+    public static void UnZipAssetsFolder(Context context, String zipFileString, String
+            outPathString) throws Exception {
+        Log.d("文件路径", context.getAssets().open(zipFileString).toString());
+        ZipInputStream inPutZip = new ZipInputStream(context.getAssets().open(zipFileString));
+        ZipEntry zipEntry;
+        String szName = "";
+        while ((zipEntry = inPutZip.getNextEntry()) != null) {
+            Log.d("判断文件是否存在",zipEntry.isDirectory()+"");
+            szName = zipEntry.getName();
+            if (zipEntry.isDirectory()) {
+                szName = szName.substring(0, szName.length() - 1);
+                File folder = new File(outPathString + File.separator + szName);
+                //目前判断条件,如果包含解压过的文件就不再解压
+                if(!folder.exists()){
+                    folder.mkdirs();
+                }else{
+                    return;
+                }
+            } else {
+                Log.e("eee", outPathString + File.separator + szName);
+                File file = new File(outPathString + File.separator + szName);
+                if (!file.exists()) {
+                    Log.e("eee", "Create the file:" + outPathString + File.separator + szName);
+                    file.getParentFile().mkdirs();
+                    file.createNewFile();
+                }
+                // 获取文件的输出流
+                FileOutputStream out = new FileOutputStream(file);
+                int len;
+                byte[] buffer = new byte[1024];
+                // 读取(字节)字节到缓冲区
+                while ((len = inPutZip.read(buffer)) != -1) {
+                    // 从缓冲区(0)位置写入(字节)字节
+                    out.write(buffer, 0, len);
+                    out.flush();
+                }
+                out.close();
+            }
+        }
+        inPutZip.close();
+    }
+
+}

+ 5 - 3
app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/XlfkActivity.java

@@ -168,7 +168,7 @@ public class XlfkActivity extends ZkjcBaseActivity<XlfkPresenter> implements Xlf
                 }
                 record = new PathRecordEntity.PathRecord();
                 mStartTime = System.currentTimeMillis();
-                record.setStartTime(start_time.getText().toString());
+                record.setStartTime(mStartTime);
                 isStart = true;
 
                 startService(new Intent(XlfkActivity.this, XlfkService.class));
@@ -188,7 +188,7 @@ public class XlfkActivity extends ZkjcBaseActivity<XlfkPresenter> implements Xlf
                 mEndTime = System.currentTimeMillis();
                 DecimalFormat decimalFormat = new DecimalFormat("0.0");
                 tv_distance.setText(decimalFormat.format(getDistance(record.getPathLinePoints()) / 1000d) + "KM");
-                record.setEndTime(end_time.getText().toString());
+                record.setEndTime(mEndTime);
 
                 saveBitmap();
 //                saveRecord(record.getPathLinePoints(), record.getStartTime());
@@ -490,10 +490,11 @@ public class XlfkActivity extends ZkjcBaseActivity<XlfkPresenter> implements Xlf
             mLocationOption = new AMapLocationClientOption();
             // 设置定位监听
             mLocationClient.setLocationListener(XlfkActivity.this);
-            // 设置为高精度定位模式
             if (ApkUtils.isSqjw(this)) {
+                // 设置为仅gps
                 mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Device_Sensors);
             } else {
+                // 设置为高精度定位模式
                 mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
             }
 
@@ -548,6 +549,7 @@ public class XlfkActivity extends ZkjcBaseActivity<XlfkPresenter> implements Xlf
                             mAMapLocationList.add(amapLocation);
                             Log.e("eee", "巡逻点已记录,数量为" + mAMapLocationList.size());
                         }
+                        Log.e("eee", "amapLocation.distanceTo(lastLocation) === " + amapLocation.distanceTo(lastLocation));
                     }
                     redrawline();
                 }

+ 16 - 21
app/src/main/java/com/zkjc/policedemo/mvp/ui/adapter/XljlAdapter.java

@@ -1,6 +1,7 @@
 package com.zkjc.policedemo.mvp.ui.adapter;
 
 import android.text.TextUtils;
+import android.view.View;
 import android.widget.ImageView;
 
 import com.amap.api.maps.AMapUtils;
@@ -10,6 +11,7 @@ import com.zkjc.policedemo.R;
 import com.zkjc.policedemo.app.utils.MapUtil;
 import com.zkjc.policedemo.mvp.model.entity.PathRecordEntity;
 
+import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.List;
 
@@ -17,7 +19,7 @@ public class XljlAdapter extends BaseRecycleAdapter<PathRecordEntity.PathRecord>
     public XljlAdapter(List<PathRecordEntity.PathRecord> datas) {
         super(datas);
     }
-
+    DecimalFormat decimalFormat = new DecimalFormat("0.0");
     @Override
     protected void bindData(BaseViewHolder holder, int position) {
         PathRecordEntity.PathRecord record = datas.get(position);
@@ -25,32 +27,25 @@ public class XljlAdapter extends BaseRecycleAdapter<PathRecordEntity.PathRecord>
         if (!TextUtils.isEmpty(record.getXllx())) {
             record.setPathLinePoints(MapUtil.parseLocations(record.getXllx()));
         }
-        setItemText(holder.getView(R.id.tv_area), calculateArea(record.getPathLinePoints()) + "平方米");
-        Picasso.with(holder.getView(R.id.iv_image).getContext()).load(record.getZp()).into((ImageView) holder.getView(R.id.iv_image));
+
+        setItemText(holder.getView(R.id.tv_time), convertDate(record.getStartTime()));
+        setItemText(holder.getView(R.id.tv_distance), "巡逻距离:" + decimalFormat.format(Double.parseDouble(record.getXllcs()) / 1000d) + "KM");
+        setItemText(holder.getView(R.id.tv_duration), "巡逻时间:" + convertDuration(record.getEndTime() - record.getStartTime()));
+        setItemText(holder.getView(R.id.tv_area), "巡逻面积:" + calculateArea(record.getPathLinePoints()) + "平方米");
+        setItemText(holder.getView(R.id.tv_start), "起点位置:" + record.getQddz());
+        setItemText(holder.getView(R.id.tv_end), "终点位置:" + record.getZddz());
+        ImageView view = (ImageView) holder.getView(R.id.iv_image);
+        if (!TextUtils.isEmpty(record.getZp())) {
+            Picasso.with(view.getContext()).load(record.getZp()).into(view);
+        } else {
+            view.setImageBitmap(null);
+        }
     }
 
     private String convertDate(long millis) {
         String currentTime = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss").format(millis);
         return currentTime;
     }
-    private float getDistance(List<PathRecordEntity.PathLocation> list) {
-        float distance = 0;
-        if (list == null || list.size() == 0) {
-            return distance;
-        }
-        for (int i = 0; i < list.size() - 1; i++) {
-            PathRecordEntity.PathLocation firstpoint = list.get(i);
-            PathRecordEntity.PathLocation secondpoint = list.get(i + 1);
-            LatLng firstLatLng = new LatLng(firstpoint.getLatitude(),
-                    firstpoint.getLongitude());
-            LatLng secondLatLng = new LatLng(secondpoint.getLatitude(),
-                    secondpoint.getLongitude());
-            double betweenDis = AMapUtils.calculateLineDistance(firstLatLng,
-                    secondLatLng);
-            distance = (float) (distance + betweenDis);
-        }
-        return distance;
-    }
     private String convertDuration(long millis) {
         long hours = millis / 3600000; // 计算小时数
         long minutes = (millis % 3600000) / 60000; // 计算分钟数

+ 6 - 2
app/src/main/java/com/zkjc/policedemo/mvp/ui/fragment/HomeFragment.java

@@ -102,6 +102,7 @@ import com.zkjc.policedemo.mvp.ui.activity.RhzfDjActivity;
 import com.zkjc.policedemo.mvp.ui.activity.RhzfMainNewActivity;
 import com.zkjc.policedemo.mvp.ui.activity.RwhcActivity;
 import com.zkjc.policedemo.mvp.ui.activity.RwxfLbActivity;
+import com.zkjc.policedemo.mvp.ui.activity.SearchAppActivity;
 import com.zkjc.policedemo.mvp.ui.activity.SmfwActivity;
 import com.zkjc.policedemo.mvp.ui.activity.SmfwListActivity;
 import com.zkjc.policedemo.mvp.ui.activity.SqCjActivity;
@@ -179,6 +180,8 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements HomeCon
 
     @BindView(R.id.home_rv)
     RecyclerView recyclerView;
+    @BindView(R.id.layout_search)
+    View layoutSearch;
     private File dir;
 
     public static HomeFragment newInstance() {
@@ -205,6 +208,9 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements HomeCon
     public void initData(@Nullable Bundle savedInstanceState) {
         recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 4));
         checkPermission();
+        layoutSearch.setOnClickListener(v -> {
+            ArmsUtils.startActivity(SearchAppActivity.class);
+        });
     }
 
     @Override
@@ -340,8 +346,6 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements HomeCon
                         MenuEntity.DataBean bean = menus.get(position);
                         switch (bean.getSort()) {
                             case "1": // 入户走访
-                                MapsInitializer.updatePrivacyShow(getActivity(), true, true);
-                                MapsInitializer.updatePrivacyAgree(getActivity(), true);
                                 ArmsUtils.startActivity(RhzfMainNewActivity.class);
                                 break;
                             case "2": // 矛盾纠纷

TEMPAT SAMPAH
app/src/main/res/drawable-xxxhdpi/btn_closed_light.png


TEMPAT SAMPAH
app/src/main/res/drawable-xxxhdpi/btn_search_black.png


+ 53 - 0
app/src/main/res/layout/activity_search_app.xml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:background="@color/white"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_marginTop="44dp"
+        android:layout_height="44dp">
+
+        <ImageView
+            android:layout_width="20dp"
+            android:layout_marginLeft="16dp"
+            android:layout_centerVertical="true"
+            android:background="@drawable/btn_back"
+            android:layout_height="20dp"/>
+
+
+        <EditText
+            android:layout_width="match_parent"
+            android:layout_centerVertical="true"
+            android:paddingLeft="8dp"
+            android:layout_marginRight="16dp"
+            android:id="@+id/search_et_content"
+            android:paddingRight="32dp"
+            android:gravity="center_vertical"
+            android:textColor="#111111"
+            android:textSize="13sp"
+            android:background="@drawable/bg_shape_f8f8f8_corner8"
+            android:layout_marginLeft="48dp"
+            android:layout_height="32dp"/>
+        
+        <ImageView
+            android:layout_width="16dp"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:id="@+id/search_iv_clear"
+            android:layout_marginRight="24dp"
+            android:background="@drawable/btn_closed_light"
+            android:layout_height="16dp"/>
+
+    </RelativeLayout>
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:layout_width="match_parent"
+        android:id="@+id/recycler_view"
+        android:layout_marginTop="12dp"
+        android:layout_height="match_parent"/>
+
+</LinearLayout>

+ 19 - 0
app/src/main/res/layout/fragment_home.xml

@@ -28,6 +28,25 @@
         android:textSize="16sp"
         />
 
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_alignParentRight="true"
+        android:id="@+id/layout_search"
+        android:paddingLeft="10dp"
+        android:paddingBottom="10dp"
+        android:layout_marginTop="25dp"
+        android:layout_height="wrap_content">
+
+
+        <ImageView
+            android:layout_width="24dp"
+            android:layout_marginRight="16dp"
+            android:background="@drawable/btn_search_black"
+            android:layout_marginTop="30dp"
+            android:layout_height="24dp"/>
+
+    </LinearLayout>
+
     <androidx.recyclerview.widget.RecyclerView
         android:layout_width="match_parent"
         android:id="@+id/home_rv"

+ 107 - 12
app/src/main/res/layout/item_xljl.xml

@@ -1,25 +1,120 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
+<RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
     android:orientation="vertical"
     android:id="@+id/item_root"
+    android:layout_marginLeft="12dp"
+    android:background="@color/white"
+    android:layout_marginRight="12dp"
+    android:layout_marginTop="10dp"
     android:layout_height="wrap_content">
 
     <TextView
-        android:id="@+id/tv_area"
-        android:layout_width="match_parent"
-        android:textSize="20sp"
-        android:textColor="#111"
-        android:text="记录"
-        android:gravity="center"
-        android:layout_marginTop="10dp"
-        android:layout_marginBottom="10dp"
-        android:layout_height="40dp"/>
+        android:layout_width="wrap_content"
+        android:id="@+id/tv_time"
+        android:textSize="18sp"
+        android:layout_marginTop="8dp"
+        android:layout_marginLeft="12dp"
+        android:textColor="#111111"
+        android:text="2024-11-11"
+        android:layout_height="wrap_content"/>
 
     <ImageView
         android:layout_width="60dp"
         android:id="@+id/iv_image"
+        android:layout_below="@id/tv_time"
+        android:layout_marginTop="6dp"
+        android:layout_marginLeft="12dp"
+        android:layout_marginBottom="10dp"
         android:scaleType="centerCrop"
-        android:layout_height="60dp"/>
+        android:layout_height="80dp"/>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:orientation="vertical"
+        android:layout_marginLeft="12dp"
+        android:id="@+id/layout_address"
+        android:layout_marginBottom="10dp"
+        android:layout_below="@id/iv_image"
+        android:layout_height="wrap_content">
+
+        <TextView
+            android:id="@+id/tv_start"
+            android:layout_width="match_parent"
+            android:textSize="16sp"
+            android:textColor="#666666"
+            android:text="起始位置"
+            android:layout_height="wrap_content"/>
+
+        <TextView
+            android:id="@+id/tv_end"
+            android:layout_width="match_parent"
+            android:textSize="16sp"
+            android:layout_marginTop="6dp"
+            android:textColor="#666666"
+            android:text="终点位置"
+            android:layout_height="wrap_content"/>
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:orientation="vertical"
+        android:layout_marginTop="6dp"
+        android:layout_marginLeft="6dp"
+        android:layout_below="@id/tv_time"
+        android:layout_toRightOf="@id/iv_image"
+        android:layout_height="wrap_content">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:orientation="horizontal"
+            android:layout_height="wrap_content">
+
+            <TextView
+                android:id="@+id/tv_distance"
+                android:layout_width="match_parent"
+                android:textSize="16sp"
+                android:textColor="#666666"
+                android:text="距离"
+                android:layout_height="wrap_content"/>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:orientation="horizontal"
+            android:layout_marginTop="4dp"
+            android:layout_height="wrap_content">
+
+            <TextView
+                android:id="@+id/tv_duration"
+                android:layout_width="match_parent"
+                android:textSize="16sp"
+                android:textColor="#666666"
+                android:text="时长"
+                android:layout_height="wrap_content"/>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:orientation="horizontal"
+            android:layout_marginTop="4dp"
+            android:layout_height="wrap_content">
+
+            <TextView
+                android:id="@+id/tv_area"
+                android:layout_width="match_parent"
+                android:textSize="16sp"
+                android:textColor="#666666"
+                android:text="面积"
+                android:layout_height="wrap_content"/>
+
+        </LinearLayout>
+
+
+    </LinearLayout>
+
 
-</LinearLayout>
+</RelativeLayout>