lichao 2 mesiacov pred
rodič
commit
78b07fd492

+ 1 - 93
app/src/main/java/com/xwkj/sqjw/mvp/ui/activity/SqjwLoginActivity.java

@@ -1,14 +1,12 @@
 package com.xwkj.sqjw.mvp.ui.activity;
 
 import android.Manifest;
-import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.text.method.HideReturnsTransformationMethod;
 import android.text.method.PasswordTransformationMethod;
-import android.util.Log;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
@@ -35,32 +33,19 @@ import com.zkjc.common.utils.ApkUtils;
 import com.zkjc.common.utils.DevicesUtils;
 import com.zkjc.common.utils.Utils;
 import com.zkjc.policedemo.R;
-import com.zkjc.policedemo.app.utils.FileUtils;
 import com.zkjc.policedemo.di.component.DaggerLoginComponent;
 import com.zkjc.policedemo.mvp.contract.LoginContract;
 import com.zkjc.policedemo.mvp.model.entity.Login;
 import com.zkjc.policedemo.mvp.presenter.LoginPresenter;
 import com.zkjc.policedemo.mvp.ui.activity.StHomeActivity;
-import com.zkjc.policedemo.mvp.ui.activity.XlfkActivity;
 
 import org.jetbrains.annotations.NotNull;
 import org.xutils.common.util.MD5;
 
-import java.io.File;
-import java.io.FileOutputStream;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
 
 import butterknife.BindView;
-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;
 
@@ -147,43 +132,6 @@ public class SqjwLoginActivity extends ZkjcBaseActivity<LoginPresenter> implemen
             map1.put("password", MD5.md5("123456"));
             mPresenter.login(map1);
             Utils.getInstances().showDialog(SqjwLoginActivity.this, "正在获取数据");
-            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(SqjwLoginActivity.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() {
-                            }
-                        });
-
-            }
-
 
         } else {
             layoutTop.setVisibility(View.VISIBLE);
@@ -244,47 +192,7 @@ public class SqjwLoginActivity extends ZkjcBaseActivity<LoginPresenter> implemen
         }
 
     }
-    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();
-    }
+
     @Override
     public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
         super.onRequestPermissionsResult(requestCode, permissions, grantResults);

+ 1 - 2
app/src/main/java/com/zkjc/policedemo/mvp/ui/activity/XlfkActivity.java

@@ -531,7 +531,7 @@ public class XlfkActivity extends ZkjcBaseActivity<XlfkPresenter> implements Xlf
                 LatLng mylocation = new LatLng(amapLocation.getLatitude(),
                         amapLocation.getLongitude());
                 mAMap.moveCamera(CameraUpdateFactory.changeLatLng(mylocation));
-                tv_area.setText(amapLocation.toString());
+                Log.e("eee", "getAddress ====== " + amapLocation.getAddress());
                 if (isStart) {
                     PathRecordEntity.PathLocation location = new PathRecordEntity.PathLocation();
                     location.setLatitude(amapLocation.getLatitude());
@@ -555,7 +555,6 @@ public class XlfkActivity extends ZkjcBaseActivity<XlfkPresenter> implements Xlf
                 String errText = "定位失败," + amapLocation.getErrorCode() + ": "
                         + amapLocation.getErrorInfo();
                 Log.e("AmapErr", errText);
-                tv_area.setText(errText);
             }
         }
     }

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

@@ -339,11 +339,11 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements HomeCon
                     public void onItemClick(View view, int position) {
                         MenuEntity.DataBean bean = menus.get(position);
                         switch (bean.getSort()) {
-                            /*case "1": // 入户走访
+                            case "1": // 入户走访
                                 MapsInitializer.updatePrivacyShow(getActivity(), true, true);
                                 MapsInitializer.updatePrivacyAgree(getActivity(), true);
                                 ArmsUtils.startActivity(RhzfMainNewActivity.class);
-                                break;*/
+                                break;
                             case "2": // 矛盾纠纷
                                 ArmsUtils.startActivity(MdjfActivity.class);
                                 break;
@@ -358,7 +358,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements HomeCon
                                 break;
                             case "6": // 标准地址
                                 break;
-                            case "1": // 巡逻防控
+                            case "7": // 巡逻防控
                                 File file = new File(FileUtils.getGdMapFilePath() + "/data_v6/map/a56");
                                 if (file.exists()) {
                                     ArmsUtils.startActivity(XlfkActivity.class);

+ 3 - 5
app/src/main/java/com/zkjc/policedemo/mvp/ui/fragment/MyFragment.java

@@ -39,7 +39,6 @@ import com.zkjc.policedemo.mvp.presenter.MyPresenter;
 import com.zkjc.policedemo.mvp.ui.activity.AboutUsActivity;
 import com.zkjc.policedemo.mvp.ui.activity.KqlbActivity;
 import com.zkjc.policedemo.mvp.ui.activity.XgUhActivity;
-import com.zkjc.policedemo.mvp.ui.activity.XlfkActivity;
 
 import org.jetbrains.annotations.NotNull;
 import org.json.JSONObject;
@@ -144,10 +143,9 @@ public class MyFragment extends BaseFragment<MyPresenter> implements MyContract.
         tvOffice.setText(sharedPreferences.getString("account", ""));
         btLogout.setOnClickListener(view -> {
 
-            ArmsUtils.startActivity(XlfkActivity.class);
-//            sharedPreferences.edit().putBoolean("isFirst", true).commit();
-//            sharedPreferences.edit().putString("token", "").commit();
-//            System.exit(0);
+            sharedPreferences.edit().putBoolean("isFirst", true).commit();
+            sharedPreferences.edit().putString("token", "").commit();
+            System.exit(0);
             // getActivity().finish();
             /*try {
                 UniMPOpenConfiguration uniMPOpenConfiguration = new UniMPOpenConfiguration();

+ 0 - 1
app/src/main/res/layout/item_xljl.xml

@@ -20,7 +20,6 @@
         android:layout_width="60dp"
         android:id="@+id/iv_image"
         android:scaleType="centerCrop"
-        android:background="#ff0000"
         android:layout_height="60dp"/>
 
 </LinearLayout>