فهرست منبع

Merge branch 'developer' of https://gitlab.com/Arisono/SkWeiChat-Baidu into fix_bug

Arison 9 سال پیش
والد
کامیت
0d60d06bde
52فایلهای تغییر یافته به همراه3573 افزوده شده و 2393 حذف شده
  1. 5 23
      WeiChat/src/main/AndroidManifest.xml
  2. 65 55
      WeiChat/src/main/java/com/xzjmyk/pm/activity/BdLocationHelper.java
  3. 1 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/MyApplication.java
  4. 4 4
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/MainActivity.java
  5. 14 24
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/VisitReportAddActivity.java
  6. 0 136
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AddMeetMainActivity.java
  7. 0 45
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AddNextSigninActivity.java
  8. 0 52
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AddSigninActivity.java
  9. 0 19
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AutoSignReceiver.java
  10. 2 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/DailydetailsActivity.java
  11. 2 2
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/ErpActivity.java
  12. 45 31
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/MissionActivity.java
  13. 0 15
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/OptionActivity.java
  14. 0 27
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/SigninTimeSetActivity.java
  15. 0 24
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/StatisticsActivity.java
  16. 0 16
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/SuperSetActivity.java
  17. 16 15
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/TravelRequestActivity.java
  18. 48 37
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/WorkDailyShowActivity.java
  19. 0 291
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/WorkLogsActivity.java
  20. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/adapter/MissionAdapter.java
  21. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/attendance/AutoErpService.java
  22. 4 4
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/attendance/AutoErpSigninUitl.java
  23. 1 2
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/MeFragment.java
  24. 3 3
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/SettingActivity.java
  25. 48 3
      WeiChat/src/main/java/com/xzjmyk/pm/activity/util/BaiduMapUtil.java
  26. 25 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/view/VpCalenderView.java
  27. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/config/Constant.java
  28. 2 1
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/pojo/StepData.java
  29. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/service/BootCompleteReceiver.java
  30. 2 4
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/service/StepDcretor.java
  31. 18 18
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/service/StepService.java
  32. 63 0
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/slidinguppanel/ScrollableViewHelper.java
  33. 1470 0
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/slidinguppanel/SlidingUpPanelLayout.java
  34. 1502 0
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/slidinguppanel/ViewDragHelper.java
  35. 26 5
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/ui/MyPedometerActivity.java
  36. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/utils/CountDownTimer.java
  37. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/basepedo/utils/DbUtils.java
  38. BIN
      WeiChat/src/main/res/drawable-xxhdpi/uustepbg.png
  39. 8 0
      WeiChat/src/main/res/drawable/above_shadow.xml
  40. 8 0
      WeiChat/src/main/res/drawable/below_shadow.xml
  41. 0 18
      WeiChat/src/main/res/layout/activity_add_meet_main.xml
  42. 0 120
      WeiChat/src/main/res/layout/activity_add_next_signin.xml
  43. 0 134
      WeiChat/src/main/res/layout/activity_add_signin.xml
  44. 0 12
      WeiChat/src/main/res/layout/activity_option.xml
  45. 90 71
      WeiChat/src/main/res/layout/activity_pedometer.xml
  46. 0 332
      WeiChat/src/main/res/layout/activity_signin_time_set.xml
  47. 0 621
      WeiChat/src/main/res/layout/activity_statistics.xml
  48. 0 152
      WeiChat/src/main/res/layout/activity_super_set.xml
  49. 71 69
      WeiChat/src/main/res/layout/item_mission.xml
  50. 19 0
      WeiChat/src/main/res/values/attrs.xml
  51. 2 1
      WeiChat/src/main/res/values/strings.xml
  52. 3 0
      WeiChat/src/main/res/values/styles.xml

+ 5 - 23
WeiChat/src/main/AndroidManifest.xml

@@ -19,7 +19,7 @@
     <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.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" />
@@ -448,9 +448,6 @@
             android:name=".ui.erp.activity.oa.AddMeetingActivity"
             android:label="新建会议"
             android:theme="@style/OAThemeMeet" />
-        <activity
-            android:name=".ui.erp.activity.oa.StatisticsActivity"
-            android:label="考勤统计" />
         <activity
             android:name=".ui.erp.activity.crm.BusinessActivity"
             android:theme="@style/CrmThemeBlue" />
@@ -525,14 +522,9 @@
         <activity
             android:name=".ui.erp.activity.crm.CustomerListSelectActivity"
             android:theme="@style/CrmThemeCustomer" />
-        <activity android:name=".ui.erp.activity.oa.AddMeetMainActivity" />
         <activity
             android:name=".ui.erp.activity.oa.DailydetailsActivity"
             android:theme="@style/OAThemeSignin" />
-        <activity android:name=".ui.erp.activity.oa.AddSigninActivity" />
-        <activity android:name=".ui.erp.activity.oa.AddNextSigninActivity" />
-        <activity android:name=".ui.erp.activity.oa.SigninTimeSetActivity" />
-        <activity android:name=".ui.erp.activity.oa.SuperSetActivity" />
         <!--
             <activity
             android:name=".ui.erp.activity.oa.AddDailyActivity"
@@ -544,15 +536,6 @@
         <activity
             android:name=".ui.erp.activity.oa.WorkDailyShowActivity"
             android:theme="@style/OAThemeSignin" />
-        <activity
-            android:name=".ui.erp.activity.oa.WorkLogsActivity"
-            android:theme="@style/OAThemeSignin" />
-        <activity
-            android:name=".ui.erp.activity.oa.SigninTimeSetActivity"
-            tools:ignore="DuplicateActivity" />
-        <activity
-            android:name=".ui.erp.activity.oa.SuperSetActivity"
-            tools:ignore="DuplicateActivity" />
         <activity
             android:name=".ui.erp.activity.oa.LocationMapActivity"
             android:label="地点微调" />
@@ -599,7 +582,6 @@
             android:name=".ui.erp.activity.oa.OutLogListActivity"
             android:label="我的外勤"
             android:theme="@style/OAThemeOutOffice" />
-        <activity android:name=".ui.erp.activity.oa.OptionActivity" />
         <activity android:name=".ui.erp.activity.crm.SubsActivity" />
         <activity android:name=".ui.erp.activity.me.UpdateSingleTextActivity" />
         <activity android:name=".ui.erp.activity.me.UpdateSexActivity" />
@@ -799,12 +781,12 @@
             android:name=".ui.erp.activity.oa.MissionActivity"
             android:label="@string/activity_mission_plan" />
         <activity
-            android:name="basepedo.ui.MyPedometerActivity"
+            android:name="com.xzjmyk.pm.basepedo.ui.MyPedometerActivity"
             android:label="UU运动" />
 
         <service
-            android:name="basepedo.service.StepService"
-            android:process="com.base.basepedo.step">
+            android:name="com.xzjmyk.pm.basepedo.service.StepService"
+            >
             <intent-filter android:priority="1000">
 
                 <!-- 系统启动完成后会调用 -->
@@ -818,7 +800,7 @@
             </intent-filter>
         </service>
 
-        <receiver android:name="basepedo.service.BootCompleteReceiver">
+        <receiver android:name="com.xzjmyk.pm.basepedo.service.BootCompleteReceiver">
             <intent-filter>
                 <action android:name="android.intent.action.BOOT_COMPLETED" />
                 <action android:name="android.intent.action.USER_PRESENT" />

+ 65 - 55
WeiChat/src/main/java/com/xzjmyk/pm/activity/BdLocationHelper.java

@@ -8,6 +8,7 @@ import com.baidu.location.BDLocation;
 import com.baidu.location.BDLocationListener;
 import com.baidu.location.LocationClient;
 import com.baidu.location.LocationClientOption;
+import com.baidu.mapapi.model.LatLng;
 import com.xzjmyk.pm.activity.bean.LocationEntity;
 import com.xzjmyk.pm.activity.ui.erp.util.StringUtils;
 import com.xzjmyk.pm.activity.ui.tool.ThreadUtil;
@@ -117,61 +118,7 @@ public class BdLocationHelper {
         @Override
         public void onReceiveLocation(BDLocation location) {
             try {
-                if (System.currentTimeMillis() - oldTime < 50000) return;//防止过度
-                if (locationEntity == null)
-                    locationEntity = new LocationEntity();
-                locationEntity.clear();
-                if (location.getLocType() == BDLocation.TypeGpsLocation// GPS定位结果
-                        || location.getLocType() == BDLocation.TypeNetWorkLocation//网络定位
-                        || location.getLocType() == BDLocation.TypeOffLineLocation//离线定位(未验证离线定位的有效性)
-                        ) {
-                    //定位成功
-                    oldTime = System.currentTimeMillis();
-                    log("定位成功");
-                    locationEntity.setLocationOk(true);
-                    locationEntity.setLatitude(location.getLatitude());
-                    locationEntity.setLongitude(location.getLongitude());
-                    locationEntity.setAddress(location.getAddrStr());
-                    locationEntity.setLocation(location.getLocationDescribe());
-                    locationEntity.setProvince(location.getProvince());
-                    locationEntity.setCityName(location.getCity());
-                    locationEntity.setDistrict(location.getDistrict());
-                    if (StringUtils.isEmpty(location.getLocationDescribe()))
-                        PreferenceUtils.putString("bdlocation", location.getLocationDescribe());
-                    if (StringUtils.isEmpty(location.getAddrStr()))
-                        PreferenceUtils.putString("bdaddress", location.getAddrStr());
-                } else {
-                    //统一未定位失败
-                    locationEntity.setLocationOk(false);
-                    log("定位失败");
-                    if (location.getLocType() == BDLocation.TypeServerError) {
-                        //服务端网络定位失败,可以反馈IMEI号和大体定位时间到loc-bugs@baidu.com,会有人追查原因
-                        locationEntity.setErrorMessage("服务端网络定位失败");
-                        log("服务端网络定位失败");
-                    } else if (location.getLocType() == BDLocation.TypeNetWorkException) {
-                        //网络不同导致定位失败,请检查网络是否通畅
-                        locationEntity.setErrorMessage("网络不同导致定位失败,请检查网络是否通畅");
-                        log("网络不同导致定位失败,请检查网络是否通畅");
-                    } else if (location.getLocType() == BDLocation.TypeCriteriaException) {
-                        //无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机
-                        locationEntity.setErrorMessage("无法获取有效定位依据导致定位失败");
-                        log("无法获取有效定位依据导致定位失败");
-                    } else {
-                        locationEntity.setErrorMessage("未知错误");
-                        log("未知错误");
-                    }
-                    if (mFaildCount < 3) {
-                        mFaildCount++;
-                        requestLocation();
-                        return;
-                    }
-                }
-                //TODO 发送广播
-                Bundle bundle = broadcast.getExtras();
-                if (bundle == null) bundle = new Bundle();
-                bundle.putParcelable("data", locationEntity);
-                broadcast.putExtras(bundle);
-                MyApplication.getInstance().sendBroadcast(broadcast);
+                setLocation(location);
             } catch (Exception e) {
                 if (e != null)
                     log("onReceiveLocation Exception" + e.getMessage());
@@ -182,6 +129,65 @@ public class BdLocationHelper {
         }
     };
 
+    private synchronized void setLocation(BDLocation location) throws Exception {
+        if (System.currentTimeMillis() - oldTime < 50000) return;//防止过度
+        if (locationEntity == null)
+            locationEntity = new LocationEntity();
+        locationEntity.clear();
+        if (location.getLocType() == BDLocation.TypeGpsLocation// GPS定位结果
+                || location.getLocType() == BDLocation.TypeNetWorkLocation//网络定位
+                || location.getLocType() == BDLocation.TypeOffLineLocation//离线定位(未验证离线定位的有效性)
+                ) {
+            //定位成功
+            oldTime = System.currentTimeMillis();
+            log("定位成功");
+            locationEntity.setLocationOk(true);
+            locationEntity.setLatitude(location.getLatitude());
+            locationEntity.setLongitude(location.getLongitude());
+            locationEntity.setAddress(location.getAddrStr());
+            locationEntity.setLocation(location.getLocationDescribe());
+            locationEntity.setProvince(location.getProvince());
+            locationEntity.setCityName(location.getCity());
+            locationEntity.setDistrict(location.getDistrict());
+            if (StringUtils.isEmpty(location.getLocationDescribe()))
+                PreferenceUtils.putString("bdlocation", location.getLocationDescribe());
+            if (StringUtils.isEmpty(location.getAddrStr()))
+                PreferenceUtils.putString("bdaddress", location.getAddrStr());
+        } else {
+            //统一未定位失败
+            locationEntity.setLocationOk(false);
+            log("定位失败");
+            if (location.getLocType() == BDLocation.TypeServerError) {
+                //服务端网络定位失败,可以反馈IMEI号和大体定位时间到loc-bugs@baidu.com,会有人追查原因
+                locationEntity.setErrorMessage("服务端网络定位失败");
+                log("服务端网络定位失败");
+            } else if (location.getLocType() == BDLocation.TypeNetWorkException) {
+                //网络不同导致定位失败,请检查网络是否通畅
+                locationEntity.setErrorMessage("网络不同导致定位失败,请检查网络是否通畅");
+                log("网络不同导致定位失败,请检查网络是否通畅");
+            } else if (location.getLocType() == BDLocation.TypeCriteriaException) {
+                //无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机
+                locationEntity.setErrorMessage("无法获取有效定位依据导致定位失败");
+                log("无法获取有效定位依据导致定位失败");
+            } else {
+                locationEntity.setErrorMessage("未知错误");
+                log("未知错误");
+            }
+            if (mFaildCount < 3) {
+                mFaildCount++;
+                requestLocation();
+                return;
+            }
+        }
+        //TODO 发送广播
+        Bundle bundle = broadcast.getExtras();
+        if (bundle == null) bundle = new Bundle();
+        bundle.putParcelable("data", locationEntity);
+        broadcast.putExtras(bundle);
+        MyApplication.getInstance().sendBroadcast(broadcast);
+
+    }
+
     private void log(String message) {
         try {
             if (!AppConfig.DEBUG && StringUtils.isEmpty(message)) return;
@@ -216,6 +222,10 @@ public class BdLocationHelper {
         return locationEntity == null ? "" : locationEntity.getProvince();
     }
 
+    public LatLng getLocation() {
+        return new LatLng(getLatitude(), getLongitude());
+    }
+
     public String getCityName() {
         return locationEntity == null ? "" : locationEntity.getCityName();
     }

+ 1 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/MyApplication.java

@@ -14,6 +14,7 @@ import android.util.Log;
 import com.android.volley.RequestQueue;
 import com.android.volley.toolbox.Volley;
 import com.baidu.mapapi.SDKInitializer;
+import com.baidu.mapapi.model.LatLng;
 import com.facebook.stetho.Stetho;
 import com.lidroid.xutils.DbUtils;
 import com.lidroid.xutils.HttpUtils;

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

@@ -64,13 +64,13 @@ import com.xzjmyk.pm.activity.volley.StringJsonArrayRequest;
 import com.xzjmyk.pm.activity.xmpp.CoreService;
 import com.xzjmyk.pm.activity.xmpp.ListenerManager;
 import com.xzjmyk.pm.activity.xmpp.listener.AuthStateListener;
+import com.xzjmyk.pm.basepedo.config.Constant;
+import com.xzjmyk.pm.basepedo.service.StepService;
+import com.xzjmyk.pm.basepedo.ui.MyPedometerActivity;
 
 import java.util.HashMap;
 import java.util.List;
 
-import basepedo.config.Constant;
-import basepedo.service.StepService;
-import basepedo.ui.MyPedometerActivity;
 
 
 /**
@@ -415,7 +415,7 @@ public class MainActivity extends BaseActivity implements NetWorkObservable.NetW
         if (isPush == 0) {
             PushManager.stopWork(this);
         }
-        // TODO 判断上一个状态UU运动是否关闭
+        // TODO 判断上一个状态UU运动是否关闭
         int isUUStep = PreferenceUtils.getInt(MyApplication.getInstance(), MainActivity.UU_STEP);
         if (isUUStep == 1){
             startService(new Intent(mContext,StepService.class));

+ 14 - 24
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/VisitReportAddActivity.java

@@ -87,28 +87,24 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
 
     private void initListener() {
         boolean isMe = getIntent().getBooleanExtra("isMe", true);
-//        setFocusable(tv_date_start, isMe);
-//        setFocusable(tv_date_end, isMe);
-//        setFocusable(tv_customer_login, isMe);
-//        setFocusable(tv_visit_steps, isMe);
-//        setFocusable(tv_relate_business, isMe);
-
-//        setFocusable(tv_visit_content, isMe);
-//        setFocusable(tv_visit_theme, isMe);
-//        setFocusable(tv_address_login, isMe);
-//        setFocusable(tv_linksman_login, isMe);
-
-
         if (isMe) {
-            tv_date_start.setOnClickListener(this);
-            tv_date_end.setOnClickListener(this);
-            tv_date_start.setKeyListener(null);
-            tv_date_end.setKeyListener(null);
-            tv_customer_login.setOnClickListener(this);
             tv_visit_steps.setKeyListener(null);
             tv_relate_business.setKeyListener(null);
             tv_visit_steps.setOnClickListener(this);
             tv_relate_business.setOnClickListener(this);
+            if (3 == getIntent().getIntExtra("type", -1)) {
+                setFocusable(tv_date_start, isMe && TextUtils.isEmpty(tv_date_start.getText()));
+                setFocusable(tv_date_end, isMe && TextUtils.isEmpty(tv_date_end.getText()));
+                setFocusable(tv_customer_login, isMe && TextUtils.isEmpty(tv_customer_login.getText()));
+                setFocusable(tv_address_login, isMe && TextUtils.isEmpty(tv_address_login.getText()));
+                setFocusable(tv_visit_theme, isMe && TextUtils.isEmpty(tv_visit_theme.getText()));
+            } else {
+                tv_date_start.setOnClickListener(this);
+                tv_date_start.setKeyListener(null);
+                tv_date_end.setOnClickListener(this);
+                tv_date_end.setKeyListener(null);
+                tv_customer_login.setOnClickListener(this);
+            }
         } else {
             //当不可编辑tv_date_end
             tv_date_start.setFocusable(false);
@@ -174,13 +170,7 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
             tv_customer_login.setText(getJSONString(object, "mpd_company"));
             tv_address_login.setText(getJSONString(object, "mpd_address"));
             tv_visit_theme.setText(getJSONString(object, "mpd_remark"));
-            boolean isMe = getIntent().getBooleanExtra("isMe", true);
-            setFocusable(tv_date_start, isMe && TextUtils.isEmpty(tv_date_start.getText()));
-            setFocusable(tv_date_end, isMe && TextUtils.isEmpty(tv_date_end.getText()));
-            setFocusable(tv_customer_login, isMe && TextUtils.isEmpty(tv_customer_login.getText()));
-            setFocusable(tv_address_login, isMe && TextUtils.isEmpty(tv_address_login.getText()));
-            setFocusable(tv_visit_theme, isMe && TextUtils.isEmpty(tv_visit_theme.getText()));
-            Log.i("gongpengming", "vp_id=" + vp_id);
+
         }
     }
 

+ 0 - 136
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AddMeetMainActivity.java

@@ -1,136 +0,0 @@
-package com.xzjmyk.pm.activity.ui.erp.activity.oa;
-
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
-import android.widget.EditText;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.ListView;
-import android.widget.RelativeLayout;
-
-import com.xzjmyk.pm.activity.R;
-import com.xzjmyk.pm.activity.ui.base.BaseActivity;
-import com.xzjmyk.pm.activity.ui.erp.entity.OAAgendaEntity;
-
-import java.util.ArrayList;
-
-public class AddMeetMainActivity extends BaseActivity implements View.OnClickListener {
-    private ArrayList<OAAgendaEntity> entities;
-    private AddMeetMainActivity ct;
-    private ListView listView;
-    private AgendaAdapter adapter;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_add_meet_main);
-        ct = this;
-        init();
-        initView();
-    }
-
-    private void initView() {
-        adapter = new AgendaAdapter();
-        listView = (ListView) findViewById(R.id.listview);
-        listView.setAdapter(adapter);
-    }
-
-    private void init() {
-        entities = new ArrayList();
-
-    }
-
-    private void setListViewPos(int pos) {
-        if (android.os.Build.VERSION.SDK_INT >= 8) {
-            listView.smoothScrollToPosition(pos);
-        } else {
-            listView.setSelection(pos);
-        }
-    }
-
-    @Override
-    public void onClick(View view) {
-        switch (view.getId()) {
-
-        }
-    }
-
-
-    class AgendaAdapter extends BaseAdapter {
-        @Override
-        public int getCount() {
-            return entities.size() + 1;
-        }
-
-        @Override
-        public Object getItem(int i) {
-            return entities.size() == 0 ? i : entities.get(i);
-        }
-
-        @Override
-        public long getItemId(int i) {
-            return i;
-        }
-
-        @Override
-        public View getView(int i, View view, ViewGroup viewGroup) {
-            AgendaViewHolder holder = null;
-            if (view == null) {
-                holder = new AgendaViewHolder();
-                view = LayoutInflater.from(ct).inflate(R.layout.item_add_meet_main, null);
-                holder.end_et = (EditText) view.findViewById(R.id.end_et);
-                holder.main_et = (EditText) view.findViewById(R.id.main_et);
-                holder.start_et = (EditText) view.findViewById(R.id.start_et);
-                holder.remove_img = (ImageView) view.findViewById(R.id.remove_img);
-                holder.rl = (RelativeLayout) view.findViewById(R.id.rl);
-                holder.ll = (LinearLayout) view.findViewById(R.id.ll);
-                view.setTag(holder);
-
-            } else {
-                holder = (AgendaViewHolder) view.getTag();
-            }
-            if (i == entities.size()) {
-                holder.rl.setVisibility(View.VISIBLE);
-                holder.ll.setVisibility(View.GONE);
-                holder.rl.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        entities.add(new OAAgendaEntity());
-                        adapter.notifyDataSetChanged();
-                        setListViewPos(entities.size());
-                    }
-                });
-
-            } else {
-                holder.rl.setVisibility(View.GONE);
-                holder.ll.setVisibility(View.VISIBLE);
-                addlistener(holder, i);
-            }
-            return view;
-        }
-
-        private void addlistener(AgendaViewHolder holder, final int i) {
-            if (holder == null) return;
-            holder.remove_img.setOnClickListener(new View.OnClickListener() {
-                @Override
-                public void onClick(View view) {
-                    if (entities.size() > i) {
-                        entities.remove(i);
-                        notifyDataSetChanged();
-                        setListViewPos(entities.size());
-                    }
-                }
-            });
-        }
-
-        class AgendaViewHolder {
-            EditText main_et, start_et, end_et;
-            ImageView remove_img;
-            LinearLayout ll;
-            RelativeLayout rl;
-        }
-    }
-}

+ 0 - 45
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AddNextSigninActivity.java

@@ -1,45 +0,0 @@
-package com.xzjmyk.pm.activity.ui.erp.activity.oa;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.TextView;
-
-import com.xzjmyk.pm.activity.R;
-import com.xzjmyk.pm.activity.ui.base.BaseActivity;
-
-public class AddNextSigninActivity extends BaseActivity implements View.OnClickListener {
-
-    private TextView addr_tv;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_add_next_signin);
-        getSupportActionBar().setTitle("规则设置");
-
-        initView();
-    }
-
-    private void initView() {
-        findViewById(R.id.time_rl).setOnClickListener(this);
-        addr_tv = (TextView) findViewById(R.id.addr_tv);
-        addr_tv.setOnClickListener(this);
-        findViewById(R.id.save_btn).setOnClickListener(this);
-    }
-
-    @Override
-    public void onClick(View view) {
-        switch (view.getId()) {
-            case R.id.time_rl:
-                startActivity(new Intent(AddNextSigninActivity.this, SigninTimeSetActivity.class));
-                break;
-            case R.id.addr_tv:
-                ToastMessage("弹框");
-                break;
-            case R.id.save_btn:
-                ToastMessage("弹框");
-                break;
-        }
-    }
-}

+ 0 - 52
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AddSigninActivity.java

@@ -1,52 +0,0 @@
-package com.xzjmyk.pm.activity.ui.erp.activity.oa;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.text.Html;
-import android.view.View;
-import android.widget.RadioButton;
-
-import com.xzjmyk.pm.activity.R;
-import com.xzjmyk.pm.activity.ui.base.BaseActivity;
-import com.xzjmyk.pm.activity.ui.erp.activity.DbfindListActivity;
-
-public class AddSigninActivity extends BaseActivity implements View.OnClickListener {
-    private RadioButton static_rb, plan_rb;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_add_signin);
-        getSupportActionBar().setTitle("新增考勤组");
-        initView();
-    }
-
-    private void initView() {
-        static_rb = (RadioButton) findViewById(R.id.static_rb);
-        plan_rb = (RadioButton) findViewById(R.id.plan_rb);
-        findViewById(R.id.next_btn).setOnClickListener(this);
-        findViewById(R.id.users_rl).setOnClickListener(this);
-        findViewById(R.id.user_rl).setOnClickListener(this);
-        String static_rbStr = "<font color=\'#3c3c3c\'>固定班次  </font><font color=\'#575757\'>(考勤时间都一样)</font>";
-        String plan_rbStr = "<font color=\'#3c3c3c\'>排班制  </font><font color='#575757'>(考勤时间不都一样) </font><font color='#FF0000'>【此类型建议在电脑上排班】</font>";
-        static_rb.setText(Html.fromHtml(static_rbStr));
-        plan_rb.setText(Html.fromHtml(plan_rbStr));
-
-
-    }
-
-    @Override
-    public void onClick(View view) {
-        switch (view.getId()) {
-            case R.id.next_btn:
-                startActivity(new Intent(AddSigninActivity.this, AddNextSigninActivity.class));
-                break;
-            case R.id.users_rl:
-                startActivityForResult(new Intent(AddSigninActivity.this, DbfindListActivity.class), 1);
-                break;
-            case R.id.user_rl:
-                startActivityForResult(new Intent(AddSigninActivity.this, DbfindListActivity.class), 1);
-                break;
-        }
-    }
-}

+ 0 - 19
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AutoSignReceiver.java

@@ -1,19 +0,0 @@
-package com.xzjmyk.pm.activity.ui.erp.activity.oa;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-
-import com.xzjmyk.pm.activity.util.TimeUtils;
-
-/**
- * Created by FANGlh on 2016/10/27.
- */
-public class AutoSignReceiver extends BroadcastReceiver {
-
-    private String c_time = TimeUtils.long2str(System.currentTimeMillis(), "HH:mm");//获取当前时间的时分
-    @Override
-    public void onReceive(Context context, Intent intent) {
-
-    }
-}

+ 2 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/DailydetailsActivity.java

@@ -148,7 +148,8 @@ public class DailydetailsActivity extends BaseActivity {
                                     finish();
                                 }else if (!TextUtils.isEmpty(fromwhere) && "dailylist".equals(fromwhere)){
                                     Intent intent = new Intent();
-                                    intent.putExtra("delete_succeed","");
+                                    intent.putExtra("delete_succeed","delete_succeed");
+                                    intent.putExtra("deleted_id",mkeyValue);
                                     setResult(DELETE_SUCCEED,intent);
                                     finish();
                                 }

+ 2 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/ErpActivity.java

@@ -1,11 +1,11 @@
 package com.xzjmyk.pm.activity.ui.erp.activity.oa;
 
 import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
 
 import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.ui.base.BaseActivity;
 
-public class ErpActivity extends AppCompatActivity {
+public class ErpActivity extends BaseActivity {
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {

+ 45 - 31
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/MissionActivity.java

@@ -58,6 +58,15 @@ public class MissionActivity extends BaseActivity implements View.OnClickListene
         @Override
         public void onReceive(Context context, Intent intent) {
             locationOk = MyApplication.getInstance().getBdLocationHelper().locationOk();
+            if (locationOk && adapter != null && !ListUtils.isEmpty(adapter.getModels())) {
+                for (int i = 0; i < adapter.getModels().size(); i++) {
+                    if (adapter.getModels().get(i).getStatus() != 1) {
+                        adapter.getModels().get(i).setRecorddate(TimeUtils.f_long_2_str(System.currentTimeMillis()));
+                        adapter.getModels().get(i).setLocation(MyApplication.getInstance().getBdLocationHelper().getName());
+                        adapter.notifyItemChanged(i);
+                    }
+                }
+            }
         }
     };
 
@@ -262,6 +271,7 @@ public class MissionActivity extends BaseActivity implements View.OnClickListene
                 });
                 break;
             case R.id.item_remark_tv:
+                if (model == null || model.getStatus() == 1) return;
                 String[] str = new String[]{"客情维护", "业务办理", "其它拜访"};
                 ArrayList<SelectBean> beans = new ArrayList<>();
                 SelectBean bean = null;
@@ -299,8 +309,8 @@ public class MissionActivity extends BaseActivity implements View.OnClickListene
                                 MyApplication.getInstance().getBdLocationHelper().getLongitude())));
             }
             adapter.notifyItemChanged(position);
