Просмотр исходного кода

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

raomeng 8 лет назад
Родитель
Сommit
91898f4efa

+ 3 - 0
WeiChat/src/main/AndroidManifest.xml

@@ -1042,6 +1042,9 @@
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
         </activity>
+        <activity android:name="com.modular.appmessages.activity.UUSportActivity"
+            android:label="@string/set_sport"/>
+
     </application>
 
 </manifest>

+ 3 - 5
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/MessageFragment.java

@@ -40,10 +40,10 @@ import com.lidroid.xutils.view.annotation.ViewInject;
 import com.modular.appmessages.activity.ProcessB2BActivity;
 import com.modular.appmessages.activity.ProcessMsgActivity;
 import com.modular.appmessages.activity.Subscription2Activity;
+import com.modular.appmessages.activity.UUSportActivity;
 import com.modular.appmessages.adapter.MessageAdapter;
 import com.modular.appmessages.presenter.MessagePresenter;
 import com.modular.appmessages.presenter.imp.IMessageView;
-import com.uas.appme.pedometer.view.NewStepActivity;
 import com.uas.appme.settings.Constant.Constant;
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.ui.platform.task.TaskActivity;
@@ -238,7 +238,7 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
 
         if (PreferenceUtils.getInt(MyApplication.getInstance(), Constant.UU_STEP) == 1
                 && !CommonUtil.isReleaseVersion()  )
-            uustep_rl.setVisibility(View.VISIBLE);
+            uustep_rl.setVisibility(View.GONE);
         else
             uustep_rl.setVisibility(View.GONE);
         return view;
@@ -333,9 +333,7 @@ public class MessageFragment extends EasyFragment implements IMessageView, View.
 //                startActivityForResult(intent, REQUESTCODE);
 //                break;
             case R.id.uustep_rl:
-//                startActivity(new Intent(mContext, UURanking.class));
-
-                startActivity(new Intent(mContext, NewStepActivity.class));
+                startActivity(new Intent(mContext, UUSportActivity.class));
                 break;
         }
 

+ 1 - 0
app_core/common/src/main/java/com/core/app/AppConstant.java

@@ -69,6 +69,7 @@ public class AppConstant {
     public static final String NEW_FUNCTION_NOTICE = "NEW_FUNCTION_NOTICE";
 
     public static final String UPDATA_UUHELPER = "UPDATA_UUHELPER";
+    public static final String UUSPORT_PUSH = "UUSPORT_PUSH";
 
     public static final int RESULT_CODE = 0x865;
 }

+ 9 - 0
app_core/common/src/main/java/com/core/dao/UUSportDao.java

@@ -0,0 +1,9 @@
+package com.core.dao;
+
+/**
+ * Created by FANGlh on 2017/9/27.
+ * function:
+ */
+
+public class UUSportDao {
+}

+ 9 - 0
app_core/common/src/main/java/com/core/model/UUSportModel.java

@@ -0,0 +1,9 @@
+package com.core.model;
+
+/**
+ * Created by FANGlh on 2017/9/27.
+ * function:
+ */
+
+public class UUSportModel  {
+}

+ 5 - 4
app_core/common/src/main/java/com/core/utils/CommonUtil.java

@@ -32,6 +32,7 @@ import com.common.data.StringUtil;
 import com.common.file.PropertiesUtil;
 import com.core.api.wxapi.ApiPlatform;
 import com.core.api.wxapi.ApiUtils;
+import com.core.app.BuildConfig;
 import com.core.app.MyApplication;
 import com.core.app.R;
 import com.core.dao.SignAutoLogDao;
