Browse Source

首页通知刷新功能;弹窗样式调整

lichao 5 tháng trước cách đây
mục cha
commit
4682c32bc8
28 tập tin đã thay đổi với 711 bổ sung70 xóa
  1. 40 0
      app/src/main/java/com/xwkj/jcjcgz/app/Event.java
  2. 23 5
      app/src/main/java/com/xwkj/jcjcgz/app/push/MyReceiver.java
  3. 33 12
      app/src/main/java/com/xwkj/jcjcgz/app/view/AreaPicker.java
  4. 30 5
      app/src/main/java/com/xwkj/jcjcgz/app/view/DictionaryPicker.java
  5. 33 5
      app/src/main/java/com/xwkj/jcjcgz/app/view/GsdwPicker.java
  6. 32 5
      app/src/main/java/com/xwkj/jcjcgz/app/view/MjPicker.java
  7. 32 5
      app/src/main/java/com/xwkj/jcjcgz/app/view/SmyjGsdwPicker.java
  8. 33 4
      app/src/main/java/com/xwkj/jcjcgz/app/view/XzqhPicker.java
  9. 9 0
      app/src/main/java/com/xwkj/jcjcgz/mvp/model/entity/ChannelEntity.java
  10. 18 0
      app/src/main/java/com/xwkj/jcjcgz/mvp/model/entity/TaskDxzpDetailEntity.java
  11. 9 0
      app/src/main/java/com/xwkj/jcjcgz/mvp/model/entity/TaskDxzpEntity.java
  12. 27 0
      app/src/main/java/com/xwkj/jcjcgz/mvp/model/entity/Wfjmfj.java
  13. 4 0
      app/src/main/java/com/xwkj/jcjcgz/mvp/ui/activity/DxzpDetailActivity.java
  14. 38 7
      app/src/main/java/com/xwkj/jcjcgz/mvp/ui/activity/FzQzFkActivity.java
  15. 2 1
      app/src/main/java/com/xwkj/jcjcgz/mvp/ui/activity/LoginActivity.java
  16. 41 3
      app/src/main/java/com/xwkj/jcjcgz/mvp/ui/activity/TestActivity.java
  17. 76 4
      app/src/main/java/com/xwkj/jcjcgz/mvp/ui/fragment/RwzxFragment.java
  18. 36 3
      app/src/main/java/com/xwkj/jcjcgz/mvp/ui/fragment/TaskDxzpFragment.java
  19. 3 2
      app/src/main/java/com/xwkj/jcjcgz/mvp/ui/fragment/TaskTypeFragment.java
  20. 2 2
      app/src/main/java/com/xwkj/jcjcgz/mvp/ui/fragment/Test1Fragment.java
  21. 27 0
      app/src/main/java/com/xwkj/jcjcgz/mvp/ui/fragment/YjFragment.java
  22. 0 0
      app/src/main/res/drawable/img_keyboard_normal.9.png
  23. 0 0
      app/src/main/res/drawable/img_keyboard_pressed.9.png
  24. 7 4
      app/src/main/res/layout/activity_fz_qz_fk.xml
  25. 47 0
      app/src/main/res/layout/fragment_test.xml
  26. 83 0
      app/src/main/res/layout/pickerview_custom_options.xml
  27. 5 3
      app/src/main/res/layout/pop_yj.xml
  28. 21 0
      common/src/main/java/com/zkjc/common/base/ZkjcBaseFragment.java

+ 40 - 0
app/src/main/java/com/xwkj/jcjcgz/app/Event.java

