Bladeren bron

计步界面基本滑动完成1

FANGLH 9 jaren geleden
bovenliggende
commit
08f4c78524

+ 4 - 4
WeiChat/src/main/AndroidManifest.xml

@@ -798,12 +798,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">
 
                 <!-- 系统启动完成后会调用 -->
@@ -817,7 +817,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" />

+ 3 - 3
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;
 
 
 /**

+ 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服务,开启线程

+ 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 {

+ 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();

+ 1 - 1
WeiChat/src/main/java/basepedo/slidinguppanel/ScrollableViewHelper.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/slidinguppanel/ScrollableViewHelper.java

@@ -1,4 +1,4 @@
-package basepedo.slidinguppanel;
+package com.xzjmyk.pm.basepedo.slidinguppanel;
 
 import android.support.v7.widget.RecyclerView;
 import android.view.View;

+ 2 - 1
WeiChat/src/main/java/basepedo/slidinguppanel/SlidingUpPanelLayout.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/slidinguppanel/SlidingUpPanelLayout.java

@@ -1,4 +1,4 @@
-package basepedo.slidinguppanel;
+package com.xzjmyk.pm.basepedo.slidinguppanel;
 
 import android.annotation.SuppressLint;
 import android.content.Context;
@@ -25,6 +25,7 @@ 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();

+ 11 - 11
WeiChat/src/main/java/basepedo/slidinguppanel/ViewDragHelper.java → WeiChat/src/main/java/com/xzjmyk/pm/basepedo/slidinguppanel/ViewDragHelper.java

@@ -15,7 +15,7 @@
  */
 
 
-package basepedo.slidinguppanel;
+package com.xzjmyk.pm.basepedo.slidinguppanel;
 
 import android.content.Context;
 import android.support.v4.view.MotionEventCompat;
@@ -281,7 +281,7 @@ public class ViewDragHelper {
          * 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(android.view.View, int)}
+         * <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
@@ -481,7 +481,7 @@ public class ViewDragHelper {
 
     /**
      * Capture a specific child view for dragging within the parent. The callback will be notified
-     * but {@link Callback#tryCaptureView(android.view.View, int)} will not be asked permission to
+     * but {@link Callback#tryCaptureView(View, int)} will not be asked permission to
      * capture this view.
      *
      * @param childView Child view to capture
@@ -523,7 +523,7 @@ public class ViewDragHelper {
 
     /**
      * The result of a call to this method is equivalent to
-     * {@link #processTouchEvent(android.view.MotionEvent)} receiving an ACTION_CANCEL event.
+     * {@link #processTouchEvent(MotionEvent)} receiving an ACTION_CANCEL event.
      */
     public void cancel() {
         mActivePointerId = INVALID_POINTER;
@@ -738,7 +738,7 @@ public class ViewDragHelper {
      *
      * @param deferCallbacks true if state callbacks should be deferred via posted message.
      *                       Set this to true if you are calling this method from
-     *                       {@link android.view.View#computeScroll()} or similar methods
+     *                       {@link View#computeScroll()} or similar methods
      *                       invoked as part of layout or drawing.
      * @return true if settle is still in progress
      */
@@ -893,8 +893,8 @@ public class ViewDragHelper {
      * of the ViewDragHelper's knowledge).
      *
      * <p>The state used to report this information is populated by the methods
-     * {@link #shouldInterceptTouchEvent(android.view.MotionEvent)} or
-     * {@link #processTouchEvent(android.view.MotionEvent)}. If one of these methods has not
+     * {@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>
      *
@@ -1312,8 +1312,8 @@ public class ViewDragHelper {
      * the required slop threshold.
      *
      * <p>This depends on internal state populated by
-     * {@link #shouldInterceptTouchEvent(android.view.MotionEvent)} or
-     * {@link #processTouchEvent(android.view.MotionEvent)}. You should only rely on
+     * {@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>
      *
@@ -1336,8 +1336,8 @@ public class ViewDragHelper {
      * the required slop threshold.
      *
      * <p>This depends on internal state populated by
-     * {@link #shouldInterceptTouchEvent(android.view.MotionEvent)} or
-     * {@link #processTouchEvent(android.view.MotionEvent)}. You should only rely on
+     * {@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>
      *

+ 5 - 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;
@@ -23,10 +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;
-import basepedo.slidinguppanel.SlidingUpPanelLayout;
 
 /**
  * Created by FANGlh on 2016/12/30.
@@ -38,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() {

+ 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;
 

+ 2 - 2
WeiChat/src/main/res/layout/activity_pedometer.xml

@@ -1,4 +1,4 @@
-<basepedo.slidinguppanel.SlidingUpPanelLayout
+<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"
@@ -95,4 +95,4 @@
         </LinearLayout>
     </LinearLayout>
 
-</basepedo.slidinguppanel.SlidingUpPanelLayout>
+</com.xzjmyk.pm.basepedo.slidinguppanel.SlidingUpPanelLayout>

+ 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>