@@ -78,11 +79,11 @@ public class CommonUtil {
      * function:判断是不是发布版本,true:发布版本
      */
     public static Boolean isReleaseVersion() {
-        //        return !BuildConfig.DEBUG;  //垃圾方法,得根据自己选择的debug还是release模式返回,根本就不好用,
+                return !BuildConfig.DEBUG;  //垃圾方法,得根据自己选择的debug还是release模式返回,根本就不好用,
         //         只要改变 common目录下的versionconfiguration就可以了
-        if (!StringUtil.isEmpty(PropertiesUtil.readData(MyApplication.getInstance(), "release_version", R.raw.versionconfiguration)) &&                "true".equals(PropertiesUtil.readData(MyApplication.getInstance(), "release_version", R.raw.versionconfiguration)))            return true;
-        else
-            return false;
+//        if (!StringUtil.isEmpty(PropertiesUtil.readData(MyApplication.getInstance(), "release_version", R.raw.versionconfiguration)) &&                "true".equals(PropertiesUtil.readData(MyApplication.getInstance(), "release_version", R.raw.versionconfiguration)))            return true;
+//        else
+//            return false;
     }
 
 

+ 6 - 1
app_modular/appme/src/main/AndroidManifest.xml

@@ -36,7 +36,12 @@
             android:name="com.uas.appme.other.activity.SelectAreaActivity"
             android:screenOrientation="portrait" />
         <activity android:name=".pedometer.view.UURanking"
-            android:label="排行榜"></activity>
+            android:label="排行榜">
+            <intent-filter>
+                <action android:name="com.modular.appme.UURanking"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+            </intent-filter>
+        </activity>
         <activity android:name=".pedometer.view.PersonalPageActivity"/>
     </application>
 </manifest>

+ 5 - 1
app_modular/appme/src/main/java/com/uas/appme/pedometer/service/StepService.java

@@ -188,19 +188,23 @@ public class StepService extends Service implements SensorEventListener {
                     case Intent.ACTION_SCREEN_OFF:
                         //屏幕熄灭改为10秒一存储
                         saveDuration = 10000;
+                        StepUtils.doSaveLocalStepsToJudgeHttps();
                         break;
                     //关机广播,保存好当前数据
                     case Intent.ACTION_SHUTDOWN:
                         saveStepData();
+                        StepUtils.doSaveLocalStepsToJudgeHttps();
                         break;
                     // 屏幕解锁广播
                     case Intent.ACTION_USER_PRESENT:
                         saveDuration = 3000;
+                        StepUtils.doSaveLocalStepsToJudgeHttps();
                         break;
                     // 当长按电源键弹出“关机”对话或者锁屏时系统会发出这个广播
                     // example:有时候会用到系统对话框,权限可能很高,会覆盖在锁屏界面或者“关机”对话框之上,
                     // 所以监听这个广播,当收到时就隐藏自己的对话,如点击pad右下角部分弹出的对话框
                     case Intent.ACTION_CLOSE_SYSTEM_DIALOGS:
+                        StepUtils.doSaveLocalStepsToJudgeHttps();
                         saveStepData();
                         break;
                     //监听日期变化
@@ -396,7 +400,7 @@ public class StepService extends Service implements SensorEventListener {
             //调用更新
             notificationManager.notify(110, stepNotification);
         }
-        StepUtils.doSaveLocalStepsToJudgeHttps();
+//        StepUtils.doSaveLocalStepsToJudgeHttps();
 //        TrackUtils.doSaveTrackPoint(latLngsList);
     }
 

+ 7 - 5
app_modular/appme/src/main/java/com/uas/appme/pedometer/view/NewStepActivity.java

@@ -271,7 +271,7 @@ public class NewStepActivity extends BaseActivity implements Handler.Callback {
         stepEntityList.addAll(stepDataDao.getAllDatas());
         // TODO: 在这里获取历史记录条数,当条数达到7条或以上时,显示更多历史记录
 //        if (stepEntityList.size() >= 7) {
-//            steps_history_ll.setVisibility(View.VISIBLE);
+            steps_history_ll.setVisibility(View.GONE);
 //        }else {
 //            steps_history_ll.setVisibility(View.GONE);
 //        }
@@ -308,8 +308,9 @@ public class NewStepActivity extends BaseActivity implements Handler.Callback {
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         if (!CommonUtil.isReleaseVersion()
-                && StepUtils.isCanStep())
-            getMenuInflater().inflate(R.menu.menu_uusport_list, menu);
+                && StepUtils.isCanStep()) {
+//            getMenuInflater().inflate(R.menu.menu_uusport_list, menu);
+        }
         return super.onCreateOptionsMenu(menu);
     }
 
@@ -318,9 +319,10 @@ public class NewStepActivity extends BaseActivity implements Handler.Callback {
         if (item.getItemId() == android.R.id.home){
 //            startActivity(new Intent(getApplicationContext(), SettingActivity.class));
             finish();
-        } else if (StepUtils.isCanStep() && !CommonUtil.isReleaseVersion() && item.getItemId() == R.id.more){
-            startActivity(new Intent(this,UURanking.class));
         }
+//        else if (StepUtils.isCanStep() && !CommonUtil.isReleaseVersion() && item.getItemId() == R.id.more){
+//            startActivity(new Intent(this,UURanking.class));
+//        }
         return super.onOptionsItemSelected(item);
     }
 

+ 2 - 0
app_modular/appme/src/main/java/com/uas/appme/pedometer/view/UURanking.java

@@ -27,6 +27,7 @@ import com.uas.appme.pedometer.bean.StepEntity;
 import com.uas.appme.pedometer.bean.StepsRankingBean;
 import com.uas.appme.pedometer.constant.Constant;
 import com.uas.appme.pedometer.db.StepDataDao;
+import com.uas.appme.pedometer.utils.StepUtils;
 import com.uas.appme.pedometer.utils.TimeUtil;
 
 import java.util.ArrayList;
@@ -64,6 +65,7 @@ public class UURanking extends BaseActivity implements View.OnClickListener {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.uu_ranking_activity);
+        StepUtils.doSaveLocalStepsToJudgeHttps();
         initView();
         initData();
         initEvents();

BIN
app_modular/appme/src/main/res/drawable-xxhdpi/rankb.jpg


+ 2 - 1
app_modular/appme/src/main/res/layout/personal_page_activity.xml

@@ -158,7 +158,8 @@
             android:layout_marginTop="20dp"
             android:layout_width="match_parent"
             android:layout_height="300dp"
-            android:background="#48D1CC">
+            android:background="#48D1CC"
+            android:layout_marginBottom="20dp">
             <lecho.lib.hellocharts.view.LineChartView
                 android:id="@+id/line_chart"
                 android:layout_width="match_parent"

+ 79 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/UUSportActivity.java

@@ -0,0 +1,79 @@
+package com.modular.appmessages.activity;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.support.v4.content.LocalBroadcastManager;
+import android.support.v7.widget.DefaultItemAnimator;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+import com.core.app.AppConstant;
+import com.core.base.BaseActivity;
+import com.core.model.UUSportModel;
+import com.modular.appmessages.R;
+import com.modular.appmessages.adapter.UUSportAdapter;
+
+import java.util.List;
+
+/**
+ * Created by FANGlh on 2017/9/27.
+ * function:
+ */
+
+public class UUSportActivity extends BaseActivity implements View.OnClickListener {
+    private RecyclerView contentRV;
+    private UUSportAdapter mAdapter;
+    private BroadcastReceiver updateReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            initData();
+        }
+    };
+    private LinearLayoutManager manager;
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_uusport);
+        LocalBroadcastManager.getInstance(this).registerReceiver(updateReceiver, new IntentFilter(AppConstant.UUSPORT_PUSH));
+        initView();
+        initData();
+    }
+
+    private void initData() {
+//        List<UUSportModel> models = UUSportDao.getInstance().getAllModels();
+        List<UUSportModel> models = null;
+        showModel(models);
+    }
+    private void showModel(final List<UUSportModel> models) {
+        if (mAdapter == null) {
+            mAdapter = new UUSportAdapter(ct, models);
+            contentRV.setAdapter(mAdapter);
+        } else {
+            mAdapter.setModels(models);
+            mAdapter.notifyDataSetChanged();
+        }
+//        ViewUtils.move2Position(manager, contentRV, ListUtils.getSize(models) - 1);
+    }
+    private void initView() {
+        contentRV = (RecyclerView) findViewById(R.id.contentRV);
+        contentRV.setItemAnimator(new DefaultItemAnimator());
+        manager = new LinearLayoutManager(ct);
+        contentRV.setLayoutManager(manager);
+
+        findViewById(R.id.step_rank_ll).setOnClickListener(this);
+    }
+
+    @Override
+    public void onClick(View v) {
+       if (v.getId() == R.id.step_rank_ll){
+           startActivity(new Intent("com.modular.appme.UURanking"));
+           ToastMessage("step_rank_ll");
+       }
+    }
+}

