Sfoglia il codice sorgente

提交分类: 测试版本;
提交内容: 修改密码UI搭建
当前版本: 测试版本6.2.9
是否冲突: 否

raomeng 8 anni fa
parent
commit
5927870d76
88 ha cambiato i file con 1777 aggiunte e 491 eliminazioni
  1. 1 7
      WeiChat/src/main/AndroidManifest.xml
  2. 31 14
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/MainActivity.java
  3. 112 22
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/MessageFragment.java
  4. BIN
      WeiChat/src/main/res/drawable-hdpi/guanzhu.png
  5. BIN
      WeiChat/src/main/res/drawable-hdpi/phone.png
  6. BIN
      WeiChat/src/main/res/drawable-hdpi/qunliao.png
  7. BIN
      WeiChat/src/main/res/drawable-hdpi/uuhaoyou.png
  8. BIN
      WeiChat/src/main/res/drawable-mdpi/qiyetongxunlu.png
  9. BIN
      WeiChat/src/main/res/drawable-xhdpi/guanzhu.png
  10. BIN
      WeiChat/src/main/res/drawable-xhdpi/index_a.png
  11. BIN
      WeiChat/src/main/res/drawable-xhdpi/index_b.png
  12. BIN
      WeiChat/src/main/res/drawable-xhdpi/index_c.png
  13. BIN
      WeiChat/src/main/res/drawable-xhdpi/index_d.png
  14. BIN
      WeiChat/src/main/res/drawable-xhdpi/phone.png
  15. BIN
      WeiChat/src/main/res/drawable-xhdpi/qiyetongxunlu.png
  16. BIN
      WeiChat/src/main/res/drawable-xhdpi/qunliao.png
  17. BIN
      WeiChat/src/main/res/drawable-xhdpi/uuhaoyou.png
  18. BIN
      WeiChat/src/main/res/drawable-xxhdpi/guanzhu.png
  19. BIN
      WeiChat/src/main/res/drawable-xxhdpi/phone.png
  20. BIN
      WeiChat/src/main/res/drawable-xxhdpi/qiyetongxunlu.png
  21. BIN
      WeiChat/src/main/res/drawable-xxhdpi/qunliao.png
  22. BIN
      WeiChat/src/main/res/drawable-xxhdpi/uuhaoyou.png
  23. 2 1
      WeiChat/src/main/res/layout/activity_ad.xml
  24. 0 17
      WeiChat/src/main/res/layout/activity_main.xml
  25. 1 1
      WeiChat/src/main/res/layout/contact_item.xml
  26. 0 85
      WeiChat/src/main/res/layout/fragment_message.xml
  27. 64 53
      WeiChat/src/main/res/layout/fragment_new_message.xml
  28. 9 5
      WeiChat/src/main/res/layout/header_fragment_contact.xml
  29. 2 0
      WeiChat/src/main/res/values/colors.xml
  30. 9 0
      WeiChat/src/main/res/values/styles.xml
  31. 10 0
      app_core/common/src/main/assets/work_menu.json
  32. 5 0
      app_core/common/src/main/java/com/common/data/DateFormatUtil.java
  33. 223 0
      app_core/common/src/main/java/com/core/base/SupportToolBarActivity.java
  34. 3 1
      app_core/common/src/main/java/com/core/utils/BaiduMapUtil.java
  35. 18 7
      app_core/common/src/main/java/com/core/utils/ToastUtil.java
  36. 11 0
      app_core/common/src/main/java/com/core/widget/StrengthView.java
  37. 1 1
      app_core/common/src/main/java/com/core/widget/crouton/Crouton.java
  38. BIN
      app_core/common/src/main/res/drawable-hdpi/common_toolbar_bg.png
  39. BIN
      app_core/common/src/main/res/drawable-hdpi/common_toolbar_message_bg.png
  40. BIN
      app_core/common/src/main/res/drawable-xhdpi/common_toolbar_bg.png
  41. BIN
      app_core/common/src/main/res/drawable-xhdpi/common_toolbar_message_bg.png
  42. BIN
      app_core/common/src/main/res/drawable-xxhdpi/common_toolbar_bg.png
  43. BIN
      app_core/common/src/main/res/drawable-xxhdpi/common_toolbar_message_bg.png
  44. 4 0
      app_core/common/src/main/res/drawable/ic_baseutil_back.xml
  45. 8 0
      app_core/common/src/main/res/drawable/selector_item_white_pass.xml
  46. 7 6
      app_core/common/src/main/res/layout/activity_main.xml
  47. 20 0
      app_core/common/src/main/res/layout/base_bar_layout.xml
  48. 16 0
      app_core/common/src/main/res/layout/common_toolbar.xml
  49. 1 1
      app_core/common/src/main/res/layout/contact_item.xml
  50. 15 2
      app_core/common/src/main/res/layout/fragment_contacts.xml
  51. 0 85
      app_core/common/src/main/res/layout/fragment_message.xml
  52. 1 1
      app_core/common/src/main/res/layout/header_fragment_contact.xml
  53. 15 0
      app_core/common/src/main/res/layout/include_toolbar.xml
  54. 8 8
      app_core/common/src/main/res/layout/item_message.xml
  55. 2 2
      app_core/message/src/main/java/com/me/message/imp/BaseToastImpl.java
  56. 2 2
      app_modular/appcontact/src/main/java/com/uas/appcontact/adapter/FriendSortAdapter.java
  57. 28 15
      app_modular/appcontact/src/main/java/com/uas/appcontact/ui/fragment/ContactsFragment.java
  58. 33 0
      app_modular/appmessages/src/main/java/com/modular/appmessages/fragment/MessageNewFragment.java
  59. 0 24
      app_modular/appmessages/src/main/java/com/modular/appmessages/model/MessageModel.java
  60. 109 0
      app_modular/appmessages/src/main/java/com/modular/appmessages/model/MessageNew.java
  61. 23 0
      app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/MessageNewPresenter.java
  62. 48 14
      app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/MessagePresenter.java
  63. 4 0
      app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/imp/IMessageView.java
  64. 0 102
      app_modular/appmessages/src/main/java/com/modular/appmessages/ui/MessageHeaderView.java
  65. 486 0
      app_modular/appmessages/src/main/java/com/modular/appmessages/widget/SignRefreshLayout.java
  66. BIN
      app_modular/appmessages/src/main/res/drawable-hdpi/ic_quick_sign.png
  67. BIN
      app_modular/appmessages/src/main/res/drawable-xhdpi/ic_quick_sign.png
  68. BIN
      app_modular/appmessages/src/main/res/drawable-xxhdpi/bg_message_sign.png
  69. BIN
      app_modular/appmessages/src/main/res/drawable-xxhdpi/ic_quick_sign.png
  70. BIN
      app_modular/appmessages/src/main/res/drawable-xxhdpi/ic_sign.png
  71. BIN
      app_modular/appmessages/src/main/res/drawable-xxhdpi/ic_sign_off.png
  72. BIN
      app_modular/appmessages/src/main/res/drawable-xxhdpi/ic_sign_work.png
  73. 7 0
      app_modular/appmessages/src/main/res/drawable/ic_baseutil_simple_load.xml
  74. 9 0
      app_modular/appmessages/src/main/res/drawable/ic_refresh_pull_down.xml
  75. 4 0
      app_modular/appmessages/src/main/res/drawable/ic_refresh_pull_up.xml
  76. 13 0
      app_modular/appmessages/src/main/res/layout/fragment_message.xml
  77. 10 0
      app_modular/appmessages/src/main/res/layout/header_sign.xml
  78. 8 6
      app_modular/appmessages/src/main/res/layout/item_message_header.xml
  79. 46 0
      app_modular/appmessages/src/main/res/layout/refresh_sign_header.xml
  80. 36 0
      app_modular/appmessages/src/main/res/layout/refresh_simple_header.xml
  81. 9 0
      app_modular/appmessages/src/main/res/menu/menu_message_fragment.xml
  82. 3 2
      app_modular/apputils/src/main/java/com/modular/apputils/activity/BaseNetActivity.java
  83. 272 0
      app_modular/apputils/src/main/java/com/modular/apputils/utils/SignUtils.java
  84. 0 1
      app_modular/apputils/src/main/java/com/modular/apputils/utils/SwitchUtil.java
  85. 22 0
      app_modular/apputils/src/main/java/com/modular/apputils/utils/VoiceUtils.java
  86. BIN
      app_modular/apputils/src/main/res/raw/rec.mp3
  87. 3 6
      app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/utils/AutoErpSigninUitl.java
  88. 3 0
      app_third/library-refreshlayout/src/main/java/com/yalantis/phoenix/PullToRefreshView.java

+ 1 - 7
WeiChat/src/main/AndroidManifest.xml

@@ -14,12 +14,10 @@
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.READ_LOGS" />
     <uses-permission android:name="android.permission.CALL_PHONE" />
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
     <uses-permission android:name="android.permission.GET_TASKS" />
-    <uses-permission android:name="android.permission.SET_DEBUG_APP" />
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
     <uses-permission android:name="android.permission.USE_CREDENTIALS" />
@@ -35,7 +33,6 @@
     <uses-permission android:name="android.permission.WAKE_LOCK" />
     <uses-permission android:name="android.permission.GET_TASKS" />
     <uses-permission android:name="android.permission.REORDER_TASKS" />
-    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
     <!-- 录音录像的权限 -->
     <uses-permission android:name="android.permission.RECORD_VIDEO" />
     <uses-permission android:name="android.permission.RECORD_AUDIO" />
@@ -49,8 +46,6 @@
     <!-- <uses-permission android:name="android.permission.INTERNET" /> -->
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
-    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
-    <uses-permission android:name="android.permission.READ_LOGS" />
     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
     <uses-permission android:name="android.permission.USE_CREDENTIALS" />
     <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
@@ -65,7 +60,6 @@
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
-    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
     <uses-permission android:name="android.permission.VIBRATE" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
@@ -86,7 +80,6 @@
     <!-- 百度自动更新 -->
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
-    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.GET_TASKS" />
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
@@ -287,6 +280,7 @@
             android:configChanges="keyboardHidden|orientation"
             android:hardwareAccelerated="true"
             android:label="@string/app_name"
+            android:theme="@style/MainBaseTheme"
             android:launchMode="singleTask"
             android:screenOrientation="portrait"
             android:windowSoftInputMode="stateUnspecified|adjustNothing">

+ 31 - 14
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/MainActivity.java

@@ -20,6 +20,7 @@ import android.os.PersistableBundle;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentTransaction;
+import android.support.v7.widget.Toolbar;
 import android.text.TextUtils;
 import android.util.DisplayMetrics;
 import android.util.Log;
@@ -51,7 +52,6 @@ import com.core.api.wxapi.ApiUtils;
 import com.core.app.AppConfig;
 import com.core.app.AppConstant;
 import com.core.app.MyApplication;
-import com.core.base.BaseActivity;
 import com.core.broadcast.MsgBroadcast;
 import com.core.dao.SignAutoLogDao;
 import com.core.dao.UserDao;
@@ -76,6 +76,7 @@ import com.core.xmpp.listener.AuthStateListener;
 import com.core.xmpp.model.SignAutoLogEntity;
 import com.modular.appmessages.presenter.MessagePresenter;
 import com.modular.apptasks.presenter.AutoPresenter;
+import com.core.base.SupportToolBarActivity;
 import com.modular.login.activity.LoginActivity;
 import com.uas.appcontact.listener.ImStatusListener;
 import com.uas.appcontact.ui.fragment.ContactsFragment;
@@ -107,7 +108,7 @@ import java.util.Map;
 import static android.view.View.GONE;
 
 
-public class MainActivity extends BaseActivity implements ImStatusListener, NetWorkObservable.NetWorkObserver, MessagePresenter.UnReaderListener, AuthStateListener {
+public class MainActivity extends SupportToolBarActivity implements ImStatusListener, NetWorkObservable.NetWorkObserver, MessagePresenter.UnReaderListener, AuthStateListener {
     private static final int LOG_SEND_REQUEST = 17519;
     public static String HASHCODE = "MainActivity";
     public static boolean isUnReadWork;   //判断我的空间是否有新内容
@@ -288,7 +289,7 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
                     mBusinessCircleFragment = new ContactsFragment();
                 }
                 changeFragment(mBusinessCircleFragment, TAG_BusinessCircle);//发现
-                getSupportActionBar().setTitle(getString(R.string.contact_title));
+                setTitle(getString(R.string.contact_title));
 
             } else if (checkedId == R.id.main_tab_three) {  //点击工作选项
                 if (mWorksFragment == null) {
@@ -299,9 +300,9 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
                 String role = com.core.utils.CommonUtil.getUserRole();
                 if (role.equals("2")) {
                     String master_ch = CommonUtil.getSharedPreferences(ct, "Master_ch");
-                    getSupportActionBar().setTitle(TextUtils.isEmpty(master_ch) ? getString(R.string.work_title) : master_ch);
+                    setTitle(TextUtils.isEmpty(master_ch) ? getString(R.string.work_title) : master_ch);
                 } else {
-                    getSupportActionBar().setTitle(getString(R.string.work_title));
+                    setTitle(getString(R.string.work_title));
                 }
                 //TODO 当前隐藏新功能提醒红点
                 main_tab_three_tv.setVisibility(View.INVISIBLE);
@@ -312,7 +313,7 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
 					mGroupChatFragment = new GroupChatFragment();
 				}
 				changeFragment(mGroupChatFragment, TAG_GROUP_CHAT);//群聊
-				getSupportActionBar().setTitle(R.string.group_chat);
+				setTitle(R.string.group_chat);
 			}*/
             else if (checkedId == R.id.main_tab_five) {
                 if (mMeFragment == null) {
@@ -320,7 +321,7 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
                 }
                 CommonUtil.setSharedPreferences(ct, com.core.app.Constants.NEW_ME_TAG, true);
                 changeFragment(mMeFragment, TAG_ME);//我
-                getSupportActionBar().setTitle(R.string.me);
+                setTitle(R.string.me);
             }
         }
     };
@@ -492,12 +493,14 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
         }
     };
 
+    @Override
+    public boolean needNavigation() {
+        return false;
+    }
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        LogUtil.d("OnCreate start:" + DateFormatUtil.long2Str(DateFormatUtil.YMD_HMS));
-        getSupportActionBar().setDisplayShowHomeEnabled(false);
-        getSupportActionBar().setDisplayHomeAsUpEnabled(false);
         setContentView(R.layout.activity_main);
         SIP_USERNAME = MyApplication.getInstance().mLoginUser.getUserId();
         String host = mConfig.MeetingHost;
@@ -960,6 +963,20 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
             fragmentTransaction.attach(addFragment);
         }
         mLastFragment = addFragment;
+
+        if (addFragment == mWorksFragment) {
+            hideToolBar();
+        } else {
+            showToolBar();
+            Toolbar mToolBar = getCommonToolBar();
+            if (mToolBar != null) {
+                if (addFragment == mMessageFragment) {
+                    mToolBar.setBackgroundResource(R.drawable.common_toolbar_message_bg);
+                } else {
+                    mToolBar.setBackgroundResource(R.drawable.common_toolbar_bg);
+                }
+            }
+        }
         fragmentTransaction.commitAllowingStateLoss();
     }
 
