Commit 3a8301b98236c5e9184d802f0f685f2e34672484

Authored by 杨帅
2 parents de1136ae 70d69cfc
.idea/gradle.xml
@@ -3,6 +3,9 @@ @@ -3,6 +3,9 @@
3 <component name="GradleSettings"> 3 <component name="GradleSettings">
4 <option name="linkedExternalProjectsSettings"> 4 <option name="linkedExternalProjectsSettings">
5 <GradleProjectSettings> 5 <GradleProjectSettings>
  6 + <compositeConfiguration>
  7 + <compositeBuild compositeDefinitionSource="SCRIPT" />
  8 + </compositeConfiguration>
6 <option name="distributionType" value="DEFAULT_WRAPPED" /> 9 <option name="distributionType" value="DEFAULT_WRAPPED" />
7 <option name="externalProjectPath" value="$PROJECT_DIR$" /> 10 <option name="externalProjectPath" value="$PROJECT_DIR$" />
8 <option name="modules"> 11 <option name="modules">
moudle_pedometer/build.gradle
@@ -74,6 +74,7 @@ dependencies { @@ -74,6 +74,7 @@ dependencies {
74 implementation "com.github.bumptech.glide:glide:$rootProject.glide" 74 implementation "com.github.bumptech.glide:glide:$rootProject.glide"
75 implementation "jp.wasabeef:glide-transformations:$rootProject.glideTransformations" 75 implementation "jp.wasabeef:glide-transformations:$rootProject.glideTransformations"
76 implementation 'com.android.support.constraint:constraint-layout:1.1.3' 76 implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  77 + implementation 'com.android.support:support-v4:28.0.0'
77 annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.compiler" 78 annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.compiler"
78 79
79 //-------------------------------------------------------- 80 //--------------------------------------------------------
moudle_pedometer/src/main/AndroidManifest.xml
@@ -52,7 +52,8 @@ @@ -52,7 +52,8 @@
52 android:required="true" /> 52 android:required="true" />
53 53
54 <application android:persistent="true"> 54 <application android:persistent="true">
55 - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.SelfRecordActivity"></activity> 55 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity"></activity>
  56 + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.SelfRecordActivity" />
56 <activity android:name="com.cnlive.moudle.pedometer.ui.activity.TakePartActivity" /> 57 <activity android:name="com.cnlive.moudle.pedometer.ui.activity.TakePartActivity" />
57 <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RunLineActivity" /> 58 <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RunLineActivity" />
58 <activity android:name="com.cnlive.moudle.pedometer.ui.activity.MyRecordActivity" /> 59 <activity android:name="com.cnlive.moudle.pedometer.ui.activity.MyRecordActivity" />
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/SelfRecordPresenter.java
@@ -24,9 +24,10 @@ import io.reactivex.disposables.Disposable; @@ -24,9 +24,10 @@ import io.reactivex.disposables.Disposable;
24 public class SelfRecordPresenter extends MvpBasePresenter<SelfRecordView> { 24 public class SelfRecordPresenter extends MvpBasePresenter<SelfRecordView> {
25 25
26 26
27 - public void getData(Context context,String sid, int pageNo, int pageSize){ 27 + public void getData(Context context,String sid,int completeStatus, int pageNo, int pageSize){
28 HashMap<String, String> map = new HashMap<>(); 28 HashMap<String, String> map = new HashMap<>();
29 map.put("sid", sid); 29 map.put("sid", sid);
  30 + map.put("completeStatus",completeStatus+"");
30 map.put("pageNo", pageNo+""); 31 map.put("pageNo", pageNo+"");
31 map.put("pageSize",pageSize+""); 32 map.put("pageSize",pageSize+"");
32 getView().showLoading(); 33 getView().showLoading();
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/SelfRecordView.java
@@ -11,6 +11,7 @@ import com.cnlive.moudle.pedometer.model.RunningFinishBean; @@ -11,6 +11,7 @@ import com.cnlive.moudle.pedometer.model.RunningFinishBean;
11 import com.cnlive.moudle.pedometer.net.bean.BaseInfo; 11 import com.cnlive.moudle.pedometer.net.bean.BaseInfo;
12 import com.cnlive.moudle.pedometer.net.bean.EventRouteRecordBeanVoListBean; 12 import com.cnlive.moudle.pedometer.net.bean.EventRouteRecordBeanVoListBean;
13 import com.cnlive.moudle.pedometer.net.bean.SelfRecordInfo; 13 import com.cnlive.moudle.pedometer.net.bean.SelfRecordInfo;
  14 +import com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity;
14 import com.cnlive.moudle.pedometer.ui.activity.RunLineActivity; 15 import com.cnlive.moudle.pedometer.ui.activity.RunLineActivity;
15 import com.cnlive.moudle.pedometer.ui.adapter.RaceRecordAdapter; 16 import com.cnlive.moudle.pedometer.ui.adapter.RaceRecordAdapter;
16 import com.cnlive.moudle.pedometer.ui.fragment.SelfRecordFragment; 17 import com.cnlive.moudle.pedometer.ui.fragment.SelfRecordFragment;
@@ -26,13 +27,14 @@ import java.util.List; @@ -26,13 +27,14 @@ import java.util.List;
26 /** 27 /**
27 * Created by hanyayun 019/06/12. 28 * Created by hanyayun 019/06/12.
28 */ 29 */
29 -public class SelfRecordView implements MvpView{ 30 +public class SelfRecordView implements MvpView {
30 31
31 private SelfRecordFragment fragment; 32 private SelfRecordFragment fragment;
32 public QMUITipDialog loadingDiaog; 33 public QMUITipDialog loadingDiaog;
33 private List<EventRouteRecordBeanVoListBean> list = new ArrayList<>(); 34 private List<EventRouteRecordBeanVoListBean> list = new ArrayList<>();
34 private RaceRecordAdapter adapter; 35 private RaceRecordAdapter adapter;
35 36
  37 +
36 public SelfRecordView(SelfRecordFragment fragment) { 38 public SelfRecordView(SelfRecordFragment fragment) {
37 this.fragment = fragment; 39 this.fragment = fragment;
38 loadingDiaog = new QMUITipDialog.Builder(fragment.getActivity()) 40 loadingDiaog = new QMUITipDialog.Builder(fragment.getActivity())
@@ -41,59 +43,57 @@ public class SelfRecordView implements MvpView{ @@ -41,59 +43,57 @@ public class SelfRecordView implements MvpView{
41 .create(); 43 .create();
42 } 44 }
43 45
44 - public void setData(BaseInfo<SelfRecordInfo> selfRecordInfoBaseInfo){ 46 + public void setData(BaseInfo<SelfRecordInfo> selfRecordInfoBaseInfo) {
45 hideLoading(); 47 hideLoading();
46 fragment.binding.ryRecord.setVisibility(View.VISIBLE); 48 fragment.binding.ryRecord.setVisibility(View.VISIBLE);
47 fragment.binding.txAll.setVisibility(View.VISIBLE); 49 fragment.binding.txAll.setVisibility(View.VISIBLE);
48 - if(selfRecordInfoBaseInfo.getData().getRecordSum() == null){ 50 + if (selfRecordInfoBaseInfo.getData().getRecordSum() == null) {
49 showEmpty(); 51 showEmpty();
50 return; 52 return;
51 } 53 }
52 54
53 - if(fragment.currentPage == 1){ 55 + if (fragment.currentPage == 1) {
54 list.clear(); 56 list.clear();
55 list.addAll(selfRecordInfoBaseInfo.getData().getEventRouteRecordBeanVoList()); 57 list.addAll(selfRecordInfoBaseInfo.getData().getEventRouteRecordBeanVoList());
56 - if(adapter == null){  
57 - SelfRecordInfo.RecordSumBean recordSumBean = selfRecordInfoBaseInfo.getData().getRecordSum();  
58 - fragment.binding.kilometerNum.setText(recordSumBean.getMileage()+"");  
59 - fragment.binding.stepNum.setText(recordSumBean.getStep());  
60 - fragment.binding.allTime.setText(recordSumBean.getEmployTime());  
61 - fragment.binding.finishNum.setText(recordSumBean.getNumber()); 58 + if (adapter == null) {
  59 + SelfRecordInfo.RecordSumBean recordSumBean = selfRecordInfoBaseInfo.getData().getRecordSum();
  60 + fragment.binding.kilometerNum.setText(recordSumBean.getCountMileage() + "");
  61 + fragment.binding.stepNum.setText(recordSumBean.getYetStep());
  62 + fragment.binding.allTime.setText(recordSumBean.getYetEmployTime());
  63 + fragment.binding.finishNum.setText(recordSumBean.getYetNumber());
  64 +
  65 + fragment.binding.stepNumNo.setText(recordSumBean.getNotStep());
  66 + fragment.binding.allTimeNo.setText(recordSumBean.getNotEmployTime());
  67 + fragment.binding.finishNumNo.setText(recordSumBean.getNotNumber());
  68 +
62 fragment.binding.recordRecy.setLayoutManager(new LinearLayoutManager(fragment.getActivity())); 69 fragment.binding.recordRecy.setLayoutManager(new LinearLayoutManager(fragment.getActivity()));
63 - adapter = new RaceRecordAdapter(list,fragment.getActivity()); 70 + adapter = new RaceRecordAdapter(list, fragment.getActivity());
64 fragment.binding.recordRecy.setAdapter(adapter); 71 fragment.binding.recordRecy.setAdapter(adapter);
65 adapter.setOnClickListener(new RaceRecordAdapter.OnClickListener() { 72 adapter.setOnClickListener(new RaceRecordAdapter.OnClickListener() {
66 @Override 73 @Override
67 public void onClickListener(EventRouteRecordBeanVoListBean bean, int position) { 74 public void onClickListener(EventRouteRecordBeanVoListBean bean, int position) {
68 - CollRunningFinishActivity.startActivity(fragment.getActivity(),new RunningFinishBean()); 75 + CollRunningFinishActivity.startActivity(fragment.getActivity(), new RunningFinishBean());
69 } 76 }
70 }); 77 });
71 -// fragment.binding.topbar.addRightImageButton(R.drawable.share_img, R.id.fragment_more)  
72 -// .setOnClickListener(v -> {  
73 -// //分享  
74 -//// ShareRecordActivity.newInstance(fragment.getActivity(),fragment.raceTitle,bestResultBean.getMileage(),bestResultBean.getStep(),  
75 -//// bestResultBean.getEmployTime(),bestResultBean.getPace());  
76 -// });  
77 -  
78 - }else { 78 + } else {
79 adapter.notifyDataSetChanged(); 79 adapter.notifyDataSetChanged();
80 } 80 }
81 } 81 }
82 82
83 - if(list.size() != 0){ 83 + if (list.size() != 0) {
84 fragment.binding.emptyNet.setVisibility(View.GONE); 84 fragment.binding.emptyNet.setVisibility(View.GONE);
85 fragment.binding.empty.setVisibility(View.GONE); 85 fragment.binding.empty.setVisibility(View.GONE);
86 fragment.binding.refreshLayout.setVisibility(View.VISIBLE); 86 fragment.binding.refreshLayout.setVisibility(View.VISIBLE);
87 - }else { 87 + } else {
88 showEmpty(); 88 showEmpty();
89 } 89 }
90 90
91 - if(selfRecordInfoBaseInfo.getData().getEventRouteRecordBeanVoList().size() < fragment.pageSize){ 91 + if (selfRecordInfoBaseInfo.getData().getEventRouteRecordBeanVoList().size() < fragment.pageSize) {
92 fragment.binding.refreshLayout.setEnableLoadMore(false); 92 fragment.binding.refreshLayout.setEnableLoadMore(false);
93 - }else { 93 + } else {
94 fragment.binding.refreshLayout.setEnableLoadMore(true); 94 fragment.binding.refreshLayout.setEnableLoadMore(true);
95 } 95 }
96 - if(fragment.currentPage > 1){ 96 + if (fragment.currentPage > 1) {
97 list.addAll(selfRecordInfoBaseInfo.getData().getEventRouteRecordBeanVoList()); 97 list.addAll(selfRecordInfoBaseInfo.getData().getEventRouteRecordBeanVoList());
98 adapter.notifyDataSetChanged(); 98 adapter.notifyDataSetChanged();
99 } 99 }
@@ -101,18 +101,16 @@ public class SelfRecordView implements MvpView{ @@ -101,18 +101,16 @@ public class SelfRecordView implements MvpView{
101 fragment.binding.refreshLayout.finishLoadMore(); 101 fragment.binding.refreshLayout.finishLoadMore();
102 } 102 }
103 103
104 - public void initView(){  
105 - fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> {  
106 - fragment.getActivity().finish();  
107 - });  
108 - fragment.binding.topbar.setTitle("我的记录"); 104 + public void initView() {
  105 + fragment.binding.back.setOnClickListener(v -> fragment.getActivity().finish());
109 fragment.binding.refreshLayout.setRefreshHeader(new ClassicsHeader(fragment.getActivity())); 106 fragment.binding.refreshLayout.setRefreshHeader(new ClassicsHeader(fragment.getActivity()));
110 fragment.binding.refreshLayout.setRefreshFooter(new ClassicsFooter(fragment.getActivity())); 107 fragment.binding.refreshLayout.setRefreshFooter(new ClassicsFooter(fragment.getActivity()));
111 fragment.binding.recordRecy.setLayoutManager(new LinearLayoutManager(fragment.getActivity())); 108 fragment.binding.recordRecy.setLayoutManager(new LinearLayoutManager(fragment.getActivity()));
  109 + fragment.binding.againUp.setOnClickListener(v -> LineUpAgainActivity.newInstance(fragment.getActivity()));
112 } 110 }
113 111
114 112
115 - public void showEmpty(){ 113 + public void showEmpty() {
116 fragment.binding.refreshLayout.setVisibility(View.GONE); 114 fragment.binding.refreshLayout.setVisibility(View.GONE);
117 fragment.binding.empty.setVisibility(View.VISIBLE); 115 fragment.binding.empty.setVisibility(View.VISIBLE);
118 fragment.binding.emptyNet.setVisibility(View.GONE); 116 fragment.binding.emptyNet.setVisibility(View.GONE);
@@ -126,7 +124,7 @@ public class SelfRecordView implements MvpView{ @@ -126,7 +124,7 @@ public class SelfRecordView implements MvpView{
126 }); 124 });
127 } 125 }
128 126
129 - public void showError(String msg){ 127 + public void showError(String msg) {
130 fragment.binding.refreshLayout.finishRefresh(); 128 fragment.binding.refreshLayout.finishRefresh();
131 fragment.binding.refreshLayout.finishLoadMore(); 129 fragment.binding.refreshLayout.finishLoadMore();
132 if (list.size() == 0) { 130 if (list.size() == 0) {
@@ -141,7 +139,7 @@ public class SelfRecordView implements MvpView{ @@ -141,7 +139,7 @@ public class SelfRecordView implements MvpView{
141 @Override 139 @Override
142 public void onClick(View v) { 140 public void onClick(View v) {
143 fragment.currentPage = 1; 141 fragment.currentPage = 1;
144 - fragment.getPresenter().getData(fragment.getActivity(),"10514343",fragment.currentPage,fragment.pageSize); 142 + fragment.getPresenter().getData(fragment.getActivity(), "10514343", fragment.completeStatus, fragment.currentPage, fragment.pageSize);
145 } 143 }
146 }); 144 });
147 fragment.binding.emptyNet.setLoadingShowing(false); 145 fragment.binding.emptyNet.setLoadingShowing(false);
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/net/bean/SelfRecordInfo.java
@@ -8,19 +8,19 @@ import java.util.List; @@ -8,19 +8,19 @@ import java.util.List;
8 public class SelfRecordInfo { 8 public class SelfRecordInfo {
9 9
10 /** 10 /**
11 - * recordSum : {"number":5,"employTime":0,"step":50000,"mileage":25.5} 11 + * RecordSum : {"yetEmployTime":"30.0","yetNumber":"30.0","yetStep":"10000.0","yetMileage":"5.0","notNumber":"10000.0","notMileage":"5.0","notEmployTime":"30.0","notStep":"10000.0","countMileage":101.7}
12 * eventRouteRecordBeanVoList : [{"createTime":1559722819000,"employTime":"30","eventTitle":"2018国际网络徒步大赛黄金海岸站","mileage":"5.5","pace":"22.33","recordId":2,"roadmap":"http://wjjtest.ys2.cnliveimg.com/802/img/2018/1205/ff80808166c2a45201677ce7aff652e9/000001.jpg","step":"10000"},{"createTime":1559722832000,"employTime":"00:0:55","eventTitle":"2018国际网络徒步大赛黄金海岸站","mileage":"5","pace":"22.33","recordId":3,"roadmap":"http://wjjtest.ys2.cnliveimg.com/802/img/2018/1205/ff80808166c2a45201677ce7aff652e9/000001.jpg","step":"10000"}] 12 * eventRouteRecordBeanVoList : [{"createTime":1559722819000,"employTime":"30","eventTitle":"2018国际网络徒步大赛黄金海岸站","mileage":"5.5","pace":"22.33","recordId":2,"roadmap":"http://wjjtest.ys2.cnliveimg.com/802/img/2018/1205/ff80808166c2a45201677ce7aff652e9/000001.jpg","step":"10000"},{"createTime":1559722832000,"employTime":"00:0:55","eventTitle":"2018国际网络徒步大赛黄金海岸站","mileage":"5","pace":"22.33","recordId":3,"roadmap":"http://wjjtest.ys2.cnliveimg.com/802/img/2018/1205/ff80808166c2a45201677ce7aff652e9/000001.jpg","step":"10000"}]
13 */ 13 */
14 14
15 - private RecordSumBean recordSum; 15 + private RecordSumBean RecordSum;
16 private List<EventRouteRecordBeanVoListBean> eventRouteRecordBeanVoList; 16 private List<EventRouteRecordBeanVoListBean> eventRouteRecordBeanVoList;
17 17
18 public RecordSumBean getRecordSum() { 18 public RecordSumBean getRecordSum() {
19 - return recordSum; 19 + return RecordSum;
20 } 20 }
21 21
22 - public void setRecordSum(RecordSumBean recordSum) {  
23 - this.recordSum = recordSum; 22 + public void setRecordSum(RecordSumBean RecordSum) {
  23 + this.RecordSum = RecordSum;
24 } 24 }
25 25
26 public List<EventRouteRecordBeanVoListBean> getEventRouteRecordBeanVoList() { 26 public List<EventRouteRecordBeanVoListBean> getEventRouteRecordBeanVoList() {
@@ -33,47 +33,97 @@ public class SelfRecordInfo { @@ -33,47 +33,97 @@ public class SelfRecordInfo {
33 33
34 public static class RecordSumBean { 34 public static class RecordSumBean {
35 /** 35 /**
36 - * number : 5  
37 - * employTime : 0  
38 - * step : 50000  
39 - * mileage : 25.5 36 + * yetEmployTime : 30.0
  37 + * yetNumber : 30.0
  38 + * yetStep : 10000.0
  39 + * yetMileage : 5.0
  40 + * notNumber : 10000.0
  41 + * notMileage : 5.0
  42 + * notEmployTime : 30.0
  43 + * notStep : 10000.0
  44 + * countMileage : 101.7
40 */ 45 */
41 46
42 - private int number;  
43 - private int employTime;  
44 - private int step;  
45 - private double mileage; 47 + private String yetEmployTime;
  48 + private String yetNumber;
  49 + private String yetStep;
  50 + private String yetMileage;
  51 + private String notNumber;
  52 + private String notMileage;
  53 + private String notEmployTime;
  54 + private String notStep;
  55 + private double countMileage;
  56 +
  57 + public String getYetEmployTime() {
  58 + return yetEmployTime;
  59 + }
  60 +
  61 + public void setYetEmployTime(String yetEmployTime) {
  62 + this.yetEmployTime = yetEmployTime;
  63 + }
  64 +
  65 + public String getYetNumber() {
  66 + return yetNumber;
  67 + }
  68 +
  69 + public void setYetNumber(String yetNumber) {
  70 + this.yetNumber = yetNumber;
  71 + }
  72 +
  73 + public String getYetStep() {
  74 + return yetStep;
  75 + }
  76 +
  77 + public void setYetStep(String yetStep) {
  78 + this.yetStep = yetStep;
  79 + }
  80 +
  81 + public String getYetMileage() {
  82 + return yetMileage;
  83 + }
  84 +
  85 + public void setYetMileage(String yetMileage) {
  86 + this.yetMileage = yetMileage;
  87 + }
  88 +
  89 + public String getNotNumber() {
  90 + return notNumber;
  91 + }
  92 +
  93 + public void setNotNumber(String notNumber) {
  94 + this.notNumber = notNumber;
  95 + }
46 96
47 - public int getNumber() {  
48 - return number; 97 + public String getNotMileage() {
  98 + return notMileage;
49 } 99 }
50 100
51 - public void setNumber(int number) {  
52 - this.number = number; 101 + public void setNotMileage(String notMileage) {
  102 + this.notMileage = notMileage;
53 } 103 }
54 104
55 - public int getEmployTime() {  
56 - return employTime; 105 + public String getNotEmployTime() {
  106 + return notEmployTime;
57 } 107 }
58 108
59 - public void setEmployTime(int employTime) {  
60 - this.employTime = employTime; 109 + public void setNotEmployTime(String notEmployTime) {
  110 + this.notEmployTime = notEmployTime;
61 } 111 }
62 112
63 - public int getStep() {  
64 - return step; 113 + public String getNotStep() {
  114 + return notStep;
65 } 115 }
66 116
67 - public void setStep(int step) {  
68 - this.step = step; 117 + public void setNotStep(String notStep) {
  118 + this.notStep = notStep;
69 } 119 }
70 120
71 - public double getMileage() {  
72 - return mileage; 121 + public double getCountMileage() {
  122 + return countMileage;
73 } 123 }
74 124
75 - public void setMileage(double mileage) {  
76 - this.mileage = mileage; 125 + public void setCountMileage(double countMileage) {
  126 + this.countMileage = countMileage;
77 } 127 }
78 } 128 }
79 } 129 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/LineUpAgainActivity.java 0 → 100644
  1 +package com.cnlive.moudle.pedometer.ui.activity;
  2 +
  3 +import android.content.Context;
  4 +import android.content.Intent;
  5 +import android.support.v7.app.AppCompatActivity;
  6 +import android.os.Bundle;
  7 +
  8 +import com.cnlive.libs.base.util.StatusBarUtil;
  9 +import com.cnlive.libs.base.util.StatusBarUtil2;
  10 +import com.example.moudle_pedometer.R;
  11 +
  12 +/**
  13 + * 重新上传
  14 + * Created by hanyayun 019/06/20.
  15 + */
  16 +public class LineUpAgainActivity extends AppCompatActivity {
  17 +
  18 + public static void newInstance(Context context){
  19 + Intent intent = new Intent();
  20 + intent.setClass(context,LineUpAgainActivity.class);
  21 + context.startActivity(intent);
  22 + }
  23 +
  24 + @Override
  25 + protected void onCreate(Bundle savedInstanceState) {
  26 + super.onCreate(savedInstanceState);
  27 + StatusBarUtil.setStatusBarWrite(this);
  28 + StatusBarUtil2.setColor(this, getResources().getColor(R.color.color_fff), 0);
  29 + setContentView(R.layout.activity_line_up_again);
  30 + }
  31 +}
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/SelfRecordFragment.java
@@ -23,6 +23,7 @@ public class SelfRecordFragment extends MvpBindingFragment&lt;SelfRecordView, SelfR @@ -23,6 +23,7 @@ public class SelfRecordFragment extends MvpBindingFragment&lt;SelfRecordView, SelfR
23 23
24 public int currentPage = 1; 24 public int currentPage = 1;
25 public int pageSize = 10; 25 public int pageSize = 10;
  26 + public int completeStatus = 0;
26 public SelfRecordFragment() { 27 public SelfRecordFragment() {
27 // Required empty public constructor 28 // Required empty public constructor
28 } 29 }
@@ -32,23 +33,47 @@ public class SelfRecordFragment extends MvpBindingFragment&lt;SelfRecordView, SelfR @@ -32,23 +33,47 @@ public class SelfRecordFragment extends MvpBindingFragment&lt;SelfRecordView, SelfR
32 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 33 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
33 super.onViewCreated(view, savedInstanceState); 34 super.onViewCreated(view, savedInstanceState);
34 if(getMvpView() != null) getMvpView().initView(); 35 if(getMvpView() != null) getMvpView().initView();
35 - getPresenter().getData(getActivity(),"10514343",currentPage,pageSize); 36 + getData(-1);
  37 +
  38 + binding.hasFinish.setOnClickListener(v -> getData(0));
  39 + binding.noFinish.setOnClickListener(v -> getData(1));
36 binding.refreshLayout.setOnRefreshListener(new OnRefreshListener() { 40 binding.refreshLayout.setOnRefreshListener(new OnRefreshListener() {
37 @Override 41 @Override
38 public void onRefresh(@NonNull RefreshLayout refreshLayout) { 42 public void onRefresh(@NonNull RefreshLayout refreshLayout) {
39 currentPage = 1; 43 currentPage = 1;
40 - getPresenter().getData(getActivity(),"10514343",currentPage,pageSize); 44 + getData(-1);
41 } 45 }
42 }); 46 });
43 binding.refreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() { 47 binding.refreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
44 @Override 48 @Override
45 public void onLoadMore(@NonNull RefreshLayout refreshLayout) { 49 public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
46 currentPage++; 50 currentPage++;
47 - getPresenter().getData(getActivity(),"10514343",currentPage,pageSize); 51 + getData(-1);
48 } 52 }
49 }); 53 });
50 } 54 }
51 55
  56 + private void getData(int completeStatus){
  57 + if(completeStatus == -1){
  58 + getPresenter().getData(getActivity(),"10514343",completeStatus,currentPage,pageSize);
  59 + }else {
  60 + this.completeStatus = currentPage;
  61 + getPresenter().getData(getActivity(),"10514343",completeStatus,currentPage,pageSize);
  62 + if(completeStatus == 0){
  63 + binding.hasFinish.setTextColor(getActivity().getResources().getColor(R.color.green_tx));
  64 + binding.hasFinish.setTextSize(18);
  65 + binding.noFinish.setTextColor(getActivity().getResources().getColor(R.color.text_black));
  66 + binding.noFinish.setTextSize(15);
  67 + }else {
  68 + binding.hasFinish.setTextColor(getActivity().getResources().getColor(R.color.text_black));
  69 + binding.hasFinish.setTextSize(15);
  70 + binding.noFinish.setTextColor(getActivity().getResources().getColor(R.color.green_tx));
  71 + binding.noFinish.setTextSize(18);
  72 + }
  73 + }
  74 + }
  75 +
  76 +
52 @Override 77 @Override
53 protected int getLayoutId() { 78 protected int getLayoutId() {
54 return R.layout.fragment_self_record; 79 return R.layout.fragment_self_record;
moudle_pedometer/src/main/res/layout/activity_line_up_again.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + tools:context="com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity">
  8 +
  9 +</android.support.constraint.ConstraintLayout>
moudle_pedometer/src/main/res/layout/fragment_self_record.xml
1 -<layout xmlns:android="http://schemas.android.com/apk/res/android"> 1 +<layout xmlns:android="http://schemas.android.com/apk/res/android"
  2 + xmlns:app="http://schemas.android.com/apk/res-auto">
2 3
3 <LinearLayout 4 <LinearLayout
4 android:layout_width="match_parent" 5 android:layout_width="match_parent"
@@ -6,10 +7,40 @@ @@ -6,10 +7,40 @@
6 android:background="@color/white" 7 android:background="@color/white"
7 android:orientation="vertical"> 8 android:orientation="vertical">
8 9
9 - <com.qmuiteam.qmui.widget.QMUITopBar  
10 - android:id="@+id/topbar" 10 + <RelativeLayout
11 android:layout_width="match_parent" 11 android:layout_width="match_parent"
12 - android:layout_height="?attr/qmui_topbar_height" /> 12 + android:layout_height="?attr/qmui_topbar_height">
  13 +
  14 + <ImageView
  15 + android:id="@+id/back"
  16 + android:layout_width="wrap_content"
  17 + android:layout_height="wrap_content"
  18 + android:layout_centerVertical="true"
  19 + android:padding="10dp"
  20 + android:src="@drawable/top_back_black"/>
  21 +
  22 + <TextView
  23 + android:layout_width="wrap_content"
  24 + android:layout_height="wrap_content"
  25 + android:layout_centerVertical="true"
  26 + android:textColor="#333333"
  27 + android:textSize="18sp"
  28 + android:layout_centerInParent="true"
  29 + android:text="@string/myrecord"
  30 + />
  31 +
  32 + <TextView
  33 + android:id="@+id/again_up"
  34 + android:layout_width="wrap_content"
  35 + android:layout_height="wrap_content"
  36 + android:layout_centerVertical="true"
  37 + android:padding="10dp"
  38 + android:textColor="#333333"
  39 + android:textSize="15sp"
  40 + android:layout_alignParentRight="true"
  41 + android:text="@string/again_up"
  42 + />
  43 + </RelativeLayout>
13 44
14 <RelativeLayout 45 <RelativeLayout
15 android:id="@+id/ry_record" 46 android:id="@+id/ry_record"
@@ -38,19 +69,19 @@ @@ -38,19 +69,19 @@
38 android:id="@+id/kilometer_num" 69 android:id="@+id/kilometer_num"
39 android:layout_width="wrap_content" 70 android:layout_width="wrap_content"
40 android:layout_height="wrap_content" 71 android:layout_height="wrap_content"
41 - android:layout_marginTop="20dp"  
42 android:layout_centerHorizontal="true" 72 android:layout_centerHorizontal="true"
  73 + android:layout_marginTop="20dp"
43 android:text="0.0" 74 android:text="0.0"
44 android:textColor="@color/white" 75 android:textColor="@color/white"
45 - android:textSize="50sp"  
46 - /> 76 + android:textSize="50sp" />
47 77
48 <RelativeLayout 78 <RelativeLayout
  79 + android:id="@+id/ry_finish"
49 android:layout_width="match_parent" 80 android:layout_width="match_parent"
50 android:layout_height="wrap_content" 81 android:layout_height="wrap_content"
51 android:layout_below="@id/kilometer_num" 82 android:layout_below="@id/kilometer_num"
52 - android:layout_marginTop="10dp"  
53 android:layout_marginLeft="20dp" 83 android:layout_marginLeft="20dp"
  84 + android:layout_marginTop="10dp"
54 android:layout_marginRight="20dp"> 85 android:layout_marginRight="20dp">
55 86
56 <LinearLayout 87 <LinearLayout
@@ -61,10 +92,10 @@ @@ -61,10 +92,10 @@
61 <TextView 92 <TextView
62 android:layout_width="wrap_content" 93 android:layout_width="wrap_content"
63 android:layout_height="wrap_content" 94 android:layout_height="wrap_content"
64 - android:text="@string/finish_num"  
65 - android:textSize="12sp"  
66 android:layout_gravity="center" 95 android:layout_gravity="center"
67 - android:textColor="@color/white" /> 96 + android:text="@string/finish_num"
  97 + android:textColor="@color/white"
  98 + android:textSize="12sp" />
68 99
69 <TextView 100 <TextView
70 android:id="@+id/finish_num" 101 android:id="@+id/finish_num"
@@ -72,9 +103,9 @@ @@ -72,9 +103,9 @@
72 android:layout_height="wrap_content" 103 android:layout_height="wrap_content"
73 android:layout_gravity="center" 104 android:layout_gravity="center"
74 android:layout_marginTop="5dp" 105 android:layout_marginTop="5dp"
75 - android:textSize="20sp"  
76 android:text="0" 106 android:text="0"
77 - android:textColor="@color/white" /> 107 + android:textColor="@color/white"
  108 + android:textSize="20sp" />
78 </LinearLayout> 109 </LinearLayout>
79 110
80 111
@@ -87,10 +118,10 @@ @@ -87,10 +118,10 @@
87 <TextView 118 <TextView
88 android:layout_width="wrap_content" 119 android:layout_width="wrap_content"
89 android:layout_height="wrap_content" 120 android:layout_height="wrap_content"
90 - android:textSize="12sp"  
91 android:layout_gravity="center" 121 android:layout_gravity="center"
92 android:text="@string/all_time" 122 android:text="@string/all_time"
93 - android:textColor="@color/white" /> 123 + android:textColor="@color/white"
  124 + android:textSize="12sp" />
94 125
95 <TextView 126 <TextView
96 android:id="@+id/all_time" 127 android:id="@+id/all_time"
@@ -98,9 +129,9 @@ @@ -98,9 +129,9 @@
98 android:layout_height="wrap_content" 129 android:layout_height="wrap_content"
99 android:layout_gravity="center" 130 android:layout_gravity="center"
100 android:layout_marginTop="5dp" 131 android:layout_marginTop="5dp"
101 - android:textSize="20sp"  
102 android:text="00:00:00" 132 android:text="00:00:00"
103 - android:textColor="@color/white" /> 133 + android:textColor="@color/white"
  134 + android:textSize="20sp" />
104 </LinearLayout> 135 </LinearLayout>
105 136
106 <LinearLayout 137 <LinearLayout
@@ -112,10 +143,10 @@ @@ -112,10 +143,10 @@
112 <TextView 143 <TextView
113 android:layout_width="wrap_content" 144 android:layout_width="wrap_content"
114 android:layout_height="wrap_content" 145 android:layout_height="wrap_content"
115 - android:textSize="12sp"  
116 android:layout_gravity="center" 146 android:layout_gravity="center"
117 android:text="@string/stepnum" 147 android:text="@string/stepnum"
118 - android:textColor="@color/white" /> 148 + android:textColor="@color/white"
  149 + android:textSize="12sp" />
119 150
120 <TextView 151 <TextView
121 android:id="@+id/step_num" 152 android:id="@+id/step_num"
@@ -123,23 +154,138 @@ @@ -123,23 +154,138 @@
123 android:layout_height="wrap_content" 154 android:layout_height="wrap_content"
124 android:layout_gravity="center" 155 android:layout_gravity="center"
125 android:layout_marginTop="5dp" 156 android:layout_marginTop="5dp"
126 - android:textSize="20sp"  
127 android:text="--" 157 android:text="--"
128 - android:textColor="@color/white" /> 158 + android:textColor="@color/white"
  159 + android:textSize="20sp" />
  160 + </LinearLayout>
  161 + </RelativeLayout>
  162 +
  163 + <RelativeLayout
  164 + android:layout_width="match_parent"
  165 + android:layout_height="wrap_content"
  166 + android:layout_below="@id/ry_finish"
  167 + android:layout_marginLeft="20dp"
  168 + android:layout_marginTop="10dp"
  169 + android:layout_marginRight="20dp">
  170 +
  171 + <LinearLayout
  172 + android:layout_width="wrap_content"
  173 + android:layout_height="wrap_content"
  174 + android:orientation="vertical">
  175 +
  176 + <TextView
  177 + android:layout_width="wrap_content"
  178 + android:layout_height="wrap_content"
  179 + android:layout_gravity="center"
  180 + android:text="@string/finish_num_no"
  181 + android:textColor="@color/white"
  182 + android:textSize="12sp" />
  183 +
  184 + <TextView
  185 + android:id="@+id/finish_num_no"
  186 + android:layout_width="wrap_content"
  187 + android:layout_height="wrap_content"
  188 + android:layout_gravity="center"
  189 + android:layout_marginTop="5dp"
  190 + android:text="0"
  191 + android:textColor="@color/white"
  192 + android:textSize="20sp" />
  193 + </LinearLayout>
  194 +
  195 +
  196 + <LinearLayout
  197 + android:layout_width="wrap_content"
  198 + android:layout_height="wrap_content"
  199 + android:layout_centerInParent="true"
  200 + android:orientation="vertical">
  201 +
  202 + <TextView
  203 + android:layout_width="wrap_content"
  204 + android:layout_height="wrap_content"
  205 + android:layout_gravity="center"
  206 + android:text="@string/all_time"
  207 + android:textColor="@color/white"
  208 + android:textSize="12sp" />
  209 +
  210 + <TextView
  211 + android:id="@+id/all_time_no"
  212 + android:layout_width="wrap_content"
  213 + android:layout_height="wrap_content"
  214 + android:layout_gravity="center"
  215 + android:layout_marginTop="5dp"
  216 + android:text="00:00:00"
  217 + android:textColor="@color/white"
  218 + android:textSize="20sp" />
  219 + </LinearLayout>
  220 +
  221 + <LinearLayout
  222 + android:layout_width="wrap_content"
  223 + android:layout_height="wrap_content"
  224 + android:layout_alignParentRight="true"
  225 + android:orientation="vertical">
  226 +
  227 + <TextView
  228 + android:layout_width="wrap_content"
  229 + android:layout_height="wrap_content"
  230 + android:layout_gravity="center"
  231 + android:text="@string/stepnum"
  232 + android:textColor="@color/white"
  233 + android:textSize="12sp" />
  234 +
  235 + <TextView
  236 + android:id="@+id/step_num_no"
  237 + android:layout_width="wrap_content"
  238 + android:layout_height="wrap_content"
  239 + android:layout_gravity="center"
  240 + android:layout_marginTop="5dp"
  241 + android:text="--"
  242 + android:textColor="@color/white"
  243 + android:textSize="20sp" />
129 </LinearLayout> 244 </LinearLayout>
130 </RelativeLayout> 245 </RelativeLayout>
131 246
132 </RelativeLayout> 247 </RelativeLayout>
133 248
134 - <TextView 249 + <RelativeLayout
135 android:id="@+id/tx_all" 250 android:id="@+id/tx_all"
136 - android:layout_width="wrap_content" 251 + android:layout_width="match_parent"
137 android:layout_height="wrap_content" 252 android:layout_height="wrap_content"
138 android:layout_marginLeft="10dp" 253 android:layout_marginLeft="10dp"
139 android:layout_marginTop="10dp" 254 android:layout_marginTop="10dp"
140 - android:textSize="18sp"  
141 - android:textColor="#333333"  
142 - android:text="@string/has_take_part_line" /> 255 + android:layout_marginRight="10dp">
  256 +
  257 + <TextView
  258 + android:layout_width="wrap_content"
  259 + android:layout_height="wrap_content"
  260 + android:text="@string/has_take_part_line"
  261 + android:textColor="#333333"
  262 + android:textSize="18sp" />
  263 +
  264 + <LinearLayout
  265 + android:layout_width="wrap_content"
  266 + android:layout_height="wrap_content"
  267 + android:layout_alignParentRight="true"
  268 + android:orientation="horizontal">
  269 +
  270 + <TextView
  271 + android:id="@+id/has_finish"
  272 + android:layout_width="wrap_content"
  273 + android:layout_height="wrap_content"
  274 + android:textSize="18sp"
  275 + android:textColor="#36C28D"
  276 + android:text="@string/finish" />
  277 +
  278 + <TextView
  279 + android:id="@+id/no_finish"
  280 + android:layout_width="wrap_content"
  281 + android:layout_height="wrap_content"
  282 + android:text="@string/no_finish"
  283 + android:layout_marginLeft="20dp"
  284 + android:textColor="#333333"
  285 + android:textSize="15sp"
  286 + />
  287 + </LinearLayout>
  288 + </RelativeLayout>
143 289
144 <com.scwang.smartrefresh.layout.SmartRefreshLayout 290 <com.scwang.smartrefresh.layout.SmartRefreshLayout
145 android:id="@+id/refreshLayout" 291 android:id="@+id/refreshLayout"
@@ -150,16 +296,16 @@ @@ -150,16 +296,16 @@
150 android:id="@+id/record_recy" 296 android:id="@+id/record_recy"
151 android:layout_width="match_parent" 297 android:layout_width="match_parent"
152 android:layout_height="match_parent" 298 android:layout_height="match_parent"
153 - android:padding="10dp"  
154 - android:background="@color/white" /> 299 + android:background="@color/white"
  300 + android:padding="10dp" />
155 </com.scwang.smartrefresh.layout.SmartRefreshLayout> 301 </com.scwang.smartrefresh.layout.SmartRefreshLayout>
156 302
157 <RelativeLayout 303 <RelativeLayout
158 android:id="@+id/empty" 304 android:id="@+id/empty"
159 android:layout_width="match_parent" 305 android:layout_width="match_parent"
160 android:layout_height="match_parent" 306 android:layout_height="match_parent"
161 - android:visibility="gone"  
162 - android:background="@color/white"> 307 + android:background="@color/white"
  308 + android:visibility="gone">
163 309
164 <LinearLayout 310 <LinearLayout
165 android:layout_width="wrap_content" 311 android:layout_width="wrap_content"
@@ -175,28 +321,26 @@ @@ -175,28 +321,26 @@
175 <TextView 321 <TextView
176 android:layout_width="wrap_content" 322 android:layout_width="wrap_content"
177 android:layout_height="wrap_content" 323 android:layout_height="wrap_content"
  324 + android:layout_gravity="center"
  325 + android:layout_marginTop="15dp"
178 android:text="还没有跑过的线路" 326 android:text="还没有跑过的线路"
179 android:textColor="#333333" 327 android:textColor="#333333"
180 - android:textSize="15sp"  
181 - android:layout_marginTop="15dp"  
182 - android:layout_gravity="center"  
183 - /> 328 + android:textSize="15sp" />
184 329
185 <TextView 330 <TextView
186 android:id="@+id/check_all_line" 331 android:id="@+id/check_all_line"
187 android:layout_width="wrap_content" 332 android:layout_width="wrap_content"
188 android:layout_height="wrap_content" 333 android:layout_height="wrap_content"
189 android:layout_gravity="center" 334 android:layout_gravity="center"
190 - android:text="@string/chek_all_line"  
191 android:layout_marginTop="10dp" 335 android:layout_marginTop="10dp"
192 - android:textSize="12sp"  
193 - android:textColor="#36C28D"  
194 android:background="@drawable/green_raduis_bg" 336 android:background="@drawable/green_raduis_bg"
195 - android:paddingTop="5dp"  
196 - android:paddingBottom="5dp"  
197 android:paddingLeft="8dp" 337 android:paddingLeft="8dp"
  338 + android:paddingTop="5dp"
198 android:paddingRight="8dp" 339 android:paddingRight="8dp"
199 - /> 340 + android:paddingBottom="5dp"
  341 + android:text="@string/chek_all_line"
  342 + android:textColor="#36C28D"
  343 + android:textSize="12sp" />
200 </LinearLayout> 344 </LinearLayout>
201 345
202 </RelativeLayout> 346 </RelativeLayout>
moudle_pedometer/src/main/res/values/colors.xml
@@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
34 <color name="bottom_sheet_dialog_race_location_text">#999999</color> 34 <color name="bottom_sheet_dialog_race_location_text">#999999</color>
35 35
36 <color name="color_7cbd83">#7cbd83</color> 36 <color name="color_7cbd83">#7cbd83</color>
  37 + <color name="green_tx">#36C28D</color>
37 <color name="s_topbar_btn_color">#333333</color> 38 <color name="s_topbar_btn_color">#333333</color>
38 39
39 40
moudle_pedometer/src/main/res/values/strings.xml
@@ -60,6 +60,7 @@ @@ -60,6 +60,7 @@
60 <string name="has_balence">累计步行距离</string> 60 <string name="has_balence">累计步行距离</string>
61 <string name="Kilimanjaro">(公里)</string> 61 <string name="Kilimanjaro">(公里)</string>
62 <string name="finish_num">完成(次)</string> 62 <string name="finish_num">完成(次)</string>
  63 + <string name="finish_num_no">未完成(次)</string>
63 <string name="all_time">累计用时</string> 64 <string name="all_time">累计用时</string>
64 <string name="has_take_part_line">我跑过的线路</string> 65 <string name="has_take_part_line">我跑过的线路</string>
65 <string name="chek_all_line">查看全部路线</string> 66 <string name="chek_all_line">查看全部路线</string>
@@ -75,6 +76,10 @@ @@ -75,6 +76,10 @@
75 <string name="later_finish">天后结束</string> 76 <string name="later_finish">天后结束</string>
76 <string name="layout_collect_bind_trace">绑定轨迹</string> 77 <string name="layout_collect_bind_trace">绑定轨迹</string>
77 <string name="identify_the_start_point">确认开始地点</string> 78 <string name="identify_the_start_point">确认开始地点</string>
  79 + <string name="finish">完成</string>
  80 + <string name="no_finish">未完成</string>
  81 + <string name="again_up">重新上传</string>
  82 + <string name="myrecord">我的记录</string>
78 83
79 84
80 </resources> 85 </resources>