+ 55 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/adapter/UUSportAdapter.java

@@ -0,0 +1,55 @@
+package com.modular.appmessages.adapter;
+
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.ViewGroup;
+
+import com.core.model.UUSportModel;
+
+import java.util.List;
+
+/**
+ * Created by FANGlh on 2017/9/27.
+ * function:
+ */
+
+public class UUSportAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
+    private Context ct;
+    private List<UUSportModel> models;
+    private LayoutInflater inflater;
+
+    public UUSportAdapter(Context ct, List<UUSportModel> models) {
+        this.ct = ct;
+        this.models = models;
+    }
+
+    public List<UUSportModel> getModels() {
+        return models;
+    }
+    public void setModels(List<UUSportModel> models) {
+        this.models = models;
+    }
+
+    @Override
+    public int getItemViewType(int position) {
+        return position;
+    }
+
+
+
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+        return null;
+    }
+
+    @Override
+    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
+
+    }
+
+    @Override
+    public int getItemCount() {
+        return 0;
+    }
+}

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

@@ -0,0 +1,36 @@
+<?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"
+    android:background="@color/base_bg"
+   >
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/contentRV"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="10dp"
+        android:layout_above="@id/operationLL"
+        android:layout_alignParentTop="true" />
+
+    <LinearLayout
+        android:id="@+id/step_rank_ll"
+        android:layout_alignParentBottom="true"
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:orientation="vertical">
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/line"
+            android:background="@color/item_line"/>
+        <TextView
+            android:id="@+id/invite_friends_tv"
+            android:layout_width="match_parent"
+            android:layout_height="50dp"
+            android:text="步数排行榜"
+            android:gravity="center"
+            android:textColor="@color/black"
+            />
+    </LinearLayout>
+</RelativeLayout>