@@ -989,12 +1006,12 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
      */
     private void updateMessageTitle() {
         if (mImStatus == AuthStateListener.AUTH_STATE_NOT) {
-            getSupportActionBar().setTitle(R.string.msg_offline);
+            setTitle(R.string.msg_offline);
             // mMessageFragment.setNetNoticeVisiable(true);
         } else if (mImStatus == AuthStateListener.AUTH_STATE_ING) {
-            getSupportActionBar().setTitle(R.string.msg_connect);
+            setTitle(R.string.msg_connect);
         } else if (mImStatus == AuthStateListener.AUTH_STATE_SUCCESS) {
-            getSupportActionBar().setTitle(R.string.msg_online);
+            setTitle(R.string.msg_online);
             // mMessageFragment.setNetNoticeVisiable(false);
         }
     }
@@ -1111,4 +1128,4 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
         updateMsgUnReadTv();
     }
 
-}
+}

+ 112 - 22
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/MessageFragment.java

@@ -5,20 +5,24 @@ import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.provider.Settings;
+import android.support.v7.widget.AppCompatTextView;
 import android.text.Editable;
+import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.BaseAdapter;
+import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.PopupWindow;
-import android.widget.ScrollView;
 import android.widget.TextView;
 
-import com.common.LogUtil;
 import com.common.data.DateFormatUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
@@ -27,19 +31,19 @@ import com.common.system.DisplayUtil;
 import com.core.api.wxapi.ApiPlatform;
 import com.core.api.wxapi.ApiUtils;
 import com.core.app.Constants;
+import com.core.base.BaseActivity;
 import com.core.base.EasyFragment;
 import com.core.model.Friend;
+import com.core.model.WorkModel;
+import com.core.utils.ToastUtil;
 import com.core.utils.sortlist.BaseSortModel;
 import com.core.widget.DrawableCenterTextView;
 import com.core.widget.MyListView;
 import com.core.widget.RedView;
 import com.core.widget.VoiceSearchView;
 import com.core.widget.listener.EditChangeListener;
-import com.handmark.pulltorefresh.library.PullToRefreshBase;
-import com.handmark.pulltorefresh.library.PullToRefreshScrollView;
 import com.lidroid.xutils.ViewUtils;
 import com.lidroid.xutils.view.annotation.ViewInject;
-import com.modular.appmessages.activity.ApprovalListActivity;
 import com.modular.appmessages.activity.ProcessB2BActivity;
 import com.modular.appmessages.activity.ProcessMsgActivity;
 import com.modular.appmessages.activity.Subscription2Activity;
@@ -47,6 +51,7 @@ import com.modular.appmessages.adapter.MessageAdapter;
 import com.modular.appmessages.model.MessageHeader;
 import com.modular.appmessages.presenter.MessagePresenter;
 import com.modular.appmessages.presenter.imp.IMessageView;
+import com.modular.appmessages.widget.SignRefreshLayout;
 import com.uas.appme.pedometer.view.UURanking;
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.ui.platform.task.TaskActivity;
@@ -59,6 +64,7 @@ import java.util.List;
 /**
  * Created by Bitliker on 2017/3/1.
  */