@@ -0,0 +1,40 @@
+package com.xwkj.jcjcgz.app;
+
+import com.zkjc.common.event.IEvent;
+
+public class Event implements IEvent {
+    public static final int E_LOGIN_OUT = 100;
+    public static final int E_REFRESH_TASK_MENU = 101;
+    public static final int E_REFRESH_TASK_TYPE = 101;
+
+    private int event;
+    private String id;
+    public Event(int event) {
+        this.event = event;
+    }
+    public Event(int event, String id) {
+        this.event = event;
+        this.id = id;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public int getEvent() {
+        return event;
+    }
+
+    public void setEvent(int event) {
+        this.event = event;
+    }
+
+    @Override
+    public int getType() {
+        return event;
+    }
+}

+ 23 - 5
app/src/main/java/com/xwkj/jcjcgz/app/push/MyReceiver.java

@@ -8,8 +8,10 @@ import android.util.Log;
 import android.widget.Toast;
 
 import com.mpush.api.Constants;
+import com.xwkj.jcjcgz.app.Event;
 import com.xwkj.jcjcgz.mvp.ui.activity.DxzpDetailActivity;
 
+import org.greenrobot.eventbus.EventBus;
 import org.json.JSONException;
 import org.json.JSONObject;
 
@@ -17,12 +19,10 @@ public class MyReceiver extends BroadcastReceiver {
 
     @Override
     public void onReceive(Context context, Intent intent) {
-        Log.e("eee", "MyReceiver onReceive is run !!!!");
         if (MPushService.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) {
             byte[] bytes = intent.getByteArrayExtra(MPushService.EXTRA_PUSH_MESSAGE);
             int messageId = intent.getIntExtra(MPushService.EXTRA_PUSH_MESSAGE_ID, 0);
             String message = new String(bytes, Constants.UTF_8);
-            Log.e("eee", message);
 
 //            Toast.makeText(context, "收到新的通知:" + message, Toast.LENGTH_SHORT).show();
 
@@ -35,8 +35,21 @@ public class MyReceiver extends BroadcastReceiver {
             if (ndo != null) {
                 Intent it = new Intent(context, MyReceiver.class);
                 it.setAction(MPushService.ACTION_NOTIFICATION_OPENED);
-                it.putExtra("test", "test");
-                if (ndo.getExtras() != null) it.putExtra("extra", ndo.getExtras().toString());
+                if (ndo.getExtras() != null) {
+                    it.putExtra("extra", ndo.getExtras().toString());
+
+                    JSONObject jsonObject = null;
+                    try {
+                        jsonObject = new JSONObject(ndo.getExtras().toString());
+                        String menuId1 = jsonObject.optString("menuId1");
+                        String menuId2 = jsonObject.optString("menuId2");
+                        EventBus.getDefault().post(new Event(Event.E_REFRESH_TASK_MENU, menuId1));
+                        EventBus.getDefault().post(new Event(Event.E_REFRESH_TASK_TYPE, menuId2));
+                    } catch (JSONException e) {
+                        e.printStackTrace();
+                    }
+                }
+
                 if (TextUtils.isEmpty(ndo.getTitle())) ndo.setTitle("推送");
                 if (TextUtils.isEmpty(ndo.getTicker())) ndo.setTicker(ndo.getTitle());
                 if (TextUtils.isEmpty(ndo.getContent())) ndo.setContent(ndo.getTitle());
@@ -44,15 +57,20 @@ public class MyReceiver extends BroadcastReceiver {
             }
         } else if (MPushService.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
             Notifications.I.clean(intent);
-            Log.e("eee", Notifications.EXTRA_MESSAGE_ID + "=======" + intent.getStringExtra(Notifications.EXTRA_MESSAGE_ID));
             String extras = intent.getStringExtra("extra");
             if (!TextUtils.isEmpty(extras)) {
                 try {
                     JSONObject jsonObject = new JSONObject(extras);
                     String messageId = jsonObject.optString("messageId");
+                    String syncId = jsonObject.optString("syncId");
+                    String menuId1 = jsonObject.optString("menuId1");
+                    String menuId2 = jsonObject.optString("menuId2");
+                    EventBus.getDefault().post(new Event(Event.E_REFRESH_TASK_MENU, menuId1));
+                    EventBus.getDefault().post(new Event(Event.E_REFRESH_TASK_TYPE, menuId2));
                     Intent start = new Intent(context, DxzpDetailActivity.class);
                     start.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                     start.putExtra("id", messageId);
+                    start.putExtra("syncId", syncId);
                     context.startActivity(start);
                 } catch (JSONException e) {
                     e.printStackTrace();

+ 33 - 12
app/src/main/java/com/xwkj/jcjcgz/app/view/AreaPicker.java

@@ -3,11 +3,14 @@ package com.xwkj.jcjcgz.app.view;
 import android.content.Context;
 import android.graphics.Color;
 import android.view.View;
+import android.widget.TextView;
 
 import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
+import com.bigkoo.pickerview.listener.CustomListener;
 import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
 import com.bigkoo.pickerview.view.OptionsPickerView;
 import com.google.gson.Gson;
+import com.xwkj.jcjcgz.R;
 import com.xwkj.jcjcgz.mvp.model.entity.Area;
 import com.xwkj.jcjcgz.mvp.model.entity.DictionaryEntity;
 
@@ -19,6 +22,8 @@ import java.util.List;
 public class AreaPicker {
     private Context mContext;
     private OnAreaSelectListener mListener;
+    private OptionsPickerView pvOptions;
+
     public interface OnAreaSelectListener{
         void onAreaSelect(Area area);
     }
@@ -32,7 +37,7 @@ public class AreaPicker {
     private ArrayList<ArrayList<ArrayList<DictionaryEntity.Xzqh>>> options3Items = new ArrayList<>();
     public void showPickerView(Area area, String title) {// 弹出选择器
 
-        OptionsPickerView pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
+        pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
             @Override
             public void onOptionsSelect(int options1, int options2, int options3, View v) {
                 //返回的分别是三个级别的选中位置
@@ -61,18 +66,34 @@ public class AreaPicker {
             }
         })
 
-                .setTitleText(title)
-                .setDividerColor(Color.BLACK)
-                .setTextColorCenter(Color.BLACK) //设置选中项文字颜色
-
-/*                .setDividerColor(context.getResources().getColor(R.color.vipfont))//分频器颜色
-                .setTitleColor(context.getResources().getColor(R.color.white))//标题文字颜色
-                .setSubmitColor(context.getResources().getColor(R.color.white))//确定按钮文字颜色
-                .setCancelColor(context.getResources().getColor(R.color.white))//取消按钮文字颜色
-                .setTitleBgColor(context.getResources().getColor(R.color.zitixuanzhong))//标题背景颜色 Night mode
-                .setBgColor(Color.WHITE)//滚轮背景颜色 Night mode*/
-
+                .setDividerColor(Color.parseColor("#106DFF"))
+                .setTextColorCenter(Color.parseColor("#106DFF")) //设置选中项文字颜色
+                .setTextColorOut(Color.parseColor("#999999"))
                 .setContentTextSize(20)
+                .setLayoutRes(R.layout.pickerview_custom_options, new CustomListener() {
+                    @Override
+                    public void customLayout(View v) {
+                        //自定义布局中的控件初始化及事件处理
+                        final TextView tvSubmit = v.findViewById(R.id.pickerview_confirm);
+                        final TextView tvTitle = v.findViewById(R.id.pickerview_tv_title);
+                        tvTitle.setText(title);
+                        View cancel = v.findViewById(R.id.pickerview_layout_cancel);
+                        tvSubmit.setOnClickListener(new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                pvOptions.returnData();
+                                pvOptions.dismiss();
+                            }
+                        });
+                        cancel.setOnClickListener(new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                pvOptions.dismiss();
+                            }
+                        });
+
+                    }
+                })
                 .setSelectOptions(area != null? area.getCityIndex() : 0, area != null? area.getAreaIndex() : 0, area != null? area.getStreetIndex() : 0)
                 .build();
 

+ 30 - 5
app/src/main/java/com/xwkj/jcjcgz/app/view/DictionaryPicker.java

@@ -3,10 +3,13 @@ package com.xwkj.jcjcgz.app.view;
 import android.content.Context;
 import android.graphics.Color;
 import android.view.View;
+import android.widget.TextView;
 
 import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
+import com.bigkoo.pickerview.listener.CustomListener;
 import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
 import com.bigkoo.pickerview.view.OptionsPickerView;
+import com.xwkj.jcjcgz.R;
 import com.xwkj.jcjcgz.mvp.model.entity.DictionaryEntity;
 import com.xwkj.jcjcgz.mvp.model.entity.PickerResult;
 
@@ -30,7 +33,6 @@ public class DictionaryPicker {
 
     public void showPickerView(PickerResult result, String title) {// 弹出选择器
 
-        if (pvOptions == null) {
             pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
                 @Override
                 public void onOptionsSelect(int options1, int options2, int options3, View v) {
@@ -50,13 +52,36 @@ public class DictionaryPicker {
                 }
             })
 
-                    .setTitleText(title)
-                    .setDividerColor(Color.BLACK)
-                    .setTextColorCenter(Color.BLACK) //设置选中项文字颜色
+                    .setDividerColor(Color.parseColor("#106DFF"))
+                    .setTextColorCenter(Color.parseColor("#106DFF")) //设置选中项文字颜色
+                    .setTextColorOut(Color.parseColor("#999999"))
                     .setContentTextSize(20)
+                    .setLayoutRes(R.layout.pickerview_custom_options, new CustomListener() {
+                        @Override
+                        public void customLayout(View v) {
+                            //自定义布局中的控件初始化及事件处理
+                            final TextView tvSubmit = v.findViewById(R.id.pickerview_confirm);
+                            final TextView tvTitle = v.findViewById(R.id.pickerview_tv_title);
+                            tvTitle.setText(title);
+                            View cancel = v.findViewById(R.id.pickerview_layout_cancel);
+                            tvSubmit.setOnClickListener(new View.OnClickListener() {
+                                @Override
+                                public void onClick(View v) {
+                                    pvOptions.returnData();
+                                    pvOptions.dismiss();
+                                }
+                            });
+                            cancel.setOnClickListener(new View.OnClickListener() {
+                                @Override
+                                public void onClick(View v) {
+                                    pvOptions.dismiss();
+                                }
+                            });
+
+                        }
+                    })
                     .setSelectOptions(result != null? result.getLv1Index() : 0)
                     .build();
-        }
 
         pvOptions.setPicker(options1Items);
         pvOptions.show();

+ 33 - 5
app/src/main/java/com/xwkj/jcjcgz/app/view/GsdwPicker.java

@@ -3,10 +3,13 @@ package com.xwkj.jcjcgz.app.view;
 import android.content.Context;
 import android.graphics.Color;
 import android.view.View;
+import android.widget.TextView;
 
 import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
+import com.bigkoo.pickerview.listener.CustomListener;
 import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
 import com.bigkoo.pickerview.view.OptionsPickerView;
+import com.xwkj.jcjcgz.R;
 import com.xwkj.jcjcgz.mvp.model.entity.DictionaryEntity;
 import com.xwkj.jcjcgz.mvp.model.entity.PickerResult;
 
@@ -16,6 +19,8 @@ import java.util.List;
 public class GsdwPicker {
     private Context mContext;
     private OnAreaSelectListener mListener;
+    private OptionsPickerView pvOptions;
+
     public interface OnAreaSelectListener{
         void onAreaSelect(PickerResult area);
     }
@@ -27,8 +32,7 @@ public class GsdwPicker {
     private List<DictionaryEntity.Gsdw> options1Items = new ArrayList<>();
     private ArrayList<ArrayList<DictionaryEntity.Gsdw>> options2Items = new ArrayList<>();
     public void showPickerView(PickerResult result) {// 弹出选择器
-
-        OptionsPickerView pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
+        pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
             @Override
             public void onOptionsSelect(int options1, int options2, int options3, View v) {
                 DictionaryEntity.Gsdw opt1tx = options1Items.size() > 0 ?
@@ -56,11 +60,35 @@ public class GsdwPicker {
         })
 
                 .setTitleText("归属单位")
-                .setDividerColor(Color.BLACK)
-                .setTextColorCenter(Color.BLACK) //设置选中项文字颜色
+                .setDividerColor(Color.parseColor("#106DFF"))
+                .setTextColorCenter(Color.parseColor("#106DFF")) //设置选中项文字颜色
+                .setTextColorOut(Color.parseColor("#999999"))
                 .setContentTextSize(20)
                 .isDialog(true)
-                .setLayoutRes()
+                .setLayoutRes(R.layout.pickerview_custom_options, new CustomListener() {
+                    @Override
+                    public void customLayout(View v) {
+                        //自定义布局中的控件初始化及事件处理
+                        final TextView tvSubmit = v.findViewById(R.id.pickerview_confirm);
+                        final TextView tvTitle = v.findViewById(R.id.pickerview_tv_title);
+                        tvTitle.setText("请选择归属单位");
+                        View cancel = v.findViewById(R.id.pickerview_layout_cancel);
+                        tvSubmit.setOnClickListener(new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                pvOptions.returnData();
+                                pvOptions.dismiss();
+                            }
+                        });
+                        cancel.setOnClickListener(new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                pvOptions.dismiss();
+                            }
+                        });
+
+                    }
+                })
                 .setSelectOptions(result != null? result.getLv1Index() : 0, result != null? result.getLv2Index() : 0)
                 .build();
 

+ 32 - 5
app/src/main/java/com/xwkj/jcjcgz/app/view/MjPicker.java

@@ -3,10 +3,13 @@ package com.xwkj.jcjcgz.app.view;
 import android.content.Context;
 import android.graphics.Color;
 import android.view.View;
+import android.widget.TextView;
 
 import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
+import com.bigkoo.pickerview.listener.CustomListener;
 import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
 import com.bigkoo.pickerview.view.OptionsPickerView;
+import com.xwkj.jcjcgz.R;
 import com.xwkj.jcjcgz.mvp.model.entity.GsdwEntity;
 import com.xwkj.jcjcgz.mvp.model.entity.MjEntity;
 import com.xwkj.jcjcgz.mvp.model.entity.PickerResult;
@@ -17,6 +20,7 @@ import java.util.List;
 public class MjPicker {
     private Context mContext;
     private OnAreaSelectListener mListener;
+    private OptionsPickerView pvOptions;
 
     public interface OnAreaSelectListener{
         void onAreaSelect(PickerResult area);
@@ -30,7 +34,7 @@ public class MjPicker {
 
     public void showPickerView(PickerResult result, String title) {// 弹出选择器
 
-            OptionsPickerView pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
+            pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
                 @Override
                 public void onOptionsSelect(int options1, int options2, int options3, View v) {
                     MjEntity.Mj opt1tx = options1Items.size() > 0 ?
@@ -48,11 +52,34 @@ public class MjPicker {
                 }
             })
 
-                    .setTitleText(title)
-                    .setDividerColor(Color.BLACK)
-                    .setTextColorCenter(Color.BLACK) //设置选中项文字颜色
+                    .setDividerColor(Color.parseColor("#106DFF"))
+                    .setTextColorCenter(Color.parseColor("#106DFF")) //设置选中项文字颜色
+                    .setTextColorOut(Color.parseColor("#999999"))
                     .setContentTextSize(20)
-                    .isDialog(true)
+                    .setLayoutRes(R.layout.pickerview_custom_options, new CustomListener() {
+                        @Override
+                        public void customLayout(View v) {
+                            //自定义布局中的控件初始化及事件处理
+                            final TextView tvSubmit = v.findViewById(R.id.pickerview_confirm);
+                            final TextView tvTitle = v.findViewById(R.id.pickerview_tv_title);
+                            tvTitle.setText(title);
+                            View cancel = v.findViewById(R.id.pickerview_layout_cancel);
+                            tvSubmit.setOnClickListener(new View.OnClickListener() {
+                                @Override
+                                public void onClick(View v) {
+                                    pvOptions.returnData();
+                                    pvOptions.dismiss();
+                                }
+                            });
+                            cancel.setOnClickListener(new View.OnClickListener() {
+                                @Override
+                                public void onClick(View v) {
+                                    pvOptions.dismiss();
+                                }
+                            });
+
+                        }
+                    })
                     .setSelectOptions(result != null? result.getLv1Index() : 0)
                     .build();
 

+ 32 - 5
app/src/main/java/com/xwkj/jcjcgz/app/view/SmyjGsdwPicker.java

@@ -3,10 +3,13 @@ package com.xwkj.jcjcgz.app.view;
 import android.content.Context;
 import android.graphics.Color;
 import android.view.View;
+import android.widget.TextView;
 
 import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
+import com.bigkoo.pickerview.listener.CustomListener;
 import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
 import com.bigkoo.pickerview.view.OptionsPickerView;
+import com.xwkj.jcjcgz.R;
 import com.xwkj.jcjcgz.mvp.model.entity.DictionaryEntity;
 import com.xwkj.jcjcgz.mvp.model.entity.GsdwEntity;
 import com.xwkj.jcjcgz.mvp.model.entity.PickerResult;
@@ -17,6 +20,7 @@ import java.util.List;
 public class SmyjGsdwPicker {
     private Context mContext;
     private OnAreaSelectListener mListener;
+    private OptionsPickerView pvOptions;
 
     public interface OnAreaSelectListener{
         void onAreaSelect(PickerResult area);
@@ -30,7 +34,7 @@ public class SmyjGsdwPicker {
 
     public void showPickerView(PickerResult result, String title) {// 弹出选择器
 
-            OptionsPickerView pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
+            pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
                 @Override
                 public void onOptionsSelect(int options1, int options2, int options3, View v) {
                     //返回的分别是三个级别的选中位置
@@ -49,11 +53,34 @@ public class SmyjGsdwPicker {
                 }
             })
 
-                    .setTitleText(title)
-                    .setDividerColor(Color.BLACK)
-                    .setTextColorCenter(Color.BLACK) //设置选中项文字颜色
+                    .setDividerColor(Color.parseColor("#106DFF"))
+                    .setTextColorCenter(Color.parseColor("#106DFF")) //设置选中项文字颜色
+                    .setTextColorOut(Color.parseColor("#999999"))
                     .setContentTextSize(20)
-                    .isDialog(true)
+                    .setLayoutRes(R.layout.pickerview_custom_options, new CustomListener() {
+                        @Override
+                        public void customLayout(View v) {
+                            //自定义布局中的控件初始化及事件处理
+                            final TextView tvSubmit = v.findViewById(R.id.pickerview_confirm);
+                            final TextView tvTitle = v.findViewById(R.id.pickerview_tv_title);
+                            tvTitle.setText(title);
+                            View cancel = v.findViewById(R.id.pickerview_layout_cancel);
+                            tvSubmit.setOnClickListener(new View.OnClickListener() {
+                                @Override
+                                public void onClick(View v) {
+                                    pvOptions.returnData();
+                                    pvOptions.dismiss();
+                                }
+                            });
+                            cancel.setOnClickListener(new View.OnClickListener() {
+                                @Override
+                                public void onClick(View v) {
+                                    pvOptions.dismiss();
+                                }
+                            });
+
+                        }
+                    })
                     .setSelectOptions(result != null? result.getLv1Index() : 0)
                     .build();
 

+ 33 - 4
app/src/main/java/com/xwkj/jcjcgz/app/view/XzqhPicker.java

@@ -3,10 +3,13 @@ package com.xwkj.jcjcgz.app.view;
 import android.content.Context;
 import android.graphics.Color;
 import android.view.View;
+import android.widget.TextView;
 
 import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
+import com.bigkoo.pickerview.listener.CustomListener;
 import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
 import com.bigkoo.pickerview.view.OptionsPickerView;
+import com.xwkj.jcjcgz.R;
 import com.xwkj.jcjcgz.mvp.model.entity.DictionaryEntity;
 import com.xwkj.jcjcgz.mvp.model.entity.PickerResult;
 
@@ -19,6 +22,8 @@ import java.util.List;
 public class XzqhPicker {
     private Context mContext;
     private OnAreaSelectListener mListener;
+    private OptionsPickerView pvOptions;
+
     public interface OnAreaSelectListener{
         void onAreaSelect(PickerResult area);
     }
@@ -31,7 +36,7 @@ public class XzqhPicker {
     private ArrayList<ArrayList<DictionaryEntity.Xzqh>> options2Items = new ArrayList<>();
     public void showPickerView(PickerResult result) {// 弹出选择器
 
-        OptionsPickerView pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
+        pvOptions = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
             @Override
             public void onOptionsSelect(int options1, int options2, int options3, View v) {
                 //返回的分别是三个级别的选中位置
@@ -59,10 +64,34 @@ public class XzqhPicker {
             }
         })
 
-                .setTitleText("归属省市")
-                .setDividerColor(Color.BLACK)
-                .setTextColorCenter(Color.BLACK) //设置选中项文字颜色
+                .setDividerColor(Color.parseColor("#106DFF"))
+                .setTextColorCenter(Color.parseColor("#106DFF")) //设置选中项文字颜色
+                .setTextColorOut(Color.parseColor("#999999"))
                 .setContentTextSize(20)
+                .setLayoutRes(R.layout.pickerview_custom_options, new CustomListener() {
+                    @Override
+                    public void customLayout(View v) {
+                        //自定义布局中的控件初始化及事件处理
+                        final TextView tvSubmit = v.findViewById(R.id.pickerview_confirm);
+                        final TextView tvTitle = v.findViewById(R.id.pickerview_tv_title);
+                        tvTitle.setText("请选择归属省市");
+                        View cancel = v.findViewById(R.id.pickerview_layout_cancel);
+                        tvSubmit.setOnClickListener(new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                pvOptions.returnData();
+                                pvOptions.dismiss();
+                            }
+                        });
+                        cancel.setOnClickListener(new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                pvOptions.dismiss();
+                            }
+                        });
+
+                    }
+                })
                 .isDialog(true)
                 .setSelectOptions(result != null? result.getLv1Index() : 0, result != null? result.getLv2Index() : 0)
                 .build();

+ 9 - 0
app/src/main/java/com/xwkj/jcjcgz/mvp/model/entity/ChannelEntity.java

@@ -44,6 +44,7 @@ public class ChannelEntity {
 
     public static class Task implements Serializable {
         private ArrayList<Task> children;
+        private String id;
         private String code;
         private String dictKey;
         private String dictValue;
@@ -57,6 +58,14 @@ public class ChannelEntity {
         private String sort;
         private String tenantId;
 
+        public String getId() {
+            return id;
+        }
+
+        public void setId(String id) {
+            this.id = id;
+        }
+
         public String getCode() {
             return code;
         }

+ 18 - 0
app/src/main/java/com/xwkj/jcjcgz/mvp/model/entity/TaskDxzpDetailEntity.java

@@ -108,6 +108,24 @@ public class TaskDxzpDetailEntity {
         private String victimIdcard;
         private String victimAddress;
         private String deptId;
+        private String syncId;
+        private String dataSource; // 值是资金预警需要民警上门
+
+        public String getDataSource() {
+            return dataSource;
+        }
+
+        public void setDataSource(String dataSource) {
+            this.dataSource = dataSource;
+        }
+
+        public String getSyncId() {
+            return syncId;
+        }
+
+        public void setSyncId(String syncId) {
+            this.syncId = syncId;
+        }
 
         public String getDeptId() {
             return deptId;

+ 9 - 0
app/src/main/java/com/xwkj/jcjcgz/mvp/model/entity/TaskDxzpEntity.java

@@ -61,6 +61,15 @@ public class TaskDxzpEntity {
         private String fkjg;
         private String warnAccount;
         private String warnNumber;
+        private String syncId;
+
+        public String getSyncId() {
+            return syncId;
+        }
+
+        public void setSyncId(String syncId) {
+            this.syncId = syncId;
+        }
 
         public String getWarnNumber() {
             return warnNumber;

+ 27 - 0
app/src/main/java/com/xwkj/jcjcgz/mvp/model/entity/Wfjmfj.java

@@ -3,6 +3,33 @@ package com.xwkj.jcjcgz.mvp.model.entity;
 public class Wfjmfj {
     private String warnNumber;
     private String file;
+    private String fileName;
+    private String fileSuffix;
+    private String syncId;
+
+    public String getSyncId() {
+        return syncId;
+    }
+
+    public void setSyncId(String syncId) {
+        this.syncId = syncId;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public String getFileSuffix() {
+        return fileSuffix;
+    }
+
+    public void setFileSuffix(String fileSuffix) {
+        this.fileSuffix = fileSuffix;
+    }
 
     public String getWarnNumber() {
         return warnNumber;

+ 4 - 0
app/src/main/java/com/xwkj/jcjcgz/mvp/ui/activity/DxzpDetailActivity.java

@@ -123,6 +123,7 @@ public class DxzpDetailActivity extends ZkjcBaseActivity<DxzpDetailPresenter> im
         layoutYj.setOnClickListener(this);
         Map<String, String> map = new HashMap<>();
         map.put("warnNumber", getIntent().getStringExtra("id"));
+        map.put("syncId", getIntent().getStringExtra("syncId"));
         mPresenter.getDetail(map);
         mPresenter.getDic(new HashMap<>());
         tvFk.setOnClickListener(this);
@@ -273,6 +274,7 @@ public class DxzpDetailActivity extends ZkjcBaseActivity<DxzpDetailPresenter> im
                         public void onConfirmClick(PickerResult result, String yjsm) {
                             Map<String, String> map = new HashMap<>();
                             map.put("warnNumber", getIntent().getStringExtra("id"));
+                            map.put("syncId", getIntent().getStringExtra("syncId"));
                             map.put("targetUnitCode", result.getLv2Id());
                             map.put("transferMsg", yjsm);
                             mPresenter.yj(map);
@@ -297,6 +299,8 @@ public class DxzpDetailActivity extends ZkjcBaseActivity<DxzpDetailPresenter> im
                 Intent intent = new Intent(DxzpDetailActivity.this, FzQzFkActivity.class);
                 intent.putExtra("dept_id", mDetail.getDeptId());
                 intent.putExtra("warnNumber", mDetail.getWarnNumber());
+                intent.putExtra("syncId", mDetail.getSyncId());
+                intent.putExtra("is_zjyj", "资金预警".equals(mDetail.getDataSource()));
                 intent.putExtra("data", mData);
                 startActivityForResult(intent, 1);
             }

+ 38 - 7
app/src/main/java/com/xwkj/jcjcgz/mvp/ui/activity/FzQzFkActivity.java

@@ -167,12 +167,17 @@ public class FzQzFkActivity extends ZkjcBaseActivity<FzQzFkPresenter> implements
     TextView tvFksmCount;
     @BindView(R.id.tv_jg_bt)
     TextView tvJgBt;
+    @BindView(R.id.tv_xz_bt)
+    TextView tvXzBt;
+    @BindView(R.id.tv_dz_bt)
+    TextView tvDzBt;
     @BindView(R.id.layout_jmjg)
     View layoutJmjg;
     @BindView(R.id.layout_wfjmfj)
     View layoutWfjmfj;
     @BindView(R.id.iv_delete)
     View ivDelete;
+
     private DictionaryPicker mSjszxxPicker;
     private PickerResult mSjszxxResult;
     private DictionaryPicker mZplxPicker;
@@ -197,6 +202,7 @@ public class FzQzFkActivity extends ZkjcBaseActivity<FzQzFkPresenter> implements
     private String mPictureString;
     private AreaPicker mXzqhPick;
     private Area mXzqhResult;
+    private String mFileName;
 
     @Override
     public void setupActivityComponent(@NonNull AppComponent appComponent) {
@@ -233,6 +239,9 @@ public class FzQzFkActivity extends ZkjcBaseActivity<FzQzFkPresenter> implements
             layoutMore.setVisibility(View.VISIBLE);
 //            tvJgBt.setVisibility(View.VISIBLE);
             layoutJmjg.setVisibility(View.VISIBLE);
+            if (getIntent().getBooleanExtra("is_zjyj", false)) {
+                tvJgBt.setVisibility(View.VISIBLE);
+            }
         }
         mZd = (DictionaryEntity.Dictionary) getIntent().getSerializableExtra("data");
         setData(mZd);
@@ -291,7 +300,7 @@ public class FzQzFkActivity extends ZkjcBaseActivity<FzQzFkPresenter> implements
             public void afterTextChanged(Editable s) {
                 if (s != null) {
                     if (s.length() > 200) {
-                        s.delete(2000, s.length());
+                        s.delete(200, s.length());
                         ToastUtils.show("超过最大输入字符");
                     }
                     tvFksmCount.setText(s.length() + "");
@@ -434,6 +443,13 @@ public class FzQzFkActivity extends ZkjcBaseActivity<FzQzFkPresenter> implements
                             } else {
                                 layoutWfjmfj.setVisibility(View.GONE);
                             }
+                            if ("1".equals(mJmjgResult.getLv1Id())) {
+                                tvDzBt.setVisibility(View.VISIBLE);
+                                tvXzBt.setVisibility(View.VISIBLE);
+                            } else {
+                                tvDzBt.setVisibility(View.GONE);
+                                tvXzBt.setVisibility(View.GONE);
+                            }
                             tvJmjg.setText(mJmjgResult.getLv1Value());
                         });
                     }
@@ -482,15 +498,12 @@ public class FzQzFkActivity extends ZkjcBaseActivity<FzQzFkPresenter> implements
         try {
             Map<String, Object> map = new HashMap<>();
             map.put("warnNumber", getIntent().getStringExtra("warnNumber"));
+            map.put("syncId", getIntent().getStringExtra("syncId"));
             if (isMj) {
                 if (mJmjgResult == null) {
                     ToastUtils.show("请选择见面结果");
                     return;
                 }
-                if (TextUtils.isEmpty(tvJmdz.getText())) {
-                    ToastUtils.show("请填写见面地址");
-                    return;
-                }
                 if ("3".equals(mJmjgResult.getLv1Id())) {
                     if (TextUtils.isEmpty(mPictureString)) {
                         ToastUtils.show("请上传无法见面附件");
@@ -498,7 +511,13 @@ public class FzQzFkActivity extends ZkjcBaseActivity<FzQzFkPresenter> implements
                     } else {
                         Wfjmfj wfjmfj = new Wfjmfj();
                         wfjmfj.setWarnNumber(getIntent().getStringExtra("warnNumber"));
+                        wfjmfj.setSyncId(getIntent().getStringExtra("syncId"));
                         wfjmfj.setFile(mPictureString);
+                        if (!TextUtils.isEmpty(mFileName)) {
+                            String[] split = mFileName.split("\\.");
+                            wfjmfj.setFileName(split[0]);
+                            wfjmfj.setFileSuffix(split[1]);
+                        }
                         map.put("fj", wfjmfj);
                     }
 
@@ -613,6 +632,7 @@ public class FzQzFkActivity extends ZkjcBaseActivity<FzQzFkPresenter> implements
 
             mPresenter.submit(map);
         } catch (Exception e) {
+            e.printStackTrace();
             ToastUtils.show("数据不完整,请填写完稍后再点击");
         }
     }
@@ -644,6 +664,15 @@ public class FzQzFkActivity extends ZkjcBaseActivity<FzQzFkPresenter> implements
                 switchSmyj.setVisibility(View.VISIBLE);
                 switchSmyj.setChecked(false);
                 layoutXsmyj.setVisibility(View.GONE);
+                if (getIntent().getBooleanExtra("is_zjyj", false)) {
+                    switchSmyj.setVisibility(View.GONE);
+                    switchSmyj.setChecked(true);
+                    layoutXsmyj.setVisibility(View.VISIBLE);
+                } else {
+                    switchSmyj.setVisibility(View.VISIBLE);
+                    switchSmyj.setChecked(false);
+                    layoutXsmyj.setVisibility(View.GONE);
+                }
                 break;
         }
     }
@@ -684,8 +713,10 @@ public class FzQzFkActivity extends ZkjcBaseActivity<FzQzFkPresenter> implements
                 ArrayList<ImageItem> images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
                 if (images != null && !images.isEmpty()) {
                     ImageItem mItem = images.get(0);
-
-                    mPictureString = BitmapUtils.fileToBase64(new File(mItem.path));
+                    File file = new File(mItem.path);
+                    Log.e("eee", "name ====== " + file.getName());
+                    mPictureString = BitmapUtils.fileToBase64(file);
+                    mFileName = file.getName();
                     ivCamera.setVisibility(View.VISIBLE);
                     ivDelete.setVisibility(View.VISIBLE);
 

+ 2 - 1
app/src/main/java/com/xwkj/jcjcgz/mvp/ui/activity/LoginActivity.java

@@ -207,8 +207,9 @@ public class LoginActivity extends ZkjcBaseActivity<LoginPresenter> implements L
                 edit.putBoolean("isFirst", false);
 
                 edit.commit();
+                ToastUtils.show("登录成功");
 //                ArmsUtils.startActivity(MainActivity.class);
-//                finish();
+                finish();
             } else {
                 String error_description = jsonObject.get("error_description").getAsString();
                 ToastUtils.show(error_description);

+ 41 - 3
app/src/main/java/com/xwkj/jcjcgz/mvp/ui/activity/TestActivity.java

@@ -1,10 +1,12 @@
 package com.xwkj.jcjcgz.mvp.ui.activity;
 
+import android.Manifest;
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.os.Bundle;
+import android.provider.Settings;
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import android.util.Log;
@@ -25,6 +27,8 @@ import com.mpush.api.http.HttpMethod;
 import com.mpush.api.http.HttpRequest;
 import com.mpush.api.http.HttpResponse;
 import com.mpush.client.ClientConfig;
+import com.xm.permissions.OnRequestPermissionsCallback;
+import com.xm.permissions.XmPermissions;
 import com.xwkj.jcjcgz.BuildConfig;
 import com.xwkj.jcjcgz.R;
 import com.xwkj.jcjcgz.app.push.MPush;
@@ -32,6 +36,7 @@ import com.xwkj.jcjcgz.di.component.DaggerTestComponent;
 import com.xwkj.jcjcgz.mvp.contract.TestContract;
 import com.xwkj.jcjcgz.mvp.presenter.TestPresenter;
 
+import org.jetbrains.annotations.NotNull;
 import org.json.JSONObject;
 
 import java.util.concurrent.TimeUnit;
@@ -51,7 +56,9 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
  * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
  * ================================================
  */
-public class TestActivity extends BaseActivity<TestPresenter> implements TestContract.View, View.OnClickListener {
+public class TestActivity extends BaseActivity<TestPresenter> implements TestContract.View, View.OnClickListener, OnRequestPermissionsCallback {
+
+    private XmPermissions xmPermissions;
 
     @Override
     public void setupActivityComponent(@NonNull AppComponent appComponent) {
@@ -79,6 +86,10 @@ public class TestActivity extends BaseActivity<TestPresenter> implements TestCon
         findViewById(R.id.push_init).setOnClickListener(this);
         findViewById(R.id.push_info).setOnClickListener(this);
         findViewById(R.id.add_shr).setOnClickListener(this);
+
+        xmPermissions = XmPermissions.Companion.newInstance(this);
+        xmPermissions.setOnRequestPermissionsCallback(this);
+        xmPermissions.requestPermissions(Manifest.permission.RECORD_AUDIO, Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.ACCESS_FINE_LOCATION);
     }
 
     @Override
@@ -131,7 +142,8 @@ public class TestActivity extends BaseActivity<TestPresenter> implements TestCon
                 break;
             case R.id.dxzp_detail:
                 Intent intent = new Intent(TestActivity.this, DxzpDetailActivity.class);
-                intent.putExtra("id", 1 + "");
+                intent.putExtra("id", 2 + "");
+                intent.putExtra("syncId", 222 + "");
                 startActivity(intent);
                 break;
             case R.id.dxzp_fk:
@@ -168,7 +180,7 @@ public class TestActivity extends BaseActivity<TestPresenter> implements TestCon
 
     private String getDeviceId() {
         if (true) {
-            return "1";
+            return Settings.System.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
         }
         TelephonyManager tm = (TelephonyManager) this.getSystemService(Activity.TELEPHONY_SERVICE);
         String deviceId = tm.getDeviceId();
@@ -224,4 +236,30 @@ public class TestActivity extends BaseActivity<TestPresenter> implements TestCon
         });
         MPush.I.sendHttpProxy(request);
     }
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+        xmPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults);
+    }
+
+    @Override
+    public void onDenied(@NotNull String[] strings) {
+
+    }
+
+    @Override
+    public void onGranted() {
+
+    }
+
+    @Override
+    public void onPermanentlyDenied(@NotNull String[] strings) {
+
+    }
+
+    @Override
+    public void onSettingBackDenied(@NotNull String[] strings) {
+
+    }
 }

+ 76 - 4
app/src/main/java/com/xwkj/jcjcgz/mvp/ui/fragment/RwzxFragment.java

@@ -3,6 +3,8 @@ package com.xwkj.jcjcgz.mvp.ui.fragment;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Message;
+import android.text.TextUtils;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -35,6 +37,7 @@ import com.scwang.smart.refresh.layout.constant.RefreshState;
 import com.scwang.smart.refresh.layout.simple.SimpleMultiListener;
 import com.squareup.picasso.Picasso;
 import com.xwkj.jcjcgz.R;
+import com.xwkj.jcjcgz.app.Event;
 import com.xwkj.jcjcgz.di.component.DaggerRwzxComponent;
 import com.xwkj.jcjcgz.mvp.contract.RwzxContract;
 import com.xwkj.jcjcgz.mvp.model.api.CommonInterFace;
@@ -43,6 +46,11 @@ import com.xwkj.jcjcgz.mvp.model.entity.ChannelEntity;
 import com.xwkj.jcjcgz.mvp.model.entity.TaskEntity;
 import com.xwkj.jcjcgz.mvp.presenter.RwzxPresenter;
 import com.xwkj.jcjcgz.mvp.ui.activity.MainActivity;
+import com.zkjc.common.base.ZkjcBaseFragment;
+import com.zkjc.common.event.IEvent;
+
+import org.greenrobot.eventbus.Subscribe;
+import org.greenrobot.eventbus.ThreadMode;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -68,7 +76,7 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
  * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
  * ================================================
  */
-public class RwzxFragment extends BaseFragment<RwzxPresenter> implements RwzxContract.View {
+public class RwzxFragment extends ZkjcBaseFragment<RwzxPresenter> implements RwzxContract.View {
 
     @BindView(R.id.rwzx_tv_search)
     TextView tvSearch;
@@ -416,8 +424,19 @@ public class RwzxFragment extends BaseFragment<RwzxPresenter> implements RwzxCon
                 for (ChannelEntity.Task task1: task.getChildren()) {
                     num = num + task1.getNum();
                 }
-                tvTaskNum1.setText(num + "");
+                if (num <= 0) {
+                    tvTaskNum1.setVisibility(View.GONE);
+                    tvTaskNum1.setText("0");
+                } else {
+                    tvTaskNum1.setVisibility(View.VISIBLE);
+                    if (num > 99) {
+                        tvTaskNum1.setText("99+");
+                    } else {
+                        tvTaskNum1.setText(num + "");
+                    }
+                }
                 tvTask1.setText(task.getDictValue());
+                tvTaskNum1.setTag(task.getId());
                 Picasso.with(getActivity()).load(task.getRemark()).into(ivTask1);
                 taskTypeFragment1.initFragment(task.getChildren());
             }
@@ -425,27 +444,80 @@ public class RwzxFragment extends BaseFragment<RwzxPresenter> implements RwzxCon
             case 1: {
 //                taskTypeFragment2 = TaskTypeFragment.newInstance(task.getChildren());
                 tvTask2.setText(task.getDictValue());
+                tvTaskNum2.setTag(task.getId());
                 Picasso.with(getActivity()).load(task.getRemark()).into(ivTask2);
                 int num = 0;
                 for (ChannelEntity.Task task1: task.getChildren()) {
                     num = num + task1.getNum();
                 }
-                tvTaskNum2.setText(num + "");
+                if (num <= 0) {
+                    tvTaskNum2.setVisibility(View.GONE);
+                    tvTaskNum2.setText("0");
+                } else {
+                    tvTaskNum2.setVisibility(View.VISIBLE);
+                    if (num > 99) {
+                        tvTaskNum2.setText("99+");
+                    } else {
+                        tvTaskNum2.setText(num + "");
+                    }
+                }
             }
                 break;
             case 2: {
 //                taskTypeFragment3 = TaskTypeFragment.newInstance(task.getChildren());
                 tvTask3.setText(task.getDictValue());
+                tvTaskNum3.setTag(task.getId());
                 Picasso.with(getActivity()).load(task.getRemark()).into(ivTask3);
                 int num = 0;
                 for (ChannelEntity.Task task1: task.getChildren()) {
                     num = num + task1.getNum();
                 }
-                tvTaskNum3.setText(num + "");
+                if (num <= 0) {
+                    tvTaskNum3.setVisibility(View.GONE);
+                    tvTaskNum3.setText("0");
+                } else {
+                    tvTaskNum3.setVisibility(View.VISIBLE);
+                    if (num > 99) {
+                        tvTaskNum3.setText("99+");
+                    } else {
+                        tvTaskNum3.setText(num + "");
+                    }
+                }
             }
                 break;
             default:
                 break;
         }
     }
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    @Override
+    public void onThisEvent(IEvent iEvent) {
+        if (iEvent instanceof Event) {
+            Event event = (Event) iEvent;
+            if (event.getEvent() == Event.E_REFRESH_TASK_MENU) {
+                setTvNum(event, tvTaskNum1);
+                setTvNum(event, tvTaskNum2);
+                setTvNum(event, tvTaskNum3);
+            }
+        }
+    }
+
+    private void setTvNum(Event event, TextView tvTaskNum) {
+        if (!TextUtils.isEmpty(tvTaskNum.getTag().toString()) && tvTaskNum.getTag().toString().equals(event.getId())) {
+            tvTaskNum.setVisibility(View.VISIBLE);
+            String num;
+            try {
+                int i = Integer.parseInt(tvTaskNum.getText().toString()) + 1;
+                if (i > 99) {
+                    num = "99+";
+                } else {
+                    num = i + "";
+                }
+                tvTaskNum.setText(num);
+            } catch (NumberFormatException e) {
+                tvTaskNum.setText("99+");
+            }
+        }
+    }
 }

+ 36 - 3
app/src/main/java/com/xwkj/jcjcgz/mvp/ui/fragment/TaskDxzpFragment.java

@@ -10,6 +10,8 @@ import androidx.fragment.app.Fragment;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 
+import android.text.TextUtils;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -27,6 +29,7 @@ import com.scwang.smart.refresh.layout.api.RefreshLayout;
 import com.scwang.smart.refresh.layout.constant.SpinnerStyle;
 import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener;
 import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
+import com.xwkj.jcjcgz.app.Event;
 import com.xwkj.jcjcgz.di.component.DaggerTaskDxzpComponent;
 import com.xwkj.jcjcgz.mvp.contract.TaskDxzpContract;
 import com.xwkj.jcjcgz.mvp.model.entity.TaskDxzpEntity;
@@ -38,6 +41,11 @@ import com.xwkj.jcjcgz.mvp.ui.activity.DxzpDetailActivity;
 import com.xwkj.jcjcgz.mvp.ui.adapter.BaseRecycleAdapter;
 import com.xwkj.jcjcgz.mvp.ui.adapter.TaskAdapter;
 import com.xwkj.jcjcgz.mvp.ui.adapter.TaskDxzpAdapter;
+import com.zkjc.common.base.ZkjcBaseFragment;
+import com.zkjc.common.event.IEvent;
+
+import org.greenrobot.eventbus.Subscribe;
+import org.greenrobot.eventbus.ThreadMode;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -61,7 +69,7 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
  * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
  * ================================================
  */
-public class TaskDxzpFragment extends BaseFragment<TaskDxzpPresenter> implements TaskDxzpContract.View, OnRefreshListener, OnLoadMoreListener {
+public class TaskDxzpFragment extends ZkjcBaseFragment<TaskDxzpPresenter> implements TaskDxzpContract.View, OnRefreshListener, OnLoadMoreListener {
     @BindView(R.id.task_rv)
     RecyclerView rv;
     @BindView(R.id.smart_refresh)
@@ -71,8 +79,12 @@ public class TaskDxzpFragment extends BaseFragment<TaskDxzpPresenter> implements
     private TaskDxzpAdapter mAdapter;
     private int pageNo = 1;
     private int pageSize = 10;
-    public static TaskDxzpFragment newInstance() {
+    private String mId;
+    public static TaskDxzpFragment newInstance(String id) {
         TaskDxzpFragment fragment = new TaskDxzpFragment();
+        Bundle bundle = new Bundle();
+        bundle.putString("id", id);
+        fragment.setArguments(bundle);
         return fragment;
     }
 
@@ -93,6 +105,7 @@ public class TaskDxzpFragment extends BaseFragment<TaskDxzpPresenter> implements
 
     @Override
     public void initData(@Nullable Bundle savedInstanceState) {
+        mId = getArguments().getString("id");
         smart_refresh.setEnableRefresh(false);
         //设置 Header
         smart_refresh.setRefreshHeader(new ClassicsHeader(getActivity()).setEnableLastTime(true));
@@ -112,6 +125,7 @@ public class TaskDxzpFragment extends BaseFragment<TaskDxzpPresenter> implements
                 TaskDxzpEntity.Task task = list.get(position);
                 Intent intent = new Intent(getActivity(), DxzpDetailActivity.class);
                 intent.putExtra("id", task.getWarnNumber());
+                intent.putExtra("syncId", task.getSyncId());
                 startActivity(intent);
             }
 
@@ -121,7 +135,7 @@ public class TaskDxzpFragment extends BaseFragment<TaskDxzpPresenter> implements
             }
         });
         rv.setAdapter(mAdapter);
-        requestData(pageNo = 1, pageSize);
+//        requestData(pageNo = 1, pageSize);
     }
 
     /**
@@ -243,4 +257,23 @@ public class TaskDxzpFragment extends BaseFragment<TaskDxzpPresenter> implements
             ToastUtils.show("获取数据出错,请重试");
         }
     }
+
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    @Override
+    public void onThisEvent(IEvent iEvent) {
+
+        Log.e("eee", "onMessageEvent is run !!!!! ");
+        if (iEvent instanceof Event) {
+            Event event = (Event) iEvent;
+            if (event.getEvent() == Event.E_REFRESH_TASK_TYPE) {
+                if (!TextUtils.isEmpty(mId) && mId.equals(event.getId())) {
+                    Log.e("eee", "mId.equals(event.getId()) is run !!!!! ");
+                    list.clear();
+                    mAdapter.notifyDataSetChanged();
+                    requestData(pageNo = 1, pageSize);
+                }
+            }
+        }
+    }
 }

+ 3 - 2
app/src/main/java/com/xwkj/jcjcgz/mvp/ui/fragment/TaskTypeFragment.java

@@ -26,6 +26,7 @@ import com.xwkj.jcjcgz.mvp.model.entity.ChannelEntity;
 import com.xwkj.jcjcgz.mvp.presenter.TaskTypePresenter;
 
 import com.xwkj.jcjcgz.R;
+import com.zkjc.common.base.ZkjcBaseFragment;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -49,7 +50,7 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
  * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
  * ================================================
  */
-public class TaskTypeFragment extends BaseFragment<TaskTypePresenter> implements TaskTypeContract.View {
+public class TaskTypeFragment extends ZkjcBaseFragment<TaskTypePresenter> implements TaskTypeContract.View {
     @BindView(R.id.rwzx_tab)
     TabLayout tabLayout;
     @BindView(R.id.rwzx_vp)
@@ -96,7 +97,7 @@ public class TaskTypeFragment extends BaseFragment<TaskTypePresenter> implements
         List<Fragment> fragments = new ArrayList<>();
         List<String> titles = new ArrayList<>();
         for (ChannelEntity.Task task: tasks) {
-            fragments.add(TaskDxzpFragment.newInstance());
+            fragments.add(TaskDxzpFragment.newInstance(task.getId()));
             titles.add(task.getDictValue() + "  " + task.getNum());
         }
         FragmentStateAdapter mAdapter = new FragmentStateAdapter(this) {

+ 2 - 2
app/src/main/java/com/xwkj/jcjcgz/mvp/ui/fragment/Test1Fragment.java

@@ -117,10 +117,10 @@ public class Test1Fragment extends BaseFragment<Test1Presenter> implements Test1
     View container;
     @BindView(R.id.layout_rwzx)
     View layoutRwzx;
-/*    @BindView(R.id.rwfx_tab)
+    @BindView(R.id.rwfx_tab)
     TabLayout tabLayout;
     @BindView(R.id.rwfx_vp)
-    ViewPager2 viewPager;*/
+    ViewPager2 viewPager;
 /*    @BindView(R.id.firstFloorView)
     SwipeRefreshLayout firstFloorView;*/
 

+ 27 - 0
app/src/main/java/com/xwkj/jcjcgz/mvp/ui/fragment/YjFragment.java

@@ -1,6 +1,8 @@
 package com.xwkj.jcjcgz.mvp.ui.fragment;
 
 import android.os.Bundle;
+import android.text.Editable;
+import android.text.TextWatcher;
 import android.view.View;
 import android.widget.EditText;
 import android.widget.TextView;
@@ -56,6 +58,7 @@ public class YjFragment extends BaseBottomSheetDialogFragment {
         TextView tvGsdw = mRootView.findViewById(R.id.pop_yj_tv_gsdw);
         TextView tvGsss = mRootView.findViewById(R.id.pop_yj_gsss_tv_gsss);
         EditText etYjsm = mRootView.findViewById(R.id.et_yjsm);
+        TextView etYjsmCount = mRootView.findViewById(R.id.tv_yjsm_count);
         layoutKs.setOnClickListener(v -> {
             mSelectKs = true;
             ivKs.setVisibility(View.VISIBLE);
@@ -94,6 +97,30 @@ public class YjFragment extends BaseBottomSheetDialogFragment {
             }
             mXzqhPicker.showPickerView(mKsResult);
         });
+
+        etYjsm.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 (s != null) {
+                    if (s.length() > 200) {
+                        s.delete(200, s.length());
+                        ToastUtils.show("超过最大输入字符");
+                    }
+                    etYjsmCount.setText(s.length() + "");
+                }
+            }
+        });
+
         layoutSn.performClick();
         confirm.setOnClickListener(v -> {
             if (myDialogListener != null) {

+ 0 - 0
app/src/main/res/drawable-xxxhdpi/img_keyboard_normal.9.png → app/src/main/res/drawable/img_keyboard_normal.9.png


+ 0 - 0
app/src/main/res/drawable-xxxhdpi/img_keyboard_pressed.9.png → app/src/main/res/drawable/img_keyboard_pressed.9.png


+ 7 - 4
app/src/main/res/layout/activity_fz_qz_fk.xml

@@ -132,6 +132,7 @@
                 android:layout_marginTop="12dp"
                 android:visibility="gone"
                 android:layout_marginRight="16dp"
+                android:paddingBottom="6dp"
                 android:background="@drawable/white_shape"
                 android:minHeight="148dp"
                 android:orientation="vertical">
@@ -676,12 +677,14 @@
                         <LinearLayout
                             android:layout_width="match_parent"
                             android:orientation="vertical"
+                            android:visibility="gone"
                             android:id="@+id/layout_jmjg"
                             android:layout_height="wrap_content">
 
 
                             <RelativeLayout
                                 android:layout_width="match_parent"
+                                android:layout_marginLeft="12dp"
                                 android:layout_height="50dp">
 
                                 <TextView
@@ -697,7 +700,6 @@
                                 <TextView
                                     android:layout_width="wrap_content"
                                     android:layout_height="wrap_content"
-                                    android:layout_marginLeft="12dp"
                                     android:layout_centerVertical="true"
                                     android:layout_toRightOf="@id/tv_jg_bt"
                                     android:text="见面结果"
@@ -819,6 +821,7 @@
 
                             <RelativeLayout
                                 android:layout_width="match_parent"
+                                android:layout_marginLeft="12dp"
                                 android:layout_height="50dp">
                                 <TextView
                                     android:id="@+id/tv_dz_bt"
@@ -834,7 +837,6 @@
                                 <TextView
                                     android:layout_width="wrap_content"
                                     android:layout_height="wrap_content"
-                                    android:layout_marginLeft="12dp"
                                     android:layout_centerVertical="true"
                                     android:layout_toRightOf="@id/tv_dz_bt"
                                     android:text="见面地址"
@@ -856,7 +858,8 @@
                                         android:layout_centerVertical="true"
                                         android:layout_marginLeft="80dp"
                                         android:singleLine="true"
-                                        android:text="请选择省、市、区、街道"
+                                        android:textColorHint="#666"
+                                        android:hint="请选择省、市、区、街道"
                                         android:textColor="#666"
                                         android:textSize="14sp" />
 
@@ -878,6 +881,7 @@
 
                             <RelativeLayout
                                 android:layout_width="match_parent"
+                                android:layout_marginLeft="12dp"
                                 android:layout_height="50dp">
                                 <TextView
                                     android:id="@+id/tv_xz_bt"
@@ -893,7 +897,6 @@
                                 <TextView
                                     android:layout_width="wrap_content"
                                     android:layout_height="wrap_content"
-                                    android:layout_marginLeft="12dp"
                                     android:layout_centerVertical="true"
                                     android:layout_toRightOf="@id/tv_xz_bt"
                                     android:text="详细地址"

+ 47 - 0
app/src/main/res/layout/fragment_test.xml

@@ -381,6 +381,53 @@
                         android:layout_height="match_parent">
 
 
+                        <RelativeLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="40dp">
+
+                            <LinearLayout
+                                android:layout_width="60dp"
+                                android:id="@+id/rwzx_layout_filter"
+                                android:layout_alignParentRight="true"
+                                android:orientation="horizontal"
+                                android:layout_centerVertical="true"
+                                android:gravity="center_vertical"
+                                android:layout_height="wrap_content">
+
+                                <TextView
+                                    android:layout_width="wrap_content"
+                                    android:layout_height="wrap_content"
+                                    android:layout_marginLeft="8dp"
+                                    android:text="筛选"
+                                    android:textColor="@color/color_666666"
+                                    android:textSize="12sp"/>
+
+                                <ImageView
+                                    android:layout_width="16dp"
+                                    android:background="@mipmap/icon_screening"
+                                    android:layout_height="16dp"/>
+
+                            </LinearLayout>
+
+                            <com.google.android.material.tabs.TabLayout
+                                android:id="@+id/rwzx_tab"
+                                android:layout_width="match_parent"
+                                android:layout_height="40dp"
+                                android:paddingLeft="8dp"
+                                android:layout_toLeftOf="@id/rwzx_layout_filter"
+                                android:paddingRight="8dp"
+                                app:tabIndicatorHeight="0dp"
+                                app:tabMode="scrollable"
+                                app:tabSelectedTextColor="@color/blue"
+                                app:tabTextColor="#666666" />
+
+                        </RelativeLayout>
+
+                        <androidx.viewpager2.widget.ViewPager2
+                            android:id="@+id/rwzx_vp"
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"/>
+
 
                     </LinearLayout>
                 </androidx.core.widget.NestedScrollView>

+ 83 - 0
app/src/main/res/layout/pickerview_custom_options.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/bg_shape_white_corner8"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="65dp">
+        
+        <TextView
+            android:layout_width="wrap_content"
+            android:text="请选择服务类型"
+            android:id="@+id/pickerview_tv_title"
+            android:layout_centerVertical="true"
+            android:textColor="#ff111111"
+            android:layout_marginLeft="20dp"
+            android:textSize="18sp"
+            android:layout_height="wrap_content"/>
+
+        <RelativeLayout
+            android:layout_width="56dp"
+            android:id="@+id/pickerview_layout_cancel"
+            android:layout_alignParentRight="true"
+            android:layout_height="match_parent">
+
+            <ImageView
+                android:id="@+id/iv_cancel"
+                android:layout_width="16dp"
+                android:layout_height="16dp"
+                android:layout_centerInParent="true"
+                android:src="@drawable/icon_closed" />
+
+        </RelativeLayout>
+
+    </RelativeLayout>
+
+    <!--此部分需要完整复制过去,删减或者更改ID会导致初始化找不到内容而报空-->
+    <LinearLayout
+        android:id="@+id/optionspicker"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="12dp"
+        android:layout_marginRight="12dp"
+        android:minHeight="150dp"
+        android:gravity="center"
+        android:background="@android:color/white"
+        android:orientation="horizontal">
+
+        <com.contrarywind.view.WheelView
+            android:id="@+id/options1"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1" />
+
+        <com.contrarywind.view.WheelView
+            android:id="@+id/options2"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1" />
+
+        <com.contrarywind.view.WheelView
+            android:id="@+id/options3"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1" />
+    </LinearLayout>
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_marginLeft="16dp"
+        android:layout_marginRight="16dp"
+        android:id="@+id/pickerview_confirm"
+        android:layout_marginTop="20dp"
+        android:gravity="center"
+        android:background="@drawable/bg_shape_blue_corner8"
+        android:text="确定"
+        android:textColor="#ffffffff"
+        android:textSize="18sp"
+        android:layout_marginBottom="12dp"
+        android:layout_height="44dp"/>
+
+</LinearLayout>

+ 5 - 3
app/src/main/res/layout/pop_yj.xml

@@ -140,7 +140,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="match_parent"
                     android:layout_alignParentRight="true"
-                    android:layout_marginLeft="5dp"
+                    android:layout_marginLeft="90dp"
                     android:layout_marginRight="12dp">
 
                     <TextView
@@ -150,6 +150,7 @@
                         android:layout_centerVertical="true"
                         android:layout_marginLeft="12dp"
                         android:textColorHint="#666"
+                        android:singleLine="true"
                         android:hint="请选择归属单位"
                         android:textColor="#666"
                         android:textSize="14sp" />
@@ -182,7 +183,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="match_parent"
                     android:layout_alignParentRight="true"
-                    android:layout_marginLeft="5dp"
+                    android:layout_marginLeft="90dp"
                     android:layout_marginRight="12dp">
 
                     <TextView
@@ -191,6 +192,7 @@
                         android:layout_height="wrap_content"
                         android:layout_centerVertical="true"
                         android:layout_marginLeft="12dp"
+                        android:singleLine="true"
                         android:text="请选择归属省市"
                         android:textColor="#666"
                         android:textSize="14sp" />
@@ -263,7 +265,7 @@
                         <TextView
                             android:layout_width="wrap_content"
                             android:text="0"
-                            android:id="@+id/tv_fksm_count"
+                            android:id="@+id/tv_yjsm_count"
                             android:textColor="#ffbebebe"
                             android:textSize="14sp"
                             android:layout_height="wrap_content"/>

+ 21 - 0
common/src/main/java/com/zkjc/common/base/ZkjcBaseFragment.java

@@ -12,6 +12,11 @@ import com.jess.arms.base.delegate.IFragment;
 import com.jess.arms.integration.lifecycle.FragmentLifecycleable;
 import com.jess.arms.mvp.IPresenter;
 import com.xdja.watermarklibrary.WaterMarkUtils;
+import com.zkjc.common.event.IEvent;
+
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+import org.greenrobot.eventbus.ThreadMode;
 
 public abstract class ZkjcBaseFragment<P extends IPresenter> extends BaseFragment<P> implements IFragment, FragmentLifecycleable {
 
@@ -29,6 +34,22 @@ public abstract class ZkjcBaseFragment<P extends IPresenter> extends BaseFragmen
             prefix = sharedPreferences.getString("jh", "") + sharedPreferences.getString("name", "");
         String waterMark = "  " + prefix;
         WaterMarkUtils.addWaterMark(getActivity(), waterMark, 350);
+
+        if (!EventBus.getDefault().isRegistered(this)) {
+            EventBus.getDefault().register(this);
+        }
     }
 
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        if (EventBus.getDefault().isRegistered(this)) {
+            EventBus.getDefault().unregister(this);
+        }
+    }
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    public void onThisEvent(IEvent event) {
+
+    }
 }