-            if (!StringUtils.isEmpty(adapter.getModels().get(position).getCompanyAddr()))
-                setEndTime(entity.getCompanyName(), entity.getDistance());
+            if (entity.getLatLng() != null)
+                setEndTime(entity.getLatLng(), entity.getDistance());
         } else if (requestCode == 0x21) {//选择地址
             PoiInfo info = data.getParcelableExtra("resultName");
             if (info == null) {
@@ -313,6 +323,7 @@ public class MissionActivity extends BaseActivity implements View.OnClickListene
                 if (StringUtils.isEmpty(adapter.getModels().get(position).getCompanyName())) {
                     adapter.getModels().get(position).setCompanyName(info.name);
                 }
+                adapter.getModels().get(position).setCompanyName(info.name);
                 adapter.getModels().get(position).setCompanyAddr(info.address);
                 adapter.getModels().get(position).setLatLng(info.location);
                 adapter.getModels().get(position).setDistance(BaiduMapUtil.getInstence().distance(adapter.getModels().get(position).getLatLng()
@@ -320,7 +331,12 @@ public class MissionActivity extends BaseActivity implements View.OnClickListene
                                 MyApplication.getInstance().getBdLocationHelper().getLongitude())));
                 adapter.notifyItemChanged(position);
                 if (!StringUtils.isEmpty(adapter.getModels().get(position).getCompanyName()))
-                    setEndTime(info.name, 0);
+                    try {
+                        setEndTime(info.location, Double.valueOf(BaiduMapUtil.getInstence().getDistance(info.location)));
+                    } catch (ClassCastException e) {
+
+                    } catch (Exception e) {
+                    }
             }
         } else if (0x22 == requestCode) {//外勤设置
             boolean isAuto = data.getBooleanExtra("isAuto", true);
@@ -348,37 +364,36 @@ public class MissionActivity extends BaseActivity implements View.OnClickListene
 
 
     /**
-     *
-     * @param name
+     * @param location
      * @param dis
      * @update by 2017/1/11
      */
-    private void setEndTime(String name, final double dis) {
-        BaiduMapUtil.getInstence().getDrivingRoute(MyApplication.getInstance().
-                getBdLocationHelper().getCityName(), MyApplication.getInstance().
-                getBdLocationHelper().getName(), name, new OnGetDrivingRouteResult() {
-            @Override
-            public void onGetDrivingRouteResult(DrivingRouteResult drivingRouteResult) {
-                List<DrivingRouteLine> list = drivingRouteResult.getRouteLines();
-                if (ListUtils.isEmpty(list)) {
-                    Log.i("gongpengming", "onGetDrivingRouteResult: isEmpty");
-                    if (dis != 0) {
-                        setVoisitTime((long) (dis / 3));
-                    } else
-                        setVoisitTime(800);
-                    return;
-                }
-                int minTime = 0;
-                for (DrivingRouteLine e : list) {
-                    if (minTime == 0 || minTime > e.getDuration()) {
-                        minTime = e.getDuration();
-                    }
-                }
-                setVoisitTime(minTime);
-                Log.i("gongpengming", "最短时间为" + minTime);
+    private void setEndTime(LatLng location, final double dis) {
+        Log.i("gongpengming", "dis=" + dis);
+        BaiduMapUtil.getInstence().getDrivingRoute(MyApplication.getInstance().getBdLocationHelper().getLocation(), location,
+                new OnGetDrivingRouteResult() {
+                    @Override
+                    public void onGetDrivingRouteResult(DrivingRouteResult drivingRouteResult) {
+                        List<DrivingRouteLine> list = drivingRouteResult.getRouteLines();
+                        if (ListUtils.isEmpty(list)) {
+                            Log.i("gongpengming", "onGetDrivingRouteResult: isEmpty");
+                            if (dis != 0) {
+                                setVoisitTime((long) (dis / 3));
+                            } else
+                                setVoisitTime(800);
+                            return;
+                        }
+                        int minTime = 0;
+                        for (DrivingRouteLine e : list) {
+                            if (minTime == 0 || minTime > e.getDuration()) {
+                                minTime = e.getDuration();
+                            }
+                        }
+                        setVoisitTime(minTime);
+                        Log.i("gongpengming", "最短时间为" + minTime);
 
-            }
-        });
+                    }
+                });
 
     }
 
@@ -391,7 +406,6 @@ public class MissionActivity extends BaseActivity implements View.OnClickListene
         String realTime = TimeUtils.f_long_2_str(System.currentTimeMillis() + (time * 1000));
 
 
-
         adapter.getModels().get(position).setVisitTime(realTime);
         adapter.notifyItemChanged(position);
     }

+ 0 - 15
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/OptionActivity.java

@@ -1,15 +0,0 @@
-package com.xzjmyk.pm.activity.ui.erp.activity.oa;
-
-import android.os.Bundle;
-
-import com.xzjmyk.pm.activity.R;
-import com.xzjmyk.pm.activity.ui.base.BaseActivity;
-
-public class OptionActivity extends BaseActivity {
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_option);
-    }
-}

+ 0 - 27
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/SigninTimeSetActivity.java

@@ -1,27 +0,0 @@
-package com.xzjmyk.pm.activity.ui.erp.activity.oa;
-
-import android.os.Bundle;
-import android.view.View;
-
-import com.xzjmyk.pm.activity.R;
-import com.xzjmyk.pm.activity.ui.base.BaseActivity;
-
-public class SigninTimeSetActivity extends BaseActivity {
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_signin_time_set);
-
-        initView();
-    }
-
-    private void initView() {
-        findViewById(R.id.ok_btn).setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                finish();
-            }
-        });
-    }
-}

+ 0 - 24
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/StatisticsActivity.java

@@ -1,24 +0,0 @@
-package com.xzjmyk.pm.activity.ui.erp.activity.oa;
-
-import android.os.Bundle;
-
-import com.lidroid.xutils.ViewUtils;
-import com.xzjmyk.pm.activity.R;
-import com.xzjmyk.pm.activity.ui.base.BaseActivity;
-
-public class StatisticsActivity extends BaseActivity {
-
-//    @ViewInject(R.id._rl)
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_statistics);
-        ViewUtils.inject(this);
-        initView();
-    }
-
-
-    private void initView() {
-    }
-}

+ 0 - 16
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/SuperSetActivity.java

@@ -1,16 +0,0 @@
-package com.xzjmyk.pm.activity.ui.erp.activity.oa;
-
-import android.os.Bundle;
-
-import com.xzjmyk.pm.activity.R;
-import com.xzjmyk.pm.activity.ui.base.BaseActivity;
-
-public class SuperSetActivity extends BaseActivity {
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-            setContentView(R.layout.activity_super_set);
-        getSupportActionBar().setTitle("高级设置");
-    }
-}

+ 16 - 15
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/TravelRequestActivity.java