+@Deprecated
 public class MessageFragment extends EasyFragment implements IMessageView, View.OnClickListener {
 
     @ViewInject(R.id.voiceSearchView)
@@ -66,14 +72,21 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
 
     @ViewInject(R.id.message_net_set)
     private DrawableCenterTextView message_net_set;
-    @ViewInject(R.id.pullScrollView)
-    private PullToRefreshScrollView pullScrollView;
+    @ViewInject(R.id.mSignRefreshLayout)
+    private SignRefreshLayout mSignRefreshLayout;
     @ViewInject(R.id.headerLV)
     private MyListView headerLV;
     @ViewInject(R.id.contentLV)
     private MyListView contentLV;
+    @ViewInject(R.id.handerAndContentLine)
+    private View handerAndContentLine;
 
-    private Activity mContext;
+    private View signView;
+    private ImageButton itemSignImage;
+    private AppCompatTextView itemWorkTv;
+    private AppCompatTextView itemOffkTv;
+
+    private BaseActivity mContext;
     private MessagePresenter presenter;
     private MessageAdapter mAdapter;
     private PopupWindow setWindow;
@@ -88,8 +101,8 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
     @Override
     public void onAttach(Context context) {
         super.onAttach(context);
-        if (context instanceof Activity) {
-            mContext = (Activity) context;
+        if (context instanceof BaseActivity) {
+            mContext = (BaseActivity) context;
         }
         if (context instanceof MessagePresenter.UnReaderListener) {
             unReaderListener = (MessagePresenter.UnReaderListener) context;
@@ -103,6 +116,20 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
     }
 
 
+    @Override
+    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+        inflater.inflate(R.menu.menu_message_fragment, menu);
+        super.onCreateOptionsMenu(menu, inflater);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == R.id.quick_sign) {
+            setSignViewData();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
     @Override
     protected int inflateLayoutId() {
         return R.layout.fragment_new_message;
@@ -110,12 +137,12 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
 
     @Override
     protected void onCreateView(Bundle savedInstanceState, boolean createView) {
-        LogUtil.d("onCreateView:" + DateFormatUtil.long2Str(DateFormatUtil.YMD_HMS));
         if (createView) {
             ViewUtils.inject(getmRootView());
             platform = ApiUtils.getApiModel() instanceof ApiPlatform;
             initView();
             initEvent();
+            setHasOptionsMenu(true);
         }
     }
 
@@ -123,6 +150,10 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
     public void onResume() {
         super.onResume();
         presenter.loadData();
+        if (PreferenceUtils.getBoolean("hasAutoSign", false)) {
+            mSignRefreshLayout.setSignShow();
+            PreferenceUtils.putBoolean("hasAutoSign",false);
+        }
     }
 
 
@@ -134,13 +165,13 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
                 presenter.search(s.toString());
             }
         });
-        pullScrollView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ScrollView>() {
+        mSignRefreshLayout.setOnRefreshListener(new SignRefreshLayout.onRefreshListener() {
             @Override
-            public void onRefresh(PullToRefreshBase<ScrollView> refreshView) {
-//                initHeaderView();
+            public void onRefresh() {
                 presenter.loadData();
             }
         });
+
         contentLV.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
@@ -168,12 +199,56 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
 
 
     private void initView() {
-        pullScrollView.setMode(PullToRefreshBase.Mode.PULL_FROM_START);
         mAdapter = new MessageAdapter(null, mContext);
         contentLV.setAdapter(mAdapter);
         presenter = new MessagePresenter(mContext, this, unReaderListener);
+        signView = mSignRefreshLayout.getSignView();
+
+
+        if (signView != null) {
+            itemSignImage = signView.findViewById(R.id.itemSignImage);
+            itemWorkTv = signView.findViewById(R.id.itemWorkTv);
+            itemOffkTv = signView.findViewById(R.id.itemOffkTv);
+            itemSignImage.setOnClickListener(this);
+        }
     }
 
+    public void showProgress() {
+        if (mContext != null && mContext.progressDialog != null) {
+            mContext.progressDialog.show();
+        }
+    }
+
+    private void setSignViewData() {
+        if (mContext != null && mContext.progressDialog != null) {
+            mContext.progressDialog.dismiss();
+        }
+        WorkModel work = presenter.getCurrentWork();
+        if (work != null) {
+            if (itemWorkTv != null) {
+                if (TextUtils.isEmpty(work.getWorkSignin())) {
+                    itemWorkTv.setTextColor(getResources().getColor(R.color.message_not_sign_time));
+                    itemWorkTv.setText("未打卡(" + work.getWorkTime() + ")");
+                } else {
+                    itemWorkTv.setText(work.getWorkSignin() + ":00");
+                    itemWorkTv.setTextColor(getResources().getColor(R.color.white));
+                }
+            }
+            if (itemOffkTv != null) {
+                if (TextUtils.isEmpty(work.getOffSignin())) {
+                    itemOffkTv.setTextColor(getResources().getColor(R.color.message_not_sign_time));
+                    itemOffkTv.setText("未打卡(" + work.getOffTime() + ")");
+                } else {
+                    itemOffkTv.setText(work.getOffSignin() + ":00");
+                    itemOffkTv.setTextColor(getResources().getColor(R.color.white));
+                }
+            }
+            mSignRefreshLayout.setTag(work);
+            mSignRefreshLayout.setSignShow();
+        } else {
+            ToastUtil.showToast(ct, "未找到班次!!");
+        }
+    }
 
     private void showPopupWindow() {
         if (setWindow == null) initPopupWindow();
@@ -249,11 +324,20 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
                 break;
 
             case R.id.uustep_rl:
-//                startActivity(new Intent(mContext, UUSportActivity.class));
                 startActivity(new Intent(mContext, UURanking.class));
-//				uustepRedtv.setVisibility(View.GONE);
                 PreferenceUtils.putBoolean(Constants.UU_STEP_RED, true);
                 break;
+
+            case R.id.itemSignImage:
+                WorkModel work = null;
+                if (mSignRefreshLayout != null && mSignRefreshLayout.getTag() != null) {
+                    Object tag = mSignRefreshLayout.getTag();
+                    if (tag instanceof WorkModel) {
+                        work = (WorkModel) tag;
+                    }
+                }
+                presenter.signWork(work);
+                break;
         }
 
     }
@@ -262,8 +346,8 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
     @Override
     public void showModel(List<BaseSortModel<Friend>> models) {
         sortModels(models);
-        if (pullScrollView.isRefreshing()) {
-            pullScrollView.onRefreshComplete();
+        if (mSignRefreshLayout.isEnablePullDown() && mSignRefreshLayout.isRefreshing()) {
+            mSignRefreshLayout.stopRefresh();
         }
         if (mAdapter == null) {
             mAdapter = new MessageAdapter(models, mContext);
@@ -273,6 +357,7 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
             mAdapter.notifyDataSetChanged();
         }
         headerLV.setSelection(0);
+        handerAndContentLine.setVisibility(ListUtils.isEmpty(models) ? View.GONE : View.VISIBLE);
     }
 
     private void sortModels(List<BaseSortModel<Friend>> models) {
@@ -296,10 +381,8 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
 
     @Override
     public void updateHeaderView(int type, int num, String subTitle, String time) {
-
         if (headAdapter != null && !ListUtils.isEmpty(headAdapter.getModels())) {
             boolean isUpdated = false;
-
             if (type != MessagePresenter.REAL_TIME_FORM && type != MessagePresenter.BUSINESS_STATISTICS) {
                 for (MessageHeader e : headAdapter.getModels()) {
                     if (e.getType() == type) {
@@ -320,7 +403,9 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
             }
 
         }
-        pullScrollView.onRefreshComplete();
+        if (mSignRefreshLayout.isEnablePullDown() && mSignRefreshLayout.isRefreshing()) {
+            mSignRefreshLayout.stopRefresh();
+        }
     }
 
     private boolean updateHideOrDisplay(int num, boolean isUpdated, int type) {
@@ -394,6 +479,11 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
         }
     }
 
+    @Override
+    public void updateSign() {
+        setSignViewData();
+    }
+
 
     private class HeadAdapter extends BaseAdapter {
         List<MessageHeader> models;

BIN
WeiChat/src/main/res/drawable-hdpi/guanzhu.png


BIN
WeiChat/src/main/res/drawable-hdpi/phone.png


BIN
WeiChat/src/main/res/drawable-hdpi/qunliao.png


BIN
WeiChat/src/main/res/drawable-hdpi/uuhaoyou.png


BIN
WeiChat/src/main/res/drawable-mdpi/qiyetongxunlu.png


BIN
WeiChat/src/main/res/drawable-xhdpi/guanzhu.png


BIN
WeiChat/src/main/res/drawable-xhdpi/index_a.png


BIN
WeiChat/src/main/res/drawable-xhdpi/index_b.png


BIN
WeiChat/src/main/res/drawable-xhdpi/index_c.png


BIN
WeiChat/src/main/res/drawable-xhdpi/index_d.png


BIN
WeiChat/src/main/res/drawable-xhdpi/phone.png


BIN
WeiChat/src/main/res/drawable-xhdpi/qiyetongxunlu.png


BIN
WeiChat/src/main/res/drawable-xhdpi/qunliao.png


BIN
WeiChat/src/main/res/drawable-xhdpi/uuhaoyou.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/guanzhu.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/phone.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/qiyetongxunlu.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/qunliao.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/uuhaoyou.png


+ 2 - 1
WeiChat/src/main/res/layout/activity_ad.xml

@@ -10,7 +10,8 @@
 
     <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:visibility="gone">
 
         <RadioGroup
             android:id="@+id/rg"

+ 0 - 17
WeiChat/src/main/res/layout/activity_main.xml

@@ -1,17 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:fitsSystemWindows="true">
-    <FrameLayout
-        android:id="@+id/main_content"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_above="@+id/main_tab_radio_group" >
-    </FrameLayout>
-    <include
-        android:id="@+id/main_tab_radio_group"
-        android:layout_width="match_parent"
-        android:layout_height="60dp"
-        android:layout_alignParentBottom="true"
-        layout="@layout/layout_main_tab_radio_group" />
-</RelativeLayout>

+ 1 - 1
WeiChat/src/main/res/layout/contact_item.xml

@@ -3,7 +3,7 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:paddingBottom="10dp"
-    android:background="@drawable/selector_me_menu_item_bg"
+    android:background="@drawable/selector_item_white_pass"
     >
 
     <View

+ 0 - 85
WeiChat/src/main/res/layout/fragment_message.xml

@@ -1,85 +0,0 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="#ebe9e9"
-    android:orientation="vertical">
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="48dp"
-        android:background="@drawable/bg_bar"
-        android:orientation="horizontal"
-        android:paddingBottom="5dp"
-        android:paddingLeft="15dp"
-        android:paddingRight="15dp"
-        android:paddingTop="5dp">
-
-        <com.core.widget.ClearEditText
-            android:id="@+id/search_edit"
-            android:layout_width="fill_parent"
-            android:layout_height="fill_parent"
-            android:layout_centerVertical="true"
-            android:background="@drawable/search_input"
-            android:drawableLeft="@drawable/search"
-            android:drawableRight="@drawable/search_clear"
-            android:hint="@string/search"
-            android:textColor="@color/dark_grey"
-            android:textColorHint="@color/grey"
-            android:textSize="15sp" />
-
-        <ImageView
-            android:id="@+id/voice_search_iv"
-            android:layout_width="20dp"
-            android:layout_height="20dp"
-            android:layout_alignParentRight="true"
-            android:layout_alignRight="@+id/search_edit"
-            android:layout_marginRight="25dp"
-            android:layout_marginTop="8dp"
-            android:background="@drawable/btn_yuyin_nor"
-            android:visibility="visible" />
-    </RelativeLayout>
-
-    <com.core.widget.DrawableCenterTextView
-        android:id="@+id/message_net_set"
-        android:layout_width="match_parent"
-        android:layout_height="35dp"
-        android:background="#fcd8d8"
-        android:drawableLeft="@drawable/ic_net_noticce"
-        android:drawablePadding="10dp"
-        android:gravity="center_vertical"
-        android:text="当前网络不可用,请检查您的网络设置"
-        android:textColor="@color/black"
-        android:visibility="gone" />
-
-    <com.xzjmyk.pm.activity.view.PullToRefreshSlideListView xmlns:slide="http://schemas.android.com/apk/res-auto"
-        android:id="@+id/pull_refresh_list"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="#ebe9e9"
-        android:hardwareAccelerated="false"
-        android:layerType="software"
-        app:ptrAnimationStyle="flip"
-        app:ptrDrawableEnd="@drawable/default_ptr_rotate"
-        app:ptrDrawableStart="@drawable/default_ptr_flip"
-        app:ptrHeaderTextColor="@color/black"
-        app:ptrMode="both"
-        app:ptrOverScroll="false"
-        app:ptrScrollingWhileRefreshingEnabled="true"
-        app:ptrShowIndicator="false"
-        slide:slideAnimationTime="200"
-        slide:slideLeftAction="scroll"
-        slide:slideMode="right"
-        slide:slideRightAction="scroll" />
-
-    <com.handmark.pulltorefresh.library.PullToRefreshListView
-        android:id="@+id/pull_newmessages_list"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/seach_top"
-        android:background="@color/item_line"
-        android:dividerHeight="2px"
-        android:scrollbars="none">
-
-    </com.handmark.pulltorefresh.library.PullToRefreshListView>
-</LinearLayout>

+ 64 - 53
WeiChat/src/main/res/layout/fragment_new_message.xml

@@ -1,73 +1,84 @@
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:slide="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="#ebe9e9"
-    xmlns:slide="http://schemas.android.com/apk/res-auto"
     android:orientation="vertical">
 
     <com.core.widget.VoiceSearchView
         android:id="@+id/voiceSearchView"
         android:layout_width="match_parent"
-        android:layout_height="48dp"/>
+        android:layout_height="48dp"
+        android:visibility="gone" />
+
+    <!--<com.handmark.pulltorefresh.library.PullToRefreshScrollView-->
+    <!--android:id="@+id/pullScrollView"-->
+    <!--slide:slideAnimationTime="200"-->
+    <!--slide:slideLeftAction="scroll"-->
+    <!--slide:slideMode="right"-->
+    <!--slide:slideRightAction="scroll"-->
+    <!--android:layout_width="match_parent"-->
+    <!--android:layout_height="match_parent"-->
+    <!--android:background="@color/transparent"-->
+    <!--android:divider="@color/item_line"-->
+    <!--android:dividerHeight="@dimen/line"-->
+    <!--slide:ptrAnimationStyle="flip"-->
+    <!--slide:ptrDrawableEnd="@drawable/default_ptr_rotate"-->
+    <!--slide:ptrDrawableStart="@drawable/default_ptr_flip"-->
+    <!--slide:ptrHeaderTextColor="@color/black"-->
+    <!--slide:ptrOverScroll="false"-->
+    <!--slide:ptrScrollingWhileRefreshingEnabled="true"-->
+    <!--slide:ptrShowIndicator="false">-->
 
-    <com.handmark.pulltorefresh.library.PullToRefreshScrollView
-        android:id="@+id/pullScrollView"
-        slide:slideAnimationTime="200"
-        slide:slideLeftAction="scroll"
-        slide:slideMode="right"
-        slide:slideRightAction="scroll"
+    <com.modular.appmessages.widget.SignRefreshLayout
+        android:id="@+id/mSignRefreshLayout"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@color/transparent"
-        android:divider="@color/item_line"
-        android:dividerHeight="@dimen/line"
-        slide:ptrAnimationStyle="flip"
-        slide:ptrDrawableEnd="@drawable/default_ptr_rotate"
-        slide:ptrDrawableStart="@drawable/default_ptr_flip"
-        slide:ptrHeaderTextColor="@color/black"
-        slide:ptrOverScroll="false"
-        slide:ptrScrollingWhileRefreshingEnabled="true"
-        slide:ptrShowIndicator="false">
+        android:layout_height="match_parent">
 
-        <LinearLayout
+        <ScrollView
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="vertical">
+            android:layout_height="match_parent">
 
-
-            <com.core.widget.DrawableCenterTextView
-                android:id="@+id/message_net_set"
+            <LinearLayout
                 android:layout_width="match_parent"
-                android:layout_height="35dp"
-                android:background="#fcd8d8"
-                android:drawableLeft="@drawable/ic_net_noticce"
-                android:drawablePadding="10dp"
-                android:gravity="center_vertical"
-                android:text="当前网络不可用,请检查您的网络设置"
-                android:textColor="@color/black"
-                android:visibility="gone"/>
+                android:layout_height="match_parent"
+                android:orientation="vertical">
 
-            <com.core.widget.MyListView
-                android:id="@+id/headerLV"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:divider="@color/item_line"
-                android:dividerHeight="@dimen/line"/>
 
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/line"
-                android:background="@color/item_line"/>
+                <com.core.widget.DrawableCenterTextView
+                    android:id="@+id/message_net_set"
+                    android:layout_width="match_parent"
+                    android:layout_height="35dp"
+                    android:background="#fcd8d8"
+                    android:drawableLeft="@drawable/ic_net_noticce"
+                    android:drawablePadding="10dp"
+                    android:gravity="center_vertical"
+                    android:text="当前网络不可用,请检查您的网络设置"
+                    android:textColor="@color/black"
+                    android:visibility="gone" />
 
-            <com.core.widget.MyListView
-                android:id="@+id/contentLV"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:divider="@color/item_line"
-                android:dividerHeight="@dimen/line"/>
+                <com.core.widget.MyListView
+                    android:id="@+id/headerLV"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:dividerHeight="5dp" />
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="5dp"
+                    android:id="@+id/handerAndContentLine" />
+
+                <com.core.widget.MyListView
+                    android:id="@+id/contentLV"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:dividerHeight="5dp" />
+
+
+            </LinearLayout>
 
+        </ScrollView>
+    </com.modular.appmessages.widget.SignRefreshLayout>
 
-        </LinearLayout>
-    </com.handmark.pulltorefresh.library.PullToRefreshScrollView>
+    <!--</com.handmark.pulltorefresh.library.PullToRefreshScrollView>-->
 </LinearLayout>

+ 9 - 5
WeiChat/src/main/res/layout/header_fragment_contact.xml

@@ -2,7 +2,7 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/me_menu_item_normal"
+    android:background="@color/white"
     android:orientation="vertical">
 
     <com.core.widget.VoiceSearchView
@@ -23,8 +23,9 @@
             android:layout_weight="1"
             android:drawableTop="@drawable/qiyetongxunlu"
             android:gravity="center"
+            android:textColor="#333333"
             android:text="@string/contact_company"
-            android:textSize="16sp"/>
+            android:textSize="12sp"/>
 
         <TextView
             android:id="@+id/group"
@@ -33,7 +34,8 @@
             android:layout_weight="1"
             android:drawableTop="@drawable/qunliao"
             android:gravity="center"
-            android:textSize="16sp"
+            android:textSize="12sp"
+            android:textColor="#333333"
             android:text="@string/contact_business" />
 
         <RelativeLayout
@@ -47,7 +49,8 @@
                 android:drawableTop="@drawable/uuhaoyou"
                 android:gravity="center"
                 android:text="@string/contact_friend"
-                android:textSize="16sp"/>
+                android:textSize="12sp"
+                android:textColor="#333333"/>
             <TextView
                 android:id="@+id/tv_uu_new"
                 android:layout_width="10dp"
@@ -69,7 +72,8 @@
             android:drawableTop="@drawable/guanzhu"
             android:gravity="center"
             android:text="@string/contact_often"
-            android:textSize="16sp"/>
+            android:textSize="12sp"
+            android:textColor="#333333"/>
     </LinearLayout>
 
     <View

+ 2 - 0
WeiChat/src/main/res/values/colors.xml

@@ -328,4 +328,6 @@
     <color name="selected_day_text">#fff2f2f2</color>
     <color name="new_waitting_approvel">#F4A460</color>
 
+    <color name="message_not_sign_time">#8AB8D9</color>
+
 </resources>

+ 9 - 0
WeiChat/src/main/res/values/styles.xml

@@ -38,6 +38,15 @@
         <item name="styleLoadingLayout">@style/LoadingLayoutStyle</item>
     </style>
 
+    <style name="MainBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
+        <item name="android:buttonStyle">@android:style/Widget.Button</item>
+        <item name="android:windowAnimationStyle">@style/IMAnimationStyle</item>
+        <item name="android:listViewStyle">@style/IMListView</item>
+        <item name="homeAsUpIndicator">@drawable/actionbar_up_indicator</item>
+        <item name="android:windowDisablePreview">true</item>
+        <item name="styleLoadingLayout">@style/LoadingLayoutStyle</item>
+    </style>
+
 
     <!-- Application theme. -->
     <style name="AppTheme" parent="AppBaseTheme">

+ 10 - 0
app_core/common/src/main/assets/work_menu.json

@@ -6,6 +6,16 @@
     "moduleId": "",
     "moduleVisible": true,
     "moduleList": [
+      {
+        "isLocalMenu": true,
+        "menuName": "产城服务",
+        "menuIcon": "ic_work_city_industry_service",
+        "menuActivity": "com.modular.cityIndustry.CityIndustryServiceMainActivity",
+        "menuTag": "local_city_industry",
+        "menuUrl": "",
+        "caller": "",
+        "isHide": false
+      },
       {
         "isLocalMenu": true,
         "menuName": "str_work_subscribe_secretary",

+ 5 - 0
app_core/common/src/main/java/com/common/data/DateFormatUtil.java

@@ -1,5 +1,7 @@
 package com.common.data;
 
+import android.text.TextUtils;
+
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
@@ -43,6 +45,9 @@ public class DateFormatUtil {
     }
 
     public static long str2Long(String time, String format) {
+        if (TextUtils.isEmpty(time)){
+            return 0;
+        }
         SimpleDateFormat s = new SimpleDateFormat(format);
         try {
             return s.parse(time).getTime();

+ 223 - 0
app_core/common/src/main/java/com/core/base/SupportToolBarActivity.java

@@ -0,0 +1,223 @@
+package com.core.base;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.support.annotation.LayoutRes;
+import android.support.annotation.Nullable;
+import android.support.v7.widget.Toolbar;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewStub;
+import android.widget.FrameLayout;
+import android.widget.TextView;
+
+import com.core.app.R;
+import com.core.utils.StatusBarUtil;
+import com.core.utils.ToastUtil;
+
+/**
+ * Created by Bitlike on 2018/5/3.
+ */
+
+public class SupportToolBarActivity extends BaseActivity {
+    private FrameLayout contentFl;
+    private Toolbar commonToolBar;
+    private TextView commonTitleTv;
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        super.setContentView(R.layout.base_bar_layout);
+        contentFl = findViewById(R.id.contentFl);
+        if (needCommonToolBar()) {
+            initCommonToolbar();
+        }
+    }
+
+    public void initCommonToolbar() {
+        ViewStub stub = findViewById(R.id.toolbarVs);
+        stub.inflate();
+        commonToolBar = findViewById(R.id.commonToolBar);
+        commonTitleTv = findViewById(R.id.commonTitleTv);
+        if (commonToolBar != null) {
+            StatusBarUtil.immersive(this, 0x00000000, 0.0f);
+            setSupportActionBar(commonToolBar);
+            getSupportActionBar().setDisplayShowTitleEnabled(false);
+            StatusBarUtil.setPaddingSmart(this, commonToolBar);
+        }
+        if (needNavigation()) {
+            setNavigation(0, null, null);
+        }
+        commonTitleTv.setText(getTitle());
+    }
+
+    /**
+     * 初始化导航键
+     *
+     * @param iconId          返回图标(优先)
+     * @param icon            返回图标(当iconId小于0时)
+     * @param onClickListener 导航键监听事件
+     */
+    public final void setNavigation(int iconId, Drawable icon, View.OnClickListener onClickListener) {
+        if (iconId > 0) {
+            commonToolBar.setNavigationIcon(iconId);
+        } else if (icon != null) {
+            commonToolBar.setNavigationIcon(icon);
+        } else {
+            commonToolBar.setNavigationIcon(R.drawable.ic_baseutil_back);
+        }
+        if (onClickListener == null) {
+            onClickListener = new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    onBackPressed();
+                }
+            };
+        }
+        //设置返回按钮的点击事件
+        commonToolBar.setNavigationOnClickListener(onClickListener);
+        setToolBarMenuClickListener(null);
+    }
+
+    //是否需要返回键
+    public boolean needNavigation() {
+        return true;
+    }
+
+    //是否需要通用的toolbar
+    public boolean needCommonToolBar() {
+        return true;
+    }
+
+    /*隐藏toolbar*/
+    protected final void hideToolBar() {
+        if (commonToolBar != null) {
+            commonToolBar.setVisibility(View.GONE);
+        }
+    }
+
+    /*显示toolbar*/
+    public final void showToolBar() {
+        if (commonToolBar != null && commonToolBar.getVisibility() == View.GONE) {
+            commonToolBar.setVisibility(View.VISIBLE);
+        }
+    }
+
+    /*设置toolbar的点击监听器*/
+    public final void setToolBarMenuClickListener(Toolbar.OnMenuItemClickListener onclick) {
+        if (commonToolBar != null) {
+            if (onclick == null) {
+                onclick = new Toolbar.OnMenuItemClickListener() {
+                    @Override
+                    public boolean onMenuItemClick(MenuItem item) {
+                        onOptionsItemSelected(item);
+                        return false;
+                    }
+                };
+            }
+            commonToolBar.setOnMenuItemClickListener(onclick);
+        }
+    }
+
+    /*设置标题*/
+    public final void setTitle(CharSequence title) {
+        super.setTitle(title);
+        if (!TextUtils.isEmpty(title)) {
+            if (commonTitleTv != null) {
+                commonTitleTv.setText(title);
+            }
+            getSupportActionBar().setTitle(title);
+        }
+    }
+
+    /**
+     * 更改为自定义的ToolBar,此时默认的Toobar将会制空
+     * TODO 存在问题:前面如果设置的返回键监听事件会失效
+     *
+     * @param toolBarId 当前布局里toolbar的资源id
+     * @return 返回新的Toobar
+     */
+    public final Toolbar updataToolBar(int toolBarId) {
+        Drawable navigationIcon = null;
+        if (commonToolBar != null) {
+            if (needNavigation()) {
+                navigationIcon = commonToolBar.getNavigationIcon();
+            }
+        }
+        commonToolBar = contentFl.findViewById(toolBarId);
+        if (commonToolBar != null) {
+            setSupportActionBar(commonToolBar);
+            //设置actionBar的标题是否显示,对应ActionBar.DISPLAY_SHOW_TITLE。
+            getSupportActionBar().setDisplayShowTitleEnabled(false);
+            if (needNavigation()) {
+                setNavigation(0, navigationIcon, null);
+            }
+        }
+        return commonToolBar;
+    }
+
+
+    @Override
+    public void setContentView(View contentView) {
+        setContentView(contentView, null);
+    }
+
+    @SuppressLint("ResourceType")
+    @Override
+    public void setContentView(@LayoutRes int layoutId) {
+        if (layoutId > 0) {
+            if (contentFl != null) {
+                LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+                inflater.inflate(layoutId, contentFl);
+            } else {
+                super.setContentView(layoutId);
+            }
+        }
+    }
+
+    @Override
+    public void setContentView(View contentView, ViewGroup.LayoutParams params) {
+        if (contentView != null) {
+            if (contentFl != null) {
+                contentFl.removeAllViews();
+                if (params == null) {
+                    params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
+                            ViewGroup.LayoutParams.MATCH_PARENT);
+                }
+                contentFl.addView(contentView, params);
+            } else {
+                super.setContentView(contentView);
+            }
+        }
+    }
+
+
+    public void showToast(CharSequence message) {
+        if (contentFl != null && !TextUtils.isEmpty(message)) {
+            ToastUtil.showToast(this, message, contentFl);
+        } else {
+            ToastUtil.showToast(this, message);
+        }
+    }
+
+    public void showToast(int messageId) {
+        if (contentFl != null && messageId != 0) {
+            ToastUtil.showToast(this, messageId, contentFl);
+        } else {
+            ToastUtil.showToast(this, messageId);
+        }
+    }
+
+    public FrameLayout getContentFl() {
+        return contentFl;
+    }
+
+    public Toolbar getCommonToolBar() {
+        return commonToolBar;
+    }
+}

+ 3 - 1
app_core/common/src/main/java/com/core/utils/BaiduMapUtil.java

@@ -151,7 +151,9 @@ public class BaiduMapUtil {
                 String chche = BaiduMapUtil.getInstence().getDistance(bean.getLongitude(),
                         bean.getLatitude(), helper.getLatitude(), helper.getLongitude());
                 dis = Float.valueOf(chche);
-                if (dis < bean.getValidrange()) return dis;
+                if (dis < bean.getValidrange()){
+                    return dis;
+                }
             }
             return 0;
         } catch (NumberFormatException e) {

+ 18 - 7
app_core/common/src/main/java/com/core/utils/ToastUtil.java

@@ -4,6 +4,7 @@ import android.app.Activity;
 import android.content.Context;
 import android.graphics.Color;
 import android.text.Editable;
+import android.text.TextUtils;
 import android.text.TextWatcher;
 import android.util.Log;
 import android.view.Gravity;
@@ -12,8 +13,8 @@ import android.widget.EditText;
 import android.widget.TextView;
 import android.widget.Toast;
 
-import com.common.data.StringUtil;
 import com.core.app.R;
+import com.core.base.SupportToolBarActivity;
 import com.core.widget.crouton.Crouton;
 import com.core.widget.crouton.Style;
 
@@ -79,22 +80,32 @@ public class ToastUtil {
         showToast(context, R.string.data_exception);
     }
 
-    public static void showToast(Context context, String message) {
-        if (context == null || StringUtil.isEmpty(message)) {
+    public static void showToast(Context context, CharSequence message) {
+        if (context == null || TextUtils.isEmpty(message)) {
             return;
         }
-        Crouton.makeText(context, message);
+        ViewGroup vg = null;
+        if (context instanceof SupportToolBarActivity) {
+            vg = ((SupportToolBarActivity) context).getContentFl();
+        }
+        if (vg != null) {
+            showToast(context, message, vg);
+        } else {
+            Crouton.makeText(context, message);
+        }
+
+
     }
 
     public static void showToast(Context context, int resId) {
         if (context == null) {
             return;
         }
-        Crouton.makeText(context, context.getString(resId));
+        showToast(context,context.getString(resId));
     }
 
-    public static void showToast(Context context, String message, ViewGroup viewGroup) {
-        if (context == null || StringUtil.isEmpty(message)) {
+    public static void showToast(Context context, CharSequence message, ViewGroup viewGroup) {
+        if (context == null || TextUtils.isEmpty(message)) {
             return;
         }
         Crouton.makeText((Activity) context, message, Style.holoGreenLight, 1000, viewGroup).show();

+ 11 - 0
app_core/common/src/main/java/com/core/widget/StrengthView.java

@@ -0,0 +1,11 @@
+package com.core.widget;
+
+import android.view.View;
+
+/**
+ * @author RaoMeng
+ * @describe
+ * @date 2018/5/6 21:38
+ */
+public class StrengthView extends View {
+}

+ 1 - 1
app_core/common/src/main/java/com/core/widget/crouton/Crouton.java

@@ -195,7 +195,7 @@ public final class Crouton {
             makeText((Activity) ct, message, ct.getResources().getColor(color), 1000).show();
     }
 
-    public static void makeText(Context ct, String message) {
+    public static void makeText(Context ct, CharSequence message) {
         try {
             makeText((Activity) ct, message, Style.holoGreenLight, 1000).show();
         } catch (Exception e) {

BIN
app_core/common/src/main/res/drawable-hdpi/common_toolbar_bg.png


BIN
app_core/common/src/main/res/drawable-hdpi/common_toolbar_message_bg.png


BIN
app_core/common/src/main/res/drawable-xhdpi/common_toolbar_bg.png


BIN
app_core/common/src/main/res/drawable-xhdpi/common_toolbar_message_bg.png


BIN
app_core/common/src/main/res/drawable-xxhdpi/common_toolbar_bg.png


BIN
app_core/common/src/main/res/drawable-xxhdpi/common_toolbar_message_bg.png


+ 4 - 0
app_core/common/src/main/res/drawable/ic_baseutil_back.xml

@@ -0,0 +1,4 @@
+<vector android:height="24dp" android:viewportHeight="1024.0"
+    android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#FFFFFF" android:pathData="M363.8,473C336.9,497.4 337.3,537.5 364.7,561.5L674,832.1C682.8,839.8 696.3,838.9 704.1,830 711.8,821.2 710.9,807.7 702,799.9L392.8,529.4C384.6,522.2 384.5,511.8 392.5,504.6L702.3,223.8C711.1,215.9 711.7,202.4 703.8,193.7 695.9,184.9 682.4,184.3 673.7,192.2L363.8,473Z"/>
+</vector>

+ 8 - 0
app_core/common/src/main/res/drawable/selector_item_white_pass.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@color/me_menu_item_press" android:state_checked="true"/>
+    <item android:drawable="@color/me_menu_item_press" android:state_pressed="true"/>
+    <item android:drawable="@color/me_menu_item_press" android:state_selected="true"/>
+
+    <item android:drawable="@color/white"/>
+</selector>

+ 7 - 6
app_core/common/src/main/res/layout/activity_main.xml

@@ -1,17 +1,18 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:fitsSystemWindows="true">
+    android:layout_height="match_parent">
+
     <FrameLayout
         android:id="@+id/main_content"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_above="@+id/main_tab_radio_group" >
-    </FrameLayout>
+        android:layout_above="@+id/main_tab_radio_group"
+      />
+
     <include
         android:id="@+id/main_tab_radio_group"
+        layout="@layout/layout_main_tab_radio_group"
         android:layout_width="match_parent"
         android:layout_height="60dp"
-        android:layout_alignParentBottom="true"
-        layout="@layout/layout_main_tab_radio_group" />
+        android:layout_alignParentBottom="true" />
 </RelativeLayout>

+ 20 - 0
app_core/common/src/main/res/layout/base_bar_layout.xml

@@ -0,0 +1,20 @@
+<?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="match_parent"
+    android:orientation="vertical">
+
+    <ViewStub
+        android:id="@+id/toolbarVs"
+        android:layout_width="match_parent"
+        android:layout_height="?attr/actionBarSize"
+        android:layout="@layout/common_toolbar" />
+
+    <FrameLayout
+        android:id="@+id/contentFl"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="horizontal" />
+
+
+</LinearLayout>

+ 16 - 0
app_core/common/src/main/res/layout/common_toolbar.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/commonToolBar"
+    android:layout_width="match_parent"
+    android:layout_height="?attr/actionBarSize"
+    android:background="@drawable/common_toolbar_bg">
+
+    <TextView
+        android:id="@+id/commonTitleTv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="left|center_vertical"
+        android:text="@string/app_name"
+        android:textColor="@color/white"
+        android:textSize="18sp" />
+</android.support.v7.widget.Toolbar>

+ 1 - 1
app_core/common/src/main/res/layout/contact_item.xml

@@ -3,7 +3,7 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:paddingBottom="10dp"
-    android:background="@drawable/selector_me_menu_item_bg">
+    android:background="@drawable/selector_item_white_pass">
 
     <View
         android:layout_width="match_parent"

+ 15 - 2
app_core/common/src/main/res/layout/fragment_contacts.xml

@@ -9,9 +9,22 @@
         style="@style/normalListView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:dividerHeight="@dimen/line"
+        android:background="@color/transparent"
         android:divider="@color/item_line"
-        android:background="@color/transparent" />
+        android:dividerHeight="@dimen/line"
+        android:visibility="gone" />
+
+    <com.yalantis.phoenix.PullToRefreshView
+        android:id="@+id/contact_ptrv"
+        style="@style/ListViewBasic">
+
+        <se.emilsjolander.stickylistheaders.StickyListHeadersListView
+            android:id="@+id/pull_refresh_list"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+
+    </com.yalantis.phoenix.PullToRefreshView>
+
 
     <TextView
         android:id="@+id/dialogTV"

+ 0 - 85
app_core/common/src/main/res/layout/fragment_message.xml

@@ -1,85 +0,0 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="#ebe9e9"
-    android:orientation="vertical">
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="48dp"
-        android:background="@drawable/bg_bar"
-        android:orientation="horizontal"
-        android:paddingBottom="5dp"
-        android:paddingLeft="15dp"
-        android:paddingRight="15dp"
-        android:paddingTop="5dp">
-
-        <com.xzjmyk.pm.activity.view.ClearEditText
-            android:id="@+id/search_edit"
-            android:layout_width="fill_parent"
-            android:layout_height="fill_parent"
-            android:layout_centerVertical="true"
-            android:background="@drawable/search_input"
-            android:drawableLeft="@drawable/search"
-            android:drawableRight="@drawable/search_clear"
-            android:hint="@string/search"
-            android:textColor="@color/dark_grey"
-            android:textColorHint="@color/grey"
-            android:textSize="15sp" />
-
-        <ImageView
-            android:id="@+id/voice_search_iv"
-            android:layout_width="20dp"
-            android:layout_height="20dp"
-            android:layout_alignParentRight="true"
-            android:layout_alignRight="@+id/search_edit"
-            android:layout_marginRight="25dp"
-            android:layout_marginTop="8dp"
-            android:background="@drawable/btn_yuyin_nor"
-            android:visibility="visible" />
-    </RelativeLayout>
-
-    <com.core.widget.DrawableCenterTextView
-        android:id="@+id/message_net_set"
-        android:layout_width="match_parent"
-        android:layout_height="35dp"
-        android:background="#fcd8d8"
-        android:drawableLeft="@drawable/ic_net_noticce"
-        android:drawablePadding="10dp"
-        android:gravity="center_vertical"
-        android:text="当前网络不可用,请检查您的网络设置"
-        android:textColor="@color/black"
-        android:visibility="gone" />
-
-    <com.xzjmyk.pm.activity.view.PullToRefreshSlideListView xmlns:slide="http://schemas.android.com/apk/res-auto"
-        android:id="@+id/pull_refresh_list"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="#ebe9e9"
-        android:hardwareAccelerated="false"
-        android:layerType="software"
-        app:ptrAnimationStyle="flip"
-        app:ptrDrawableEnd="@drawable/default_ptr_rotate"
-        app:ptrDrawableStart="@drawable/default_ptr_flip"
-        app:ptrHeaderTextColor="@color/black"
-        app:ptrMode="both"
-        app:ptrOverScroll="false"
-        app:ptrScrollingWhileRefreshingEnabled="true"
-        app:ptrShowIndicator="false"
-        slide:slideAnimationTime="200"
-        slide:slideLeftAction="scroll"
-        slide:slideMode="right"
-        slide:slideRightAction="scroll" />
-
-    <com.handmark.pulltorefresh.library.PullToRefreshListView
-        android:id="@+id/pull_newmessages_list"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/seach_top"
-        android:background="@color/item_line"
-        android:dividerHeight="2px"
-        android:scrollbars="none">
-
-    </com.handmark.pulltorefresh.library.PullToRefreshListView>
-</LinearLayout>

+ 1 - 1
app_core/common/src/main/res/layout/header_fragment_contact.xml

@@ -2,7 +2,7 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="@color/me_menu_item_normal"
+    android:background="@color/white"
     android:orientation="vertical">
 
     <com.core.widget.VoiceSearchView

+ 15 - 0
app_core/common/src/main/res/layout/include_toolbar.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/common_toolbar"
+    android:layout_width="match_parent"
+    android:background="@drawable/common_toolbar_message_bg"
+    android:layout_height="?attr/actionBarSize">
+
+    <TextView
+        android:id="@+id/common_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/app_name"
+        android:textColor="@color/cadetblue" />
+
+</android.support.v7.widget.Toolbar>

+ 8 - 8
app_core/common/src/main/res/layout/item_message.xml

@@ -2,7 +2,7 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="@dimen/item_height"
-    android:background="@drawable/selector_me_menu_item_bg"
+    android:background="@drawable/selector_item_white_pass"
     android:descendantFocusability="blocksDescendants"
     android:minHeight="@dimen/item_height"
     android:paddingLeft="15dp"
@@ -14,7 +14,7 @@
         android:layout_height="65dp"
         android:layout_centerVertical="true">
 
-        <ImageView
+        <de.hdodenhof.circleimageview.CircleImageView
             android:id="@+id/avatar_img"
             android:layout_width="@dimen/item_img_height"
             android:layout_height="@dimen/item_img_width"
@@ -52,8 +52,8 @@
             android:ellipsize="end"
             android:lines="1"
             android:text="我的审批"
-            android:textColor="@color/text_main"
-            android:textSize="16sp" />
+            android:textColor="#333333"
+            android:textSize="15sp" />
 
         <TextView
             android:id="@+id/time_tv"
@@ -61,8 +61,8 @@
             android:layout_height="wrap_content"
             android:layout_alignParentRight="true"
             android:ellipsize="end"
-            android:textColor="@color/text_hine"
-            android:textSize="14sp" />
+            android:textColor="#999999"
+            android:textSize="10sp" />
 
         <TextView
             android:id="@+id/content_tv"
@@ -72,8 +72,8 @@
             android:layout_marginTop="8dp"
             android:ellipsize="end"
             android:lines="1"
-            android:textColor="@color/text_hine"
-            android:textSize="14sp" />
+            android:textColor="#999999"
+            android:textSize="12sp" />
     </RelativeLayout>
 
 </RelativeLayout>

+ 2 - 2
app_core/message/src/main/java/com/me/message/imp/BaseToastImpl.java

@@ -75,8 +75,8 @@ public class BaseToastImpl implements BaseToast {
         if (ct == null) ct = Utils.getContext();
         NotificationManager mNotificationManager = (NotificationManager) ct.getSystemService(Context.NOTIFICATION_SERVICE);
         NotificationCompat.Builder builder = new NotificationCompat.Builder(ct.getApplicationContext());
-        builder.setSmallIcon(R.drawable.uuu);
-        builder.setLargeIcon(BitmapFactory.decodeResource(ct.getResources(), R.drawable.uuu)); // 设置下拉列表中的图标(大图标)
+        builder.setSmallIcon(0);
+        builder.setLargeIcon(BitmapFactory.decodeResource(ct.getResources(),0)); // 设置下拉列表中的图标(大图标)
         builder.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE);
         builder.setAutoCancel(true);
         builder.setContentTitle(title);

+ 2 - 2
app_modular/appcontact/src/main/java/com/uas/appcontact/adapter/FriendSortAdapter.java

@@ -18,10 +18,8 @@ import com.core.model.Friend;
 import com.core.utils.helper.AvatarHelper;
 import com.core.utils.sortlist.BaseSortModel;
 import com.core.widget.crouton.Crouton;
-import com.core.xmpp.FriendHelper;
 import com.uas.appcontact.R;
 import com.uas.appcontact.db.TopContactsDao;
-import com.uas.appcontact.ui.widget.stickylistheaders.StickyListHeadersAdapter;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -30,6 +28,8 @@ import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import se.emilsjolander.stickylistheaders.StickyListHeadersAdapter;
+
 
 public class FriendSortAdapter extends BaseAdapter implements SectionIndexer,StickyListHeadersAdapter {
 

+ 28 - 15
app_modular/appcontact/src/main/java/com/uas/appcontact/ui/fragment/ContactsFragment.java

@@ -55,23 +55,29 @@ import com.uas.appcontact.ui.activity.MyFriendActivity;
 import com.uas.appcontact.ui.activity.NewFriendActivity;
 import com.uas.appcontact.ui.activity.PlatContactAddPeopleActivity;
 import com.uas.appcontact.ui.activity.UserSearchActivity;
+import com.yalantis.phoenix.PullToRefreshView;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import se.emilsjolander.stickylistheaders.StickyListHeadersListView;
+
 /**
  * Created by Bitliker on 2017/9/1.
  */
 
 public class ContactsFragment extends EasyFragment
         implements SideBar.OnTouchingLetterChangedListener
-        , PullToRefreshBase.OnRefreshListener<ListView>
+        , PullToRefreshView.OnRefreshListener
         , AdapterView.OnItemClickListener
         , View.OnClickListener
         , ContactsManager.OnEmployListener {
 
-    private PullToRefreshListView refreshListView;
+    private StickyListHeadersListView refreshListView;
+    private PullToRefreshView mPullToRefreshView;
+
+
     private TextView dialogTV;
     private TextView uuRedTag;
     private SideBar sidebar;
@@ -157,18 +163,18 @@ public class ContactsFragment extends EasyFragment
         showDatas = new ArrayList<>();
         allDatas = new ArrayList<>();
         userId = MyApplication.getInstance().getLoginUserId();
-        refreshListView = (PullToRefreshListView) findViewById(R.id.refreshListView);
+        refreshListView = (StickyListHeadersListView) findViewById(R.id.pull_refresh_list);
+        mPullToRefreshView = (PullToRefreshView) findViewById(R.id.contact_ptrv);
         dialogTV = (TextView) findViewById(R.id.dialogTV);
         sidebar = (SideBar) findViewById(R.id.sidebar);
         sidebar.setTextView(dialogTV);
         sidebar.setOnTouchingLetterChangedListener(this);
-        refreshListView.setMode(PullToRefreshBase.Mode.PULL_FROM_START);
-        refreshListView.setOnRefreshListener(this);
         refreshListView.setOnItemClickListener(this);
         comparator = new BaseComparator();
         initHeaderView();
         adapter = new FriendSortAdapter(ct, showDatas);
         refreshListView.setAdapter(adapter);
+        mPullToRefreshView.setOnRefreshListener(this);
         loadData();
     }
 
@@ -210,7 +216,7 @@ public class ContactsFragment extends EasyFragment
 
     private void initHeaderView() {
         View headview = LayoutInflater.from(ct).inflate(R.layout.header_fragment_contact, null);
-        refreshListView.getRefreshableView().addHeaderView(headview);
+        refreshListView.addHeaderView(headview);
         voiceSearchView = (VoiceSearchView) headview.findViewById(R.id.voiceSearchView);
         headview.findViewById(R.id.company).setOnClickListener(this);//企业结构
         headview.findViewById(R.id.group).setOnClickListener(this);//商务群
@@ -230,8 +236,8 @@ public class ContactsFragment extends EasyFragment
 
 
     void showLoading() {
-        if (refreshListView!=null) {
-            if (!refreshListView.isRefreshing() && isVisible) {
+        if (mPullToRefreshView != null) {
+            if (!mPullToRefreshView.isRefreshing() && isVisible) {
                 progressDialog.show();
             }
         }
@@ -241,9 +247,9 @@ public class ContactsFragment extends EasyFragment
         if (progressDialog != null && progressDialog.isShowing()) {
             progressDialog.dismiss();
         }
-        if (refreshListView!=null) {
-            if (refreshListView.isRefreshing()) {
-                refreshListView.onRefreshComplete();
+        if (mPullToRefreshView != null) {
+            if (mPullToRefreshView.isRefreshing()) {
+                mPullToRefreshView.setRefreshing(false);
             }
         }
     }//关闭刷新
@@ -264,10 +270,10 @@ public class ContactsFragment extends EasyFragment
         // 该字母首次出现的位置
         int position = adapter.getPositionForSection(s.charAt(0));
         if (position != -1) {
-            refreshListView.getRefreshableView().setSelection(position);
+            refreshListView.setSelection(position);
         }
         if ("↑".equals(s)) {
-            refreshListView.getRefreshableView().setSelection(0);
+            refreshListView.setSelection(0);
         }
     }
 
@@ -277,9 +283,9 @@ public class ContactsFragment extends EasyFragment
     }
 
     @Override
-    public void onRefresh(PullToRefreshBase<ListView> refreshView) {
+    public void onRefresh() {
         if ("1".equals(CommonUtil.getUserRole())) {
-            refreshListView.setRefreshing(false);
+            mPullToRefreshView.setRefreshing(false);
             dimssLoading();
         } else {
             ContactsManager.getInstance().loadContactByNet(this);
@@ -387,6 +393,7 @@ public class ContactsFragment extends EasyFragment
         OAHttpHelper.getInstance().post(new Runnable() {
             @Override
             public void run() {
+                mPullToRefreshView.setRefreshing(false);
                 if (adapter == null) return;
                 adapter.setData(showDatas);
                 dimssLoading();
@@ -394,6 +401,12 @@ public class ContactsFragment extends EasyFragment
         });
     }
 
+    @Override
+    public void onResume() {
+        super.onResume();
+        mPullToRefreshView.setRefreshing(false, false);
+    }
+
     /**
      * 将Rep转化为Friend对象
      *

+ 33 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/fragment/MessageNewFragment.java

@@ -0,0 +1,33 @@
+package com.modular.appmessages.fragment;
+
+import android.os.Bundle;
+import android.support.v7.widget.RecyclerView;
+
+import com.core.base.EasyFragment;
+import com.modular.appmessages.R;
+
+/**
+ * Created by Bitlike on 2018/5/2.
+ */
+
+public class MessageNewFragment extends EasyFragment {
+    private RecyclerView mRecyclerView;
+
+    @Override
+    protected int inflateLayoutId() {
+        return R.layout.fragment_message;
+    }
+
+    @Override
+    protected void onCreateView(Bundle savedInstanceState, boolean createView) {
+        if (createView) {
+            initView();
+        }
+    }
+
+    private void initView() {
+        mRecyclerView = (RecyclerView) findViewById(R.id.messageRecycler);
+    }
+
+
+}

+ 0 - 24
app_modular/appmessages/src/main/java/com/modular/appmessages/model/MessageModel.java

@@ -1,24 +0,0 @@
-package com.modular.appmessages.model;
-
-import android.content.Context;
-import android.content.Intent;
-
-/**
- * Created by Bitlike on 2017/12/15.
- */
-
-public class MessageModel<T> {
-    private int type;//0.头文件  1.正常数据
-    private int imageId;//头像图片
-    private int unRedNum;//未阅读的个数
-    private long lastTime;//最后一条消息时间
-    private String imageUrl;//头像网址
-    private String title;//标题
-    private String summary;//简介
-    private String remindAble;//是否显示提醒
-    private String remindMessage;//提醒的信息
-    private Class cazz;
-    private T t;
-
-
-}

+ 109 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/model/MessageNew.java

@@ -0,0 +1,109 @@
+package com.modular.appmessages.model;
+
+/**
+ * 新UI的消息对象
+ * Created by Bitlike on 2018/5/2.
+ */
+
+public class MessageNew<T> {
+    private int type;//0.头文件  1.正常数据
+    private int imageId;//头像图片(本地资源)
+    private int unRedNum;//未阅读的个数
+    private long lastTime;//最后一条消息时间
+    private String imageUrl;//头像网址
+    private String title;//标题
+    private String summary;//简介
+    private String remindAble;//是否显示提醒
+    private String remindMessage;//提醒的信息
+    private Class cazz;
+    private T t;
+
+
+    public int getType() {
+        return type;
+    }
+
+    public void setType(int type) {
+        this.type = type;
+    }
+
+    public int getImageId() {
+        return imageId;
+    }
+
+    public void setImageId(int imageId) {
+        this.imageId = imageId;
+    }
+
+    public int getUnRedNum() {
+        return unRedNum;
+    }
+
+    public void setUnRedNum(int unRedNum) {
+        this.unRedNum = unRedNum;
+    }
+
+    public long getLastTime() {
+        return lastTime;
+    }
+
+    public void setLastTime(long lastTime) {
+        this.lastTime = lastTime;
+    }
+
+    public String getImageUrl() {
+        return imageUrl;
+    }
+
+    public void setImageUrl(String imageUrl) {
+        this.imageUrl = imageUrl;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getSummary() {
+        return summary;
+    }
+
+    public void setSummary(String summary) {
+        this.summary = summary;
+    }
+
+    public String getRemindAble() {
+        return remindAble;
+    }
+
+    public void setRemindAble(String remindAble) {
+        this.remindAble = remindAble;
+    }
+
+    public String getRemindMessage() {
+        return remindMessage;
+    }
+
+    public void setRemindMessage(String remindMessage) {
+        this.remindMessage = remindMessage;
+    }
+
+    public Class getCazz() {
+        return cazz;
+    }
+
+    public void setCazz(Class cazz) {
+        this.cazz = cazz;
+    }
+
+    public T getT() {
+        return t;
+    }
+
+    public void setT(T t) {
+        this.t = t;
+    }
+}

+ 23 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/MessageNewPresenter.java

@@ -0,0 +1,23 @@
+package com.modular.appmessages.presenter;
+
+
+import com.modular.appmessages.model.MessageNew;
+
+import java.util.List;
+
+/**
+ * Created by Bitlike on 2018/5/2.
+ */
+
+public class MessageNewPresenter {
+
+    private List<MessageNew> headerModels;
+
+
+
+
+
+
+
+
+}

+ 48 - 14
app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/MessagePresenter.java

@@ -13,6 +13,7 @@ import android.text.TextUtils;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.common.LogUtil;
 import com.common.data.DateFormatUtil;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
@@ -28,16 +29,21 @@ import com.core.app.MyApplication;
 import com.core.broadcast.MsgBroadcast;
 import com.core.dao.MessageDao;
 import com.core.dao.UUHelperDao;
+import com.core.dao.UserDao;
+import com.core.dao.work.WorkModelDao;
 import com.core.model.Friend;
 import com.core.model.MessageModel;
 import com.core.model.OAConfig;
 import com.core.model.UUHelperModel;
+import com.core.model.User;
+import com.core.model.WorkModel;
 import com.core.model.XmppMessage;
 import com.core.net.http.http.OAHttpHelper;
 import com.core.net.http.http.OnHttpResultListener;
 import com.core.net.http.http.Request;
 import com.core.utils.CommonUtil;
 import com.core.utils.TimeUtils;
+import com.core.utils.ToastUtil;
 import com.core.utils.sortlist.BaseSortModel;
 import com.core.utils.sortlist.PingYinUtil;
 import com.core.xmpp.dao.ChatMessageDao;
@@ -47,7 +53,6 @@ import com.modular.appmessages.activity.ApprovalListActivity;
 import com.modular.appmessages.activity.BusinessTargetsActivity;
 import com.modular.appmessages.activity.MsgsSecondCommonActivity;
 import com.modular.appmessages.activity.ProcessB2BActivity;
-import com.modular.appmessages.activity.ProcessMsgActivity;
 import com.modular.appmessages.activity.RealTimeFormActivity;
 import com.modular.appmessages.activity.Subscription2Activity;
 import com.modular.appmessages.activity.UUHelperActivity;
@@ -56,6 +61,7 @@ import com.modular.appmessages.model.MessageHeader;
 import com.modular.appmessages.model.SubMessage;
 import com.modular.appmessages.presenter.imp.IMessageView;
 import com.modular.appmessages.util.ApprovalUtil;
+import com.modular.apputils.utils.SignUtils;
 import com.modular.apputils.utils.SwitchUtil;
 import com.modular.booking.activity.services.BServiceListActivity;
 import com.modular.booking.model.SBMenuModel;
@@ -478,11 +484,12 @@ public class MessagePresenter implements OnHttpResultListener {
                 time = "";
             }
         }
-        String taskTime = TimeUtils.getFriendlyTimeDesc(ct, (int) (TimeUtils.f_str_2_long(time) / 1000));
+        String taskTime = TimeUtils.getFriendlyTimeDesc(ct, (int) (DateFormatUtil.str2Long(time, DateFormatUtil.YMD_HMS) / 1000));
         iMessageView.updateHeaderView(5, taskNum, subTitle, taskTime);
         updateForUnReader();
     }
 
+
     /**
      * 处理审批了相关数据
      *
@@ -530,16 +537,7 @@ public class MessagePresenter implements OnHttpResultListener {
                 long time = JSONUtil.getLong(array.getJSONObject(0), "CREATEDATE_");
                 sub = TimeUtils.getFriendlyTimeDesc(ct, (int) (time / 1000));
             }
-//            messages = JSON.parseArray(object.getJSONArray("data").toJSONString(), SubscriptionMessage.class);
-//            if (ListUtils.isEmpty(messages)) {
-//                showsubsNum(0, "", "");
-//                return;
-//            }
-//            for (SubscriptionMessage e : messages) {
-//                if (e.getSTATUS_() == 0) {
-//                    num += 1;
-//                }
-//            }
+
         }
         showsubsNum(num, title, sub);
     }
@@ -621,8 +619,8 @@ public class MessagePresenter implements OnHttpResultListener {
                     detailModel.setTime(DateFormatUtil.long2Str(JSONUtil.getTime(detail, "createTime"), "yyyy-MM-dd HH:mm"));
                     detailModel.setType(type);
                     detailModel.setHierarchy(1);
-                    detailModel.setCaller(JSONUtil.getText(detail,"caller"));
-                    detailModel.setKeyValue(JSONUtil.getInt(detail,"keyValue"));
+                    detailModel.setCaller(JSONUtil.getText(detail, "caller"));
+                    detailModel.setKeyValue(JSONUtil.getInt(detail, "keyValue"));
                     detailModels.add(detailModel);
                 }
             }
@@ -910,6 +908,22 @@ public class MessagePresenter implements OnHttpResultListener {
         iMessageView.showModel(chcheShow);
     }
 
+    public WorkModel getCurrentWork() {
+        List<WorkModel> workModels = WorkModelDao.getInstance().queryAuto();
+        WorkModel workModel = null;
+        String newsTime = DateFormatUtil.long2Str(DateFormatUtil.HM);
+        if (!ListUtils.isEmpty(workModels)) {
+            for (WorkModel e : workModels) {
+                if (newsTime.compareTo(e.getWorkStart()) >= 0 && newsTime.compareTo(e.getOffend()) <= 0) {
+                    workModel = e;
+                    break;
+                }
+            }
+        }
+        return workModel;
+    }
+
+
     private boolean canShowbyFilter(BaseSortModel<Friend> mode) {
         if (TextUtils.isEmpty(filter) || mode.getSimpleSpell().startsWith(filter) || mode.getWholeSpell().startsWith(filter)
                 || mode.getBean().getShowName().startsWith(filter)) return true;
@@ -1043,6 +1057,26 @@ public class MessagePresenter implements OnHttpResultListener {
 
     private UnReaderListener unReaderListener;
 
+    private SignUtils mSignUtils;
+
+    public void signWork(WorkModel work) {
+        if (mSignUtils == null) {
+            mSignUtils = new SignUtils(new SignUtils.SignListener() {
+                @Override
+                public void sign(boolean signOk, String message) {
+                    ToastUtil.showToast(ct, message);
+                    LogUtil.i("gong", "message=" + message);
+                    iMessageView.updateSign();
+                }
+            });
+        }
+        if (work == null) {
+            work = getCurrentWork();
+        }
+        iMessageView.showProgress();
+        mSignUtils.sign(isB2b, work);
+    }
+
     public interface UnReaderListener {
         void setUnReader(int number);
 

+ 4 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/imp/IMessageView.java

@@ -21,4 +21,8 @@ public interface IMessageView  {
     void changeNet(boolean workConnected);
 
     void updateHeader(List<MessageHeader> models);
+
+    void updateSign();
+
+    void showProgress();
 }

+ 0 - 102
app_modular/appmessages/src/main/java/com/modular/appmessages/ui/MessageHeaderView.java

@@ -1,102 +0,0 @@
-package com.modular.appmessages.ui;
-
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-import android.text.Html;
-import android.util.AttributeSet;
-import android.view.LayoutInflater;
-import android.widget.ImageView;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-
-import com.core.utils.TimeUtils;
-import com.modular.appmessages.R;
-
-/**
- * Created by Bitliker on 2017/9/11.
- */
-
-public class MessageHeaderView extends RelativeLayout {
-    private TextView timeTV, numUnReadTV, titleTV, messageTV;
-    private ImageView headIMG;
-
-    public MessageHeaderView(Context context) {
-        this(context, null);
-    }
-
-    public MessageHeaderView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        LayoutInflater.from(context).inflate(R.layout.incule_item_message, this);
-        timeTV = (TextView) findViewById(R.id.timeTV);
-        numUnReadTV = (TextView) findViewById(R.id.numUnReadTV);
-        titleTV = (TextView) findViewById(R.id.titleTV);
-        messageTV = (TextView) findViewById(R.id.messageTV);
-        headIMG = (ImageView) findViewById(R.id.headIMG);
-
-
-    }
-
-    private void initTypedArray(Context context, AttributeSet attrs) {
-//        TypedArray attr = context.getTypedArray(context, attrs, R.styleable.ShadowLayout);
-    }
-
-
-    public void setNumUnRead(int number) {
-        if (number > 0) {
-            numUnReadTV.setText(String.valueOf(number));
-            if (numUnReadTV.getVisibility() == GONE) {
-                numUnReadTV.setVisibility(VISIBLE);
-            }
-        } else {
-            numUnReadTV.setVisibility(GONE);
-        }
-    }
-
-
-    public void setTitle(String title) {
-        if (title != null) {
-            titleTV.setText(title);
-        }
-    }
-
-    public void setMessage(String message) {
-        if (message != null) {
-            messageTV.setText(Html.fromHtml(message));
-        }
-    }
-
-    public void setHeadImg(int reId) {
-        if (reId > 0) {
-            headIMG.setImageResource(reId);
-        }
-    }
-
-    public void setTime(String time) {
-        if (time != null) {
-            timeTV.setText(time);
-            drawablesTimeTV(0);
-        }
-    }
-
-    public void setTime(long time) {
-        if (time > 0) {
-            timeTV.setText(TimeUtils.getFriendlyTimeDesc(getContext(), (int) time));
-            drawablesTimeTV(0);
-        }
-    }
-
-    public void setUnreadTag(String text) {
-        if (text != null) {
-            timeTV.setText(text);
-            drawablesTimeTV(R.drawable.hongdian);
-        }
-    }
-
-    public void drawablesTimeTV(int reId) {
-        Drawable drawable = null;
-        if (reId > 0) {
-            drawable = getContext().getResources().getDrawable(reId);
-        }
-        timeTV.setCompoundDrawables(null, null, null, drawable);
-    }
-}

+ 486 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/widget/SignRefreshLayout.java

@@ -0,0 +1,486 @@
+package com.modular.appmessages.widget;
+
+import android.content.Context;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.support.v7.widget.RecyclerView;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.LinearInterpolator;
+import android.view.animation.RotateAnimation;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.ScrollView;
+import android.widget.Scroller;
+import android.widget.TextView;
+
+import com.common.LogUtil;
+import com.common.system.DisplayUtil;
+import com.modular.appmessages.R;
+import com.modular.apputils.widget.EmptyRecyclerView;
+
+
+/**
+ * 1.通过代码setSignShow 弹出打卡头布局
+ * Created by Bitlike on 2018/4/28.
+ */
+
+public class SignRefreshLayout extends ViewGroup {
+    private boolean mEnablePullDown;// 是否允许下拉刷新
+    private onRefreshListener mListener;// 事件监听接口
+
+    private LayoutInflater mInflater;// 布局填充器对象
+    private Scroller mLayoutScroller;  // 用于平滑滑动的Scroller对象
+    private final int SCROLL_SPEED = 650;  // Scroller的滑动速度
+    private int mReachBottomScroll; // 当滚动到内容最底部时Y轴所需要滑动的举例
+    private int mEffectiveScroll; // 最小有效滑动距离(滑动超过该距离才视作一次有效的滑动刷新/加载操作)
+    private int lastChildIndex;// 最后一个content-child-view的index
+    private int mLayoutContentHeight; // ViewGroup的内容高度(不包括header与footer的高度)
+
+    private View headerView; //头布局
+    private final int headerHeight;
+
+    public SignRefreshLayout(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        mEffectiveScroll = (int) context.getResources().getDimension(R.dimen.refresh_item_height);
+        // 实例化布局填充器
+        mInflater = LayoutInflater.from(context);
+        // 实例化Scroller
+        mLayoutScroller = new Scroller(context);
+        mEffectiveScroll = headerHeight = DisplayUtil.dip2px(context, 160);
+        mEnablePullDown = true;
+    }
+
+    public void setEnablePullDown(boolean mEnablePullDown) {
+        this.mEnablePullDown = mEnablePullDown;
+    }
+
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+        lastChildIndex = getChildCount() - 1;
+        // 添加上拉刷新部分
+        if (mEnablePullDown) {
+            addLayoutHeader();
+        }
+
+    }
+
+    private void addLayoutHeader() {
+        headerView = getHeader(mInflater);
+        // 通过LayoutInflater获取从布局文件中获取header的view对象
+        // 设置布局参数(宽度为MATCH_PARENT,高度为MATCH_PARENT)
+        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams
+                (RelativeLayout.LayoutParams.MATCH_PARENT, headerHeight);
+        // 将Header添加进Layout当中
+        addView(headerView, params);
+    }
+
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+        // 遍历进行子视图的测量工作
+        for (int i = 0; i < getChildCount(); i++) {
+            // 通知子视图进行测量
+            View child = getChildAt(i);
+            measureChild(child, widthMeasureSpec, heightMeasureSpec);
+        }
+    }
+
+    @Override
+    protected void onLayout(boolean changed, int l, int t, int r, int b) {
+        // 重置(避免重复累加)
+        mLayoutContentHeight = 0;
+        // 遍历进行子视图的置位工作
+        for (int index = 0; index < getChildCount(); index++) {
+            View child = getChildAt(index);
+            if (child == headerView) { // 头视图隐藏在ViewGroup的顶端
+                child.layout(0, -DisplayUtil.dip2px(getContext(), 160), child.getMeasuredWidth(), 0);
+            } else { // 内容视图根据定义(插入)顺序,按由上到下的顺序在垂直方向进行排列
+                child.layout(0, mLayoutContentHeight, child.getMeasuredWidth(), mLayoutContentHeight + child.getMeasuredHeight());
+                if (index <= lastChildIndex) {
+                    if (child instanceof ScrollView) {
+                        mLayoutContentHeight += getMeasuredHeight();
+                        continue;
+                    }
+                    mLayoutContentHeight += child.getMeasuredHeight();
+                }
+            }
+        }
+        // 计算到达内容最底部时ViewGroup的滑动距离
+        mReachBottomScroll = mLayoutContentHeight - getMeasuredHeight();
+    }
+
+
+    // 普通状态
+    protected final int NORMAL = 0;
+    // 意图刷新
+    protected final int TRY_REFRESH = 1;
+    // 刷新状态
+    protected final int REFRESH = 2;
+    protected final int SIGN_TRY_REFRESH = 3;
+    protected final int SIGN_REFRESH = 4;
+
+
+    // Layout状态
+    private int status = NORMAL;
+    // 用于计算滑动距离的Y坐标中介
+    private int mLastYMoved, mDownYMoved;
+    // 用于判断是否拦截触摸事件的Y坐标中介
+    private int mLastYIntercept;
+
+    @Override
+    public boolean onInterceptTouchEvent(MotionEvent event) {
+        boolean intercept = false;
+        // 记录此次触摸事件的y坐标
+        int y = (int) event.getY();
+        // 判断触摸事件类型
+        switch (event.getAction()) {
+            // Down事件
+            case MotionEvent.ACTION_DOWN: {
+                // 记录下本次系列触摸事件的起始点Y坐标
+                mDownYMoved = mLastYMoved = y;
+                // 不拦截ACTION_DOWN,因为当ACTION_DOWN被拦截,后续所有触摸事件都会被拦截
+                intercept = false;
+                break;
+            }
+            // Move事件
+            case MotionEvent.ACTION_MOVE: {
+                if (y > mLastYIntercept && mEnablePullDown) { // 下滑操作
+                    // 获取最顶部的子视图
+                    View child = getChildAt(0);
+                    if (child instanceof RecyclerView) {
+                        intercept = rvPullDownIntercept(child);
+                    } else if (child instanceof ScrollView) {
+                        intercept = svPullDownIntercept(child);
+                    }  else if (child instanceof EmptyRecyclerView) {
+                        RecyclerView recycler = ((EmptyRecyclerView) child);
+                        intercept = rvPullDownIntercept(recycler);
+                    }
+                } else if (y < mLastYIntercept && status != NORMAL) {
+                    intercept = true;
+                } else {
+                    intercept = false;
+                }
+                break;
+            }
+            // Up事件
+            case MotionEvent.ACTION_UP: {
+                intercept = false;
+                break;
+            }
+        }
+        mLastYIntercept = y;
+        Log.i("gong", "intercept=" + intercept);
+        Log.i("gong", "status=" + status);
+        return intercept;
+    }
+    private boolean svPullDownIntercept(View child) {
+        boolean intercept = false;
+        if (child.getScrollY() <= 0) {
+            intercept = true;
+        }
+        return intercept;
+    }
+
+    private boolean rvPullDownIntercept(View child) {
+        boolean intercept = false;
+        RecyclerView recyclerChild = (RecyclerView) child;
+        if (recyclerChild.computeVerticalScrollOffset() <= 0)
+            intercept = true;
+        return intercept;
+    }
+
+
+    private final float effectiveScrollMultiple = 2f;
+
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        int y = (int) event.getY();
+        switch (event.getAction()) {
+            case MotionEvent.ACTION_MOVE: {
+                // 计算本次滑动的Y轴增量(距离)
+                int dy = mLastYMoved - y;
+                // 如果滑动增量小于0,即下拉操作
+                if (dy < 0) {//表示往下滑
+                    if (mEnablePullDown) {
+                        // 如果下拉的距离小于mLayoutHeader1/2的高度,则允许滑动
+                        if (getScrollY() > 0 || Math.abs(getScrollY()) <= mEffectiveScroll * effectiveScrollMultiple) {
+                            scrollBy(0, dy / 2);
+                            if (status != REFRESH) {
+                                if (getScrollY() <= 0) {
+                                    if (status != TRY_REFRESH) {
+                                        updateStatus(TRY_REFRESH);
+                                    } else if (Math.abs(getScrollY()) > mEffectiveScroll) {
+                                        updateStatus(REFRESH);
+                                    }
+                                }
+                            }
+                        }
+                    } else if (!isEnablePullDown() && Math.abs(getScrollY()) <= mEffectiveScroll) {
+                        scrollBy(0, dy / 2);
+                        if (Math.abs(getScrollY()) > mEffectiveScroll / 2) {
+                            updateStatus(SIGN_REFRESH);
+                        } else {
+                            updateStatus(SIGN_TRY_REFRESH);
+                        }
+                    }
+                } else if (dy > 0) {//上拉
+                    if (mEnablePullDown) {
+                        if (getScrollY() <= mReachBottomScroll + mEffectiveScroll * effectiveScrollMultiple) {
+                            // 进行Y轴上的滑动
+                            if (status != TRY_REFRESH && status != REFRESH) {
+                                scrollBy(0, dy / 2);
+                            } else {
+                                if (getScrollY() <= 0) {
+                                    dy = dy > 30 ? 30 : dy;
+                                    scrollBy(0, dy / 2);
+                                    if (Math.abs(getScrollY()) < mEffectiveScroll)
+                                        updateStatus(TRY_REFRESH);
+                                }
+                            }
+                        }
+                    } else if (!isEnablePullDown()) {
+                        scrollBy(0, dy / 2);
+                        if (Math.abs(getScrollY()) > mEffectiveScroll / 2) {
+                            updateStatus(SIGN_REFRESH);
+                        } else {
+                            updateStatus(SIGN_TRY_REFRESH);
+                        }
+                    }
+                }
+                // 记录y坐标
+                mLastYMoved = y;
+                break;
+            }
+            case MotionEvent.ACTION_UP: {
+                // 判断本次触摸系列事件结束时,Layout的状态
+                LogUtil.i("gong", "status=" + status);
+                switch (status) {
+                    case NORMAL:
+                        upWithStatusNormal();
+                        break;
+                    case TRY_REFRESH:
+                        upWithStatusTryRefresh();
+                        break;
+                    case REFRESH:
+                        upWithStatusRefresh();
+                        break;
+                    case SIGN_REFRESH:
+                        mLayoutScroller.startScroll(0, getScrollY(), 0, -(getScrollY() - (-mEffectiveScroll)), SCROLL_SPEED);
+                        break;
+                    case SIGN_TRY_REFRESH:
+                        mLayoutScroller.startScroll(0, getScrollY(), 0, -getScrollY(), SCROLL_SPEED);
+                        mUIHandler.postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                showSignView(false);
+                                setEnablePullDown(true);
+                            }
+                        }, SCROLL_SPEED);
+                        break;
+                }
+            }
+        }
+        mLastYIntercept = 0;
+        postInvalidate();
+        return true;
+    }
+
+    private void updateStatus(int status) {
+        if (headerView != null) {
+            upStatus(status);
+        }
+        LogUtil.i("gong","updateStatus="+status);
+        if (status != NORMAL) {
+            this.status = status;
+        }
+    }
+
+    private void upWithStatusNormal() {
+
+    }
+
+    private void upWithStatusTryRefresh() {
+        // 取消本次的滑动
+        mLayoutScroller.startScroll(0, getScrollY(), 0, -getScrollY(), SCROLL_SPEED);
+        LogUtil.i("gong","upWithStatusTryRefresh="+status);
+        status = NORMAL;
+        if (headerView != null) {
+            stopAnim();
+        }
+    }
+
+
+    private void upWithStatusRefresh() {
+        mLayoutScroller.startScroll(0, getScrollY(), 0, -(getScrollY() - (-mEffectiveScroll)), SCROLL_SPEED);
+        if (headerView != null) {
+            startAnim();
+        }
+        // 通过Listener接口执行刷新时的监听事件
+        if (mListener != null) {
+            mListener.onRefresh();
+        }
+    }
+
+
+    @Override
+    public void computeScroll() {
+        super.computeScroll();
+        if (mLayoutScroller.computeScrollOffset()) {
+            scrollTo(0, mLayoutScroller.getCurrY());
+        }
+        postInvalidate();
+    }
+
+    private final int STOP_REFRESH = 1;
+
+    private Handler mUIHandler = new Handler(Looper.getMainLooper()) {
+        @Override
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
+                case STOP_REFRESH: {
+                    LogUtil.i("gong","handleMessage="+status);
+                    mLayoutScroller.startScroll(0, getScrollY(), 0, -getScrollY(), SCROLL_SPEED);
+                    status = NORMAL;
+                    if (headerView != null) {
+                        stopAnim();
+                    }
+                    break;
+                }
+            }
+        }
+    };
+
+
+    private void stopTryRefresh() {
+        Message msg = mUIHandler.obtainMessage(STOP_REFRESH);
+        mUIHandler.sendMessage(msg);
+    }
+
+
+    public void stopRefresh() {
+        if (status == REFRESH) {
+            stopTryRefresh();
+        }
+        LogUtil.i("gong","stopRefresh="+status);
+        status = NORMAL;
+    }
+
+    public boolean isRefreshing() {
+        return status == REFRESH;
+    }
+
+
+    public void setOnRefreshListener(onRefreshListener listener) {
+        mListener = listener;
+    }
+
+    public interface onRefreshListener {
+        void onRefresh();
+
+    }
+
+    private View signView;
+    private View simplyView;
+    private ImageView statusImg;
+    private TextView statusTV;
+
+    private void showSignView(boolean sign) {
+        if (sign) {
+            mEffectiveScroll = DisplayUtil.dip2px(getContext(), 160);
+            simplyView.setVisibility(GONE);
+            signView.setVisibility(VISIBLE);
+        } else {
+            mEffectiveScroll = DisplayUtil.dip2px(getContext(), 80);
+            simplyView.setVisibility(VISIBLE);
+            signView.setVisibility(GONE);
+        }
+    }
+
+
+    public void setSignShow() {
+        showSignView(true);
+        mLayoutScroller.startScroll(0, getScrollY(), 0, -(getScrollY() - (-mEffectiveScroll)), SCROLL_SPEED);
+        setEnablePullDown(false);
+        updateStatus(SIGN_REFRESH);
+    }
+
+    public View getSignView() {
+        return signView;
+    }
+
+    public  boolean isEnablePullDown() {
+        return simplyView != null && simplyView.getVisibility() == VISIBLE;
+    }
+
+    protected View getHeader(LayoutInflater mInflater) {
+        View view = mInflater.inflate(R.layout.header_sign, null);
+        signView = view.findViewById(R.id.signView);
+        simplyView = view.findViewById(R.id.simplyView);
+        initSimpleView();
+        showSignView(false);
+        return view;
+    }
+
+    private void initSimpleView() {
+        statusImg = simplyView.findViewById(R.id.statusImg);
+        statusTV = simplyView.findViewById(R.id.statusTV);
+
+    }
+
+
+    private void upStatus(int status) {
+        statusImg.setAnimation(null);
+        if (isEnablePullDown()) {
+            switch (status) {
+                case TRY_REFRESH:
+                    statusTV.setText(R.string.pull_down_to_refresh);
+                    statusImg.setImageResource(R.drawable.ic_refresh_pull_down);
+                    break;
+                case REFRESH:
+                    statusTV.setText(R.string.up_to_refresh);
+                    statusImg.setImageResource(R.drawable.ic_refresh_pull_up);
+                    break;
+            }
+        }
+    }
+
+    private void stopAnim() {
+        Log.i("gong", "stopAnim");
+        statusImg.setAnimation(null);
+        statusImg.setImageResource(R.drawable.ic_refresh_pull_down);
+        statusTV.setText(R.string.pull_down_to_refresh);
+
+    }
+
+    private void startAnim() {
+        Log.i("gong", "startAnim");
+        statusTV.setText(R.string.refreshing);
+        statusImg.setImageResource(R.drawable.ic_baseutil_simple_load);
+        statusImg.setAnimation(getImgAnimation());
+    }
+
+    private RotateAnimation rotate;
+
+    private Animation getImgAnimation() {
+        if (rotate == null) {
+            rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
+            LinearInterpolator lin = new LinearInterpolator();
+            rotate.setInterpolator(lin);
+            rotate.setDuration(1000);//设置动画持续时间
+            rotate.setRepeatCount(-1);//设置重复次数
+            rotate.setFillAfter(true);//动画执行完后是否停留在执行完的状态
+            rotate.setStartOffset(10);//执行前的等待时间
+        }
+        return rotate;
+    }
+
+}

BIN
app_modular/appmessages/src/main/res/drawable-hdpi/ic_quick_sign.png


BIN
app_modular/appmessages/src/main/res/drawable-xhdpi/ic_quick_sign.png


BIN
app_modular/appmessages/src/main/res/drawable-xxhdpi/bg_message_sign.png


BIN
app_modular/appmessages/src/main/res/drawable-xxhdpi/ic_quick_sign.png


BIN
app_modular/appmessages/src/main/res/drawable-xxhdpi/ic_sign.png


BIN
app_modular/appmessages/src/main/res/drawable-xxhdpi/ic_sign_off.png


BIN
app_modular/appmessages/src/main/res/drawable-xxhdpi/ic_sign_work.png


File diff suppressed because it is too large
+ 7 - 0
app_modular/appmessages/src/main/res/drawable/ic_baseutil_simple_load.xml


+ 9 - 0
app_modular/appmessages/src/main/res/drawable/ic_refresh_pull_down.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportHeight="1024.0"
+    android:viewportWidth="1024.0">
+    <path
+        android:fillColor="#8a8a8a"
+        android:pathData="M512.2,908.7c26.8,0 48.5,-21.7 48.5,-48.5L560.7,112.6c0,-26.8 -21.7,-48.5 -48.5,-48.5l0,0c-26.8,0 -48.5,21.7 -48.5,48.5l0,747.6C463.7,887 485.4,908.7 512.2,908.7L512.2,908.7zM477.8,944.5c18.9,18.9 48.6,20 66.2,2.4l357.2,-357.2c17.6,-17.6 16.5,-47.2 -2.4,-66.2l0,0c-18.9,-18.9 -48.6,-20 -66.2,-2.4l-357.2,357.2C457.8,895.9 458.9,925.6 477.8,944.5L477.8,944.5zM546.6,944.5c18.9,-18.9 20,-48.6 2.4,-66.2l-357.2,-357.2c-17.6,-17.6 -47.2,-16.5 -66.2,2.4l0,0c-18.9,18.9 -20,48.6 -2.4,66.2l357.2,357.2C498.1,964.5 527.7,963.4 546.6,944.5L546.6,944.5z" />
+</vector>

+ 4 - 0
app_modular/appmessages/src/main/res/drawable/ic_refresh_pull_up.xml

@@ -0,0 +1,4 @@
+<vector android:height="24dp" android:viewportHeight="1024.0"
+    android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#8a8a8a" android:pathData="M512,113.9c-26.9,0 -48.6,21.8 -48.6,48.6L463.4,912.4c0,26.9 21.8,48.6 48.6,48.6l0,0c26.9,0 48.6,-21.8 48.6,-48.6L560.6,162.5C560.6,135.6 538.9,113.9 512,113.9L512,113.9zM546.5,78c-19,-19 -48.7,-20.1 -66.4,-2.4L121.9,433.8c-17.6,17.7 -16.6,47.4 2.4,66.4l0,0c19,19 48.7,20.1 66.4,2.4l358.3,-358.3C566.6,126.7 565.5,97 546.5,78L546.5,78zM477.5,78c-19,19 -20.1,48.7 -2.4,66.4l358.3,358.3c17.6,17.6 47.4,16.6 66.4,-2.4l0,0c19,-19 20.1,-48.7 2.4,-66.4L543.8,75.5C526.2,57.9 496.5,59 477.5,78L477.5,78z"/>
+</vector>

+ 13 - 0
app_modular/appmessages/src/main/res/layout/fragment_message.xml

@@ -0,0 +1,13 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/base_bg">
+
+<android.support.v7.widget.RecyclerView
+    android:id="@+id/messageRecycler"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"/>
+
+
+
+</RelativeLayout>

+ 10 - 0
app_modular/appmessages/src/main/res/layout/header_sign.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="160dp">
+
+    <include layout="@layout/refresh_sign_header" />
+
+    <include layout="@layout/refresh_simple_header" />
+
+</FrameLayout>

+ 8 - 6
app_modular/appmessages/src/main/res/layout/item_message_header.xml

@@ -3,7 +3,7 @@
                 xmlns:app="http://schemas.android.com/apk/res-auto"
                 android:layout_width="match_parent"
                 android:layout_height="@dimen/item_height"
-                android:background="@drawable/selector_me_menu_item_bg"
+                android:background="@drawable/selector_item_white_pass"
                 android:descendantFocusability="blocksDescendants"
                 android:minHeight="@dimen/item_height"
                 android:paddingLeft="15dp"
@@ -15,7 +15,7 @@
         android:layout_height="65dp"
         android:layout_centerVertical="true">
 
-        <ImageView
+        <de.hdodenhof.circleimageview.CircleImageView
             android:id="@+id/headerImg"
             android:layout_width="@dimen/item_img_height"
             android:layout_height="@dimen/item_img_width"
@@ -63,6 +63,8 @@
             android:layout_height="wrap_content"
             android:layout_alignParentRight="true"
             android:layout_marginRight="8dp"
+            android:textColor="#999999"
+            android:textSize="10sp"
             android:visibility="gone"
             />
 
@@ -74,8 +76,8 @@
             android:ellipsize="end"
             android:lines="1"
             android:text="会所"
-            android:textColor="@color/text_main"
-            android:textSize="16sp"/>
+            android:textColor="#333333"
+            android:textSize="15sp"/>
 
 
         <TextView
@@ -88,8 +90,8 @@
             android:ellipsize="end"
             android:lines="1"
             android:text="预约有优惠"
-            android:textColor="@color/text_hine"
-            android:textSize="14sp"/>
+            android:textColor="#999999"
+            android:textSize="12sp"/>
     </RelativeLayout>
 
 </RelativeLayout>

+ 46 - 0
app_modular/appmessages/src/main/res/layout/refresh_sign_header.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="160dp"
+    android:id="@+id/signView"
+    android:background="@drawable/bg_message_sign">
+
+    <ImageButton
+        android:id="@+id/itemSignImage"
+        android:layout_width="66dp"
+        android:layout_height="66dp"
+        android:background="@drawable/ic_sign"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/itemWorkTv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:drawableLeft="@drawable/ic_sign_work"
+        android:drawablePadding="4dp"
+        android:text="08:26:20"
+        android:textColor="#FFFFFFFF"
+        android:textSize="12sp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toLeftOf="@id/itemSignImage"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <android.support.v7.widget.AppCompatTextView
+        android:id="@+id/itemOffkTv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:drawableLeft="@drawable/ic_sign_off"
+        android:drawablePadding="4dp"
+        android:text="08:26:20"
+        android:textColor="#FFFFFFFF"
+        android:textSize="12sp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toRightOf="@id/itemSignImage"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+</android.support.constraint.ConstraintLayout>

+ 36 - 0
app_modular/appmessages/src/main/res/layout/refresh_simple_header.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/simplyView"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@color/white"
+    android:gravity="center_horizontal|bottom">
+
+    <LinearLayout
+        android:layout_width="160dp"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:gravity="center"
+        android:orientation="horizontal"
+        android:paddingBottom="20dp">
+
+        <ImageView
+            android:id="@+id/statusImg"
+            android:layout_width="20dp"
+            android:layout_height="20dp"
+            android:src="@drawable/ic_refresh_pull_down" />
+
+        <TextView
+            android:id="@+id/statusTV"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_marginLeft="5dp"
+            android:layout_toRightOf="@+id/statusImg"
+            android:gravity="center"
+            android:text="@string/pull_down_to_refresh"
+            android:textSize="16sp" />
+    </LinearLayout>
+
+
+</RelativeLayout>

+ 9 - 0
app_modular/appmessages/src/main/res/menu/menu_message_fragment.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+    <item
+        android:id="@+id/quick_sign"
+        app:showAsAction="always"
+        android:icon="@drawable/ic_quick_sign"
+        android:title="快捷打卡" />
+</menu>

+ 3 - 2
app_modular/apputils/src/main/java/com/modular/apputils/activity/BaseNetActivity.java

@@ -25,6 +25,7 @@ import com.common.preferences.PreferenceUtils;
 import com.common.thread.ThreadPool;
 import com.core.app.ActionBackActivity;
 import com.core.app.MyApplication;
+import com.core.base.BaseActivity;
 import com.core.net.http.HttpUtil;
 import com.core.utils.CommonUtil;
 import com.core.widget.CustomProgressDialog;
@@ -53,7 +54,7 @@ import java.util.Locale;
  * Created by Bitlike on 2018/1/10.
  */
 
-public abstract class BaseNetActivity extends ActionBackActivity {
+public abstract class BaseNetActivity extends BaseActivity {
     protected Activity ct;
     private CustomProgressDialog progressDialog;
     protected HttpClient httpClient;
@@ -96,7 +97,7 @@ public abstract class BaseNetActivity extends ActionBackActivity {
         }
     }
 
-    protected void preOnCreacte() {
+    public void preOnCreacte() {
     }
 
     protected abstract int getLayoutId();

+ 272 - 0
app_modular/apputils/src/main/java/com/modular/apputils/utils/SignUtils.java

@@ -0,0 +1,272 @@
+package com.modular.apputils.utils;
+
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.content.LocalBroadcastManager;
+import android.text.TextUtils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.common.LogUtil;
+import com.common.data.DateFormatUtil;
+import com.common.data.JSONUtil;
+import com.common.data.ListUtils;
+import com.common.data.StringUtil;
+import com.common.preferences.PreferenceUtils;
+import com.core.api.wxapi.ApiConfig;
+import com.core.api.wxapi.ApiUtils;
+import com.core.app.AppConfig;
+import com.core.app.MyApplication;
+import com.core.broadcast.MsgBroadcast;
+import com.core.dao.MessageDao;
+import com.core.dao.UserDao;
+import com.core.dao.WorkLocationDao;
+import com.core.dao.work.WorkModelDao;
+import com.core.model.User;
+import com.core.model.WorkModel;
+import com.core.net.http.http.OAHttpHelper;
+import com.core.net.http.http.OnHttpResultListener;
+import com.core.net.http.http.Request;
+import com.core.net.location.BdLocationHelper;
+import com.core.utils.BaiduMapUtil;
+import com.core.utils.CommonInterface;
+import com.modular.apputils.R;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static com.core.utils.CommonUtil.getSharedPreferences;
+
+
+/**
+ * 只负责判断|签到
+ * Created by Bitlike on 2018/5/3.
+ */
+
+public class SignUtils implements OnHttpResultListener {
+    private final int LOAD_WORKLOG = 12;
+    private final int SIGNING = 11;
+    private SignListener mSignListener;
+
+    public SignUtils(SignListener mSignListener) {
+        this.mSignListener = mSignListener;
+    }
+
+    public interface SignListener {
+        void sign(boolean signOk, String message);
+    }
+
+
+    public void sign(final boolean isB2b, WorkModel model) {
+        final float dis = isSubmitAble();
+        if (dis > 0) {
+            final Bundle bundle = new Bundle();
+            bundle.putParcelable("data", model);
+            if (isB2b) {
+                signinWork(isB2b, bundle, "", dis);
+            } else {
+                CommonInterface.getInstance().getCodeByNet("CardLog", new CommonInterface.OnResultListener() {
+                    @Override
+                    public void result(boolean isOk, int result, String message) {
+                        signinWork(isB2b, bundle, message, dis);
+                    }
+                });
+            }
+        } else {
+            if (this.mSignListener != null) {
+                this.mSignListener.sign(false, StringUtil.getMessage(R.string.too_long));
+            }
+        }
+
+    }
+
+    //签到
+    private void signinWork(boolean isB2b, Bundle bunder, String code, float dis) {
+        Context ct = MyApplication.getInstance();
+        Map<String, Object> param = new HashMap<>();
+        Map<String, Object> form = new HashMap<>();
+        if (!isB2b)
+            form.put("cl_code", code);
+        String phone = MyApplication.getInstance().mLoginUser.getTelephone();
+        if (StringUtil.isEmpty(phone)) {
+            String userId = MyApplication.getInstance().mLoginUser.getUserId();
+            if (!StringUtil.isEmpty(userId)) {
+                User user = UserDao.getInstance().getUserByUserId(userId);
+                phone = user.getTelephone();
+            } else
+                phone = getSharedPreferences(MyApplication.getInstance(), "user_phone");
+        }
+        form.put("cl_phone", phone);
+        form.put("cl_emcode", getSharedPreferences(ct, "erp_username"));
+        String emname = getSharedPreferences(ct, "erp_emname");
+        if (StringUtil.isEmpty(emname)) {
+            emname = MyApplication.getInstance().mLoginUser.getNickName().trim();
+        }
+        form.put("cl_emname", emname);
+        form.put("cl_distance", dis);
+
+        boolean isp = isPlay(form);
+        if (!isp) {
+            return;//不符合打卡
+        }
+        if (isB2b) {
+            form.put("enuu", getSharedPreferences(MyApplication.getInstance().getApplicationContext(), "companyEnUu"));
+            form.put("emcode", getSharedPreferences(MyApplication.getInstance().getApplicationContext(), "b2b_uu"));
+        } else
+            param.put("caller", "CardLog");
+
+        String formStore = JSONUtil.map2JSON(form);
+        param.put("formStore", formStore);
+        param.put("emcode", getSharedPreferences(ct, "erp_username"));
+        String url = isB2b ? ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().punch_worksignin_url :
+                "mobile/saveCardLog.action";
+        if (bunder != null) {
+            bunder.putBoolean("isB2b", isB2b);
+        }
+        Request request = new Request.Bulider()
+                .setBundle(bunder)
+                .setMode(Request.Mode.POST)
+                .setParam(param)
+                .setUrl(url)
+                .setWhat(SIGNING)
+                .bulid();
+        OAHttpHelper.getInstance().requestHttp(request, this);
+
+    }
+
+    /*判断是否符合打卡*/
+    private boolean isPlay(Map<String, Object> form) {
+        try {
+            //判断是否符合打卡
+            BdLocationHelper helper = MyApplication.getInstance().getBdLocationHelper();
+            String address = helper.getAddress();
+            if (StringUtil.isEmpty(address)) {
+                address = PreferenceUtils.getString("bdaddress");
+            }
+            form.put("cl_address", address);
+            form.put("cl_location", helper.getName());
+            return true;
+
+        } catch (NullPointerException e) {
+            return false;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    private float isSubmitAble() {
+        //先判断网络
+        if (!MyApplication.getInstance().isNetworkActive()) {
+            if (this.mSignListener != null) {
+                this.mSignListener.sign(false, StringUtil.getMessage(R.string.networks_out));
+            }
+            return -1;
+        }
+        //判断位置
+        float dis = BaiduMapUtil.getInstence().getDistance();
+        return dis;
+    }
+
+    //获取打卡记录
+    private void loadLog(Bundle bunder) {
+        boolean isB2b = false;
+        if (bunder != null) {
+            isB2b = bunder.getBoolean("isB2b");
+        }
+        String date = DateFormatUtil.long2Str(DateFormatUtil.YMD);
+        //获取网络数据
+        Map<String, Object> param = new HashMap<>();
+        String code = getSharedPreferences(MyApplication.getInstance(), "erp_username");
+        param.put("currentMaster", getSharedPreferences(MyApplication.getInstance(), "erp_master"));
+        if (isB2b) {
+            param.put("pageNumber", 1);
+            param.put("date", DateFormatUtil.long2Str(System.currentTimeMillis(), "yyyyMMdd"));
+        } else {
+            param.put("page", 1);
+            param.put("condition", "cl_emcode='" + code + "' and to_char(cl_time,'yyyy-MM-dd')='" + date + "'");
+        }
+        param.put("pageSize", 100);
+        param.put("caller", "CardLog");
+        param.put("emcode", code);
+        param.put("master", getSharedPreferences(MyApplication.getInstance(), "erp_master"));
+
+        String url = isB2b ? ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().punch_record_url :
+                "mobile/oa/workdata.action";
+        Request request = new Request.Bulider()
+                .setBundle(bunder)
+                .setMode(Request.Mode.GET)
+                .setParam(param)
+                .setUrl(url)
+                .setWhat(LOAD_WORKLOG)
+                .bulid();
+        OAHttpHelper.getInstance().requestHttp(request, this);
+    }
+
+    @Override
+    public void result(int what, boolean isJSON, String message, Bundle bundle) {
+        try {
+            switch (what) {
+                case SIGNING:
+                    loadLog(bundle);
+                    break;
+                case LOAD_WORKLOG:
+                    if (isJSON && JSON.parseObject(message).containsKey("listdata")) {
+                        saveSignin2DB(bundle, JSON.parseObject(message).getJSONArray("listdata"));
+                    }
+                    break;
+            }
+        } catch (Exception e) {
+            if (this.mSignListener != null && e != null) {
+                this.mSignListener.sign(false, "e=" + e.getMessage());
+            }
+        }
+    }
+
+    @Override
+    public void error(int what, String message, Bundle bundle) {
+        if (this.mSignListener != null && message != null) {
+            this.mSignListener.sign(false, message);
+        }
+    }
+
+    //保存到数据库
+    private void saveSignin2DB(Bundle bundle, JSONArray array) throws Exception {
+        WorkModel model = null;
+        if (bundle != null && bundle.getParcelable("data") != null) {
+            model = bundle.getParcelable("data");
+        }
+        if (model == null) {
+            LogUtil.i("model == null");
+            List<WorkModel> models = WorkModelDao.getInstance().query(false);
+            if (ListUtils.isEmpty(models)) return;
+            String time = DateFormatUtil.long2Str(System.currentTimeMillis(), "HH:mm");
+            for (WorkModel m : models) {
+                //当前时间位于该班次之间
+                if (m.getWorkStart().compareTo(time) < 0 && m.getOffend().compareTo(time) > 0) {
+                    model = m;
+                    break;
+                }
+            }
+        }
+        //取最后一个
+        JSONObject object = array.getJSONObject(array.size() - 1);
+        String time = object.getString("cl_time");//获取最后一次打卡信息,班次打卡信息
+        time = DateFormatUtil.long2Str(DateFormatUtil.str2Long(time, DateFormatUtil.YMD_HMS), DateFormatUtil.HM);//获取到的
+        if (StringUtil.isEmpty(time) || model == null) return;
+        if (StringUtil.isEmpty(model.getWorkSignin()) && model.getWorkStart().compareTo(time) <= 0
+                && model.getWorkTime().compareTo(time) >= 0) {
+            model.setWorkSignin(time);
+            WorkModelDao.getInstance().update(model);
+        } else if (StringUtil.isEmpty(model.getOffSignin()) && model.getOffTime().compareTo(time) <= 0
+                && model.getOffend().compareTo(time) >= 0) {
+            model.setOffSignin(time);
+            WorkModelDao.getInstance().update(model);
+        }
+        if (this.mSignListener != null) {
+            this.mSignListener.sign(true, "打卡成功");
+        }
+    }
+}

+ 0 - 1
app_modular/apputils/src/main/java/com/modular/apputils/utils/SwitchUtil.java

@@ -1,7 +1,6 @@
 package com.modular.apputils.utils;
 
 
-import com.common.config.BaseConfig;
 
 /**
  * Created by Bitlike on 2017/11/22.

+ 22 - 0
app_modular/apputils/src/main/java/com/modular/apputils/utils/VoiceUtils.java

@@ -0,0 +1,22 @@
+package com.modular.apputils.utils;
+
+import android.media.Ringtone;
+import android.media.RingtoneManager;
+import android.net.Uri;
+
+import com.common.preferences.PreferenceUtils;
+import com.core.app.MyApplication;
+import com.modular.apputils.R;
+
+public class VoiceUtils {
+
+    public static void signVoice() {
+        if (PreferenceUtils.getBoolean("signVoiceAble", true)) {
+            //TODO 语音播放
+            Uri notification = Uri.parse("android.resource://"+ MyApplication.getInstance().getPackageName()+"/"+ R.raw.rec);
+            Ringtone r = RingtoneManager.getRingtone( MyApplication.getInstance().getApplicationContext(), notification);
+            r.play();
+
+        }
+    }
+}

BIN
app_modular/apputils/src/main/res/raw/rec.mp3


+ 3 - 6
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/utils/AutoErpSigninUitl.java

@@ -19,7 +19,6 @@ import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
 import com.common.preferences.PreferenceUtils;
-import com.common.system.SystemUtil;
 import com.common.thread.ThreadUtil;
 import com.core.api.wxapi.ApiConfig;
 import com.core.api.wxapi.ApiPlatform;
@@ -46,6 +45,7 @@ import com.core.utils.NotificationManage;
 import com.core.utils.OnGetDrivingRouteResult;
 import com.core.utils.TimeUtils;
 import com.core.utils.WorkHandlerUtil;
+import com.modular.apputils.utils.VoiceUtils;
 import com.uas.appworks.OA.erp.activity.MissionActivity;
 import com.uas.appworks.OA.erp.activity.WorkActivity;
 import com.uas.appworks.R;
@@ -99,11 +99,6 @@ public class AutoErpSigninUitl implements OnHttpResultListener {
             CommonUtil.saveAutoLogtoLocal(getString(R.string.auto_sign_failed), getString(R.string.common_notlinknet));
             return;
         }
-        String macAddress = SystemUtil.getMac(MyApplication.getInstance());
-        if (StringUtil.isEmpty(macAddress)) {
-            CommonUtil.saveAutoLogtoLocal(getString(R.string.auto_sign_failed), "未获取到mac地址");
-            return;
-        }
         final Bundle bundle = new Bundle();
         bundle.putParcelable("data", model);
         if (isB2b) {
@@ -434,6 +429,8 @@ public class AutoErpSigninUitl implements OnHttpResultListener {
                         if (saveOk) {
                             Intent intent = new Intent(OAConfig.AUTO_SIGIN_ALART);
                             LocalBroadcastManager.getInstance(MyApplication.getInstance()).sendBroadcast(intent);
+                            PreferenceUtils.putBoolean("hasAutoSign",true);
+                            VoiceUtils.signVoice();
                         }
                     }
                     loadLog(bundle);

+ 3 - 0
app_third/library-refreshlayout/src/main/java/com/yalantis/phoenix/PullToRefreshView.java

@@ -339,6 +339,9 @@ public class PullToRefreshView extends ViewGroup {
         }
     }
 
+    public boolean isRefreshing(){
+        return mRefreshing;
+    }
     public void setRefreshing(boolean refreshing, final boolean notify) {
 //        if (mRefreshing != refreshing) {
             mNotify = notify;

Some files were not shown because too many files changed in this diff