@@ -34,22 +34,21 @@ import java.util.Map;
  */
 public class TravelRequestActivity extends BaseActivity implements View.OnTouchListener, View.OnClickListener {
     private FormEditText mExplainEt;
-    private RelativeLayout mStartTimeRl,mEndTimeRl,mBasisRl;
-    private TextView mStartTimeTv,mEndTimeTv,mBasisTv;
-    private FormEditText mDaysEt,mDestinationEt,mTargetEt,mProjectEt;
+    private RelativeLayout mStartTimeRl, mEndTimeRl, mBasisRl;
+    private TextView mStartTimeTv, mEndTimeTv, mBasisTv;
+    private FormEditText mDaysEt, mDestinationEt, mTargetEt, mProjectEt;
     private Button mCommitBtn;
 
     private final static int TRAVEL_BASIS_REQUEST = 102;
     private SingleDialog signDialog;
     private List<String> mBasisList = new ArrayList<>();
-    private Handler mHandler = new Handler(){
+    private Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
-            switch (msg.what){
+            switch (msg.what) {
                 case TRAVEL_BASIS_REQUEST:
-                    progressDialog.dismiss();;
-                    mBasisList = (List<String>) FlexJsonUtil.fromJson(msg.getData().getString("result")).get(
-                            "combdatas");
+                    progressDialog.dismiss();
+                    mBasisList = (List<String>) FlexJsonUtil.fromJson(msg.getData().getString("result")).get("combdatas");
                     if (mBasisList.isEmpty()) {
                         mBasisList.add("无");
                     }
@@ -94,12 +93,12 @@ public class TravelRequestActivity extends BaseActivity implements View.OnTouchL
 
     @Override
     public void onClick(View v) {
-        switch (v.getId()){
+        switch (v.getId()) {
             case R.id.travel_request_starttime_rl:
-                CommonUtil.showDataPickDialog(this,mStartTimeTv);
+                CommonUtil.showDataPickDialog(this, mStartTimeTv);
                 break;
             case R.id.travel_request_endtime_rl:
-                CommonUtil.showDataPickDialog(this,mEndTimeTv);
+                CommonUtil.showDataPickDialog(this, mEndTimeTv);
                 break;
             case R.id.travel_request_basis_rl:
                 progressDialog.show();
@@ -112,12 +111,13 @@ public class TravelRequestActivity extends BaseActivity implements View.OnTouchL
 
     /**
      * 获取考勤依据列表
+     *
      * @param field
      * @param what
      */
-    public void loadTravelBasis(String field,int what){
+    public void loadTravelBasis(String field, int what) {
         Log.i("leave", "what=" + what);
-        String url= Constants.getAppBaseUrl(ct)+"mobile/common/getCombo.action";
+        String url = Constants.getAppBaseUrl(ct) + "mobile/common/getCombo.action";
         Map<String, String> param = new HashMap<String, String>();
         param.put("caller", "FeePlease!CCSQ");
         param.put("field", field);
@@ -128,6 +128,7 @@ public class TravelRequestActivity extends BaseActivity implements View.OnTouchL
 
     /**
      * 展示考勤列表
+     *
      * @param view
      */
     public void showSignDialog(View view) {
@@ -154,9 +155,9 @@ public class TravelRequestActivity extends BaseActivity implements View.OnTouchL
 
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
-        switch (item.getItemId()){
+        switch (item.getItemId()) {
             case R.id.oa_form:
-                Intent it_scale = new Intent(ct,SaleSelectActivity.class);
+                Intent it_scale = new Intent(ct, SaleSelectActivity.class);
                 it_scale.putExtra("caller", "FeePlease!CCSQ");
                 it_scale.putExtra("title", "出差单查询");
                 it_scale.putExtra("from", "SignMain");

+ 48 - 37
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/WorkDailyShowActivity.java

@@ -27,6 +27,7 @@ import com.xzjmyk.pm.activity.ui.base.BaseActivity;
 import com.xzjmyk.pm.activity.ui.erp.net.ViewUtil;
 import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
 import com.xzjmyk.pm.activity.ui.erp.util.Constants;
+import com.xzjmyk.pm.activity.ui.erp.util.ListUtils;
 import com.xzjmyk.pm.activity.ui.erp.util.LogUtil;
 import com.xzjmyk.pm.activity.ui.erp.util.StringUtils;
 import com.xzjmyk.pm.activity.ui.erp.view.EmptyLayout;
@@ -56,9 +57,11 @@ public class WorkDailyShowActivity extends BaseActivity {
     private WorkDailyAdapter mWorkDailyAdapter;
     public EmptyLayout mEmptyLayout;
     private int mPosition;
-    private String returnedData;
+    private int returnedData;
     private List<WorkDailyBean> real_list;
     private List<WorkDailyBean> click_list;
+    private List<WorkDailyBean> last_list;
+    private String delete_succeed;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -88,37 +91,44 @@ public class WorkDailyShowActivity extends BaseActivity {
         mSearchEt.addTextChangedListener(new TextWatcher() {
             @Override
             public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-
+                mWorkDailyAdapter.notifyDataSetChanged();
             }
 
             @Override
             public void onTextChanged(CharSequence s, int start, int before, int count) {
-
+                mWorkDailyAdapter.notifyDataSetChanged();
             }
 
             @Override
             public void afterTextChanged(Editable editable) {
-                String strChche = editable.toString().replace(" ", "");//去除空格
-                strChche = strChche.replace(" ", " ");//去除空格
-                List<WorkDailyBean> chche = new ArrayList<>();
+                if ("delete_succeed".equals(delete_succeed) && !ListUtils.isEmpty(last_list) && TextUtils.isEmpty(editable.toString())){
+                    mWorkDailyAdapter.setmWorkDailyBeanList(last_list);
+                    Log.v("delete_succeed",delete_succeed);
+                    mWorkDailyAdapter.notifyDataSetChanged();
+                }else {
+                    String strChche = editable.toString().replace(" ", "");//去除空格
+                    strChche = strChche.replace(" ", " ");//去除空格
+                    List<WorkDailyBean> chche = new ArrayList<>();
 
-                if (real_list == null || real_list.size() <= 0) {
-                    mEmptyLayout.showEmpty();
-                    return;
-                } else {
-                    for (WorkDailyBean wd : real_list) {
-                        boolean b = getResult(wd.getWD_DATE() + wd.getWD_COMMENT() + wd.getSTATUS(), strChche.trim());
-                        if (b) {
-                            chche.add(wd);
+                    if (real_list == null || real_list.size() <= 0) {
+                        mEmptyLayout.showEmpty();
+                        return;
+                    } else {
+                        for (WorkDailyBean wd : real_list) {
+                            boolean b = getResult(wd.getWD_DATE() + wd.getWD_COMMENT() + wd.getSTATUS(), strChche.trim());
+                            if (b) {
+                                chche.add(wd);
+                            }
                         }
                     }
-                }
-                mWorkDailyAdapter.setSearch_content(strChche);
-                mWorkDailyAdapter.setmWorkDailyBeanList(chche);
-                if (!TextUtils.isEmpty(strChche)){
-                    mPullToRefreshListView.getRefreshableView().setAdapter(mWorkDailyAdapter);
-                }else {
-                    mWorkDailyAdapter.notifyDataSetInvalidated();
+                    mWorkDailyAdapter.setSearch_content(strChche);
+                    mWorkDailyAdapter.setmWorkDailyBeanList(chche);
+                    if (!TextUtils.isEmpty(strChche)){
+                        mPullToRefreshListView.getRefreshableView().setAdapter(mWorkDailyAdapter);
+                    }else {
+                        mWorkDailyAdapter.notifyDataSetInvalidated();
+                    }
+
                 }
 
             }
@@ -329,22 +339,23 @@ public class WorkDailyShowActivity extends BaseActivity {
 
         if (requestCode == 1219){
             if (resultCode == DailydetailsActivity.DELETE_SUCCEED) {
-//                if (data != null) {
-//                    returnedData = "" + data.getIntExtra("deleted_id", 0);
-//                    if (click_list != null) {
-//                        for (int i = 0; i < click_list.size(); i++) {
-//                            if (returnedData.equals(click_list.get(i).getWD_ID())) {
-//                                click_list.remove(i);
-//                            }
-//                        }
-//                        mWorkDailyAdapter.notifyDataSetChanged();
-//
-//                    }
-//                }else {
-                    click_list.remove(mPosition);
-                    mWorkDailyAdapter.notifyDataSetChanged();
-//                }
-
+                if (data != null) {
+                    delete_succeed = data.getStringExtra("delete_succeed");
+                    returnedData = data.getIntExtra("deleted_id", 0);
+                    if (real_list != null) {
+                        last_list = real_list;
+                        for (int i = 0; i < last_list.size(); i++) {
+                            int currid = last_list.get(i).getWD_ID();
+                            if (currid == returnedData) {
+                                last_list.remove(i);
+                                click_list.remove(mPosition);
+                            }
+                        }
+                        mWorkDailyAdapter.notifyDataSetChanged();
+                    }
+                }
+//                    click_list.remove(mPosition);
+//                    mWorkDailyAdapter.notifyDataSetChanged();
             }
         }
 

+ 0 - 291
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/WorkLogsActivity.java

@@ -1,291 +0,0 @@
-package com.xzjmyk.pm.activity.ui.erp.activity.oa;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.text.Editable;
-import android.text.TextWatcher;
-import android.view.View;
-import android.widget.AbsListView;
-import android.widget.ListView;
-
-import com.android.volley.Response;
-import com.android.volley.VolleyError;
-import com.handmark.pulltorefresh.library.PullToRefreshBase;
-import com.handmark.pulltorefresh.library.PullToRefreshListView;
-import com.xzjmyk.pm.activity.MyApplication;
-import com.xzjmyk.pm.activity.R;
-import com.xzjmyk.pm.activity.adapter.WorkLogAdapter;
-import com.xzjmyk.pm.activity.bean.circle.Comment;
-import com.xzjmyk.pm.activity.bean.circle.PublicMessage;
-import com.xzjmyk.pm.activity.ui.base.BaseActivity;
-import com.xzjmyk.pm.activity.util.StringUtils;
-import com.xzjmyk.pm.activity.util.ToastUtil;
-import com.xzjmyk.pm.activity.view.ClearEditText;
-import com.xzjmyk.pm.activity.view.PMsgBottomView;
-import com.xzjmyk.pm.activity.volley.ArrayResult;
-import com.xzjmyk.pm.activity.volley.ObjectResult;
-import com.xzjmyk.pm.activity.volley.Result;
-import com.xzjmyk.pm.activity.volley.StringJsonArrayRequest;
-import com.xzjmyk.pm.activity.volley.StringJsonObjectRequest;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * 工作日报
- * by gongpm 16\07\05
- */
-public class WorkLogsActivity extends BaseActivity {
-    private WorkLogsActivity ct;
-    private List<PublicMessage> allMag;//消息对象
-    private List<PublicMessage> showMag;//消息对象
-    private PMsgBottomView bottom_view;
-    private CommentItemChche itemChche;
-    private static int requestCode = 0x21;
-    public static int resultCode = 0x22;
-    private WorkLogAdapter mAdapter;
-    private ClearEditText search_edit;
-    private PullToRefreshListView context_rv;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_work_daily);
-        getSupportActionBar().setTitle("日报记录");
-        ct = this;
-        allMag = new ArrayList<>();
-        showMag = new ArrayList<>();
-        initView();
-        listener();
-    }
-
-
-    /*@Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        switch (item.getItemId()) {
-            case R.id.add_item:
-                startActivityForResult(new Intent(ct, AddDailyActivity.class), requestCode);
-                break;
-        }
-        return super.onOptionsItemSelected(item);
-    }
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        getMenuInflater().inflate(R.menu.menu_add_icon, menu);
-        return super.onCreateOptionsMenu(menu);
-    }*/
-
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-        if (requestCode == this.requestCode) {
-            if (resultCode == this.resultCode) {
-                requestMyBusiness(true);
-            }
-        }
-    }
-
-    //获取数据后更新界面
-    private void upDataUi() {
-        mAdapter.setData(showMag);
-        mAdapter.notifyDataSetChanged();
-    }
-
-    //正则
-    private static boolean getResult(String text, String str) {
-        Pattern p = Pattern.compile(str);
-        Matcher m = p.matcher(text);
-        return m.find();
-    }
-
-    private void listener() {
-        context_rv.setOnScrollListener(new AbsListView.OnScrollListener() {
-            @Override
-            public void onScrollStateChanged(AbsListView absListView, int i) {
-                if (bottom_view.getVisibility() == View.VISIBLE)
-                    bottom_view.hide();
-            }
-
-            @Override
-            public void onScroll(AbsListView absListView, int i, int i1, int i2) {
-            }
-        });
-        bottom_view.setPMsgBottomListener(new PMsgBottomView.PMsgBottomListener() {
-            @Override
-            public void sendText(String text) {
-                //完成输入
-                if (itemChche == null) return;
-                itemChche.body = text;
-                addComment();
-                bottom_view.hide();
-            }
-        });
-        search_edit.addTextChangedListener(new TextWatcher() {
-            @Override
-            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
-
-            }
-
-            @Override
-            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
-
-            }
-
-            @Override
-            public void afterTextChanged(Editable editable) {
-                String strChche = editable.toString();
-                //TODO 正则
-                showMag.clear();
-
-                for (PublicMessage e : allMag) {
-                    boolean b = getResult(e.getNickName() + e.getBody().getText(), strChche);
-                    if (b) {
-                        showMag.add(e);
-                    }
-                }
-                mAdapter.setData(showMag);
-                mAdapter.notifyDataSetChanged();
-            }
-        });
-        context_rv.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
-            @Override
-            public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
-                requestMyBusiness(true);
-            }
-
-            @Override
-            public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
-                requestMyBusiness(false);
-            }
-        });
-        mAdapter.setButtonViewListener(new WorkLogAdapter.ButtonViewListener() {
-            @Override
-            public void onClick(int i, String messageId, String toUserId, String toName) {
-                if (itemChche == null)
-                    itemChche = new CommentItemChche();
-                itemChche.messageId = messageId;
-                itemChche.toName = toName;
-                itemChche.toUserId = toUserId;
-                itemChche.toUserId = toUserId;
-                itemChche.option = i;
-                bottom_view.show();
-            }
-        });
-
-       /* context_rv.getRefreshableView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
-            @Override
-            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
-                Intent intent = new Intent(WorkLogsActivity.this,DailydetailsActivity.class);
-                startActivityForResult(intent, 0x99);
-            }
-        });*/
-    }
-
-    private void initView() {
-        bottom_view = (PMsgBottomView) findViewById(R.id.bottom_view);
-        search_edit = (ClearEditText) findViewById(R.id.work_daily_search_edit);
-        context_rv = (PullToRefreshListView) findViewById(R.id.work_daily_context_ptlv);
-        context_rv.setMode(PullToRefreshBase.Mode.BOTH);
-        mAdapter = new WorkLogAdapter(ct, showMag);
-        context_rv.setAdapter(mAdapter);
-        initData();
-    }
-    private void initData() {
-        requestMyBusiness(true);
-    }
-
-
-
-    private void requestMyBusiness(final boolean isPullDwonToRefersh) {
-        if (!StringUtils.isEmpty(search_edit.getText().toString())) {
-            search_edit.setText("");
-        }
-
-
-        HashMap<String, String> params = new HashMap<>();
-        String messageId = null;
-        if (!isPullDwonToRefersh && allMag.size() > 0) {
-            messageId = allMag.get(allMag.size() - 1).getMessageId();
-            params.put("messageId", messageId);
-        }
-        params.put("access_token", MyApplication.getInstance().mAccessToken);
-        params.put("pageSize", "10");
-        params.put("type", "0");
-        params.put("flag", "1");
-        StringJsonArrayRequest<PublicMessage> request = new StringJsonArrayRequest<PublicMessage>(
-                mConfig.MSG_LIST, new Response.ErrorListener() {
-            @Override
-            public void onErrorResponse(VolleyError arg0) {
-                ToastUtil.showErrorNet(ct);
-            }
-        }, new StringJsonArrayRequest.Listener<PublicMessage>() {
-            @Override
-            public void onResponse(ArrayResult<PublicMessage> result) {
-                boolean success = Result.defaultParser(mContext, result, true);
-                if (success) {
-                    if (allMag == null) {
-                        allMag = new ArrayList<>();
-                    }
-                    if (showMag == null) {
-                        showMag = new ArrayList<>();
-                    }
-                    if (isPullDwonToRefersh) {
-                        showMag.clear();
-                        allMag.clear();
-                    }
-                    if (context_rv.isRefreshing()) {
-                        context_rv.onRefreshComplete();
-                    }
-                    showMag.addAll(result.getData());
-                    allMag.addAll(result.getData());
-                    upDataUi();
-                }
-            }
-        }, PublicMessage.class, params);
-        addDefaultRequest(request);
-    }
-
-    private void addComment() {
-        if (itemChche == null) return;
-        Map<String, String> params = new HashMap<String, String>();
-        params.put("access_token", MyApplication.getInstance().mAccessToken);
-        params.put("messageId", itemChche.messageId);
-        params.put("body", itemChche.body);
-        StringJsonObjectRequest<String> request = new StringJsonObjectRequest<String>(mConfig.MSG_COMMENT_ADD, new Response.ErrorListener() {
-            @Override
-            public void onErrorResponse(VolleyError arg0) {
-                ToastUtil.showErrorNet(ct);
-            }
-        }, new StringJsonObjectRequest.Listener<String>() {
-            @Override
-            public void onResponse(ObjectResult<String> result) {
-                boolean success = Result.defaultParser(ct, result, true);
-                if (success && result.getData() != null) {
-                    Comment comment = new Comment();
-                    comment.setBody(itemChche.body);
-                    comment.setNickName(MyApplication.getInstance().mLoginUser.getNickName());
-                    comment.setToBody(itemChche.body);
-                    showMag.get(itemChche.option).getComments().add(comment);
-                    mAdapter.setData(showMag);
-                    mAdapter.notifyDataSetChanged();
-                }
-            }
-        }, String.class, params);
-        addDefaultRequest(request);
-    }
-
-
-    class CommentItemChche {
-        private int option;
-        private String messageId;
-        private String toUserId;
-        private String toName;
-        private String body;
-    }
-
-
-}

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/adapter/MissionAdapter.java

@@ -190,7 +190,7 @@ public class MissionAdapter extends RecyclerView.Adapter<MissionAdapter.BaseView
                 item_time_tv,//创建时间
                 item_long_tv,
                 item_company_tv, //公司名称
-                item_remark_tv;
+                item_remark_tv;//目的
         RadioButton item_half_rb, item_all_rb;
 
         public BaseViewHolder(View itemView) {

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/attendance/AutoErpService.java

@@ -30,10 +30,10 @@ import com.xzjmyk.pm.activity.ui.erp.util.auto.NotificationManage;
 import com.xzjmyk.pm.activity.ui.tool.ThreadUtil;
 import com.xzjmyk.pm.activity.util.PreferenceUtils;
 import com.xzjmyk.pm.activity.util.TimeUtils;
+import com.xzjmyk.pm.basepedo.service.StepService;
 
 import java.util.List;
 
-import basepedo.service.StepService;
 
 /**
  * 自动Erp服务,开启线程

+ 4 - 4
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/attendance/AutoErpSigninUitl.java

@@ -410,10 +410,10 @@ public class AutoErpSigninUitl implements HttpHandler.OnResultListener {
      * @throws Exception
      */
     private void endMission(final MissionModel model, final boolean saveOk) throws Exception {
-        //TODO 英唐大厦应该改为公司名称
+        float longitude = PreferenceUtils.getFloat("longitude");
+        float latitude = PreferenceUtils.getFloat("latitude");
         BaiduMapUtil.getInstence().getDrivingRoute(MyApplication.getInstance().
-                getBdLocationHelper().getCityName(), MyApplication.getInstance().
-                getBdLocationHelper().getName(), "英唐大厦", new OnGetDrivingRouteResult() {
+                getBdLocationHelper().getLocation(), new LatLng(latitude, longitude), new OnGetDrivingRouteResult() {
             @Override
             public void onGetDrivingRouteResult(DrivingRouteResult drivingRouteResult) {
                 List<DrivingRouteLine> list = drivingRouteResult.getRouteLines();
@@ -424,7 +424,7 @@ public class AutoErpSigninUitl implements HttpHandler.OnResultListener {
                     return;
                 }
                 int minTime = 0;
-                for (DrivingRouteLine e : list) {//TODO 获取最优最快路线及时间
+                for (DrivingRouteLine e : list) {
                     if (minTime == 0 || minTime > e.getDuration()) {
                         minTime = e.getDuration();
                     }

+ 1 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/MeFragment.java

@@ -50,14 +50,13 @@ import com.xzjmyk.pm.activity.ui.tool.SingleImagePreviewActivity;
 import com.xzjmyk.pm.activity.util.PreferenceUtils;
 import com.xzjmyk.pm.activity.util.ToastUtil;
 import com.xzjmyk.pm.activity.view.crouton.Style;
+import com.xzjmyk.pm.basepedo.ui.MyPedometerActivity;
 
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
-import basepedo.ui.MyPedometerActivity;
-
 import static com.xzjmyk.pm.activity.R.id.my_friend_rl;
 
 

+ 3 - 3
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/SettingActivity.java

@@ -44,10 +44,10 @@ import com.xzjmyk.pm.activity.ui.tool.WebViewActivity;
 import com.xzjmyk.pm.activity.util.GetFileSizeUtil;
 import com.xzjmyk.pm.activity.util.PreferenceUtils;
 import com.xzjmyk.pm.activity.util.ToastUtil;
+import com.xzjmyk.pm.basepedo.ui.MyPedometerActivity;
 
 import java.io.File;
 
-import basepedo.ui.MyPedometerActivity;
 
 /**
  * 设置
@@ -76,7 +76,7 @@ public class SettingActivity extends ActionBackActivity implements View.OnClickL
     private RelativeLayout close_push_rl;
     private ProgressDialog dialog;
     private RelativeLayout share_rl;
-    private String uustep_service_name = "basepedo.service.StepService";
+    private String uustep_service_name = "com.xzjmyk.pm.basepedo.service.StepService";
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -139,7 +139,7 @@ public class SettingActivity extends ActionBackActivity implements View.OnClickL
 
         //UU开关的 根据StepService是否开启显示状态
         int isStep = PreferenceUtils.getInt(MyApplication.getInstance(), MainActivity.UU_STEP);
-
+         boolean sbb = isServiceRunning(uustep_service_name);
         if (isServiceRunning(uustep_service_name)&&(isStep == -1 || isStep == 1)){
             uu_step_reply.setChecked(true);
         }else {

+ 48 - 3
WeiChat/src/main/java/com/xzjmyk/pm/activity/util/BaiduMapUtil.java

@@ -328,11 +328,11 @@ public class BaiduMapUtil {
     }
 
 
-    public void getDrivingRoute(String city, String from, String to, OnGetRoutePlanResultListener onGetRoutePlanResultListener) {
+    public void getDrivingRoute( LatLng from, LatLng to, OnGetRoutePlanResultListener onGetRoutePlanResultListener) {
         drivingSearch = RoutePlanSearch.newInstance();
         drivingSearch.setOnGetRoutePlanResultListener(onGetRoutePlanResultListener);
-        PlanNode stNode = PlanNode.withCityNameAndPlaceName(city, from);
-        PlanNode enNode = PlanNode.withCityNameAndPlaceName(city, to);
+        PlanNode stNode = PlanNode.withLocation(from);
+        PlanNode enNode = PlanNode.withLocation(to);
         drivingSearch.drivingSearch((new DrivingRoutePlanOption())
                 .from(stNode)
                 .to(enNode));
@@ -390,4 +390,49 @@ public class BaiduMapUtil {
         if (!AppConfig.DEBUG || StringUtils.isEmpty(str)) return;
         Log.i("gongpengming", str);
     }
+
+    public void loadNearbyLocation(LatLng latLng, String key) {
+        PoiNearbySearchOption option = new PoiNearbySearchOption();
+        option.location(latLng);
+        option.keyword(key);
+        PoiSearch search = PoiSearch.newInstance();
+        search.setOnGetPoiSearchResultListener(new OnGetPoiSearchResultListener() {
+            @Override
+            public void onGetPoiResult(PoiResult poiResult) {
+                Log.i("gongpengming", "onGetPoiResult");
+                if (poiResult == null)
+                    Log.i("gongpengming", "poiResult==null");
+                else Log.i("gongpengming", "poiResult!!=null");
+                List<PoiInfo> list = poiResult.getAllPoi();
+                Log.i("gongpengming", "————————————————————————————————————");
+                if (ListUtils.isEmpty(list))
+                    Log.i("gongpengming", "poiResult==null");
+                else {
+                    Log.i("gongpengming", "poiResult!!=null");
+                    for (PoiInfo info : list) {
+                        Log.i("gongpengming", "address=l" + info.address);
+                        Log.i("gongpengming", "=address=" + info.name);
+                        Log.i("gongpengming", "address=" + info.city);
+                    }
+                }
+            }
+
+            @Override
+            public void onGetPoiDetailResult(PoiDetailResult poiDetailResult) {
+                Log.i("gongpengming", "onGetPoiDetailResult");
+                if (poiDetailResult == null)
+                    Log.i("gongpengming", "poiDetailResult==null");
+                else Log.i("gongpengming", "poiDetailResult!!=null");
+            }
+
+            @Override
+            public void onGetPoiIndoorResult(PoiIndoorResult poiIndoorResult) {
+                Log.i("gongpengming", "onGetPoiIndoorResult");
+                if (poiIndoorResult == null)
+                    Log.i("gongpengming", "poiIndoorResult==null");
+                else Log.i("gongpengming", "poiIndoorResult!!=null");
+            }
+        });
+        search.searchNearby(option);
+    }
 }

+ 25 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/view/VpCalenderView.java

@@ -0,0 +1,25 @@
+package com.xzjmyk.pm.activity.view;
+
+import android.content.Context;
+import android.support.v4.view.ViewPager;
+import android.util.AttributeSet;
+
+/**
+ * Created by Bitliker on 2017/1/11.
+ */
+
+public class VpCalenderView extends ViewPager {
+
+    public VpCalenderView(Context context) {
+        this(context, null);
+    }
+
+    public VpCalenderView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+
+
+
+
+}

+ 1 - 1
WeiChat/src/main/java/basepedo/config/Constant.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/config/Constant.java

@@ -1,4 +1,4 @@
-package basepedo.config;
+package com.xzjmyk.pm.basepedo.config;
 
 /**
  * Created by FANGlh on 2016/12/30.

+ 2 - 1
WeiChat/src/main/java/basepedo/pojo/StepData.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/pojo/StepData.java

@@ -1,9 +1,10 @@
-package basepedo.pojo;
+package com.xzjmyk.pm.basepedo.pojo;
 
 import com.litesuits.orm.db.annotation.Column;
 import com.litesuits.orm.db.annotation.PrimaryKey;
 import com.litesuits.orm.db.annotation.Table;
 import com.litesuits.orm.db.enums.AssignType;
+
 /**
  * Created by FANGlh on 2016/12/30.
  */

+ 1 - 1
WeiChat/src/main/java/basepedo/service/BootCompleteReceiver.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/service/BootCompleteReceiver.java

@@ -1,4 +1,4 @@
-package basepedo.service;
+package com.xzjmyk.pm.basepedo.service;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;

+ 2 - 4
WeiChat/src/main/java/basepedo/service/StepDcretor.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/service/StepDcretor.java

@@ -1,4 +1,4 @@
-package basepedo.service;
+package com.xzjmyk.pm.basepedo.service;
 
 import android.content.Context;
 import android.hardware.Sensor;
@@ -9,8 +9,6 @@ import android.util.Log;
 import java.util.Timer;
 import java.util.TimerTask;
 
-import basepedo.utils.CountDownTimer;
-
 /**
  * Created by FANGlh on 2016/12/30.
  */
@@ -237,7 +235,7 @@ public class StepDcretor implements SensorEventListener {
         return ave;
     }
 
-    class TimeCount extends CountDownTimer {
+    class TimeCount extends com.xzjmyk.pm.basepedo.utils.CountDownTimer {
         public TimeCount(long millisInFuture, long countDownInterval) {
             super(millisInFuture, countDownInterval);
         }

+ 18 - 18
WeiChat/src/main/java/basepedo/service/StepService.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/service/StepService.java

@@ -1,4 +1,4 @@
-package basepedo.service;
+package com.xzjmyk.pm.basepedo.service;
 
 import android.annotation.TargetApi;
 import android.app.ActivityManager;
@@ -30,17 +30,17 @@ import com.xzjmyk.pm.activity.MyApplication;
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.ui.MainActivity;
 import com.xzjmyk.pm.activity.util.PreferenceUtils;
+import com.xzjmyk.pm.basepedo.pojo.StepData;
+import com.xzjmyk.pm.basepedo.ui.MyPedometerActivity;
+import com.xzjmyk.pm.basepedo.utils.CountDownTimer;
+import com.xzjmyk.pm.basepedo.utils.DbUtils;
 
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
-import basepedo.config.Constant;
-import basepedo.pojo.StepData;
-import basepedo.ui.MyPedometerActivity;
-import basepedo.utils.CountDownTimer;
-import basepedo.utils.DbUtils;
+
 
 @TargetApi(Build.VERSION_CODES.CUPCAKE)
 
@@ -53,7 +53,7 @@ public class StepService extends Service implements SensorEventListener {
     private static int duration = 10000;
     private static String CURRENTDATE = "";
     private SensorManager sensorManager;
-    private StepDcretor stepDetector;
+    private com.xzjmyk.pm.basepedo.service.StepDcretor stepDetector;
     private NotificationManager nm;
     private NotificationCompat.Builder builder;
     private Messenger messenger = new Messenger(new MessenerHandler());
@@ -63,17 +63,17 @@ public class StepService extends Service implements SensorEventListener {
     //测试
     private static int i = 0;
     private String DB_NAME = "basepedo";
-    private String uustep_service_name = "basepedo.service.StepService";
+    private String uustep_service_name = "com.xzjmyk.pm.basepedo.service.StepService";
     private static class MessenerHandler extends Handler {
         @Override
         public void handleMessage(Message msg) {
             switch (msg.what) {
-                case Constant.MSG_FROM_CLIENT:
+                case com.xzjmyk.pm.basepedo.config.Constant.MSG_FROM_CLIENT:
                     try {
                         Messenger messenger = msg.replyTo;
-                        Message replyMsg = Message.obtain(null, Constant.MSG_FROM_SERVER);
+                        Message replyMsg = Message.obtain(null, com.xzjmyk.pm.basepedo.config.Constant.MSG_FROM_SERVER);
                         Bundle bundle = new Bundle();
-                        bundle.putInt("step", StepDcretor.CURRENT_SETP);
+                        bundle.putInt("step", com.xzjmyk.pm.basepedo.service.StepDcretor.CURRENT_SETP);
                         replyMsg.setData(bundle);
                         messenger.send(replyMsg);
                     } catch (RemoteException e) {
@@ -109,7 +109,7 @@ public class StepService extends Service implements SensorEventListener {
     @Override
     public int onStartCommand(Intent intent, int flags, int startId) {
         initTodayData();
-        updateNotification("今日步数:" + StepDcretor.CURRENT_SETP + " 步");
+        updateNotification("今日步数:" + com.xzjmyk.pm.basepedo.service.StepDcretor.CURRENT_SETP + " 步");
         flags = START_STICKY;
         Log.i("StepService", "onStartCommand");
         return super.onStartCommand(intent,flags,startId);
@@ -123,13 +123,13 @@ public class StepService extends Service implements SensorEventListener {
 
     private void initTodayData() {
         CURRENTDATE = getTodayDate();
-        DbUtils.createDb(this, DB_NAME);
+        com.xzjmyk.pm.basepedo.utils.DbUtils.createDb(this, DB_NAME);
         //获取当天的数据,用于展示
-        List<StepData> list = DbUtils.getQueryByWhere(StepData.class, "today", new String[]{CURRENTDATE});
+        List<com.xzjmyk.pm.basepedo.pojo.StepData> list = com.xzjmyk.pm.basepedo.utils.DbUtils.getQueryByWhere(com.xzjmyk.pm.basepedo.pojo.StepData.class, "today", new String[]{CURRENTDATE});
         if (list.size() == 0 || list.isEmpty()) {
-            StepDcretor.CURRENT_SETP = 0;
+            com.xzjmyk.pm.basepedo.service.StepDcretor.CURRENT_SETP = 0;
         } else if (list.size() == 1) {
-            StepDcretor.CURRENT_SETP = Integer.parseInt(list.get(0).getStep());
+            com.xzjmyk.pm.basepedo.service.StepDcretor.CURRENT_SETP = Integer.parseInt(list.get(0).getStep());
         } else {
             Log.i(TAG, "出错了!");
         }
@@ -236,7 +236,7 @@ public class StepService extends Service implements SensorEventListener {
                 .getSystemService(SENSOR_SERVICE);
         getLock(this);
        // android4.4以后可以使用计步传感器
-        int VERSION_CODES = android.os.Build.VERSION.SDK_INT;
+        int VERSION_CODES = Build.VERSION.SDK_INT;
         if (VERSION_CODES >= 19) {
             addCountStepListener();
         } else {
@@ -356,7 +356,7 @@ public class StepService extends Service implements SensorEventListener {
 //        android.provider.Settings.Secure.putInt(getContentResolver(), systemSettingKey,enabled ? 1 : 0);
 //    }
 
-    synchronized private PowerManager.WakeLock getLock(Context context) {
+    synchronized private WakeLock getLock(Context context) {
         if (mWakeLock != null) {
             if (mWakeLock.isHeld())
                 mWakeLock.release();

+ 63 - 0
WeiChat/src/main/java/com/xzjmyk/pm/basepedo/slidinguppanel/ScrollableViewHelper.java

@@ -0,0 +1,63 @@
+package com.xzjmyk.pm.basepedo.slidinguppanel;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.ListView;
+import android.widget.ScrollView;
+
+/**
+ * Helper class for determining the current scroll positions for scrollable views. Currently works
+ * for ListView, ScrollView and RecyclerView, but the library users can override it to add support
+ * for other views.
+ */
+public class ScrollableViewHelper {
+    /**
+     * Returns the current scroll position of the scrollable view. If this method returns zero or
+     * less, it means at the scrollable view is in a position such as the panel should handle
+     * scrolling. If the method returns anything above zero, then the panel will let the scrollable
+     * view handle the scrolling
+     *
+     * @param scrollableView the scrollable view
+     * @param isSlidingUp whether or not the panel is sliding up or down
+     * @return the scroll position
+     */
+    public int getScrollableViewScrollPosition(View scrollableView, boolean isSlidingUp) {
+        if (scrollableView == null) return 0;
+        if (scrollableView instanceof ScrollView) {
+            if (isSlidingUp) {
+                return scrollableView.getScrollY();
+            } else {
+                ScrollView sv = ((ScrollView) scrollableView);
+                View child = sv.getChildAt(0);
+                return (child.getBottom() - (sv.getHeight() + sv.getScrollY()));
+            }
+        } else if (scrollableView instanceof ListView && ((ListView) scrollableView).getChildCount() > 0) {
+            ListView lv = ((ListView) scrollableView);
+            if (lv.getAdapter() == null) return 0;
+            if (isSlidingUp) {
+                View firstChild = lv.getChildAt(0);
+                // Approximate the scroll position based on the top child and the first visible item
+                return lv.getFirstVisiblePosition() * firstChild.getHeight() - firstChild.getTop();
+            } else {
+                View lastChild = lv.getChildAt(lv.getChildCount() - 1);
+                // Approximate the scroll position based on the bottom child and the last visible item
+                return (lv.getAdapter().getCount() - lv.getLastVisiblePosition() - 1) * lastChild.getHeight() + lastChild.getBottom() - lv.getBottom();
+            }
+        } else if (scrollableView instanceof RecyclerView && ((RecyclerView) scrollableView).getChildCount() > 0) {
+            RecyclerView rv = ((RecyclerView) scrollableView);
+            RecyclerView.LayoutManager lm = rv.getLayoutManager();
+            if (rv.getAdapter() == null) return 0;
+            if (isSlidingUp) {
+                View firstChild = rv.getChildAt(0);
+                // Approximate the scroll position based on the top child and the first visible item
+                return rv.getChildLayoutPosition(firstChild) * lm.getDecoratedMeasuredHeight(firstChild) - lm.getDecoratedTop(firstChild);
+            } else {
+                View lastChild = rv.getChildAt(rv.getChildCount() - 1);
+                // Approximate the scroll position based on the bottom child and the last visible item
+                return (rv.getAdapter().getItemCount() - 1) * lm.getDecoratedMeasuredHeight(lastChild) + lm.getDecoratedBottom(lastChild) - rv.getBottom();
+            }
+        } else {
+            return 0;
+        }
+    }
+}

+ 1470 - 0
WeiChat/src/main/java/com/xzjmyk/pm/basepedo/slidinguppanel/SlidingUpPanelLayout.java

@@ -0,0 +1,1470 @@
+package com.xzjmyk.pm.basepedo.slidinguppanel;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.PixelFormat;
+import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.support.v4.view.MotionEventCompat;
+import android.support.v4.view.ViewCompat;
+import android.util.AttributeSet;
+import android.view.Gravity;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.animation.AnimationUtils;
+import android.view.animation.Interpolator;
+
+import com.xzjmyk.pm.activity.R;
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class SlidingUpPanelLayout extends ViewGroup {
+
+    private static final String TAG = SlidingUpPanelLayout.class.getSimpleName();
+
+    /**
+     * Default peeking out panel height
+     */
+    private static final int DEFAULT_PANEL_HEIGHT = 68; // dp;
+
+    /**
+     * Default anchor point height
+     */
+    private static final float DEFAULT_ANCHOR_POINT = 1.0f; // In relative %
+
+    /**
+     * Default initial state for the component
+     */
+    private static PanelState DEFAULT_SLIDE_STATE = PanelState.COLLAPSED;
+
+    /**
+     * Default height of the shadow above the peeking out panel
+     */
+    private static final int DEFAULT_SHADOW_HEIGHT = 4; // dp;
+
+    /**
+     * If no fade color is given by default it will fade to 80% gray.
+     */
+    private static final int DEFAULT_FADE_COLOR = 0x99000000;
+
+    /**
+     * Default Minimum velocity that will be detected as a fling
+     */
+    private static final int DEFAULT_MIN_FLING_VELOCITY = 400; // dips per second
+    /**
+     * Default is set to false because that is how it was written
+     */
+    private static final boolean DEFAULT_OVERLAY_FLAG = false;
+    /**
+     * Default is set to true for clip panel for performance reasons
+     */
+    private static final boolean DEFAULT_CLIP_PANEL_FLAG = true;
+    /**
+     * Default attributes for layout
+     */
+    private static final int[] DEFAULT_ATTRS = new int[]{
+            android.R.attr.gravity
+    };
+    /**
+     * Tag for the sliding state stored inside the bundle
+     */
+    public static final String SLIDING_STATE = "sliding_state";
+
+    /**
+     * Minimum velocity that will be detected as a fling
+     */
+    private int mMinFlingVelocity = DEFAULT_MIN_FLING_VELOCITY;
+
+    /**
+     * The fade color used for the panel covered by the slider. 0 = no fading.
+     */
+    private int mCoveredFadeColor = DEFAULT_FADE_COLOR;
+
+    /**
+     * Default parallax length of the main view
+     */
+    private static final int DEFAULT_PARALLAX_OFFSET = 0;
+
+    /**
+     * The paint used to dim the main layout when sliding
+     */
+    private final Paint mCoveredFadePaint = new Paint();
+
+    /**
+     * Drawable used to draw the shadow between panes.
+     */
+    private final Drawable mShadowDrawable;
+
+    /**
+     * The size of the overhang in pixels.
+     */
+    private int mPanelHeight = -1;
+
+    /**
+     * The size of the shadow in pixels.
+     */
+    private int mShadowHeight = -1;
+
+    /**
+     * Parallax offset
+     */
+    private int mParallaxOffset = -1;
+
+    /**
+     * True if the collapsed panel should be dragged up.
+     */
+    private boolean mIsSlidingUp;
+
+    /**
+     * Panel overlays the windows instead of putting it underneath it.
+     */
+    private boolean mOverlayContent = DEFAULT_OVERLAY_FLAG;
+
+    /**
+     * The main view is clipped to the main top border
+     */
+    private boolean mClipPanel = DEFAULT_CLIP_PANEL_FLAG;
+
+    /**
+     * If provided, the panel can be dragged by only this view. Otherwise, the entire panel can be
+     * used for dragging.
+     */
+    private View mDragView;
+
+    /**
+     * If provided, the panel can be dragged by only this view. Otherwise, the entire panel can be
+     * used for dragging.
+     */
+    private int mDragViewResId = -1;
+
+    /**
+     * If provided, the panel will transfer the scroll from this view to itself when needed.
+     */
+    private View mScrollableView;
+    private int mScrollableViewResId;
+    private ScrollableViewHelper mScrollableViewHelper = new ScrollableViewHelper();
+
+    /**
+     * The child view that can slide, if any.
+     */
+    private View mSlideableView;
+
+    /**
+     * The main view
+     */
+    private View mMainView;
+
+    /**
+     * Current state of the slideable view.
+     */
+    public enum PanelState {
+        EXPANDED,
+        COLLAPSED,
+        ANCHORED,
+        HIDDEN,
+        DRAGGING
+    }
+
+    private PanelState mSlideState = DEFAULT_SLIDE_STATE;
+
+    /**
+     * If the current slide state is DRAGGING, this will store the last non dragging state
+     */
+    private PanelState mLastNotDraggingSlideState = DEFAULT_SLIDE_STATE;
+
+    /**
+     * How far the panel is offset from its expanded position.
+     * range [0, 1] where 0 = collapsed, 1 = expanded.
+     */
+    private float mSlideOffset;
+
+    /**
+     * How far in pixels the slideable panel may move.
+     */
+    private int mSlideRange;
+
+    /**
+     * An anchor point where the panel can stop during sliding
+     */
+    private float mAnchorPoint = 1.f;
+
+    /**
+     * A panel view is locked into internal scrolling or another condition that
+     * is preventing a drag.
+     */
+    private boolean mIsUnableToDrag;
+
+    /**
+     * Flag indicating that sliding feature is enabled\disabled
+     */
+    private boolean mIsTouchEnabled;
+
+    private float mPrevMotionY;
+    private float mInitialMotionX;
+    private float mInitialMotionY;
+    private boolean mIsScrollableViewHandlingTouch = false;
+
+    private List<PanelSlideListener> mPanelSlideListeners = new ArrayList<>();
+    private OnClickListener mFadeOnClickListener;
+
+    private final ViewDragHelper mDragHelper;
+
+    /**
+     * Stores whether or not the pane was expanded the last time it was slideable.
+     * If expand/collapse operations are invoked this state is modified. Used by
+     * instance state save/restore.
+     */
+    private boolean mFirstLayout = true;
+
+    private final Rect mTmpRect = new Rect();
+
+    /**
+     * Listener for monitoring events about sliding panes.
+     */
+    public interface PanelSlideListener {
+        /**
+         * Called when a sliding pane's position changes.
+         *
+         * @param panel       The child view that was moved
+         * @param slideOffset The new offset of this sliding pane within its range, from 0-1
+         */
+        public void onPanelSlide(View panel, float slideOffset);
+
+        /**
+         * Called when a sliding panel state changes
+         *
+         * @param panel The child view that was slid to an collapsed position
+         */
+        public void onPanelStateChanged(View panel, PanelState previousState, PanelState newState);
+    }
+
+    /**
+     * No-op stubs for {@link PanelSlideListener}. If you only want to implement a subset
+     * of the listener methods you can extend this instead of implement the full interface.
+     */
+    public static class SimplePanelSlideListener implements PanelSlideListener {
+        @Override
+        public void onPanelSlide(View panel, float slideOffset) {
+        }
+
+        @Override
+        public void onPanelStateChanged(View panel, PanelState previousState, PanelState newState) {
+        }
+    }
+
+    public SlidingUpPanelLayout(Context context) {
+        this(context, null);
+    }
+
+    public SlidingUpPanelLayout(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public SlidingUpPanelLayout(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+
+        if (isInEditMode()) {
+            mShadowDrawable = null;
+            mDragHelper = null;
+            return;
+        }
+
+        Interpolator scrollerInterpolator = null;
+        if (attrs != null) {
+            TypedArray defAttrs = context.obtainStyledAttributes(attrs, DEFAULT_ATTRS);
+
+            if (defAttrs != null) {
+                int gravity = defAttrs.getInt(0, Gravity.NO_GRAVITY);
+                setGravity(gravity);
+            }
+
+            defAttrs.recycle();
+
+            TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SlidingUpPanelLayout);
+
+            if (ta != null) {
+                mPanelHeight = ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoPanelHeight, -1);
+                mShadowHeight = ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoShadowHeight, -1);
+                mParallaxOffset = ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoParallaxOffset, -1);
+
+                mMinFlingVelocity = ta.getInt(R.styleable.SlidingUpPanelLayout_umanoFlingVelocity, DEFAULT_MIN_FLING_VELOCITY);
+                mCoveredFadeColor = ta.getColor(R.styleable.SlidingUpPanelLayout_umanoFadeColor, DEFAULT_FADE_COLOR);
+
+                mDragViewResId = ta.getResourceId(R.styleable.SlidingUpPanelLayout_umanoDragView, -1);
+                mScrollableViewResId = ta.getResourceId(R.styleable.SlidingUpPanelLayout_umanoScrollableView, -1);
+
+                mOverlayContent = ta.getBoolean(R.styleable.SlidingUpPanelLayout_umanoOverlay, DEFAULT_OVERLAY_FLAG);
+                mClipPanel = ta.getBoolean(R.styleable.SlidingUpPanelLayout_umanoClipPanel, DEFAULT_CLIP_PANEL_FLAG);
+
+                mAnchorPoint = ta.getFloat(R.styleable.SlidingUpPanelLayout_umanoAnchorPoint, DEFAULT_ANCHOR_POINT);
+
+                mSlideState = PanelState.values()[ta.getInt(R.styleable.SlidingUpPanelLayout_umanoInitialState, DEFAULT_SLIDE_STATE.ordinal())];
+
+                int interpolatorResId = ta.getResourceId(R.styleable.SlidingUpPanelLayout_umanoScrollInterpolator, -1);
+                if (interpolatorResId != -1) {
+                    scrollerInterpolator = AnimationUtils.loadInterpolator(context, interpolatorResId);
+                }
+            }
+
+            ta.recycle();
+        }
+
+        final float density = context.getResources().getDisplayMetrics().density;
+        if (mPanelHeight == -1) {
+            mPanelHeight = (int) (DEFAULT_PANEL_HEIGHT * density + 0.5f);
+        }
+        if (mShadowHeight == -1) {
+            mShadowHeight = (int) (DEFAULT_SHADOW_HEIGHT * density + 0.5f);
+        }
+        if (mParallaxOffset == -1) {
+            mParallaxOffset = (int) (DEFAULT_PARALLAX_OFFSET * density);
+        }
+        // If the shadow height is zero, don't show the shadow
+        if (mShadowHeight > 0) {
+            if (mIsSlidingUp) {
+                mShadowDrawable = getResources().getDrawable(R.drawable.above_shadow);
+            } else {
+                mShadowDrawable = getResources().getDrawable(R.drawable.below_shadow);
+            }
+        } else {
+            mShadowDrawable = null;
+        }
+
+        setWillNotDraw(false);
+
+        mDragHelper = ViewDragHelper.create(this, 0.5f, scrollerInterpolator, new DragHelperCallback());
+        mDragHelper.setMinVelocity(mMinFlingVelocity * density);
+
+        mIsTouchEnabled = true;
+    }
+
+    /**
+     * Set the Drag View after the view is inflated
+     */
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+        if (mDragViewResId != -1) {
+            setDragView(findViewById(mDragViewResId));
+        }
+        if (mScrollableViewResId != -1) {
+            setScrollableView(findViewById(mScrollableViewResId));
+        }
+    }
+
+    public void setGravity(int gravity) {
+        if (gravity != Gravity.TOP && gravity != Gravity.BOTTOM) {
+            throw new IllegalArgumentException("gravity must be set to either top or bottom");
+        }
+        mIsSlidingUp = gravity == Gravity.BOTTOM;
+        if (!mFirstLayout) {
+            requestLayout();
+        }
+    }
+
+    /**
+     * Set the color used to fade the pane covered by the sliding pane out when the pane
+     * will become fully covered in the expanded state.
+     *
+     * @param color An ARGB-packed color value
+     */
+    public void setCoveredFadeColor(int color) {
+        mCoveredFadeColor = color;
+        requestLayout();
+    }
+
+    /**
+     * @return The ARGB-packed color value used to fade the fixed pane
+     */
+    public int getCoveredFadeColor() {
+        return mCoveredFadeColor;
+    }
+
+    /**
+     * Set sliding enabled flag
+     *
+     * @param enabled flag value
+     */
+    public void setTouchEnabled(boolean enabled) {
+        mIsTouchEnabled = enabled;
+    }
+
+    public boolean isTouchEnabled() {
+        return mIsTouchEnabled && mSlideableView != null && mSlideState != PanelState.HIDDEN;
+    }
+
+    /**
+     * Set the collapsed panel height in pixels
+     *
+     * @param val A height in pixels
+     */
+    public void setPanelHeight(int val) {
+        if (getPanelHeight() == val) {
+            return;
+        }
+
+        mPanelHeight = val;
+        if (!mFirstLayout) {
+            requestLayout();
+        }
+
+        if (getPanelState() == PanelState.COLLAPSED) {
+            smoothToBottom();
+            invalidate();
+            return;
+        }
+    }
+
+    protected void smoothToBottom() {
+        smoothSlideTo(0, 0);
+    }
+
+    /**
+     * @return The current shadow height
+     */
+    public int getShadowHeight() {
+        return mShadowHeight;
+    }
+
+    /**
+     * Set the shadow height
+     *
+     * @param val A height in pixels
+     */
+    public void setShadowHeight(int val) {
+        mShadowHeight = val;
+        if (!mFirstLayout) {
+            invalidate();
+        }
+    }
+
+    /**
+     * @return The current collapsed panel height
+     */
+    public int getPanelHeight() {
+        return mPanelHeight;
+    }
+
+    /**
+     * @return The current parallax offset
+     */
+    public int getCurrentParallaxOffset() {
+        // Clamp slide offset at zero for parallax computation;
+        int offset = (int) (mParallaxOffset * Math.max(mSlideOffset, 0));
+        return mIsSlidingUp ? -offset : offset;
+    }
+
+    /**
+     * Set parallax offset for the panel
+     *
+     * @param val A height in pixels
+     */
+    public void setParallaxOffset(int val) {
+        mParallaxOffset = val;
+        if (!mFirstLayout) {
+            requestLayout();
+        }
+    }
+
+    /**
+     * @return The current minimin fling velocity
+     */
+    public int getMinFlingVelocity() {
+        return mMinFlingVelocity;
+    }
+
+    /**
+     * Sets the minimum fling velocity for the panel
+     *
+     * @param val the new value
+     */
+    public void setMinFlingVelocity(int val) {
+        mMinFlingVelocity = val;
+    }
+
+    /**
+     * Adds a panel slide listener
+     *
+     * @param listener
+     */
+    public void addPanelSlideListener(PanelSlideListener listener) {
+        synchronized (mPanelSlideListeners) {
+            mPanelSlideListeners.add(listener);
+        }
+    }
+
+    /**
+     * Removes a panel slide listener
+     *
+     * @param listener
+     */
+    public void removePanelSlideListener(PanelSlideListener listener) {
+        synchronized (mPanelSlideListeners) {
+            mPanelSlideListeners.remove(listener);
+        }
+    }
+
+    /**
+     * Provides an on click for the portion of the main view that is dimmed. The listener is not
+     * triggered if the panel is in a collapsed or a hidden position. If the on click listener is
+     * not provided, the clicks on the dimmed area are passed through to the main layout.
+     * @param listener
+     */
+    public void setFadeOnClickListener(OnClickListener listener) {
+        mFadeOnClickListener = listener;
+    }
+
+    /**
+     * Set the draggable view portion. Use to null, to allow the whole panel to be draggable
+     *
+     * @param dragView A view that will be used to drag the panel.
+     */
+    public void setDragView(View dragView) {
+        if (mDragView != null) {
+            mDragView.setOnClickListener(null);
+        }
+        mDragView = dragView;
+        if (mDragView != null) {
+            mDragView.setClickable(true);
+            mDragView.setFocusable(false);
+            mDragView.setFocusableInTouchMode(false);
+            mDragView.setOnClickListener(new OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if (!isEnabled() || !isTouchEnabled()) return;
+                    if (mSlideState != PanelState.EXPANDED && mSlideState != PanelState.ANCHORED) {
+                        if (mAnchorPoint < 1.0f) {
+                            setPanelState(PanelState.ANCHORED);
+                        } else {
+                            setPanelState(PanelState.EXPANDED);
+                        }
+                    } else {
+                        setPanelState(PanelState.COLLAPSED);
+                    }
+                }
+            });
+            ;
+        }
+    }
+
+    /**
+     * Set the draggable view portion. Use to null, to allow the whole panel to be draggable
+     *
+     * @param dragViewResId The resource ID of the new drag view
+     */
+    public void setDragView(int dragViewResId) {
+        mDragViewResId = dragViewResId;
+        setDragView(findViewById(dragViewResId));
+    }
+
+    /**
+     * Set the scrollable child of the sliding layout. If set, scrolling will be transfered between
+     * the panel and the view when necessary
+     *
+     * @param scrollableView The scrollable view
+     */
+    public void setScrollableView(View scrollableView) {
+        mScrollableView = scrollableView;
+    }
+
+    /**
+     * Sets the current scrollable view helper. See ScrollableViewHelper description for details.
+     * @param helper
+     */
+    public void setScrollableViewHelper(ScrollableViewHelper helper) {
+        mScrollableViewHelper = helper;
+    }
+
+    /**
+     * Set an anchor point where the panel can stop during sliding
+     *
+     * @param anchorPoint A value between 0 and 1, determining the position of the anchor point
+     *                    starting from the top of the layout.
+     */
+    public void setAnchorPoint(float anchorPoint) {
+        if (anchorPoint > 0 && anchorPoint <= 1) {
+            mAnchorPoint = anchorPoint;
+            mFirstLayout = true;
+            requestLayout();
+        }
+    }
+
+    /**
+     * Gets the currently set anchor point
+     *
+     * @return the currently set anchor point
+     */
+    public float getAnchorPoint() {
+        return mAnchorPoint;
+    }
+
+    /**
+     * Sets whether or not the panel overlays the content
+     *
+     * @param overlayed
+     */
+    public void setOverlayed(boolean overlayed) {
+        mOverlayContent = overlayed;
+    }
+
+    /**
+     * Check if the panel is set as an overlay.
+     */
+    public boolean isOverlayed() {
+        return mOverlayContent;
+    }
+
+    /**
+     * Sets whether or not the main content is clipped to the top of the panel
+     *
+     * @param clip
+     */
+    public void setClipPanel(boolean clip) {
+        mClipPanel = clip;
+    }
+
+    /**
+     * Check whether or not the main content is clipped to the top of the panel
+     */
+    public boolean isClipPanel() {
+        return mClipPanel;
+    }
+
+
+    void dispatchOnPanelSlide(View panel) {
+        synchronized (mPanelSlideListeners) {
+            for (PanelSlideListener l : mPanelSlideListeners) {
+                l.onPanelSlide(panel, mSlideOffset);
+            }
+        }
+    }
+
+
+    void dispatchOnPanelStateChanged(View panel, PanelState previousState, PanelState newState) {
+        synchronized (mPanelSlideListeners) {
+            for (PanelSlideListener l : mPanelSlideListeners) {
+                l.onPanelStateChanged(panel, previousState, newState);
+            }
+        }
+        sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
+    }
+
+    void updateObscuredViewVisibility() {
+        if (getChildCount() == 0) {
+            return;
+        }
+        final int leftBound = getPaddingLeft();
+        final int rightBound = getWidth() - getPaddingRight();
+        final int topBound = getPaddingTop();
+        final int bottomBound = getHeight() - getPaddingBottom();
+        final int left;
+        final int right;
+        final int top;
+        final int bottom;
+        if (mSlideableView != null && hasOpaqueBackground(mSlideableView)) {
+            left = mSlideableView.getLeft();
+            right = mSlideableView.getRight();
+            top = mSlideableView.getTop();
+            bottom = mSlideableView.getBottom();
+        } else {
+            left = right = top = bottom = 0;
+        }
+        View child = getChildAt(0);
+        final int clampedChildLeft = Math.max(leftBound, child.getLeft());
+        final int clampedChildTop = Math.max(topBound, child.getTop());
+        final int clampedChildRight = Math.min(rightBound, child.getRight());
+        final int clampedChildBottom = Math.min(bottomBound, child.getBottom());
+        final int vis;
+        if (clampedChildLeft >= left && clampedChildTop >= top &&
+                clampedChildRight <= right && clampedChildBottom <= bottom) {
+            vis = INVISIBLE;
+        } else {
+            vis = VISIBLE;
+        }
+        child.setVisibility(vis);
+    }
+
+    void setAllChildrenVisible() {
+        for (int i = 0, childCount = getChildCount(); i < childCount; i++) {
+            final View child = getChildAt(i);
+            if (child.getVisibility() == INVISIBLE) {
+                child.setVisibility(VISIBLE);
+            }
+        }
+    }
+
+    private static boolean hasOpaqueBackground(View v) {
+        final Drawable bg = v.getBackground();
+        return bg != null && bg.getOpacity() == PixelFormat.OPAQUE;
+    }
+
+    @Override
+    protected void onAttachedToWindow() {
+        super.onAttachedToWindow();
+        mFirstLayout = true;
+    }
+
+    @Override
+    protected void onDetachedFromWindow() {
+        super.onDetachedFromWindow();
+        mFirstLayout = true;
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
+        final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
+        final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
+        final int heightSize = MeasureSpec.getSize(heightMeasureSpec);
+
+        if (widthMode != MeasureSpec.EXACTLY && widthMode != MeasureSpec.AT_MOST) {
+            throw new IllegalStateException("Width must have an exact value or MATCH_PARENT");
+        } else if (heightMode != MeasureSpec.EXACTLY && heightMode != MeasureSpec.AT_MOST) {
+            throw new IllegalStateException("Height must have an exact value or MATCH_PARENT");
+        }
+
+        final int childCount = getChildCount();
+
+        if (childCount != 2) {
+            throw new IllegalStateException("Sliding up panel layout must have exactly 2 children!");
+        }
+
+        mMainView = getChildAt(0);
+        mSlideableView = getChildAt(1);
+        if (mDragView == null) {
+            setDragView(mSlideableView);
+        }
+
+        // If the sliding panel is not visible, then put the whole view in the hidden state
+        if (mSlideableView.getVisibility() != VISIBLE) {
+            mSlideState = PanelState.HIDDEN;
+        }
+
+        int layoutHeight = heightSize - getPaddingTop() - getPaddingBottom();
+        int layoutWidth = widthSize - getPaddingLeft() - getPaddingRight();
+
+        // First pass. Measure based on child LayoutParams width/height.
+        for (int i = 0; i < childCount; i++) {
+            final View child = getChildAt(i);
+            final LayoutParams lp = (LayoutParams) child.getLayoutParams();
+
+            // We always measure the sliding panel in order to know it's height (needed for show panel)
+            if (child.getVisibility() == GONE && i == 0) {
+                continue;
+            }
+
+            int height = layoutHeight;
+            int width = layoutWidth;
+            if (child == mMainView) {
+                if (!mOverlayContent && mSlideState != PanelState.HIDDEN) {
+                    height -= mPanelHeight;
+                }
+
+                width -= lp.leftMargin + lp.rightMargin;
+            } else if (child == mSlideableView) {
+                // The slideable view should be aware of its top margin.
+                // See https://github.com/umano/AndroidSlidingUpPanel/issues/412.
+                height -= lp.topMargin;
+            }
+
+            int childWidthSpec;
+            if (lp.width == LayoutParams.WRAP_CONTENT) {
+                childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST);
+            } else if (lp.width == LayoutParams.MATCH_PARENT) {
+                childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY);
+            } else {
+                childWidthSpec = MeasureSpec.makeMeasureSpec(lp.width, MeasureSpec.EXACTLY);
+            }
+
+            int childHeightSpec;
+            if (lp.height == LayoutParams.WRAP_CONTENT) {
+                childHeightSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST);
+            } else {
+                // Modify the height based on the weight.
+                if (lp.weight > 0 && lp.weight < 1) {
+                    height = (int) (height * lp.weight);
+                } else if (lp.height != LayoutParams.MATCH_PARENT) {
+                    height = lp.height;
+                }
+                childHeightSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
+            }
+
+            child.measure(childWidthSpec, childHeightSpec);
+
+            if (child == mSlideableView) {
+                mSlideRange = mSlideableView.getMeasuredHeight() - mPanelHeight;
+            }
+        }
+
+        setMeasuredDimension(widthSize, heightSize);
+    }
+
+    @Override
+    protected void onLayout(boolean changed, int l, int t, int r, int b) {
+        final int paddingLeft = getPaddingLeft();
+        final int paddingTop = getPaddingTop();
+
+        final int childCount = getChildCount();
+
+        if (mFirstLayout) {
+            switch (mSlideState) {
+                case EXPANDED:
+                    mSlideOffset = 1.0f;
+                    break;
+                case ANCHORED:
+                    mSlideOffset = mAnchorPoint;
+                    break;
+                case HIDDEN:
+                    int newTop = computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
+                    mSlideOffset = computeSlideOffset(newTop);
+                    break;
+                default:
+                    mSlideOffset = 0.f;
+                    break;
+            }
+        }
+
+        for (int i = 0; i < childCount; i++) {
+            final View child = getChildAt(i);
+            final LayoutParams lp = (LayoutParams) child.getLayoutParams();
+
+            // Always layout the sliding view on the first layout
+            if (child.getVisibility() == GONE && (i == 0 || mFirstLayout)) {
+                continue;
+            }
+
+            final int childHeight = child.getMeasuredHeight();
+            int childTop = paddingTop;
+
+            if (child == mSlideableView) {
+                childTop = computePanelTopPosition(mSlideOffset);
+            }
+
+            if (!mIsSlidingUp) {
+                if (child == mMainView && !mOverlayContent) {
+                    childTop = computePanelTopPosition(mSlideOffset) + mSlideableView.getMeasuredHeight();
+                }
+            }
+            final int childBottom = childTop + childHeight;
+            final int childLeft = paddingLeft + lp.leftMargin;
+            final int childRight = childLeft + child.getMeasuredWidth();
+
+            child.layout(childLeft, childTop, childRight, childBottom);
+        }
+
+        if (mFirstLayout) {
+            updateObscuredViewVisibility();
+        }
+        applyParallaxForCurrentSlideOffset();
+
+        mFirstLayout = false;
+    }
+
+    @Override
+    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+        super.onSizeChanged(w, h, oldw, oldh);
+        // Recalculate sliding panes and their details
+        if (h != oldh) {
+            mFirstLayout = true;
+        }
+    }
+
+    @Override
+    public boolean onInterceptTouchEvent(MotionEvent ev) {
+        // If the scrollable view is handling touch, never intercept
+        if (mIsScrollableViewHandlingTouch || !isTouchEnabled()) {
+            mDragHelper.abort();
+            return false;
+        }
+
+        final int action = MotionEventCompat.getActionMasked(ev);
+        final float x = ev.getX();
+        final float y = ev.getY();
+        final float adx = Math.abs(x - mInitialMotionX);
+        final float ady = Math.abs(y - mInitialMotionY);
+        final int dragSlop = mDragHelper.getTouchSlop();
+
+        switch (action) {
+            case MotionEvent.ACTION_DOWN: {
+                mIsUnableToDrag = false;
+                mInitialMotionX = x;
+                mInitialMotionY = y;
+                if (!isViewUnder(mDragView, (int) x, (int) y)) {
+                    mDragHelper.cancel();
+                    mIsUnableToDrag = true;
+                    return false;
+                }
+
+                break;
+            }
+
+            case MotionEvent.ACTION_MOVE: {
+                if (ady > dragSlop && adx > ady) {
+                    mDragHelper.cancel();
+                    mIsUnableToDrag = true;
+                    return false;
+                }
+                break;
+            }
+
+            case MotionEvent.ACTION_CANCEL:
+            case MotionEvent.ACTION_UP:
+                // If the dragView is still dragging when we get here, we need to call processTouchEvent
+                // so that the view is settled
+                // Added to make scrollable views work (tokudu)
+                if (mDragHelper.isDragging()) {
+                    mDragHelper.processTouchEvent(ev);
+                    return true;
+                }
+                // Check if this was a click on the faded part of the screen, and fire off the listener if there is one.
+                if (ady <= dragSlop
+                        && adx <= dragSlop
+                        && mSlideOffset > 0 && !isViewUnder(mSlideableView, (int) mInitialMotionX, (int) mInitialMotionY) && mFadeOnClickListener != null) {
+                    playSoundEffect(android.view.SoundEffectConstants.CLICK);
+                    mFadeOnClickListener.onClick(this);
+                    return true;
+                }
+                break;
+        }
+        return mDragHelper.shouldInterceptTouchEvent(ev);
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent ev) {
+        if (!isEnabled() || !isTouchEnabled()) {
+            return super.onTouchEvent(ev);
+        }
+        try {
+            mDragHelper.processTouchEvent(ev);
+            return true;
+        } catch (Exception ex) {
+            // Ignore the pointer out of range exception
+            return false;
+        }
+    }
+
+    @Override
+    public boolean dispatchTouchEvent(MotionEvent ev) {
+        final int action = MotionEventCompat.getActionMasked(ev);
+
+        if (!isEnabled() || !isTouchEnabled() || (mIsUnableToDrag && action != MotionEvent.ACTION_DOWN)) {
+            mDragHelper.abort();
+            return super.dispatchTouchEvent(ev);
+        }
+
+        final float y = ev.getY();
+
+        if (action == MotionEvent.ACTION_DOWN) {
+            mIsScrollableViewHandlingTouch = false;
+            mPrevMotionY = y;
+        } else if (action == MotionEvent.ACTION_MOVE) {
+            float dy = y - mPrevMotionY;
+            mPrevMotionY = y;
+
+            // If the scroll view isn't under the touch, pass the
+            // event along to the dragView.
+            if (!isViewUnder(mScrollableView, (int) mInitialMotionX, (int) mInitialMotionY)) {
+                return super.dispatchTouchEvent(ev);
+            }
+
+            // Which direction (up or down) is the drag moving?
+            if (dy * (mIsSlidingUp ? 1 : -1) > 0) { // Collapsing
+                // Is the child less than fully scrolled?
+                // Then let the child handle it.
+                if (mScrollableViewHelper.getScrollableViewScrollPosition(mScrollableView, mIsSlidingUp) > 0) {
+                    mIsScrollableViewHandlingTouch = true;
+                    return super.dispatchTouchEvent(ev);
+                }
+
+                // Was the child handling the touch previously?
+                // Then we need to rejigger things so that the
+                // drag panel gets a proper down event.
+                if (mIsScrollableViewHandlingTouch) {
+                    // Send an 'UP' event to the child.
+                    MotionEvent up = MotionEvent.obtain(ev);
+                    up.setAction(MotionEvent.ACTION_CANCEL);
+                    super.dispatchTouchEvent(up);
+                    up.recycle();
+
+                    // Send a 'DOWN' event to the panel. (We'll cheat
+                    // and hijack this one)
+                    ev.setAction(MotionEvent.ACTION_DOWN);
+                }
+
+                mIsScrollableViewHandlingTouch = false;
+                return this.onTouchEvent(ev);
+            } else if (dy * (mIsSlidingUp ? 1 : -1) < 0) { // Expanding
+                // Is the panel less than fully expanded?
+                // Then we'll handle the drag here.
+                if (mSlideOffset < 1.0f) {
+                    mIsScrollableViewHandlingTouch = false;
+                    return this.onTouchEvent(ev);
+                }
+
+                // Was the panel handling the touch previously?
+                // Then we need to rejigger things so that the
+                // child gets a proper down event.
+                if (!mIsScrollableViewHandlingTouch && mDragHelper.isDragging()) {
+                    mDragHelper.cancel();
+                    ev.setAction(MotionEvent.ACTION_DOWN);
+                }
+
+                mIsScrollableViewHandlingTouch = true;
+                return super.dispatchTouchEvent(ev);
+            }
+        } else if (action == MotionEvent.ACTION_UP) {
+            // If the scrollable view was handling the touch and we receive an up
+            // we want to clear any previous dragging state so we don't intercept a touch stream accidentally
+            if (mIsScrollableViewHandlingTouch) {
+                mDragHelper.setDragState(ViewDragHelper.STATE_IDLE);
+            }
+        }
+
+        // In all other cases, just let the default behavior take over.
+        return super.dispatchTouchEvent(ev);
+    }
+
+    private boolean isViewUnder(View view, int x, int y) {
+        if (view == null) return false;
+        int[] viewLocation = new int[2];
+        view.getLocationOnScreen(viewLocation);
+        int[] parentLocation = new int[2];
+        this.getLocationOnScreen(parentLocation);
+        int screenX = parentLocation[0] + x;
+        int screenY = parentLocation[1] + y;
+        return screenX >= viewLocation[0] && screenX < viewLocation[0] + view.getWidth() &&
+                screenY >= viewLocation[1] && screenY < viewLocation[1] + view.getHeight();
+    }
+
+    /*
+     * Computes the top position of the panel based on the slide offset.
+     */
+    private int computePanelTopPosition(float slideOffset) {
+        int slidingViewHeight = mSlideableView != null ? mSlideableView.getMeasuredHeight() : 0;
+        int slidePixelOffset = (int) (slideOffset * mSlideRange);
+        // Compute the top of the panel if its collapsed
+        return mIsSlidingUp
+                ? getMeasuredHeight() - getPaddingBottom() - mPanelHeight - slidePixelOffset
+                : getPaddingTop() - slidingViewHeight + mPanelHeight + slidePixelOffset;
+    }
+
+    /*
+     * Computes the slide offset based on the top position of the panel
+     */
+    private float computeSlideOffset(int topPosition) {
+        // Compute the panel top position if the panel is collapsed (offset 0)
+        final int topBoundCollapsed = computePanelTopPosition(0);
+
+        // Determine the new slide offset based on the collapsed top position and the new required
+        // top position
+        return (mIsSlidingUp
+                ? (float) (topBoundCollapsed - topPosition) / mSlideRange
+                : (float) (topPosition - topBoundCollapsed) / mSlideRange);
+    }
+
+    /**
+     * Returns the current state of the panel as an enum.
+     *
+     * @return the current panel state
+     */
+    public PanelState getPanelState() {
+        return mSlideState;
+    }
+
+    /**
+     * Change panel state to the given state with
+     *
+     * @param state - new panel state
+     */
+    public void setPanelState(PanelState state) {
+        if (state == null || state == PanelState.DRAGGING) {
+            throw new IllegalArgumentException("Panel state cannot be null or DRAGGING.");
+        }
+        if (!isEnabled()
+                || (!mFirstLayout && mSlideableView == null)
+                || state == mSlideState
+                || mSlideState == PanelState.DRAGGING) return;
+
+        if (mFirstLayout) {
+            setPanelStateInternal(state);
+        } else {
+            if (mSlideState == PanelState.HIDDEN) {
+                mSlideableView.setVisibility(View.VISIBLE);
+                requestLayout();
+            }
+            switch (state) {
+                case ANCHORED:
+                    smoothSlideTo(mAnchorPoint, 0);
+                    break;
+                case COLLAPSED:
+                    smoothSlideTo(0, 0);
+                    break;
+                case EXPANDED:
+                    smoothSlideTo(1.0f, 0);
+                    break;
+                case HIDDEN:
+                    int newTop = computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
+                    smoothSlideTo(computeSlideOffset(newTop), 0);
+                    break;
+            }
+        }
+    }
+
+    private void setPanelStateInternal(PanelState state) {
+        if (mSlideState == state) return;
+        PanelState oldState = mSlideState;
+        mSlideState = state;
+        dispatchOnPanelStateChanged(this, oldState, state);
+    }
+
+    /**
+     * Update the parallax based on the current slide offset.
+     */
+    @SuppressLint("NewApi")
+    private void applyParallaxForCurrentSlideOffset() {
+        if (mParallaxOffset > 0) {
+            int mainViewOffset = getCurrentParallaxOffset();
+            ViewCompat.setTranslationY(mMainView, mainViewOffset);
+        }
+    }
+
+    private void onPanelDragged(int newTop) {
+        if (mSlideState != PanelState.DRAGGING) {
+            mLastNotDraggingSlideState = mSlideState;
+        }
+        setPanelStateInternal(PanelState.DRAGGING);
+        // Recompute the slide offset based on the new top position
+        mSlideOffset = computeSlideOffset(newTop);
+        applyParallaxForCurrentSlideOffset();
+        // Dispatch the slide event
+        dispatchOnPanelSlide(mSlideableView);
+        // If the slide offset is negative, and overlay is not on, we need to increase the
+        // height of the main content
+        LayoutParams lp = (LayoutParams) mMainView.getLayoutParams();
+        int defaultHeight = getHeight() - getPaddingBottom() - getPaddingTop() - mPanelHeight;
+
+        if (mSlideOffset <= 0 && !mOverlayContent) {
+            // expand the main view
+            lp.height = mIsSlidingUp ? (newTop - getPaddingBottom()) : (getHeight() - getPaddingBottom() - mSlideableView.getMeasuredHeight() - newTop);
+            if (lp.height == defaultHeight) {
+                lp.height = LayoutParams.MATCH_PARENT;
+            }
+            mMainView.requestLayout();
+        } else if (lp.height != LayoutParams.MATCH_PARENT && !mOverlayContent) {
+            lp.height = LayoutParams.MATCH_PARENT;
+            mMainView.requestLayout();
+        }
+    }
+
+    @Override
+    protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
+        boolean result;
+        final int save = canvas.save(Canvas.CLIP_SAVE_FLAG);
+
+        if (mSlideableView != null && mSlideableView != child) { // if main view
+            // Clip against the slider; no sense drawing what will immediately be covered,
+            // Unless the panel is set to overlay content
+            canvas.getClipBounds(mTmpRect);
+            if (!mOverlayContent) {
+                if (mIsSlidingUp) {
+                    mTmpRect.bottom = Math.min(mTmpRect.bottom, mSlideableView.getTop());
+                } else {
+                    mTmpRect.top = Math.max(mTmpRect.top, mSlideableView.getBottom());
+                }
+            }
+            if (mClipPanel) {
+                canvas.clipRect(mTmpRect);
+            }
+
+            result = super.drawChild(canvas, child, drawingTime);
+
+            if (mCoveredFadeColor != 0 && mSlideOffset > 0) {
+                final int baseAlpha = (mCoveredFadeColor & 0xff000000) >>> 24;
+                final int imag = (int) (baseAlpha * mSlideOffset);
+                final int color = imag << 24 | (mCoveredFadeColor & 0xffffff);
+                mCoveredFadePaint.setColor(color);
+                canvas.drawRect(mTmpRect, mCoveredFadePaint);
+            }
+        } else {
+            result = super.drawChild(canvas, child, drawingTime);
+        }
+
+        canvas.restoreToCount(save);
+
+        return result;
+    }
+
+    /**
+     * Smoothly animate mDraggingPane to the target X position within its range.
+     *
+     * @param slideOffset position to animate to
+     * @param velocity    initial velocity in case of fling, or 0.
+     */
+    boolean smoothSlideTo(float slideOffset, int velocity) {
+        if (!isEnabled() || mSlideableView == null) {
+            // Nothing to do.
+            return false;
+        }
+
+        int panelTop = computePanelTopPosition(slideOffset);
+        if (mDragHelper.smoothSlideViewTo(mSlideableView, mSlideableView.getLeft(), panelTop)) {
+            setAllChildrenVisible();
+            ViewCompat.postInvalidateOnAnimation(this);
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public void computeScroll() {
+        if (mDragHelper != null && mDragHelper.continueSettling(true)) {
+            if (!isEnabled()) {
+                mDragHelper.abort();
+                return;
+            }
+
+            ViewCompat.postInvalidateOnAnimation(this);
+        }
+    }
+
+    @Override
+    public void draw(Canvas c) {
+        super.draw(c);
+
+        // draw the shadow
+        if (mShadowDrawable != null && mSlideableView != null) {
+            final int right = mSlideableView.getRight();
+            final int top;
+            final int bottom;
+            if (mIsSlidingUp) {
+                top = mSlideableView.getTop() - mShadowHeight;
+                bottom = mSlideableView.getTop();
+            } else {
+                top = mSlideableView.getBottom();
+                bottom = mSlideableView.getBottom() + mShadowHeight;
+            }
+            final int left = mSlideableView.getLeft();
+            mShadowDrawable.setBounds(left, top, right, bottom);
+            mShadowDrawable.draw(c);
+        }
+    }
+
+    /**
+     * Tests scrollability within child views of v given a delta of dx.
+     *
+     * @param v      View to test for horizontal scrollability
+     * @param checkV Whether the view v passed should itself be checked for scrollability (true),
+     *               or just its children (false).
+     * @param dx     Delta scrolled in pixels
+     * @param x      X coordinate of the active touch point
+     * @param y      Y coordinate of the active touch point
+     * @return true if child views of v can be scrolled by delta of dx.
+     */
+    protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
+        if (v instanceof ViewGroup) {
+            final ViewGroup group = (ViewGroup) v;
+            final int scrollX = v.getScrollX();
+            final int scrollY = v.getScrollY();
+            final int count = group.getChildCount();
+            // Count backwards - let topmost views consume scroll distance first.
+            for (int i = count - 1; i >= 0; i--) {
+                final View child = group.getChildAt(i);
+                if (x + scrollX >= child.getLeft() && x + scrollX < child.getRight() &&
+                        y + scrollY >= child.getTop() && y + scrollY < child.getBottom() &&
+                        canScroll(child, true, dx, x + scrollX - child.getLeft(),
+                                y + scrollY - child.getTop())) {
+                    return true;
+                }
+            }
+        }
+        return checkV && ViewCompat.canScrollHorizontally(v, -dx);
+    }
+
+
+    @Override
+    protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
+        return new LayoutParams();
+    }
+
+    @Override
+    protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {
+        return p instanceof MarginLayoutParams
+                ? new LayoutParams((MarginLayoutParams) p)
+                : new LayoutParams(p);
+    }
+
+    @Override
+    protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
+        return p instanceof LayoutParams && super.checkLayoutParams(p);
+    }
+
+    @Override
+    public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) {
+        return new LayoutParams(getContext(), attrs);
+    }
+
+    @Override
+    public Parcelable onSaveInstanceState() {
+        Bundle bundle = new Bundle();
+        bundle.putParcelable("superState", super.onSaveInstanceState());
+        bundle.putSerializable(SLIDING_STATE, mSlideState != PanelState.DRAGGING ? mSlideState : mLastNotDraggingSlideState);
+        return bundle;
+    }
+
+    @Override
+    public void onRestoreInstanceState(Parcelable state) {
+        if(state instanceof Bundle) {
+            Bundle bundle = (Bundle) state;
+            mSlideState = (PanelState) bundle.getSerializable(SLIDING_STATE);
+            mSlideState = mSlideState == null ? DEFAULT_SLIDE_STATE : mSlideState;
+            state = bundle.getParcelable("superState");
+        }
+        super.onRestoreInstanceState(state);
+    }
+
+    private class DragHelperCallback extends ViewDragHelper.Callback {
+
+        @Override
+        public boolean tryCaptureView(View child, int pointerId) {
+            if (mIsUnableToDrag) {
+                return false;
+            }
+
+            return child == mSlideableView;
+        }
+
+        @Override
+        public void onViewDragStateChanged(int state) {
+            if (mDragHelper.getViewDragState() == ViewDragHelper.STATE_IDLE) {
+                mSlideOffset = computeSlideOffset(mSlideableView.getTop());
+                applyParallaxForCurrentSlideOffset();
+
+                if (mSlideOffset == 1) {
+                    updateObscuredViewVisibility();
+                    setPanelStateInternal(PanelState.EXPANDED);
+                } else if (mSlideOffset == 0) {
+                    setPanelStateInternal(PanelState.COLLAPSED);
+                } else if (mSlideOffset < 0) {
+                    setPanelStateInternal(PanelState.HIDDEN);
+                    mSlideableView.setVisibility(View.INVISIBLE);
+                } else {
+                    updateObscuredViewVisibility();
+                    setPanelStateInternal(PanelState.ANCHORED);
+                }
+            }
+        }
+
+        @Override
+        public void onViewCaptured(View capturedChild, int activePointerId) {
+            setAllChildrenVisible();
+        }
+
+        @Override
+        public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) {
+            onPanelDragged(top);
+            invalidate();
+        }
+
+        @Override
+        public void onViewReleased(View releasedChild, float xvel, float yvel) {
+            int target = 0;
+
+            // direction is always positive if we are sliding in the expanded direction
+            float direction = mIsSlidingUp ? -yvel : yvel;
+
+            if (direction > 0 && mSlideOffset <= mAnchorPoint) {
+                // swipe up -> expand and stop at anchor point
+                target = computePanelTopPosition(mAnchorPoint);
+            } else if (direction > 0 && mSlideOffset > mAnchorPoint) {
+                // swipe up past anchor -> expand
+                target = computePanelTopPosition(1.0f);
+            } else if (direction < 0 && mSlideOffset >= mAnchorPoint) {
+                // swipe down -> collapse and stop at anchor point
+                target = computePanelTopPosition(mAnchorPoint);
+            } else if (direction < 0 && mSlideOffset < mAnchorPoint) {
+                // swipe down past anchor -> collapse
+                target = computePanelTopPosition(0.0f);
+            } else if (mSlideOffset >= (1.f + mAnchorPoint) / 2) {
+                // zero velocity, and far enough from anchor point => expand to the top
+                target = computePanelTopPosition(1.0f);
+            } else if (mSlideOffset >= mAnchorPoint / 2) {
+                // zero velocity, and close enough to anchor point => go to anchor
+                target = computePanelTopPosition(mAnchorPoint);
+            } else {
+                // settle at the bottom
+                target = computePanelTopPosition(0.0f);
+            }
+
+            mDragHelper.settleCapturedViewAt(releasedChild.getLeft(), target);
+            invalidate();
+        }
+
+        @Override
+        public int getViewVerticalDragRange(View child) {
+            return mSlideRange;
+        }
+
+        @Override
+        public int clampViewPositionVertical(View child, int top, int dy) {
+            final int collapsedTop = computePanelTopPosition(0.f);
+            final int expandedTop = computePanelTopPosition(1.0f);
+            if (mIsSlidingUp) {
+                return Math.min(Math.max(top, expandedTop), collapsedTop);
+            } else {
+                return Math.min(Math.max(top, collapsedTop), expandedTop);
+            }
+        }
+    }
+
+    public static class LayoutParams extends MarginLayoutParams {
+        private static final int[] ATTRS = new int[]{
+                android.R.attr.layout_weight
+        };
+
+        public float weight = 0;
+
+        public LayoutParams() {
+            super(MATCH_PARENT, MATCH_PARENT);
+        }
+
+        public LayoutParams(int width, int height) {
+            super(width, height);
+        }
+
+        public LayoutParams(int width, int height, float weight) {
+            super(width, height);
+            this.weight = weight;
+        }
+
+        public LayoutParams(ViewGroup.LayoutParams source) {
+            super(source);
+        }
+
+        public LayoutParams(MarginLayoutParams source) {
+            super(source);
+        }
+
+        public LayoutParams(LayoutParams source) {
+            super(source);
+        }
+
+        public LayoutParams(Context c, AttributeSet attrs) {
+            super(c, attrs);
+
+            final TypedArray ta = c.obtainStyledAttributes(attrs, ATTRS);
+            if (ta != null) {
+                this.weight = ta.getFloat(0, 0);
+            }
+
+            ta.recycle();
+        }
+    }
+}

+ 1502 - 0
WeiChat/src/main/java/com/xzjmyk/pm/basepedo/slidinguppanel/ViewDragHelper.java

@@ -0,0 +1,1502 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package com.xzjmyk.pm.basepedo.slidinguppanel;
+
+import android.content.Context;
+import android.support.v4.view.MotionEventCompat;
+import android.support.v4.view.VelocityTrackerCompat;
+import android.support.v4.view.ViewCompat;
+import android.support.v4.widget.ScrollerCompat;
+import android.view.MotionEvent;
+import android.view.VelocityTracker;
+import android.view.View;
+import android.view.ViewConfiguration;
+import android.view.ViewGroup;
+import android.view.animation.Interpolator;
+
+import java.util.Arrays;
+
+/**
+ * ViewDragHelper is a utility class for writing custom ViewGroups. It offers a number
+ * of useful operations and state tracking for allowing a user to drag and reposition
+ * views within their parent ViewGroup.
+ */
+public class ViewDragHelper {
+    private static final String TAG = "ViewDragHelper";
+
+    /**
+     * A null/invalid pointer ID.
+     */
+    public static final int INVALID_POINTER = -1;
+
+    /**
+     * A view is not currently being dragged or animating as a result of a fling/snap.
+     */
+    public static final int STATE_IDLE = 0;
+
+    /**
+     * A view is currently being dragged. The position is currently changing as a result
+     * of user input or simulated user input.
+     */
+    public static final int STATE_DRAGGING = 1;
+
+    /**
+     * A view is currently settling into place as a result of a fling or
+     * predefined non-interactive motion.
+     */
+    public static final int STATE_SETTLING = 2;
+
+    /**
+     * Edge flag indicating that the left edge should be affected.
+     */
+    public static final int EDGE_LEFT = 1 << 0;
+
+    /**
+     * Edge flag indicating that the right edge should be affected.
+     */
+    public static final int EDGE_RIGHT = 1 << 1;
+
+    /**
+     * Edge flag indicating that the top edge should be affected.
+     */
+    public static final int EDGE_TOP = 1 << 2;
+
+    /**
+     * Edge flag indicating that the bottom edge should be affected.
+     */
+    public static final int EDGE_BOTTOM = 1 << 3;
+
+    /**
+     * Edge flag set indicating all edges should be affected.
+     */
+    public static final int EDGE_ALL = EDGE_LEFT | EDGE_TOP | EDGE_RIGHT | EDGE_BOTTOM;
+
+    /**
+     * Indicates that a check should occur along the horizontal axis
+     */
+    public static final int DIRECTION_HORIZONTAL = 1 << 0;
+
+    /**
+     * Indicates that a check should occur along the vertical axis
+     */
+    public static final int DIRECTION_VERTICAL = 1 << 1;
+
+    /**
+     * Indicates that a check should occur along all axes
+     */
+    public static final int DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
+
+    private static final int EDGE_SIZE = 20; // dp
+
+    private static final int BASE_SETTLE_DURATION = 256; // ms
+    private static final int MAX_SETTLE_DURATION = 600; // ms
+
+    // Current drag state; idle, dragging or settling
+    private int mDragState;
+
+    // Distance to travel before a drag may begin
+    private int mTouchSlop;
+
+    // Last known position/pointer tracking
+    private int mActivePointerId = INVALID_POINTER;
+    private float[] mInitialMotionX;
+    private float[] mInitialMotionY;
+    private float[] mLastMotionX;
+    private float[] mLastMotionY;
+    private int[] mInitialEdgesTouched;
+    private int[] mEdgeDragsInProgress;
+    private int[] mEdgeDragsLocked;
+    private int mPointersDown;
+
+    private VelocityTracker mVelocityTracker;
+    private float mMaxVelocity;
+    private float mMinVelocity;
+
+    private int mEdgeSize;
+    private int mTrackingEdges;
+
+    private ScrollerCompat mScroller;
+
+    private final Callback mCallback;
+
+    private View mCapturedView;
+    private boolean mReleaseInProgress;
+
+    private final ViewGroup mParentView;
+
+    /**
+     * A Callback is used as a communication channel with the ViewDragHelper back to the
+     * parent view using it. <code>on*</code>methods are invoked on siginficant events and several
+     * accessor methods are expected to provide the ViewDragHelper with more information
+     * about the state of the parent view upon request. The callback also makes decisions
+     * governing the range and draggability of child views.
+     */
+    public static abstract class Callback {
+        /**
+         * Called when the drag state changes. See the <code>STATE_*</code> constants
+         * for more information.
+         *
+         * @param state The new drag state
+         *
+         * @see #STATE_IDLE
+         * @see #STATE_DRAGGING
+         * @see #STATE_SETTLING
+         */
+        public void onViewDragStateChanged(int state) {}
+
+        /**
+         * Called when the captured view's position changes as the result of a drag or settle.
+         *
+         * @param changedView View whose position changed
+         * @param left New X coordinate of the left edge of the view
+         * @param top New Y coordinate of the top edge of the view
+         * @param dx Change in X position from the last call
+         * @param dy Change in Y position from the last call
+         */
+        public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) {}
+
+        /**
+         * Called when a child view is captured for dragging or settling. The ID of the pointer
+         * currently dragging the captured view is supplied. If activePointerId is
+         * identified as {@link #INVALID_POINTER} the capture is programmatic instead of
+         * pointer-initiated.
+         *
+         * @param capturedChild Child view that was captured
+         * @param activePointerId Pointer id tracking the child capture
+         */
+        public void onViewCaptured(View capturedChild, int activePointerId) {}
+
+        /**
+         * Called when the child view is no longer being actively dragged.
+         * The fling velocity is also supplied, if relevant. The velocity values may
+         * be clamped to system minimums or maximums.
+         *
+         * <p>Calling code may decide to fling or otherwise release the view to let it
+         * settle into place. It should do so using {@link #settleCapturedViewAt(int, int)}
+         * or {@link #flingCapturedView(int, int, int, int)}. If the Callback invokes
+         * one of these methods, the ViewDragHelper will enter {@link #STATE_SETTLING}
+         * and the view capture will not fully end until it comes to a complete stop.
+         * If neither of these methods is invoked before <code>onViewReleased</code> returns,
+         * the view will stop in place and the ViewDragHelper will return to
+         * {@link #STATE_IDLE}.</p>
+         *
+         * @param releasedChild The captured child view now being released
+         * @param xvel X velocity of the pointer as it left the screen in pixels per second.
+         * @param yvel Y velocity of the pointer as it left the screen in pixels per second.
+         */
+        public void onViewReleased(View releasedChild, float xvel, float yvel) {}
+
+        /**
+         * Called when one of the subscribed edges in the parent view has been touched
+         * by the user while no child view is currently captured.
+         *
+         * @param edgeFlags A combination of edge flags describing the edge(s) currently touched
+         * @param pointerId ID of the pointer touching the described edge(s)
+         * @see #EDGE_LEFT
+         * @see #EDGE_TOP
+         * @see #EDGE_RIGHT
+         * @see #EDGE_BOTTOM
+         */
+        public void onEdgeTouched(int edgeFlags, int pointerId) {}
+
+        /**
+         * Called when the given edge may become locked. This can happen if an edge drag
+         * was preliminarily rejected before beginning, but after {@link #onEdgeTouched(int, int)}
+         * was called. This method should return true to lock this edge or false to leave it
+         * unlocked. The default behavior is to leave edges unlocked.
+         *
+         * @param edgeFlags A combination of edge flags describing the edge(s) locked
+         * @return true to lock the edge, false to leave it unlocked
+         */
+        public boolean onEdgeLock(int edgeFlags) {
+            return false;
+        }
+
+        /**
+         * Called when the user has started a deliberate drag away from one
+         * of the subscribed edges in the parent view while no child view is currently captured.
+         *
+         * @param edgeFlags A combination of edge flags describing the edge(s) dragged
+         * @param pointerId ID of the pointer touching the described edge(s)
+         * @see #EDGE_LEFT
+         * @see #EDGE_TOP
+         * @see #EDGE_RIGHT
+         * @see #EDGE_BOTTOM
+         */
+        public void onEdgeDragStarted(int edgeFlags, int pointerId) {}
+
+        /**
+         * Called to determine the Z-order of child views.
+         *
+         * @param index the ordered position to query for
+         * @return index of the view that should be ordered at position <code>index</code>
+         */
+        public int getOrderedChildIndex(int index) {
+            return index;
+        }
+
+        /**
+         * Return the magnitude of a draggable child view's horizontal range of motion in pixels.
+         * This method should return 0 for views that cannot move horizontally.
+         *
+         * @param child Child view to check
+         * @return range of horizontal motion in pixels
+         */
+        public int getViewHorizontalDragRange(View child) {
+            return 0;
+        }
+
+        /**
+         * Return the magnitude of a draggable child view's vertical range of motion in pixels.
+         * This method should return 0 for views that cannot move vertically.
+         *
+         * @param child Child view to check
+         * @return range of vertical motion in pixels
+         */
+        public int getViewVerticalDragRange(View child) {
+            return 0;
+        }
+
+        /**
+         * Called when the user's input indicates that they want to capture the given child view
+         * with the pointer indicated by pointerId. The callback should return true if the user
+         * is permitted to drag the given view with the indicated pointer.
+         *
+         * <p>ViewDragHelper may call this method multiple times for the same view even if
+         * the view is already captured; this indicates that a new pointer is trying to take
+         * control of the view.</p>
+         *
+         * <p>If this method returns true, a call to {@link #onViewCaptured(View, int)}
+         * will follow if the capture is successful.</p>
+         *
+         * @param child Child the user is attempting to capture
+         * @param pointerId ID of the pointer attempting the capture
+         * @return true if capture should be allowed, false otherwise
+         */
+        public abstract boolean tryCaptureView(View child, int pointerId);
+
+        /**
+         * Restrict the motion of the dragged child view along the horizontal axis.
+         * The default implementation does not allow horizontal motion; the extending
+         * class must override this method and provide the desired clamping.
+         *
+         *
+         * @param child Child view being dragged
+         * @param left Attempted motion along the X axis
+         * @param dx Proposed change in position for left
+         * @return The new clamped position for left
+         */
+        public int clampViewPositionHorizontal(View child, int left, int dx) {
+            return 0;
+        }
+
+        /**
+         * Restrict the motion of the dragged child view along the vertical axis.
+         * The default implementation does not allow vertical motion; the extending
+         * class must override this method and provide the desired clamping.
+         *
+         *
+         * @param child Child view being dragged
+         * @param top Attempted motion along the Y axis
+         * @param dy Proposed change in position for top
+         * @return The new clamped position for top
+         */
+        public int clampViewPositionVertical(View child, int top, int dy) {
+            return 0;
+        }
+    }
+
+    /**
+     * Interpolator defining the animation curve for mScroller
+     */
+    private static final Interpolator sInterpolator = new Interpolator() {
+        public float getInterpolation(float t) {
+            t -= 1.0f;
+            return t * t * t * t * t + 1.0f;
+        }
+    };
+
+    private final Runnable mSetIdleRunnable = new Runnable() {
+        public void run() {
+            setDragState(STATE_IDLE);
+        }
+    };
+
+    /**
+     * Factory method to create a new ViewDragHelper.
+     *
+     * @param forParent Parent view to monitor
+     * @param cb Callback to provide information and receive events
+     * @return a new ViewDragHelper instance
+     */
+    public static ViewDragHelper create(ViewGroup forParent, Callback cb) {
+        return new ViewDragHelper(forParent.getContext(), forParent, null, cb);
+    }
+
+    /**
+     * Factory method to create a new ViewDragHelper with the specified interpolator.
+     *
+     * @param forParent Parent view to monitor
+     * @param interpolator interpolator for scroller
+     * @param cb Callback to provide information and receive events
+     * @return a new ViewDragHelper instance
+     */
+    public static ViewDragHelper create(ViewGroup forParent, Interpolator interpolator, Callback cb) {
+        return new ViewDragHelper(forParent.getContext(), forParent, interpolator, cb);
+    }
+
+    /**
+     * Factory method to create a new ViewDragHelper.
+     *
+     * @param forParent Parent view to monitor
+     * @param sensitivity Multiplier for how sensitive the helper should be about detecting
+     *                    the start of a drag. Larger values are more sensitive. 1.0f is normal.
+     * @param cb Callback to provide information and receive events
+     * @return a new ViewDragHelper instance
+     */
+    public static ViewDragHelper create(ViewGroup forParent, float sensitivity, Callback cb) {
+        final ViewDragHelper helper = create(forParent, cb);
+        helper.mTouchSlop = (int) (helper.mTouchSlop * (1 / sensitivity));
+        return helper;
+    }
+
+    /**
+     * Factory method to create a new ViewDragHelper with the specified interpolator.
+     *
+     * @param forParent Parent view to monitor
+     * @param sensitivity Multiplier for how sensitive the helper should be about detecting
+     *                    the start of a drag. Larger values are more sensitive. 1.0f is normal.
+     * @param interpolator interpolator for scroller
+     * @param cb Callback to provide information and receive events
+     * @return a new ViewDragHelper instance
+     */
+    public static ViewDragHelper create(ViewGroup forParent, float sensitivity, Interpolator interpolator, Callback cb) {
+        final ViewDragHelper helper = create(forParent, interpolator, cb);
+        helper.mTouchSlop = (int) (helper.mTouchSlop * (1 / sensitivity));
+        return helper;
+    }
+
+    /**
+     * Apps should use ViewDragHelper.create() to get a new instance.
+     * This will allow VDH to use internal compatibility implementations for different
+     * platform versions.
+     * If the interpolator is null, the default interpolator will be used.
+     *
+     * @param context Context to initialize config-dependent params from
+     * @param forParent Parent view to monitor
+     * @param interpolator interpolator for scroller
+     */
+    private ViewDragHelper(Context context, ViewGroup forParent, Interpolator interpolator, Callback cb) {
+        if (forParent == null) {
+            throw new IllegalArgumentException("Parent view may not be null");
+        }
+        if (cb == null) {
+            throw new IllegalArgumentException("Callback may not be null");
+        }
+
+        mParentView = forParent;
+        mCallback = cb;
+
+        final ViewConfiguration vc = ViewConfiguration.get(context);
+        final float density = context.getResources().getDisplayMetrics().density;
+        mEdgeSize = (int) (EDGE_SIZE * density + 0.5f);
+
+        mTouchSlop = vc.getScaledTouchSlop();
+        mMaxVelocity = vc.getScaledMaximumFlingVelocity();
+        mMinVelocity = vc.getScaledMinimumFlingVelocity();
+        mScroller = ScrollerCompat.create(context, interpolator != null ? interpolator : sInterpolator);
+    }
+
+    /**
+     * Set the minimum velocity that will be detected as having a magnitude greater than zero
+     * in pixels per second. Callback methods accepting a velocity will be clamped appropriately.
+     *
+     * @param minVel Minimum velocity to detect
+     */
+    public void setMinVelocity(float minVel) {
+        mMinVelocity = minVel;
+    }
+
+    /**
+     * Return the currently configured minimum velocity. Any flings with a magnitude less
+     * than this value in pixels per second. Callback methods accepting a velocity will receive
+     * zero as a velocity value if the real detected velocity was below this threshold.
+     *
+     * @return the minimum velocity that will be detected
+     */
+    public float getMinVelocity() {
+        return mMinVelocity;
+    }
+
+    /**
+     * Retrieve the current drag state of this helper. This will return one of
+     * {@link #STATE_IDLE}, {@link #STATE_DRAGGING} or {@link #STATE_SETTLING}.
+     * @return The current drag state
+     */
+    public int getViewDragState() {
+        return mDragState;
+    }
+
+    /**
+     * Enable edge tracking for the selected edges of the parent view.
+     * The callback's {@link Callback#onEdgeTouched(int, int)} and
+     * {@link Callback#onEdgeDragStarted(int, int)} methods will only be invoked
+     * for edges for which edge tracking has been enabled.
+     *
+     * @param edgeFlags Combination of edge flags describing the edges to watch
+     * @see #EDGE_LEFT
+     * @see #EDGE_TOP
+     * @see #EDGE_RIGHT
+     * @see #EDGE_BOTTOM
+     */
+    public void setEdgeTrackingEnabled(int edgeFlags) {
+        mTrackingEdges = edgeFlags;
+    }
+
+    /**
+     * Return the size of an edge. This is the range in pixels along the edges of this view
+     * that will actively detect edge touches or drags if edge tracking is enabled.
+     *
+     * @return The size of an edge in pixels
+     * @see #setEdgeTrackingEnabled(int)
+     */
+    public int getEdgeSize() {
+        return mEdgeSize;
+    }
+
+    /**
+     * Capture a specific child view for dragging within the parent. The callback will be notified
+     * but {@link Callback#tryCaptureView(View, int)} will not be asked permission to
+     * capture this view.
+     *
+     * @param childView Child view to capture
+     * @param activePointerId ID of the pointer that is dragging the captured child view
+     */
+    public void captureChildView(View childView, int activePointerId) {
+        if (childView.getParent() != mParentView) {
+            throw new IllegalArgumentException("captureChildView: parameter must be a descendant " +
+                    "of the ViewDragHelper's tracked parent view (" + mParentView + ")");
+        }
+
+        mCapturedView = childView;
+        mActivePointerId = activePointerId;
+        mCallback.onViewCaptured(childView, activePointerId);
+        setDragState(STATE_DRAGGING);
+    }
+
+    /**
+     * @return The currently captured view, or null if no view has been captured.
+     */
+    public View getCapturedView() {
+        return mCapturedView;
+    }
+
+    /**
+     * @return The ID of the pointer currently dragging the captured view,
+     *         or {@link #INVALID_POINTER}.
+     */
+    public int getActivePointerId() {
+        return mActivePointerId;
+    }
+
+    /**
+     * @return The minimum distance in pixels that the user must travel to initiate a drag
+     */
+    public int getTouchSlop() {
+        return mTouchSlop;
+    }
+
+    /**
+     * The result of a call to this method is equivalent to
+     * {@link #processTouchEvent(MotionEvent)} receiving an ACTION_CANCEL event.
+     */
+    public void cancel() {
+        mActivePointerId = INVALID_POINTER;
+        clearMotionHistory();
+
+        if (mVelocityTracker != null) {
+            mVelocityTracker.recycle();
+            mVelocityTracker = null;
+        }
+    }
+
+    /**
+     * {@link #cancel()}, but also abort all motion in progress and snap to the end of any
+     * animation.
+     */
+    public void abort() {
+        cancel();
+        if (mDragState == STATE_SETTLING) {
+            final int oldX = mScroller.getCurrX();
+            final int oldY = mScroller.getCurrY();
+            mScroller.abortAnimation();
+            final int newX = mScroller.getCurrX();
+            final int newY = mScroller.getCurrY();
+            mCallback.onViewPositionChanged(mCapturedView, newX, newY, newX - oldX, newY - oldY);
+        }
+        setDragState(STATE_IDLE);
+    }
+
+    /**
+     * Animate the view <code>child</code> to the given (left, top) position.
+     * If this method returns true, the caller should invoke {@link #continueSettling(boolean)}
+     * on each subsequent frame to continue the motion until it returns false. If this method
+     * returns false there is no further work to do to complete the movement.
+     *
+     * <p>This operation does not count as a capture event, though {@link #getCapturedView()}
+     * will still report the sliding view while the slide is in progress.</p>
+     *
+     * @param child Child view to capture and animate
+     * @param finalLeft Final left position of child
+     * @param finalTop Final top position of child
+     * @return true if animation should continue through {@link #continueSettling(boolean)} calls
+     */
+    public boolean smoothSlideViewTo(View child, int finalLeft, int finalTop) {
+        mCapturedView = child;
+        mActivePointerId = INVALID_POINTER;
+
+        return forceSettleCapturedViewAt(finalLeft, finalTop, 0, 0);
+    }
+
+    /**
+     * Settle the captured view at the given (left, top) position.
+     * The appropriate velocity from prior motion will be taken into account.
+     * If this method returns true, the caller should invoke {@link #continueSettling(boolean)}
+     * on each subsequent frame to continue the motion until it returns false. If this method
+     * returns false there is no further work to do to complete the movement.
+     *
+     * @param finalLeft Settled left edge position for the captured view
+     * @param finalTop Settled top edge position for the captured view
+     * @return true if animation should continue through {@link #continueSettling(boolean)} calls
+     */
+    public boolean settleCapturedViewAt(int finalLeft, int finalTop) {
+        if (!mReleaseInProgress) {
+            throw new IllegalStateException("Cannot settleCapturedViewAt outside of a call to " +
+                    "Callback#onViewReleased");
+        }
+
+        return forceSettleCapturedViewAt(finalLeft, finalTop,
+                (int) VelocityTrackerCompat.getXVelocity(mVelocityTracker, mActivePointerId),
+                (int) VelocityTrackerCompat.getYVelocity(mVelocityTracker, mActivePointerId));
+    }
+
+    /**
+     * Settle the captured view at the given (left, top) position.
+     *
+     * @param finalLeft Target left position for the captured view
+     * @param finalTop Target top position for the captured view
+     * @param xvel Horizontal velocity
+     * @param yvel Vertical velocity
+     * @return true if animation should continue through {@link #continueSettling(boolean)} calls
+     */
+    private boolean forceSettleCapturedViewAt(int finalLeft, int finalTop, int xvel, int yvel) {
+        final int startLeft = mCapturedView.getLeft();
+        final int startTop = mCapturedView.getTop();
+        final int dx = finalLeft - startLeft;
+        final int dy = finalTop - startTop;
+
+        if (dx == 0 && dy == 0) {
+            // Nothing to do. Send callbacks, be done.
+            mScroller.abortAnimation();
+            setDragState(STATE_IDLE);
+            return false;
+        }
+
+        final int duration = computeSettleDuration(mCapturedView, dx, dy, xvel, yvel);
+        mScroller.startScroll(startLeft, startTop, dx, dy, duration);
+
+        setDragState(STATE_SETTLING);
+        return true;
+    }
+
+    private int computeSettleDuration(View child, int dx, int dy, int xvel, int yvel) {
+        xvel = clampMag(xvel, (int) mMinVelocity, (int) mMaxVelocity);
+        yvel = clampMag(yvel, (int) mMinVelocity, (int) mMaxVelocity);
+        final int absDx = Math.abs(dx);
+        final int absDy = Math.abs(dy);
+        final int absXVel = Math.abs(xvel);
+        final int absYVel = Math.abs(yvel);
+        final int addedVel = absXVel + absYVel;
+        final int addedDistance = absDx + absDy;
+
+        final float xweight = xvel != 0 ? (float) absXVel / addedVel :
+                (float) absDx / addedDistance;
+        final float yweight = yvel != 0 ? (float) absYVel / addedVel :
+                (float) absDy / addedDistance;
+
+        int xduration = computeAxisDuration(dx, xvel, mCallback.getViewHorizontalDragRange(child));
+        int yduration = computeAxisDuration(dy, yvel, mCallback.getViewVerticalDragRange(child));
+
+        return (int) (xduration * xweight + yduration * yweight);
+    }
+
+    private int computeAxisDuration(int delta, int velocity, int motionRange) {
+        if (delta == 0) {
+            return 0;
+        }
+
+        final int width = mParentView.getWidth();
+        final int halfWidth = width / 2;
+        final float distanceRatio = Math.min(1f, (float) Math.abs(delta) / width);
+        final float distance = halfWidth + halfWidth *
+                distanceInfluenceForSnapDuration(distanceRatio);
+
+        int duration;
+        velocity = Math.abs(velocity);
+        if (velocity > 0) {
+            duration = 4 * Math.round(1000 * Math.abs(distance / velocity));
+        } else {
+            final float range = (float) Math.abs(delta) / motionRange;
+            duration = (int) ((range + 1) * BASE_SETTLE_DURATION);
+        }
+        return Math.min(duration, MAX_SETTLE_DURATION);
+    }
+
+    /**
+     * Clamp the magnitude of value for absMin and absMax.
+     * If the value is below the minimum, it will be clamped to zero.
+     * If the value is above the maximum, it will be clamped to the maximum.
+     *
+     * @param value Value to clamp
+     * @param absMin Absolute value of the minimum significant value to return
+     * @param absMax Absolute value of the maximum value to return
+     * @return The clamped value with the same sign as <code>value</code>
+     */
+    private int clampMag(int value, int absMin, int absMax) {
+        final int absValue = Math.abs(value);
+        if (absValue < absMin) return 0;
+        if (absValue > absMax) return value > 0 ? absMax : -absMax;
+        return value;
+    }
+
+    /**
+     * Clamp the magnitude of value for absMin and absMax.
+     * If the value is below the minimum, it will be clamped to zero.
+     * If the value is above the maximum, it will be clamped to the maximum.
+     *
+     * @param value Value to clamp
+     * @param absMin Absolute value of the minimum significant value to return
+     * @param absMax Absolute value of the maximum value to return
+     * @return The clamped value with the same sign as <code>value</code>
+     */
+    private float clampMag(float value, float absMin, float absMax) {
+        final float absValue = Math.abs(value);
+        if (absValue < absMin) return 0;
+        if (absValue > absMax) return value > 0 ? absMax : -absMax;
+        return value;
+    }
+
+    private float distanceInfluenceForSnapDuration(float f) {
+        f -= 0.5f; // center the values about 0.
+        f *= 0.3f * Math.PI / 2.0f;
+        return (float) Math.sin(f);
+    }
+
+    /**
+     * Settle the captured view based on standard free-moving fling behavior.
+     * The caller should invoke {@link #continueSettling(boolean)} on each subsequent frame
+     * to continue the motion until it returns false.
+     *
+     * @param minLeft Minimum X position for the view's left edge
+     * @param minTop Minimum Y position for the view's top edge
+     * @param maxLeft Maximum X position for the view's left edge
+     * @param maxTop Maximum Y position for the view's top edge
+     */
+    public void flingCapturedView(int minLeft, int minTop, int maxLeft, int maxTop) {
+        if (!mReleaseInProgress) {
+            throw new IllegalStateException("Cannot flingCapturedView outside of a call to " +
+                    "Callback#onViewReleased");
+        }
+
+        mScroller.fling(mCapturedView.getLeft(), mCapturedView.getTop(),
+                (int) VelocityTrackerCompat.getXVelocity(mVelocityTracker, mActivePointerId),
+                (int) VelocityTrackerCompat.getYVelocity(mVelocityTracker, mActivePointerId),
+                minLeft, maxLeft, minTop, maxTop);
+
+        setDragState(STATE_SETTLING);
+    }
+
+    /**
+     * Move the captured settling view by the appropriate amount for the current time.
+     * If <code>continueSettling</code> returns true, the caller should call it again
+     * on the next frame to continue.
+     *
+     * @param deferCallbacks true if state callbacks should be deferred via posted message.
+     *                       Set this to true if you are calling this method from
+     *                       {@link View#computeScroll()} or similar methods
+     *                       invoked as part of layout or drawing.
+     * @return true if settle is still in progress
+     */
+    public boolean continueSettling(boolean deferCallbacks) {
+        // Make sure, there is a captured view
+        if (mCapturedView == null) {
+            return false;
+        }
+        if (mDragState == STATE_SETTLING) {
+            boolean keepGoing = mScroller.computeScrollOffset();
+            final int x = mScroller.getCurrX();
+            final int y = mScroller.getCurrY();
+            final int dx = x - mCapturedView.getLeft();
+            final int dy = y - mCapturedView.getTop();
+
+            if(!keepGoing && dy != 0) { //fix #525
+                //Invalid drag state
+                mCapturedView.setTop(0);
+                return true;
+            }
+
+            if (dx != 0) {
+                mCapturedView.offsetLeftAndRight(dx);
+            }
+            if (dy != 0) {
+                mCapturedView.offsetTopAndBottom(dy);
+            }
+
+            if (dx != 0 || dy != 0) {
+                mCallback.onViewPositionChanged(mCapturedView, x, y, dx, dy);
+            }
+
+            if (keepGoing && x == mScroller.getFinalX() && y == mScroller.getFinalY()) {
+                // Close enough. The interpolator/scroller might think we're still moving
+                // but the user sure doesn't.
+                mScroller.abortAnimation();
+                keepGoing = mScroller.isFinished();
+            }
+
+            if (!keepGoing) {
+                if (deferCallbacks) {
+                    mParentView.post(mSetIdleRunnable);
+                } else {
+                    setDragState(STATE_IDLE);
+                }
+            }
+        }
+
+        return mDragState == STATE_SETTLING;
+    }
+
+    /**
+     * Like all callback events this must happen on the UI thread, but release
+     * involves some extra semantics. During a release (mReleaseInProgress)
+     * is the only time it is valid to call {@link #settleCapturedViewAt(int, int)}
+     * or {@link #flingCapturedView(int, int, int, int)}.
+     */
+    private void dispatchViewReleased(float xvel, float yvel) {
+        mReleaseInProgress = true;
+        mCallback.onViewReleased(mCapturedView, xvel, yvel);
+        mReleaseInProgress = false;
+
+        if (mDragState == STATE_DRAGGING) {
+            // onViewReleased didn't call a method that would have changed this. Go idle.
+            setDragState(STATE_IDLE);
+        }
+    }
+
+    private void clearMotionHistory() {
+        if (mInitialMotionX == null) {
+            return;
+        }
+        Arrays.fill(mInitialMotionX, 0);
+        Arrays.fill(mInitialMotionY, 0);
+        Arrays.fill(mLastMotionX, 0);
+        Arrays.fill(mLastMotionY, 0);
+        Arrays.fill(mInitialEdgesTouched, 0);
+        Arrays.fill(mEdgeDragsInProgress, 0);
+        Arrays.fill(mEdgeDragsLocked, 0);
+        mPointersDown = 0;
+    }
+
+    private void clearMotionHistory(int pointerId) {
+        if (mInitialMotionX == null || mInitialMotionX.length <= pointerId) {
+            return;
+        }
+        mInitialMotionX[pointerId] = 0;
+        mInitialMotionY[pointerId] = 0;
+        mLastMotionX[pointerId] = 0;
+        mLastMotionY[pointerId] = 0;
+        mInitialEdgesTouched[pointerId] = 0;
+        mEdgeDragsInProgress[pointerId] = 0;
+        mEdgeDragsLocked[pointerId] = 0;
+        mPointersDown &= ~(1 << pointerId);
+    }
+
+    private void ensureMotionHistorySizeForId(int pointerId) {
+        if (mInitialMotionX == null || mInitialMotionX.length <= pointerId) {
+            float[] imx = new float[pointerId + 1];
+            float[] imy = new float[pointerId + 1];
+            float[] lmx = new float[pointerId + 1];
+            float[] lmy = new float[pointerId + 1];
+            int[] iit = new int[pointerId + 1];
+            int[] edip = new int[pointerId + 1];
+            int[] edl = new int[pointerId + 1];
+
+            if (mInitialMotionX != null) {
+                System.arraycopy(mInitialMotionX, 0, imx, 0, mInitialMotionX.length);
+                System.arraycopy(mInitialMotionY, 0, imy, 0, mInitialMotionY.length);
+                System.arraycopy(mLastMotionX, 0, lmx, 0, mLastMotionX.length);
+                System.arraycopy(mLastMotionY, 0, lmy, 0, mLastMotionY.length);
+                System.arraycopy(mInitialEdgesTouched, 0, iit, 0, mInitialEdgesTouched.length);
+                System.arraycopy(mEdgeDragsInProgress, 0, edip, 0, mEdgeDragsInProgress.length);
+                System.arraycopy(mEdgeDragsLocked, 0, edl, 0, mEdgeDragsLocked.length);
+            }
+
+            mInitialMotionX = imx;
+            mInitialMotionY = imy;
+            mLastMotionX = lmx;
+            mLastMotionY = lmy;
+            mInitialEdgesTouched = iit;
+            mEdgeDragsInProgress = edip;
+            mEdgeDragsLocked = edl;
+        }
+    }
+
+    private void saveInitialMotion(float x, float y, int pointerId) {
+        ensureMotionHistorySizeForId(pointerId);
+        mInitialMotionX[pointerId] = mLastMotionX[pointerId] = x;
+        mInitialMotionY[pointerId] = mLastMotionY[pointerId] = y;
+        mInitialEdgesTouched[pointerId] = getEdgesTouched((int) x, (int) y);
+        mPointersDown |= 1 << pointerId;
+    }
+
+    private void saveLastMotion(MotionEvent ev) {
+        final int pointerCount = MotionEventCompat.getPointerCount(ev);
+        for (int i = 0; i < pointerCount; i++) {
+            final int pointerId = MotionEventCompat.getPointerId(ev, i);
+            final float x = MotionEventCompat.getX(ev, i);
+            final float y = MotionEventCompat.getY(ev, i);
+            // Sometimes we can try and save last motion for a pointer never recorded in initial motion. In this case we just discard it.
+            if (mLastMotionX != null && mLastMotionY != null
+                    && mLastMotionX.length > pointerId && mLastMotionY.length > pointerId) {
+                mLastMotionX[pointerId] = x;
+                mLastMotionY[pointerId] = y;
+            }
+        }
+    }
+
+    /**
+     * Check if the given pointer ID represents a pointer that is currently down (to the best
+     * of the ViewDragHelper's knowledge).
+     *
+     * <p>The state used to report this information is populated by the methods
+     * {@link #shouldInterceptTouchEvent(MotionEvent)} or
+     * {@link #processTouchEvent(MotionEvent)}. If one of these methods has not
+     * been called for all relevant MotionEvents to track, the information reported
+     * by this method may be stale or incorrect.</p>
+     *
+     * @param pointerId pointer ID to check; corresponds to IDs provided by MotionEvent
+     * @return true if the pointer with the given ID is still down
+     */
+    public boolean isPointerDown(int pointerId) {
+        return (mPointersDown & 1 << pointerId) != 0;
+    }
+
+    void setDragState(int state) {
+        if (mDragState != state) {
+            mDragState = state;
+            mCallback.onViewDragStateChanged(state);
+            if (mDragState == STATE_IDLE) {
+                mCapturedView = null;
+            }
+        }
+    }
+
+    /**
+     * Attempt to capture the view with the given pointer ID. The callback will be involved.
+     * This will put us into the "dragging" state. If we've already captured this view with
+     * this pointer this method will immediately return true without consulting the callback.
+     *
+     * @param toCapture View to capture
+     * @param pointerId Pointer to capture with
+     * @return true if capture was successful
+     */
+    boolean tryCaptureViewForDrag(View toCapture, int pointerId) {
+        if (toCapture == mCapturedView && mActivePointerId == pointerId) {
+            // Already done!
+            return true;
+        }
+        if (toCapture != null && mCallback.tryCaptureView(toCapture, pointerId)) {
+            mActivePointerId = pointerId;
+            captureChildView(toCapture, pointerId);
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Tests scrollability within child views of v given a delta of dx.
+     *
+     * @param v View to test for horizontal scrollability
+     * @param checkV Whether the view v passed should itself be checked for scrollability (true),
+     *               or just its children (false).
+     * @param dx Delta scrolled in pixels along the X axis
+     * @param dy Delta scrolled in pixels along the Y axis
+     * @param x X coordinate of the active touch point
+     * @param y Y coordinate of the active touch point
+     * @return true if child views of v can be scrolled by delta of dx.
+     */
+    protected boolean canScroll(View v, boolean checkV, int dx, int dy, int x, int y) {
+        if (v instanceof ViewGroup) {
+            final ViewGroup group = (ViewGroup) v;
+            final int scrollX = v.getScrollX();
+            final int scrollY = v.getScrollY();
+            final int count = group.getChildCount();
+            // Count backwards - let topmost views consume scroll distance first.
+            for (int i = count - 1; i >= 0; i--) {
+                // TODO: Add versioned support here for transformed views.
+                // This will not work for transformed views in Honeycomb+
+                final View child = group.getChildAt(i);
+                if (x + scrollX >= child.getLeft() && x + scrollX < child.getRight() &&
+                        y + scrollY >= child.getTop() && y + scrollY < child.getBottom() &&
+                        canScroll(child, true, dx, dy, x + scrollX - child.getLeft(),
+                                y + scrollY - child.getTop())) {
+                    return true;
+                }
+            }
+        }
+
+        return checkV && (ViewCompat.canScrollHorizontally(v, -dx) ||
+                ViewCompat.canScrollVertically(v, -dy));
+    }
+
+    /**
+     * Check if this event as provided to the parent view's onInterceptTouchEvent should
+     * cause the parent to intercept the touch event stream.
+     *
+     * @param ev MotionEvent provided to onInterceptTouchEvent
+     * @return true if the parent view should return true from onInterceptTouchEvent
+     */
+    public boolean shouldInterceptTouchEvent(MotionEvent ev) {
+        final int action = MotionEventCompat.getActionMasked(ev);
+        final int actionIndex = MotionEventCompat.getActionIndex(ev);
+
+        if (action == MotionEvent.ACTION_DOWN) {
+            // Reset things for a new event stream, just in case we didn't get
+            // the whole previous stream.
+            cancel();
+        }
+
+        if (mVelocityTracker == null) {
+            mVelocityTracker = VelocityTracker.obtain();
+        }
+        mVelocityTracker.addMovement(ev);
+
+        switch (action) {
+            case MotionEvent.ACTION_DOWN: {
+                final float x = ev.getX();
+                final float y = ev.getY();
+                final int pointerId = MotionEventCompat.getPointerId(ev, 0);
+                saveInitialMotion(x, y, pointerId);
+
+                final View toCapture = findTopChildUnder((int) x, (int) y);
+
+                // Catch a settling view if possible.
+                if (toCapture == mCapturedView && mDragState == STATE_SETTLING) {
+                    tryCaptureViewForDrag(toCapture, pointerId);
+                }
+
+                final int edgesTouched = mInitialEdgesTouched[pointerId];
+                if ((edgesTouched & mTrackingEdges) != 0) {
+                    mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId);
+                }
+                break;
+            }
+
+            case MotionEventCompat.ACTION_POINTER_DOWN: {
+                final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex);
+                final float x = MotionEventCompat.getX(ev, actionIndex);
+                final float y = MotionEventCompat.getY(ev, actionIndex);
+
+                saveInitialMotion(x, y, pointerId);
+
+                // A ViewDragHelper can only manipulate one view at a time.
+                if (mDragState == STATE_IDLE) {
+                    final int edgesTouched = mInitialEdgesTouched[pointerId];
+                    if ((edgesTouched & mTrackingEdges) != 0) {
+                        mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId);
+                    }
+                } else if (mDragState == STATE_SETTLING) {
+                    // Catch a settling view if possible.
+                    final View toCapture = findTopChildUnder((int) x, (int) y);
+                    if (toCapture == mCapturedView) {
+                        tryCaptureViewForDrag(toCapture, pointerId);
+                    }
+                }
+                break;
+            }
+
+            case MotionEvent.ACTION_MOVE: {
+                // First to cross a touch slop over a draggable view wins. Also report edge drags.
+                final int pointerCount = MotionEventCompat.getPointerCount(ev);
+                for (int i = 0; i < pointerCount && mInitialMotionX != null && mInitialMotionY != null; i++) {
+                    final int pointerId = MotionEventCompat.getPointerId(ev, i);
+                    if (pointerId >= mInitialMotionX.length || pointerId >= mInitialMotionY.length) {
+                        continue;
+                    }
+                    final float x = MotionEventCompat.getX(ev, i);
+                    final float y = MotionEventCompat.getY(ev, i);
+                    final float dx = x - mInitialMotionX[pointerId];
+                    final float dy = y - mInitialMotionY[pointerId];
+
+                    reportNewEdgeDrags(dx, dy, pointerId);
+                    if (mDragState == STATE_DRAGGING) {
+                        // Callback might have started an edge drag
+                        break;
+                    }
+
+                    final View toCapture = findTopChildUnder((int)mInitialMotionX[pointerId], (int)mInitialMotionY[pointerId]);
+                    if (toCapture != null && checkTouchSlop(toCapture, dx, dy) &&
+                            tryCaptureViewForDrag(toCapture, pointerId)) {
+                        break;
+                    }
+                }
+                saveLastMotion(ev);
+                break;
+            }
+
+            case MotionEventCompat.ACTION_POINTER_UP: {
+                final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex);
+                clearMotionHistory(pointerId);
+                break;
+            }
+
+            case MotionEvent.ACTION_UP:
+            case MotionEvent.ACTION_CANCEL: {
+                cancel();
+                break;
+            }
+        }
+
+        return mDragState == STATE_DRAGGING;
+    }
+
+    /**
+     * Process a touch event received by the parent view. This method will dispatch callback events
+     * as needed before returning. The parent view's onTouchEvent implementation should call this.
+     *
+     * @param ev The touch event received by the parent view
+     */
+    public void processTouchEvent(MotionEvent ev) {
+        final int action = MotionEventCompat.getActionMasked(ev);
+        final int actionIndex = MotionEventCompat.getActionIndex(ev);
+
+        if (action == MotionEvent.ACTION_DOWN) {
+            // Reset things for a new event stream, just in case we didn't get
+            // the whole previous stream.
+            cancel();
+        }
+
+        if (mVelocityTracker == null) {
+            mVelocityTracker = VelocityTracker.obtain();
+        }
+        mVelocityTracker.addMovement(ev);
+
+        switch (action) {
+            case MotionEvent.ACTION_DOWN: {
+                final float x = ev.getX();
+                final float y = ev.getY();
+                final int pointerId = MotionEventCompat.getPointerId(ev, 0);
+                final View toCapture = findTopChildUnder((int) x, (int) y);
+
+                saveInitialMotion(x, y, pointerId);
+
+                // Since the parent is already directly processing this touch event,
+                // there is no reason to delay for a slop before dragging.
+                // Start immediately if possible.
+                tryCaptureViewForDrag(toCapture, pointerId);
+
+                final int edgesTouched = mInitialEdgesTouched[pointerId];
+                if ((edgesTouched & mTrackingEdges) != 0) {
+                    mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId);
+                }
+                break;
+            }
+
+            case MotionEventCompat.ACTION_POINTER_DOWN: {
+                final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex);
+                final float x = MotionEventCompat.getX(ev, actionIndex);
+                final float y = MotionEventCompat.getY(ev, actionIndex);
+
+                saveInitialMotion(x, y, pointerId);
+
+                // A ViewDragHelper can only manipulate one view at a time.
+                if (mDragState == STATE_IDLE) {
+                    // If we're idle we can do anything! Treat it like a normal down event.
+
+                    final View toCapture = findTopChildUnder((int) x, (int) y);
+                    tryCaptureViewForDrag(toCapture, pointerId);
+
+                    final int edgesTouched = mInitialEdgesTouched[pointerId];
+                    if ((edgesTouched & mTrackingEdges) != 0) {
+                        mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId);
+                    }
+                } else if (isCapturedViewUnder((int) x, (int) y)) {
+                    // We're still tracking a captured view. If the same view is under this
+                    // point, we'll swap to controlling it with this pointer instead.
+                    // (This will still work if we're "catching" a settling view.)
+
+                    tryCaptureViewForDrag(mCapturedView, pointerId);
+                }
+                break;
+            }
+
+            case MotionEvent.ACTION_MOVE: {
+                if (mDragState == STATE_DRAGGING) {
+                    final int index = MotionEventCompat.findPointerIndex(ev, mActivePointerId);
+                    final float x = MotionEventCompat.getX(ev, index);
+                    final float y = MotionEventCompat.getY(ev, index);
+                    final int idx = (int) (x - mLastMotionX[mActivePointerId]);
+                    final int idy = (int) (y - mLastMotionY[mActivePointerId]);
+
+                    dragTo(mCapturedView.getLeft() + idx, mCapturedView.getTop() + idy, idx, idy);
+
+                    saveLastMotion(ev);
+                } else {
+                    // Check to see if any pointer is now over a draggable view.
+                    final int pointerCount = MotionEventCompat.getPointerCount(ev);
+                    for (int i = 0; i < pointerCount; i++) {
+                        final int pointerId = MotionEventCompat.getPointerId(ev, i)
+                                ;
+                        final float x = MotionEventCompat.getX(ev, i);
+                        final float y = MotionEventCompat.getY(ev, i);
+                        final float dx = x - mInitialMotionX[pointerId];
+                        final float dy = y - mInitialMotionY[pointerId];
+
+                        reportNewEdgeDrags(dx, dy, pointerId);
+                        if (mDragState == STATE_DRAGGING) {
+                            // Callback might have started an edge drag.
+                            break;
+                        }
+
+                        final View toCapture = findTopChildUnder((int) mInitialMotionX[pointerId], (int) mInitialMotionY[pointerId]);
+                        if (checkTouchSlop(toCapture, dx, dy) &&
+                                tryCaptureViewForDrag(toCapture, pointerId)) {
+                            break;
+                        }
+                    }
+                    saveLastMotion(ev);
+                }
+                break;
+            }
+
+            case MotionEventCompat.ACTION_POINTER_UP: {
+                final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex);
+                if (mDragState == STATE_DRAGGING && pointerId == mActivePointerId) {
+                    // Try to find another pointer that's still holding on to the captured view.
+                    int newActivePointer = INVALID_POINTER;
+                    final int pointerCount = MotionEventCompat.getPointerCount(ev);
+                    for (int i = 0; i < pointerCount; i++) {
+                        final int id = MotionEventCompat.getPointerId(ev, i);
+                        if (id == mActivePointerId) {
+                            // This one's going away, skip.
+                            continue;
+                        }
+
+                        final float x = MotionEventCompat.getX(ev, i);
+                        final float y = MotionEventCompat.getY(ev, i);
+                        if (findTopChildUnder((int) x, (int) y) == mCapturedView &&
+                                tryCaptureViewForDrag(mCapturedView, id)) {
+                            newActivePointer = mActivePointerId;
+                            break;
+                        }
+                    }
+
+                    if (newActivePointer == INVALID_POINTER) {
+                        // We didn't find another pointer still touching the view, release it.
+                        releaseViewForPointerUp();
+                    }
+                }
+                clearMotionHistory(pointerId);
+                break;
+            }
+
+            case MotionEvent.ACTION_UP: {
+                if (mDragState == STATE_DRAGGING) {
+                    releaseViewForPointerUp();
+                }
+                cancel();
+                break;
+            }
+
+            case MotionEvent.ACTION_CANCEL: {
+                if (mDragState == STATE_DRAGGING) {
+                    dispatchViewReleased(0, 0);
+                }
+                cancel();
+                break;
+            }
+        }
+    }
+
+    private void reportNewEdgeDrags(float dx, float dy, int pointerId) {
+        int dragsStarted = 0;
+        if (checkNewEdgeDrag(dx, dy, pointerId, EDGE_LEFT)) {
+            dragsStarted |= EDGE_LEFT;
+        }
+        if (checkNewEdgeDrag(dy, dx, pointerId, EDGE_TOP)) {
+            dragsStarted |= EDGE_TOP;
+        }
+        if (checkNewEdgeDrag(dx, dy, pointerId, EDGE_RIGHT)) {
+            dragsStarted |= EDGE_RIGHT;
+        }
+        if (checkNewEdgeDrag(dy, dx, pointerId, EDGE_BOTTOM)) {
+            dragsStarted |= EDGE_BOTTOM;
+        }
+
+        if (dragsStarted != 0) {
+            mEdgeDragsInProgress[pointerId] |= dragsStarted;
+            mCallback.onEdgeDragStarted(dragsStarted, pointerId);
+        }
+    }
+
+    private boolean checkNewEdgeDrag(float delta, float odelta, int pointerId, int edge) {
+        final float absDelta = Math.abs(delta);
+        final float absODelta = Math.abs(odelta);
+
+        if ((mInitialEdgesTouched[pointerId] & edge) != edge  || (mTrackingEdges & edge) == 0 ||
+                (mEdgeDragsLocked[pointerId] & edge) == edge ||
+                (mEdgeDragsInProgress[pointerId] & edge) == edge ||
+                (absDelta <= mTouchSlop && absODelta <= mTouchSlop)) {
+            return false;
+        }
+        if (absDelta < absODelta * 0.5f && mCallback.onEdgeLock(edge)) {
+            mEdgeDragsLocked[pointerId] |= edge;
+            return false;
+        }
+        return (mEdgeDragsInProgress[pointerId] & edge) == 0 && absDelta > mTouchSlop;
+    }
+
+    /**
+     * Check if we've crossed a reasonable touch slop for the given child view.
+     * If the child cannot be dragged along the horizontal or vertical axis, motion
+     * along that axis will not count toward the slop check.
+     *
+     * @param child Child to check
+     * @param dx Motion since initial position along X axis
+     * @param dy Motion since initial position along Y axis
+     * @return true if the touch slop has been crossed
+     */
+    private boolean checkTouchSlop(View child, float dx, float dy) {
+        if (child == null) {
+            return false;
+        }
+        final boolean checkHorizontal = mCallback.getViewHorizontalDragRange(child) > 0;
+        final boolean checkVertical = mCallback.getViewVerticalDragRange(child) > 0;
+
+        if (checkHorizontal && checkVertical) {
+            return dx * dx + dy * dy > mTouchSlop * mTouchSlop;
+        } else if (checkHorizontal) {
+            return Math.abs(dx) > mTouchSlop;
+        } else if (checkVertical) {
+            return Math.abs(dy) > mTouchSlop;
+        }
+        return false;
+    }
+
+    /**
+     * Check if any pointer tracked in the current gesture has crossed
+     * the required slop threshold.
+     *
+     * <p>This depends on internal state populated by
+     * {@link #shouldInterceptTouchEvent(MotionEvent)} or
+     * {@link #processTouchEvent(MotionEvent)}. You should only rely on
+     * the results of this method after all currently available touch data
+     * has been provided to one of these two methods.</p>
+     *
+     * @param directions Combination of direction flags, see {@link #DIRECTION_HORIZONTAL},
+     *                   {@link #DIRECTION_VERTICAL}, {@link #DIRECTION_ALL}
+     * @return true if the slop threshold has been crossed, false otherwise
+     */
+    public boolean checkTouchSlop(int directions) {
+        final int count = mInitialMotionX.length;
+        for (int i = 0; i < count; i++) {
+            if (checkTouchSlop(directions, i)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Check if the specified pointer tracked in the current gesture has crossed
+     * the required slop threshold.
+     *
+     * <p>This depends on internal state populated by
+     * {@link #shouldInterceptTouchEvent(MotionEvent)} or
+     * {@link #processTouchEvent(MotionEvent)}. You should only rely on
+     * the results of this method after all currently available touch data
+     * has been provided to one of these two methods.</p>
+     *
+     * @param directions Combination of direction flags, see {@link #DIRECTION_HORIZONTAL},
+     *                   {@link #DIRECTION_VERTICAL}, {@link #DIRECTION_ALL}
+     * @param pointerId ID of the pointer to slop check as specified by MotionEvent
+     * @return true if the slop threshold has been crossed, false otherwise
+     */
+    public boolean checkTouchSlop(int directions, int pointerId) {
+        if (!isPointerDown(pointerId)) {
+            return false;
+        }
+
+        final boolean checkHorizontal = (directions & DIRECTION_HORIZONTAL) == DIRECTION_HORIZONTAL;
+        final boolean checkVertical = (directions & DIRECTION_VERTICAL) == DIRECTION_VERTICAL;
+
+        final float dx = mLastMotionX[pointerId] - mInitialMotionX[pointerId];
+        final float dy = mLastMotionY[pointerId] - mInitialMotionY[pointerId];
+
+        if (checkHorizontal && checkVertical) {
+            return dx * dx + dy * dy > mTouchSlop * mTouchSlop;
+        } else if (checkHorizontal) {
+            return Math.abs(dx) > mTouchSlop;
+        } else if (checkVertical) {
+            return Math.abs(dy) > mTouchSlop;
+        }
+        return false;
+    }
+
+    /**
+     * Check if any of the edges specified were initially touched in the currently active gesture.
+     * If there is no currently active gesture this method will return false.
+     *
+     * @param edges Edges to check for an initial edge touch. See {@link #EDGE_LEFT},
+     *              {@link #EDGE_TOP}, {@link #EDGE_RIGHT}, {@link #EDGE_BOTTOM} and
+     *              {@link #EDGE_ALL}
+     * @return true if any of the edges specified were initially touched in the current gesture
+     */
+    public boolean isEdgeTouched(int edges) {
+        final int count = mInitialEdgesTouched.length;
+        for (int i = 0; i < count; i++) {
+            if (isEdgeTouched(edges, i)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Check if any of the edges specified were initially touched by the pointer with
+     * the specified ID. If there is no currently active gesture or if there is no pointer with
+     * the given ID currently down this method will return false.
+     *
+     * @param edges Edges to check for an initial edge touch. See {@link #EDGE_LEFT},
+     *              {@link #EDGE_TOP}, {@link #EDGE_RIGHT}, {@link #EDGE_BOTTOM} and
+     *              {@link #EDGE_ALL}
+     * @return true if any of the edges specified were initially touched in the current gesture
+     */
+    public boolean isEdgeTouched(int edges, int pointerId) {
+        return isPointerDown(pointerId) && (mInitialEdgesTouched[pointerId] & edges) != 0;
+    }
+
+    public boolean isDragging() {
+        return mDragState == STATE_DRAGGING;
+    }
+
+    private void releaseViewForPointerUp() {
+        mVelocityTracker.computeCurrentVelocity(1000, mMaxVelocity);
+        final float xvel = clampMag(
+                VelocityTrackerCompat.getXVelocity(mVelocityTracker, mActivePointerId),
+                mMinVelocity, mMaxVelocity);
+        final float yvel = clampMag(
+                VelocityTrackerCompat.getYVelocity(mVelocityTracker, mActivePointerId),
+                mMinVelocity, mMaxVelocity);
+        dispatchViewReleased(xvel, yvel);
+    }
+
+    private void dragTo(int left, int top, int dx, int dy) {
+        int clampedX = left;
+        int clampedY = top;
+        final int oldLeft = mCapturedView.getLeft();
+        final int oldTop = mCapturedView.getTop();
+        if (dx != 0) {
+            clampedX = mCallback.clampViewPositionHorizontal(mCapturedView, left, dx);
+            mCapturedView.offsetLeftAndRight(clampedX - oldLeft);
+        }
+        if (dy != 0) {
+            clampedY = mCallback.clampViewPositionVertical(mCapturedView, top, dy);
+            mCapturedView.offsetTopAndBottom(clampedY - oldTop);
+        }
+
+        if (dx != 0 || dy != 0) {
+            final int clampedDx = clampedX - oldLeft;
+            final int clampedDy = clampedY - oldTop;
+            mCallback.onViewPositionChanged(mCapturedView, clampedX, clampedY,
+                    clampedDx, clampedDy);
+        }
+    }
+
+    /**
+     * Determine if the currently captured view is under the given point in the
+     * parent view's coordinate system. If there is no captured view this method
+     * will return false.
+     *
+     * @param x X position to test in the parent's coordinate system
+     * @param y Y position to test in the parent's coordinate system
+     * @return true if the captured view is under the given point, false otherwise
+     */
+    public boolean isCapturedViewUnder(int x, int y) {
+        return isViewUnder(mCapturedView, x, y);
+    }
+
+    /**
+     * Determine if the supplied view is under the given point in the
+     * parent view's coordinate system.
+     *
+     * @param view Child view of the parent to hit test
+     * @param x X position to test in the parent's coordinate system
+     * @param y Y position to test in the parent's coordinate system
+     * @return true if the supplied view is under the given point, false otherwise
+     */
+    public boolean isViewUnder(View view, int x, int y) {
+        if (view == null) {
+            return false;
+        }
+        return x >= view.getLeft() &&
+                x < view.getRight() &&
+                y >= view.getTop() &&
+                y < view.getBottom();
+    }
+
+    /**
+     * Find the topmost child under the given point within the parent view's coordinate system.
+     * The child order is determined using {@link Callback#getOrderedChildIndex(int)}.
+     *
+     * @param x X position to test in the parent's coordinate system
+     * @param y Y position to test in the parent's coordinate system
+     * @return The topmost child view under (x, y) or null if none found.
+     */
+    public View findTopChildUnder(int x, int y) {
+        final int childCount = mParentView.getChildCount();
+        for (int i = childCount - 1; i >= 0; i--) {
+            final View child = mParentView.getChildAt(mCallback.getOrderedChildIndex(i));
+            if (x >= child.getLeft() && x < child.getRight() &&
+                    y >= child.getTop() && y < child.getBottom()) {
+                return child;
+            }
+        }
+        return null;
+    }
+
+    private int getEdgesTouched(int x, int y) {
+        int result = 0;
+
+        if (x < mParentView.getLeft() + mEdgeSize) result |= EDGE_LEFT;
+        if (y < mParentView.getTop() + mEdgeSize) result |= EDGE_TOP;
+        if (x > mParentView.getRight() - mEdgeSize) result |= EDGE_RIGHT;
+        if (y > mParentView.getBottom() - mEdgeSize) result |= EDGE_BOTTOM;
+
+        return result;
+    }
+}

+ 26 - 5
WeiChat/src/main/java/basepedo/ui/MyPedometerActivity.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/ui/MyPedometerActivity.java

@@ -1,4 +1,4 @@
-package basepedo.ui;
+package com.xzjmyk.pm.basepedo.ui;
 
 import android.app.ActivityManager;
 import android.content.ComponentName;
@@ -11,8 +11,10 @@ import android.os.IBinder;
 import android.os.Message;
 import android.os.Messenger;
 import android.os.RemoteException;
+import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
+import android.view.View;
 import android.widget.TextView;
 
 import com.baidu.android.pushservice.PushManager;
@@ -21,9 +23,10 @@ import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.ui.base.BaseActivity;
 import com.xzjmyk.pm.activity.ui.me.SettingActivity;
 import com.xzjmyk.pm.activity.util.PreferenceUtils;
+import com.xzjmyk.pm.basepedo.config.Constant;
+import com.xzjmyk.pm.basepedo.service.StepService;
+import com.xzjmyk.pm.basepedo.slidinguppanel.SlidingUpPanelLayout;
 
-import basepedo.config.Constant;
-import basepedo.service.StepService;
 
 /**
  * Created by FANGlh on 2016/12/30.
@@ -35,7 +38,7 @@ public class MyPedometerActivity extends BaseActivity implements Handler.Callbac
     private Messenger messenger;
     private Messenger mGetReplyMessenger = new Messenger(new Handler(this));
     private Handler delayHandler;
-    private String uustep_service_name = "basepedo.service.StepService";
+    private String uustep_service_name = "com.xzjmyk.pm.basepedo.service.StepService";
     public static String UU_STEP_NOTICE = "UUSTEPNOTICE";
 
     ServiceConnection conn = new ServiceConnection() {
@@ -90,13 +93,31 @@ public class MyPedometerActivity extends BaseActivity implements Handler.Callbac
         return false;
     }
 
-
+    private SlidingUpPanelLayout mLayout;
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_pedometer);
         init();
 
+        mLayout = (SlidingUpPanelLayout) findViewById(R.id.sliding_layout);
+        mLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() {
+            @Override
+            public void onPanelSlide(View panel, float slideOffset) {
+                Log.i(TAG, "onPanelSlide, offset " + slideOffset);
+            }
+
+            @Override
+            public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
+                Log.i(TAG, "onPanelStateChanged " + newState);
+            }
+        });
+        mLayout.setFadeOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                mLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
+            }
+        });
 
     }
     private void init() {

+ 1 - 1
WeiChat/src/main/java/basepedo/utils/CountDownTimer.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/utils/CountDownTimer.java

@@ -1,4 +1,4 @@
-package basepedo.utils;
+package com.xzjmyk.pm.basepedo.utils;
 
 import android.os.Handler;
 import android.os.Message;

+ 1 - 1
WeiChat/src/main/java/basepedo/utils/DbUtils.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/utils/DbUtils.java

@@ -1,4 +1,4 @@
-package basepedo.utils;
+package com.xzjmyk.pm.basepedo.utils;
 
 import android.content.Context;
 

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


+ 8 - 0
WeiChat/src/main/res/drawable/above_shadow.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">   
+    <gradient
+        android:startColor="#20000000"
+        android:endColor="@android:color/transparent"
+        android:angle="90" >
+    </gradient>
+</shape>

+ 8 - 0
WeiChat/src/main/res/drawable/below_shadow.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">   
+    <gradient
+        android:startColor="#20000000"
+        android:endColor="@android:color/transparent"
+        android:angle="270" >
+    </gradient>
+</shape>

+ 0 - 18
WeiChat/src/main/res/layout/activity_add_meet_main.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.oa.AddMeetMainActivity">
-
-
-    <ListView
-        android:id="@+id/listview"
-        android:layout_alignParentTop="true"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:divider="@color/item_line"
-        android:dividerHeight="2px" />
-
-
-</RelativeLayout>

+ 0 - 120
WeiChat/src/main/res/layout/activity_add_next_signin.xml

@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.oa.AddNextSigninActivity">
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-        <TextView
-            style="@style/add_signin_tv_hine"
-            android:layout_marginTop="10dp"
-            android:text="对 usa技术部门 的考勤组规则进行设置" />
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="1px"
-            android:background="@color/item_line" />
-
-        <RelativeLayout
-            android:id="@+id/time_rl"
-            style="@style/add_signin"
-            android:layout_height="wrap_content"
-            android:clickable="true"
-            android:padding="10dp">
-
-            <TextView
-                android:id="@+id/time"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="考勤时间"
-                android:textColor="@color/text_main"
-                android:textSize="@dimen/text_main" />
-
-            <ImageView
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_alignParentRight="true"
-                android:src="@drawable/oa_next" />
-
-            <TextView
-                android:id="@+id/work_time"
-                style="@style/add_signin_tv_hine"
-                android:layout_below="@+id/time"
-                android:layout_marginTop="5dp"
-                android:text="每周一、二、三、四、五  班次 A 08:30-18:00" />
-
-            <TextView
-                android:id="@+id/job_time"
-                style="@style/add_signin_tv_hine"
-                android:layout_below="@+id/work_time"
-                android:layout_marginTop="10dp"
-                android:text="每周六、日 休息" />
-        </RelativeLayout>
-
-        <TextView
-            style="@style/add_signin_tv_hine"
-            android:layout_marginTop="20dp"
-            android:text="设置符合你企业要求的考勤方式" />
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="2px"
-            android:layout_marginTop="10dp"
-            android:background="@color/item_line" />
-
-        <TextView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="@color/white"
-            android:drawableLeft="@drawable/oa_client"
-            android:drawablePadding="10dp"
-            android:padding="10dp"
-            android:text="根据办公地点\n适用于在一铜大楼或一个局域内考勤" />
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="2px"
-            android:background="@color/item_line" />
-
-        <com.xzjmyk.pm.activity.view.MyListView
-            android:id="@+id/listview"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
-
-        <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="50dp">
-
-            <TextView
-                style="@style/add_signin_tv_main"
-                android:layout_marginLeft="10dp"
-                android:text="选择弹性时间" />
-
-            <TextView
-                android:id="@+id/addr_tv"
-                style="@style/add_signin_tv_hine"
-                android:layout_alignParentRight="true"
-                android:layout_marginRight="10dp"
-                android:drawablePadding="10dp"
-                android:drawableRight="@drawable/oa_updata"
-                android:text="300米" />
-        </RelativeLayout>
-
-        <Button
-            android:id="@+id/save_btn"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="20dp"
-            android:layout_marginRight="20dp"
-            android:layout_marginTop="20dp"
-            android:background="@drawable/bg_btn"
-            android:padding="15dp"
-            android:text="保存"
-            android:textColor="@color/white" />
-    </LinearLayout>
-</ScrollView>

+ 0 - 134
WeiChat/src/main/res/layout/activity_add_signin.xml

@@ -1,134 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:focusable="true"
-    android:focusableInTouchMode="true"
-    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.oa.AddSigninActivity">
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-        <RelativeLayout
-            style="@style/add_signin"
-            android:layout_marginTop="30dp">
-
-            <TextView
-                android:id="@+id/name"
-                style="@style/add_signin_tv_main"
-                android:text="考勤组名称" />
-
-            <EditText
-
-                style="@style/add_signin_tv_hine"
-                android:layout_toRightOf="@+id/name"
-                android:background="@null"
-                android:text="uas技术部门" />
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/users_rl"
-            style="@style/add_signin"
-            android:layout_marginTop="30dp">
-
-            <TextView
-                android:id="@+id/users_tv"
-                style="@style/add_signin_tv_main"
-                android:text="参与考勤人员" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_alignParentRight="true"
-                android:drawableRight="@drawable/oa_next"
-                android:text="2人" />
-        </RelativeLayout>
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="1px"
-            android:background="@color/item_line" />
-
-        <RelativeLayout
-            android:id="@+id/user_rl"
-            style="@style/add_signin">
-
-            <TextView
-                android:id="@+id/user_tv"
-                style="@style/add_signin_tv_main"
-                android:text="考勤负责人" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_alignParentRight="true"
-                android:drawableRight="@drawable/oa_next"
-                android:text="1人" />
-        </RelativeLayout>
-
-        <TextView
-            style="@style/add_signin_tv_hine"
-            android:layout_marginTop="15dp"
-            android:text="管理本考勤组的排班统计,减轻管理员的考勤工作" />
-
-        <TextView
-            style="@style/add_signin_tv_hine"
-            android:layout_marginTop="5dp"
-            android:text="清空负责人"
-            android:textColor="@color/blue" />
-
-        <TextView
-            style="@style/add_signin_tv_hine"
-            android:layout_marginTop="40dp"
-            android:text="这些人考勤时间都一样吗? (选择后不可修改)" />
-
-        <com.xzjmyk.pm.activity.view.DivideRadioGroup
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="@color/item_color2"
-            android:orientation="vertical">
-
-            <RadioButton
-                android:id="@+id/static_rb"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:button="@null"
-                android:checked="true"
-                android:drawableLeft="@drawable/oa_rb_button_bg"
-                android:padding="10dp" />
-
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="1px"
-                android:background="@color/item_line" />
-
-            <RadioButton
-                android:id="@+id/plan_rb"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:button="@null"
-                android:drawableLeft="@drawable/oa_rb_button_bg"
-                android:padding="10dp" />
-
-
-        </com.xzjmyk.pm.activity.view.DivideRadioGroup>
-
-        <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="50dp"
-            android:background="@color/item_color2"
-            android:padding="20dp">
-
-            <Button
-                android:id="@+id/next_btn"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:background="@drawable/bg_btn"
-                android:padding="15dp"
-                android:text="下一步"
-                android:textColor="@color/white" />
-        </RelativeLayout>
-    </LinearLayout>
-</ScrollView>

+ 0 - 12
WeiChat/src/main/res/layout/activity_option.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.oa.OptionActivity">
-
-    <android.support.v7.widget.RecyclerView
-        android:id="@+id/listview"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" />
-</RelativeLayout>

+ 90 - 71
WeiChat/src/main/res/layout/activity_pedometer.xml

@@ -1,84 +1,103 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<com.xzjmyk.pm.basepedo.slidinguppanel.SlidingUpPanelLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
+    xmlns:sothree="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/sliding_layout"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
-<ScrollView
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:layout_marginTop="10dp"
-    android:layout_marginLeft="10dp"
-    android:layout_marginRight="10dp">
+    android:layout_height="match_parent"
+    android:gravity="bottom"
+    sothree:umanoPanelHeight="40dp"
+    sothree:umanoShadowHeight="1dp"
+    sothree:umanoParallaxOffset="100dp"
+    sothree:umanoDragView="@+id/ll_top"
+    sothree:umanoOverlay="true"
+    sothree:umanoScrollableView="@+id/list">
 
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+    <!-- MAIN CONTENT -->
+    <FrameLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
         android:orientation="vertical">
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="当前版本须知"
-            android:textSize="18sp"
-            android:layout_gravity="center_horizontal"/>
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="计步功能:触发感应器开始计步,在持续运动3秒后才开始有效计数,不足3秒停止则时间重置,新增步数重置(屏蔽细微移动)。"
-            />
-        <TextView
-            android:visibility="gone"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="屏蔽功能:屏蔽细微移动或者驾车时震动所带来的干扰,停止运动超过3秒,便重新开启屏蔽功能(目前版本又去掉了,具体要否再协商)。"
-            />
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="通知栏提醒:实时通知更新步数,但最终只显示持续运动超过3秒的有效步数,通知栏便于实时测试观察,暂时不做点击取消显示。"
-            />
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="计步优化:添加数据库记录与更新数据;添加广播事件,监听锁屏、关屏、关机等事件,并进行保存数据的相关操作;调整计步精度;并且数据跨天清零。"/>
-        <TextView
-            android:visibility="gone"
-            android:layout_width="wrap_content"
+        <ImageView
+            android:id="@+id/head_background_im"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="计步防作弊:这里对波峰以及晃动的时间差做了特殊的处理,只记录放在口袋里的走动或者类似其的运动才会开始计步(主要外勤企业版的需求),所以测试者不要再拿着手机使劲摇的时候问我步数不变动、不准等问题了,请你走动起来测试,谢谢!!!"
+            android:src="@drawable/uustepbg"
             />
         <TextView
+            android:id="@+id/text_step"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:layout_marginTop="5dp"
-            android:text="预关闭功能:考虑下个版本外勤需要,如果当前存在外勤直接关闭不合适,所以预关闭。下次开启应用时判断是否有外勤,无则不开启UU运动,有则开启UU运动。目前UU运动只属于开放测试阶段。"/>
-
-        <TextView
-            android:id="@+id/text_step"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textColor="#00cc00"
-            android:layout_centerInParent="true"
-            android:textSize="20sp"
-            android:layout_gravity="center_horizontal"
-            android:layout_marginTop="100dp"
+            android:gravity="center"
             android:text="暂未开启UU运动"
-            />
-        <Button
-            android:id="@+id/close_uu_step_bt"
-            style="@style/from_button_base_bule"
-            android:layout_marginTop="5dp"
-            android:layout_marginLeft="40dp"
-            android:layout_marginRight="40dp"
-            android:text="关闭UU运动"
-            android:visibility="gone"/>
+            android:textColor="#00cc00"
+            android:clickable="true"
+            android:focusable="false"
+            android:textSize="16sp" />
+    </FrameLayout>
+
+    <!-- SLIDING LAYOUT -->
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="#ffffff"
+        android:clickable="true"
+        android:focusable="false"
+        android:id="@+id/dragView"
+        android:orientation="vertical"
+        >
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical"
+            android:layout_marginTop="10dp"
+            android:layout_marginLeft="10dp"
+            android:layout_marginRight="10dp">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="当前版本须知"
+                android:textSize="18sp"
+                android:layout_gravity="center_horizontal"/>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="20dp"
+                android:text="计步功能:触发感应器开始计步,在持续运动3秒后才开始有效计数,不足3秒停止则时间重置,新增步数重置(屏蔽细微移动)。"
+                />
+            <TextView
+                android:visibility="gone"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="5dp"
+                android:text="屏蔽功能:屏蔽细微移动或者驾车时震动所带来的干扰,停止运动超过3秒,便重新开启屏蔽功能(目前版本又去掉了,具体要否再协商)。"
+                />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="5dp"
+                android:text="通知栏提醒:实时通知更新步数,但最终只显示持续运动超过3秒的有效步数,通知栏便于实时测试观察,暂时不做点击取消显示(低版本号手机显示会有延迟效果)。"
+                />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="5dp"
+                android:text="计步优化:添加数据库记录与更新数据;添加广播事件,监听锁屏、关屏、关机等事件,并进行保存数据的相关操作;调整计步精度;并且数据跨天清零。"/>
+            <TextView
+                android:visibility="gone"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="5dp"
+                android:text="计步防作弊:这里对波峰以及晃动的时间差做了特殊的处理,只记录放在口袋里的走动或者类似其的运动才会开始计步(主要外勤企业版的需求),所以测试者不要再拿着手机使劲摇的时候问我步数不变动、不准等问题了,请你走动起来测试,谢谢!!!"
+                />
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginTop="5dp"
+                android:text="预关闭功能:考虑下个版本外勤需要,如果当前存在外勤直接关闭不合适,所以预关闭。下次开启应用时判断是否有外勤,无则不开启UU运动,有则开启UU运动。目前UU运动只属于开放测试阶段。"/>
 
+        </LinearLayout>
     </LinearLayout>
-</ScrollView>
 
-</LinearLayout>
+</com.xzjmyk.pm.basepedo.slidinguppanel.SlidingUpPanelLayout>

+ 0 - 332
WeiChat/src/main/res/layout/activity_signin_time_set.xml

@@ -1,332 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.oa.SigninTimeSetActivity">
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-        <RelativeLayout
-            style="@style/add_signin_item"
-            android:layout_marginTop="10dp">
-
-            <TextView
-                android:id="@+id/all"
-                style="@style/add_signin_tv_main"
-                android:text="批量设置班次" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_centerHorizontal="true"
-                android:text="班次A" />
-
-            <ImageView
-                android:id="@+id/updata_img"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:src="@drawable/oa_updata" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_marginRight="20dp"
-                android:layout_toLeftOf="@+id/updata_img"
-                android:text="08:30-18:00" />
-        </RelativeLayout>
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="10dp"
-            android:layout_marginTop="5dp"
-            android:text="可快速设置所有工作日班次" />
-
-        <RelativeLayout
-            style="@style/add_signin_item"
-            android:layout_marginTop="30dp">
-
-            <com.xzjmyk.pm.activity.view.SmoothCheckBox
-                android:id="@+id/scb1"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true" />
-
-            <TextView
-                android:id="@+id/Monday_tv"
-                style="@style/add_signin_tv_main"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/scb1"
-                android:text="每周一" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_centerHorizontal="true"
-                android:text="班次A" />
-
-            <ImageView
-                android:id="@+id/Monday_img"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:src="@drawable/oa_updata" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_marginRight="20dp"
-                android:layout_toLeftOf="@+id/Monday_img"
-                android:text="08:30-18:00" />
-        </RelativeLayout>
-
-        <RelativeLayout style="@style/add_signin_item">
-
-            <com.xzjmyk.pm.activity.view.SmoothCheckBox
-                android:id="@+id/scb2"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true" />
-
-            <TextView
-                android:id="@+id/Tuesday_tv"
-                style="@style/add_signin_tv_main"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/scb2"
-                android:text="每周二" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_centerHorizontal="true"
-                android:text="班次A" />
-
-            <ImageView
-                android:id="@+id/Tuesday_img"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:src="@drawable/oa_updata" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_marginRight="20dp"
-                android:layout_toLeftOf="@+id/Tuesday_img"
-                android:text="08:30-18:00" />
-        </RelativeLayout>
-
-        <RelativeLayout style="@style/add_signin_item">
-
-            <com.xzjmyk.pm.activity.view.SmoothCheckBox
-                android:id="@+id/scb3"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true" />
-
-            <TextView
-                android:id="@+id/Wednesday_tv"
-                style="@style/add_signin_tv_main"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/scb3"
-                android:text="每周三" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_centerHorizontal="true"
-                android:text="班次A" />
-
-            <ImageView
-                android:id="@+id/Wednesday_img"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:src="@drawable/oa_updata" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_marginRight="20dp"
-                android:layout_toLeftOf="@+id/Wednesday_img"
-                android:text="08:30-18:00" />
-        </RelativeLayout>
-
-        <RelativeLayout style="@style/add_signin_item">
-
-            <com.xzjmyk.pm.activity.view.SmoothCheckBox
-                android:id="@+id/scb4"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true" />
-
-            <TextView
-                android:id="@+id/Thursday_tv"
-                style="@style/add_signin_tv_main"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/scb4"
-                android:text="每周四" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_centerHorizontal="true"
-                android:text="班次A" />
-
-            <ImageView
-                android:id="@+id/Thursday_img"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:src="@drawable/oa_updata" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_marginRight="20dp"
-                android:layout_toLeftOf="@+id/Thursday_img"
-                android:text="08:30-18:00" />
-        </RelativeLayout>
-
-        <RelativeLayout style="@style/add_signin_item">
-
-            <com.xzjmyk.pm.activity.view.SmoothCheckBox
-                android:id="@+id/scb5"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true" />
-
-            <TextView
-                android:id="@+id/Friday_tv"
-                style="@style/add_signin_tv_main"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/scb5"
-                android:text="每周五" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_centerHorizontal="true"
-                android:text="班次A" />
-
-            <ImageView
-                android:id="@+id/Friday_img"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:src="@drawable/oa_updata" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_marginRight="20dp"
-                android:layout_toLeftOf="@+id/Friday_img"
-                android:text="08:30-18:00" />
-        </RelativeLayout>
-
-        <RelativeLayout style="@style/add_signin_item">
-
-            <com.xzjmyk.pm.activity.view.SmoothCheckBox
-                android:id="@+id/scb6"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true" />
-
-            <TextView
-                android:id="@+id/Saturday_tv"
-                style="@style/add_signin_tv_main"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/scb6"
-                android:text="每周六" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_centerHorizontal="true"
-                android:text="班次A" />
-
-            <ImageView
-                android:id="@+id/Saturday_img"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:src="@drawable/oa_updata" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_marginRight="20dp"
-                android:layout_toLeftOf="@+id/Saturday_img"
-                android:text="08:30-18:00" />
-        </RelativeLayout>
-
-        <RelativeLayout style="@style/add_signin_item">
-
-            <com.xzjmyk.pm.activity.view.SmoothCheckBox
-                android:id="@+id/scb7"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true" />
-
-            <TextView
-                android:id="@+id/Sunday_tv"
-                style="@style/add_signin_tv_main"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/scb7"
-                android:text="每周日" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_centerHorizontal="true"
-                android:text="班次A" />
-
-            <ImageView
-                android:id="@+id/Sunday_img"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:src="@drawable/oa_updata" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_marginRight="20dp"
-                android:layout_toLeftOf="@+id/Sunday_img"
-                android:text="08:30-18:00" />
-        </RelativeLayout>
-
-        <RelativeLayout
-            style="@style/add_signin_item"
-            android:layout_marginTop="30dp">
-
-            <TextView
-                style="@style/add_signin_tv_main"
-                android:layout_marginLeft="10dp"
-                android:text="法定节假日自动排休" />
-
-            <com.xzjmyk.pm.activity.ui.erp.view.SwitchView
-                android:id="@+id/cb_task_reply"
-                android:layout_width="50dp"
-                android:layout_height="35dp"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:layout_marginRight="20dp" />
-
-        </RelativeLayout>
-
-        <RelativeLayout
-            style="@style/add_signin_item"
-            android:layout_marginTop="50dp">
-
-            <Button
-                android:id="@+id/ok_btn"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_marginLeft="30dp"
-                android:layout_marginRight="30dp"
-                android:background="@drawable/bg_btn"
-                android:gravity="center"
-                android:text="确定"
-                android:textColor="@color/white" />
-
-        </RelativeLayout>
-    </LinearLayout>
-</ScrollView>

+ 0 - 621
WeiChat/src/main/res/layout/activity_statistics.xml

@@ -1,621 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.oa.StatisticsActivity">
-
-    <Spinner
-        android:id="@+id/oa_statistics_spinner"
-        android:layout_width="wrap_content"
-        android:layout_height="40dp"
-        android:layout_below="@id/top"
-        android:layout_toLeftOf="@+id/oa_statistics_rl"
-        android:padding="5dp" />
-
-    <RelativeLayout
-        android:id="@+id/oa_statistics_rl"
-        android:layout_width="wrap_content"
-        android:layout_height="40dp"
-        android:layout_below="@+id/top"
-        android:layout_centerHorizontal="true">
-
-        <ImageView
-            android:id="@+id/oa_statistics_back"
-            android:layout_width="50dp"
-            android:layout_height="match_parent"
-            android:layout_marginRight="10dp"
-            android:layout_toLeftOf="@+id/oa_statistics_tv"
-            android:clickable="true"
-            android:src="@drawable/mobile_back" />
-
-        <TextView
-            android:id="@+id/oa_statistics_tv"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_centerHorizontal="true"
-            android:gravity="center"
-            android:text="星期一 2016-6-13" />
-
-        <ImageView
-            android:id="@+id/oa_statistics_next"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="10dp"
-            android:layout_toRightOf="@+id/oa_statistics_tv"
-            android:clickable="true"
-            android:src="@drawable/next" />
-    </RelativeLayout>
-
-    <View
-        android:id="@+id/oa_statistics_top_line"
-        android:layout_width="match_parent"
-        android:layout_height="2px"
-        android:layout_below="@+id/oa_statistics_rl"
-        android:background="@color/item_line" />
-
-    <RelativeLayout
-        android:id="@+id/oa_statistics"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@+id/oa_statistics_top_line"
-        android:layout_margin="10dp"
-        android:background="@color/item_color2">
-
-        <LinearLayout
-            android:id="@+id/name1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="vertical">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="正常打卡" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="请假" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="出差" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="外出" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="休息" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="未排班" />
-        </LinearLayout>
-
-        <LinearLayout
-            android:id="@+id/progress1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_toRightOf="@id/name1"
-            android:minWidth="80dp"
-            android:orientation="vertical">
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-        </LinearLayout>
-
-        <LinearLayout
-            android:id="@+id/num1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_toRightOf="@id/progress1"
-            android:orientation="vertical">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-        </LinearLayout>
-
-
-        <LinearLayout
-            android:id="@+id/name2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_toLeftOf="@+id/progress2"
-            android:orientation="vertical">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="还未打卡" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="外勤打卡" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="迟到" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="早退" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="却卡" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="旷工" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-        </LinearLayout>
-
-        <LinearLayout
-            android:id="@+id/progress2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_toLeftOf="@+id/num2"
-            android:minWidth="80dp"
-            android:orientation="vertical">
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <ProgressBar
-                style="@style/StyleProgressBarMini"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:background="@drawable/shape_progressbar_bg"
-                android:max="7"
-                android:minWidth="80dp"
-                android:progress="4" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-        </LinearLayout>
-
-        <LinearLayout
-            android:id="@+id/num2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentRight="true"
-            android:orientation="vertical">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="1" />
-
-            <View
-                android:layout_width="1dp"
-                android:layout_height="@dimen/oa_statistics_line" />
-        </LinearLayout>
-
-
-    </RelativeLayout>
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@+id/oa_statistics"
-        android:background="@color/item_color1"
-        android:padding="10dp">
-
-        <RelativeLayout
-            android:id="@+id/oa_statistics_date"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content">
-
-            <TextView
-                android:id="@+id/tv_date"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:background="@drawable/oa_statistics_date"
-                android:gravity="center"
-                android:minHeight="@dimen/oa_statistics_date_minheight"
-                android:minWidth="@dimen/oa_statistics_date_minWidth"
-                android:text="日期" />
-
-            <TextView
-                android:id="@+id/oa_statistics_yeas"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_below="@+id/tv_date"
-                android:background="@color/white"
-                android:gravity="center"
-                android:minHeight="@dimen/oa_statistics_date_minheight"
-                android:minWidth="@dimen/oa_statistics_date_minWidth"
-                android:text="2016年" />
-
-            <TextView
-                android:id="@+id/oa_statistics_mothes"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_below="@+id/oa_statistics_yeas"
-                android:background="@color/white"
-                android:gravity="center"
-                android:minHeight="@dimen/oa_statistics_date_minheight"
-                android:minWidth="@dimen/oa_statistics_date_minWidth"
-                android:text="6月>" />
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/rl"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="10dp"
-            android:layout_toRightOf="@id/oa_statistics_date"
-            android:background="@drawable/oa_statistics_rl"
-            android:minHeight="@dimen/oa_statistics_date_minheight">
-
-            <TextView
-                android:id="@+id/name"
-                android:layout_width="80dp"
-                android:layout_height="80dp"
-                android:background="@drawable/oa_mystatistics"
-                android:gravity="center"
-                android:text="我的考勤" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="10dp"
-                android:layout_marginTop="10dp"
-                android:layout_toRightOf="@id/name"
-                android:gravity="center"
-                android:text="正常考勤" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerInParent="true"
-                android:gravity="center"
-                android:text="0天" />
-        </RelativeLayout>
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_alignLeft="@id/rl"
-            android:layout_below="@id/rl"
-            android:layout_marginTop="3px"
-            android:background="@drawable/oa_statistics_tag"
-            android:minHeight="60dp"
-            android:orientation="horizontal">
-
-            <TextView
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:gravity="center"
-                android:paddingTop="10dp"
-                android:text="迟到\n0次" />
-
-            <View
-                android:layout_width="2px"
-                android:layout_height="60dp"
-                android:background="@color/item_color1" />
-
-            <TextView
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:gravity="center"
-                android:text="早退\n0次" />
-
-            <View
-                android:layout_width="2px"
-                android:layout_height="60dp"
-                android:background="@color/item_color1" />
-
-            <TextView
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:gravity="center"
-                android:text="缺卡\n0次" />
-        </LinearLayout>
-    </RelativeLayout>
-</RelativeLayout>

+ 0 - 152
WeiChat/src/main/res/layout/activity_super_set.xml

@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.oa.SuperSetActivity">
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-        <RelativeLayout style="@style/add_signin_item">
-
-            <TextView
-                style="@style/add_signin_tv_main"
-                android:text="设置上班弹性时间" />
-
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_alignParentRight="true"
-                android:drawableRight="@drawable/oa_next"
-                android:text="5分钟" />
-        </RelativeLayout>
-
-        <RelativeLayout style="@style/add_signin_item">
-
-            <TextView
-                style="@style/add_signin_tv_main"
-                android:text="设置严重迟到" />
-
-
-            android:src="@drawable/oa_next" />
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_alignParentRight="true"
-                android:drawableRight="@drawable/oa_next"
-                android:text="15分钟" />
-        </RelativeLayout>
-
-        <RelativeLayout style="@style/add_signin_item">
-
-            <TextView
-                style="@style/add_signin_tv_main"
-                android:text="设置旷工" />
-
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_alignParentRight="true"
-                android:drawableRight="@drawable/oa_next"
-                android:text="60分钟" />
-        </RelativeLayout>
-
-        <TextView
-            style="@style/add_signin_tv_hine"
-            android:layout_marginTop="10dp"
-            android:text="上班后超过多久打卡分别设置为迟到、严重迟到、旷工" />
-
-        <RelativeLayout
-            style="@style/add_signin_item"
-            android:layout_marginTop="30dp">
-
-            <TextView
-                style="@style/add_signin_tv_main"
-                android:text="设置请假、出差、外出" />
-
-            <ImageView
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:src="@drawable/oa_next" />
-        </RelativeLayout>
-
-        <TextView
-            style="@style/add_signin_tv_hine"
-            android:layout_marginTop="10dp"
-            android:text="绑定考勤类相关审批,系统将自动计算出勤情况,方便统计" />
-
-
-        <RelativeLayout
-            style="@style/add_signin_item"
-            android:layout_marginTop="30dp">
-
-            <TextView
-                style="@style/add_signin_tv_main"
-                android:text="上班打卡提醒" />
-
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_alignParentRight="true"
-                android:drawableRight="@drawable/oa_next"
-                android:text="提前10分钟" />
-        </RelativeLayout>
-
-        <RelativeLayout style="@style/add_signin_item">
-
-            <TextView
-                style="@style/add_signin_tv_main"
-                android:text="下班打卡提醒" />
-
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_alignParentRight="true"
-                android:drawableRight="@drawable/oa_next"
-                android:text="延迟1分钟" />
-        </RelativeLayout>
-
-        <RelativeLayout
-            style="@style/add_signin_item"
-            android:layout_marginTop="30dp">
-
-            <TextView
-                style="@style/add_signin_tv_main"
-                android:text="设置上班打卡的最早时间" />
-
-
-            <TextView
-                style="@style/add_signin_tv_hine"
-                android:layout_alignParentRight="true"
-                android:drawableRight="@drawable/oa_next"
-                android:text="提前180分钟" />
-        </RelativeLayout>
-
-        <TextView
-            style="@style/add_signin_tv_hine"
-            android:layout_marginTop="10dp"
-            android:text="上班时间前多少分钟,才允许打卡" />
-
-        <RelativeLayout
-            style="@style/add_signin_item"
-            android:layout_marginTop="50dp">
-
-            <Button
-                android:id="@+id/ok_btn"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_marginLeft="30dp"
-                android:layout_marginRight="30dp"
-                android:background="@drawable/bg_btn"
-                android:gravity="center"
-                android:text="确定"
-                android:textColor="@color/white" />
-
-        </RelativeLayout>
-    </LinearLayout>
-</ScrollView>

+ 71 - 69
WeiChat/src/main/res/layout/item_mission.xml

@@ -4,6 +4,7 @@
     android:layout_height="match_parent"
     android:orientation="vertical">
 
+
     <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="@dimen/misson_item_height"
@@ -33,75 +34,6 @@
             android:textSize="@dimen/text_main" />
     </RelativeLayout>
 
-    <RelativeLayout
-        android:layout_width="wrap_content"
-        android:layout_height="@dimen/misson_item_height"
-        android:paddingLeft="@dimen/misson_item_pl"
-        android:paddingRight="@dimen/misson_item_pr">
-
-        <TextView
-            android:id="@+id/time_tag"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginRight="20dp"
-            android:gravity="center"
-            android:text="创建时间"
-            android:textColor="@color/text_main"
-            android:textSize="@dimen/text_main" />
-
-
-        <TextView
-            android:id="@+id/item_time_tv"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_alignParentRight="true"
-            android:layout_toRightOf="@id/time_tag"
-            android:ellipsize="end"
-            android:gravity="center|right"
-            android:maxLines="2"
-            android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_hine" />
-    </RelativeLayout>
-
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="2px"
-        android:background="@color/item_line" />
-
-    <RelativeLayout
-        android:layout_width="wrap_content"
-        android:layout_height="@dimen/misson_item_height"
-        android:paddingLeft="@dimen/misson_item_pl"
-        android:paddingRight="@dimen/misson_item_pr">
-
-        <TextView
-            android:id="@+id/location_tag"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginRight="20dp"
-            android:gravity="center"
-            android:text="创建地点"
-            android:textColor="@color/text_main"
-            android:textSize="@dimen/text_main" />
-
-
-        <TextView
-            android:id="@+id/item_location_tv"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_alignParentRight="true"
-            android:layout_toRightOf="@id/location_tag"
-            android:ellipsize="end"
-            android:gravity="center|right"
-            android:maxLines="2"
-            android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_hine" />
-    </RelativeLayout>
-
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="2px"
-        android:background="@color/item_line" />
 
     <RelativeLayout
         android:layout_width="wrap_content"
@@ -306,6 +238,76 @@
             android:textSize="@dimen/text_hine" />
     </RelativeLayout>
 
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="2px"
+        android:background="@color/item_line" />
+
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/misson_item_height"
+        android:paddingLeft="@dimen/misson_item_pl"
+        android:paddingRight="@dimen/misson_item_pr">
+
+        <TextView
+            android:id="@+id/time_tag"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_marginRight="20dp"
+            android:gravity="center"
+            android:text="创建时间"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_main" />
+
+
+        <TextView
+            android:id="@+id/item_time_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_alignParentRight="true"
+            android:layout_toRightOf="@id/time_tag"
+            android:ellipsize="end"
+            android:gravity="center|right"
+            android:maxLines="2"
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_hine" />
+    </RelativeLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="2px"
+        android:background="@color/item_line" />
+
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/misson_item_height"
+        android:paddingLeft="@dimen/misson_item_pl"
+        android:paddingRight="@dimen/misson_item_pr">
+
+        <TextView
+            android:id="@+id/location_tag"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_marginRight="20dp"
+            android:gravity="center"
+            android:text="创建地点"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_main" />
+
+
+        <TextView
+            android:id="@+id/item_location_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_alignParentRight="true"
+            android:layout_toRightOf="@id/location_tag"
+            android:ellipsize="end"
+            android:gravity="center|right"
+            android:maxLines="2"
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_hine" />
+    </RelativeLayout>
+
     <View
         android:layout_width="match_parent"
         android:layout_height="2px"

+ 19 - 0
WeiChat/src/main/res/values/attrs.xml

@@ -125,4 +125,23 @@
         <attr name="color_unchecked" format="color" />
         <attr name="color_unchecked_stroke" format="color" />
     </declare-styleable>
+    <declare-styleable name="SlidingUpPanelLayout">
+        <attr name="umanoPanelHeight" format="dimension" />
+        <attr name="umanoShadowHeight" format="dimension" />
+        <attr name="umanoParallaxOffset" format="dimension" />
+        <attr name="umanoFadeColor" format="color" />
+        <attr name="umanoFlingVelocity" format="integer" />
+        <attr name="umanoDragView" format="reference" />
+        <attr name="umanoScrollableView" format="reference" />
+        <attr name="umanoOverlay" format="boolean"/>
+        <attr name="umanoClipPanel" format="boolean"/>
+        <attr name="umanoAnchorPoint" format="float" />
+        <attr name="umanoInitialState" format="enum">
+            <enum name="expanded" value="0" />
+            <enum name="collapsed" value="1" />
+            <enum name="anchored" value="2" />
+            <enum name="hidden" value="3" />
+        </attr>
+        <attr name="umanoScrollInterpolator" format="reference" />
+    </declare-styleable>
 </resources>

+ 2 - 1
WeiChat/src/main/res/values/strings.xml

@@ -324,7 +324,7 @@
     <string name="room_name_empty_error">群名不能为空</string>
     <string name="room_des_empty_error">群描述不能为空</string>
     <string name="create_room_failed">创建群失败</string>
-
+    <string name="uustep_service">com.xzjmyk.pm.basepedo.service.StepService</string>
     <!-- MeFragment -->
     <string name="my_uas">UAS账户</string>\
     <string name="my_b2b">B2B平台</string>
@@ -526,4 +526,5 @@
     <string name="umeng_socialize_text_googleplus_key">GooglePlus</string>
     <string name="umeng_socialize_text_more_key">更多</string>
     <string name="title_activity_process_msg">ProcessMsgActivity</string>
+
 </resources>

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

@@ -1099,4 +1099,7 @@
         <item name="android:taskToBackExitAnimation">@null</item>
 
     </style>
+    <style name="ActionBar" parent="ThemeOverlay.AppCompat.ActionBar">
+        <item name="android:displayOptions">homeAsUp</item>
+    </style>
 </resources>