Commit cd494527acfde10993900eb4846aa74908711663
Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/ModulePedometer
Showing
7 changed files
with
62 additions
and
8 deletions
lib_network/src/main/java/com/cnlive/strike/data/network/api/ApiRequest.java
| ... | ... | @@ -74,7 +74,8 @@ public class ApiRequest<Observable extends io.reactivex.Observable<Result<BaseDa |
| 74 | 74 | |
| 75 | 75 | public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends BaseInfo> |
| 76 | 76 | ApiRequest<Observable, BaseData> observable(Class<Service> clazz, ApiBuild.Api<Service, Observable, BaseData> api) { |
| 77 | - return observable(clazz, false, api, null); | |
| 77 | + //添加签名校验-杨帅 | |
| 78 | + return observable(clazz, false, api, new SignEncryptInterceptor()); | |
| 78 | 79 | } |
| 79 | 80 | |
| 80 | 81 | public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends BaseInfo> |
| ... | ... | @@ -133,13 +134,14 @@ public class ApiRequest<Observable extends io.reactivex.Observable<Result<BaseDa |
| 133 | 134 | return service(clazz, api, new DefaultEncryptInterceptor()); |
| 134 | 135 | } |
| 135 | 136 | |
| 136 | - public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends BaseInfo> | |
| 137 | + public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends BaseInfo> | |
| 137 | 138 | ApiRequest<Observable, BaseData> service(Class<Service> clazz, ApiBuild.Api<Service, Observable, BaseData> api) { |
| 138 | 139 | return service(clazz, api, new SignEncryptInterceptor()); |
| 139 | 140 | } |
| 141 | + | |
| 140 | 142 | public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends BaseInfo> |
| 141 | - ApiRequest<Observable, BaseData> serviceNewVersion(Class<Service> clazz,long connectTimeout ,long readTimeout,ApiBuild.Api<Service, Observable, BaseData> api) { | |
| 142 | - return serviceNewVersion(clazz,false, api, connectTimeout,readTimeout,new SignEncryptInterceptor()); | |
| 143 | + ApiRequest<Observable, BaseData> serviceNewVersion(Class<Service> clazz, long connectTimeout, long readTimeout, ApiBuild.Api<Service, Observable, BaseData> api) { | |
| 144 | + return serviceNewVersion(clazz, false, api, connectTimeout, readTimeout, new SignEncryptInterceptor()); | |
| 143 | 145 | } |
| 144 | 146 | |
| 145 | 147 | |
| ... | ... | @@ -188,7 +190,7 @@ public class ApiRequest<Observable extends io.reactivex.Observable<Result<BaseDa |
| 188 | 190 | |
| 189 | 191 | |
| 190 | 192 | private static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends BaseInfo> |
| 191 | - ApiRequest<Observable, BaseData> serviceNewVersion(Class<Service> clazz, boolean decode, ApiBuild.Api<Service, Observable, BaseData> api,long connectTimeout ,long readTimeout, Interceptor... interceptor) { | |
| 193 | + ApiRequest<Observable, BaseData> serviceNewVersion(Class<Service> clazz, boolean decode, ApiBuild.Api<Service, Observable, BaseData> api, long connectTimeout, long readTimeout, Interceptor... interceptor) { | |
| 192 | 194 | |
| 193 | 195 | ApiRequest<Observable, BaseData> request = new ApiRequest<>(); |
| 194 | 196 | ... | ... |
lib_network/src/main/java/com/cnlive/strike/data/network/model/runAbout/RunRaceDetailInfo.java
| ... | ... | @@ -9,18 +9,22 @@ import java.util.List; |
| 9 | 9 | */ |
| 10 | 10 | public class RunRaceDetailInfo { |
| 11 | 11 | |
| 12 | + | |
| 12 | 13 | /** |
| 13 | 14 | * address : 澳大利亚黄金海岸 |
| 15 | + * description : 2018国际网络徒步大赛黄金海岸站 | |
| 14 | 16 | * employTime : 00:0:30 |
| 15 | 17 | * endLocation : 首都师范大学操场西门 |
| 16 | 18 | * end_time : 1571140800000 |
| 19 | + * eventType : 徒步 | |
| 17 | 20 | * faceUrl : ["http://yweb0.cnliveimg.com/images/headImg/2019/0505/1557039035723_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0505/1557034319038_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2018/0902/1535858459612_small.jpg"] |
| 18 | 21 | * finishFaceUrl : ["http://yweb0.cnliveimg.com/images/headImg/2019/0505/1557039035723_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg"] |
| 22 | + * finishNum : 33 | |
| 19 | 23 | * firstEmployTime : 33 |
| 20 | 24 | * firstFaceUrl : http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg |
| 21 | 25 | * firstName : 峨眉派掌门候选人 |
| 22 | 26 | * id : 116 |
| 23 | - * latLongitude : ["39.74788,116.14294","39.74888,116.14394"] | |
| 27 | + * latLongitude : [{"latitude":39.933942415657,"latitudeE6":3.9933942415657E7,"longitude":116.30897883196,"longitudeE6":1.1630897883196001E8},{"latitude":39.933967093082,"latitudeE6":3.9933967093082E7,"longitude":116.30890884739,"longitudeE6":1.1630890884739E8},{"latitude":39.93396191311,"latitudeE6":3.9933961913109995E7,"longitude":116.30868153328,"longitudeE6":1.1630868153328E8},{"latitude":39.934018604395,"latitudeE6":3.9934018604395E7,"longitude":116.30864816843,"longitudeE6":1.1630864816843E8},{"latitude":39.934091845914,"latitudeE6":3.9934091845914E7,"longitude":116.30864003053,"longitudeE6":1.1630864003053E8},{"latitude":39.934360142831,"latitudeE6":3.9934360142831E7,"longitude":116.30875016067,"longitudeE6":1.1630875016067E8},{"latitude":39.934744000269,"latitudeE6":3.9934744000268996E7,"longitude":116.30886056182,"longitudeE6":1.1630886056182E8},{"latitude":39.934760553353,"latitudeE6":3.9934760553353004E7,"longitude":116.30891047327,"longitudeE6":1.1630891047327E8},{"latitude":39.934696015943,"latitudeE6":3.9934696015943E7,"longitude":116.30912422473,"longitudeE6":1.1630912422473E8},{"latitude":39.934698216461,"latitudeE6":3.9934698216461E7,"longitude":116.30938815875,"longitudeE6":1.1630938815875E8},{"latitude":39.934731879794,"latitudeE6":3.9934731879794E7,"longitude":116.30961357404,"longitudeE6":1.1630961357404E8},{"latitude":39.934696892741,"latitudeE6":3.9934696892741E7,"longitude":116.30967053826,"longitudeE6":1.1630967053826E8},{"latitude":39.934370279617,"latitudeE6":3.9934370279617E7,"longitude":116.30962008478,"longitudeE6":1.1630962008478E8},{"latitude":39.934132111504,"latitudeE6":3.9934132111503996E7,"longitude":116.309668369,"longitudeE6":1.1630966836899999E8},{"latitude":39.933978571682,"latitudeE6":3.9933978571682E7,"longitude":116.30965182248,"longitudeE6":1.1630965182248001E8},{"latitude":39.933964707162,"latitudeE6":3.9933964707162E7,"longitude":116.3093930426,"longitudeE6":1.1630939304259999E8},{"latitude":39.933996146467,"latitudeE6":3.9933996146467E7,"longitude":116.30915080933,"longitudeE6":1.1630915080933E8}] | |
| 24 | 28 | * mileage : 全长4.42公里 |
| 25 | 29 | * pace : 22.33 |
| 26 | 30 | * roadmap : http://yweb0.cnliveimg.com/images/headImg/2019/051 |
| ... | ... | @@ -35,9 +39,12 @@ public class RunRaceDetailInfo { |
| 35 | 39 | */ |
| 36 | 40 | |
| 37 | 41 | private String address; |
| 42 | + private String description; | |
| 38 | 43 | private String employTime; |
| 39 | 44 | private String endLocation; |
| 40 | 45 | private long end_time; |
| 46 | + private String eventType; | |
| 47 | + private String finishNum; | |
| 41 | 48 | private String firstEmployTime; |
| 42 | 49 | private String firstFaceUrl; |
| 43 | 50 | private String firstName; |
| ... | ... | @@ -65,6 +72,14 @@ public class RunRaceDetailInfo { |
| 65 | 72 | this.address = address; |
| 66 | 73 | } |
| 67 | 74 | |
| 75 | + public String getDescription() { | |
| 76 | + return description; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setDescription(String description) { | |
| 80 | + this.description = description; | |
| 81 | + } | |
| 82 | + | |
| 68 | 83 | public String getEmployTime() { |
| 69 | 84 | return employTime; |
| 70 | 85 | } |
| ... | ... | @@ -89,6 +104,22 @@ public class RunRaceDetailInfo { |
| 89 | 104 | this.end_time = end_time; |
| 90 | 105 | } |
| 91 | 106 | |
| 107 | + public String getEventType() { | |
| 108 | + return eventType; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public void setEventType(String eventType) { | |
| 112 | + this.eventType = eventType; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public String getFinishNum() { | |
| 116 | + return finishNum; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public void setFinishNum(String finishNum) { | |
| 120 | + this.finishNum = finishNum; | |
| 121 | + } | |
| 122 | + | |
| 92 | 123 | public String getFirstEmployTime() { |
| 93 | 124 | return firstEmployTime; |
| 94 | 125 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| ... | ... | @@ -110,7 +110,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 110 | 110 | |
| 111 | 111 | private String startPoint = "首都师范大学南门"; |
| 112 | 112 | private String endPoint = "首都师范大学篮球场"; |
| 113 | - private String test = "[{\"latitude\":39.933889208848,\"latitudeE6\":3.9933889208848E7,\"longitude\":116.30900265517,\"longitudeE6\":1.1630900265517001E8},{\"latitude\":39.933868507347,\"latitudeE6\":3.9933868507347E7,\"longitude\":116.30865416508,\"longitudeE6\":1.1630865416508E8},{\"latitude\":39.934756505077,\"latitudeE6\":3.9934756505077E7,\"longitude\":116.30860516469,\"longitudeE6\":1.1630860516468999E8},{\"latitude\":39.934781620502,\"latitudeE6\":3.9934781620502E7,\"longitude\":116.30961013007,\"longitudeE6\":1.1630961013007E8},{\"latitude\":39.934881620374,\"latitudeE6\":3.9934881620374E7,\"longitude\":116.30960513008,\"longitudeE6\":1.1630960513008E8},{\"latitude\":39.934077623132,\"latitudeE6\":3.9934077623132E7,\"longitude\":116.30965812942,\"longitudeE6\":1.1630965812942E8},{\"latitude\":39.933972618463,\"latitudeE6\":3.9933972618463E7,\"longitude\":116.30962113087,\"longitudeE6\":1.1630962113087E8},{\"latitude\":39.933932608856,\"latitudeE6\":3.9933932608856E7,\"longitude\":116.30953913383,\"longitudeE6\":1.1630953913383E8}]"; | |
| 113 | +// private String test = "[{\"latitude\":39.933889208848,\"latitudeE6\":3.9933889208848E7,\"longitude\":116.30900265517,\"longitudeE6\":1.1630900265517001E8},{\"latitude\":39.933868507347,\"latitudeE6\":3.9933868507347E7,\"longitude\":116.30865416508,\"longitudeE6\":1.1630865416508E8},{\"latitude\":39.934756505077,\"latitudeE6\":3.9934756505077E7,\"longitude\":116.30860516469,\"longitudeE6\":1.1630860516468999E8},{\"latitude\":39.934781620502,\"latitudeE6\":3.9934781620502E7,\"longitude\":116.30961013007,\"longitudeE6\":1.1630961013007E8},{\"latitude\":39.934881620374,\"latitudeE6\":3.9934881620374E7,\"longitude\":116.30960513008,\"longitudeE6\":1.1630960513008E8},{\"latitude\":39.934077623132,\"latitudeE6\":3.9934077623132E7,\"longitude\":116.30965812942,\"longitudeE6\":1.1630965812942E8},{\"latitude\":39.933972618463,\"latitudeE6\":3.9933972618463E7,\"longitude\":116.30962113087,\"longitudeE6\":1.1630962113087E8},{\"latitude\":39.933932608856,\"latitudeE6\":3.9933932608856E7,\"longitude\":116.30953913383,\"longitudeE6\":1.1630953913383E8}]"; | |
| 114 | 114 | private LinkedList<LatLng> importLatLngs;//关键点 |
| 115 | 115 | private LatLng startLatLng = new LatLng(39.934733, 116.308646);//起始点 |
| 116 | 116 | private List<LatLng> trackPoints; |
| ... | ... | @@ -235,6 +235,10 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 235 | 235 | if (!TextUtils.isEmpty(TimeUtil.getStampToTime(runRaceDetailInfo.getEnd_time(), "yyyy-MM-dd"))) { |
| 236 | 236 | fragment.binding.includeStreet.tvActiveEndTime.setText(TimeUtil.getStampToTime(runRaceDetailInfo.getEnd_time(), "yyyy-MM-dd")); |
| 237 | 237 | } |
| 238 | + //设置活动类型 | |
| 239 | + if (!TextUtils.isEmpty(runRaceDetailInfo.getEventType())){ | |
| 240 | + fragment.binding.includeStreet.tvEventType.setText(runRaceDetailInfo.getEventType()); | |
| 241 | + } | |
| 238 | 242 | //设置参加人数 |
| 239 | 243 | fragment.binding.includeStreet.tvSignPerson.setText(runRaceDetailInfo.getSignupNum() + ""); |
| 240 | 244 | //设置报名完成的头像 |
| ... | ... | @@ -289,6 +293,10 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 289 | 293 | fragment.binding.includeRank.llRankRoot.setVisibility(View.GONE); |
| 290 | 294 | |
| 291 | 295 | } |
| 296 | + //设置路线描述 | |
| 297 | + if (!TextUtils.isEmpty(runRaceDetailInfo.getDescription())){ | |
| 298 | + fragment.binding.includeStreetIntroduce.tvStreetIntroduce.setText(runRaceDetailInfo.getDescription()); | |
| 299 | + } | |
| 292 | 300 | //设置路线介绍的图片 |
| 293 | 301 | if (!TextUtils.isEmpty(runRaceDetailInfo.getRoadmap())) { |
| 294 | 302 | //设置路线图 | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunningFinishFragment.java
| ... | ... | @@ -5,9 +5,11 @@ import android.support.annotation.Nullable; |
| 5 | 5 | import android.view.View; |
| 6 | 6 | |
| 7 | 7 | import com.cnlive.libs.base.ui.QMUIFragment; |
| 8 | +import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | |
| 8 | 9 | import com.cnlive.moudle.pedometer.frame.presenter.RunningFinishFragmetPresenter; |
| 9 | 10 | import com.cnlive.moudle.pedometer.frame.view.RunningFinishFragmentView; |
| 10 | 11 | import com.cnlive.moudle.pedometer.model.RunningFinishBean; |
| 12 | +import com.cnlive.moudle.pedometer.utils.StepUtil; | |
| 11 | 13 | import com.example.moudle_pedometer.R; |
| 12 | 14 | import com.example.moudle_pedometer.databinding.FragmentFinishRunMapBinding; |
| 13 | 15 | |
| ... | ... | @@ -43,6 +45,7 @@ public class RunningFinishFragment extends QMUIFragment<RunningFinishFragmentVie |
| 43 | 45 | @Override |
| 44 | 46 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 45 | 47 | super.onViewCreated(view, savedInstanceState); |
| 48 | + StepUtil.clearRunData(getActivity(), CommonInfo.getUserId(getActivity())); | |
| 46 | 49 | if (getArguments() != null) { |
| 47 | 50 | runningFinishBean = (RunningFinishBean) getArguments().getSerializable("runningFinishBean"); |
| 48 | 51 | if (runningFinishBean != null) { | ... | ... |
moudle_pedometer/src/main/res/layout/fragment_finish_run_map.xml
| ... | ... | @@ -24,6 +24,14 @@ |
| 24 | 24 | android:id="@+id/mapView" |
| 25 | 25 | android:layout_width="match_parent" |
| 26 | 26 | android:layout_height="match_parent"></com.baidu.mapapi.map.MapView> |
| 27 | + <!--地图上面加一层类似于全透明黑色蒙版--> | |
| 28 | + <LinearLayout | |
| 29 | + android:layout_width="match_parent" | |
| 30 | + android:layout_height="match_parent" | |
| 31 | + android:background="#0D000000" | |
| 32 | + android:clickable="false" | |
| 33 | + android:focusable="false" | |
| 34 | + android:focusableInTouchMode="false"></LinearLayout> | |
| 27 | 35 | |
| 28 | 36 | <FrameLayout |
| 29 | 37 | android:id="@+id/fl_back" | ... | ... |
moudle_pedometer/src/main/res/layout/layout_run_detail_street.xml
| ... | ... | @@ -344,10 +344,11 @@ |
| 344 | 344 | android:layout_marginTop="10dp"> |
| 345 | 345 | |
| 346 | 346 | <TextView |
| 347 | + android:id="@+id/tv_event_type" | |
| 347 | 348 | android:layout_width="wrap_content" |
| 348 | 349 | android:layout_height="wrap_content" |
| 349 | 350 | android:layout_marginLeft="25dp" |
| 350 | - android:text="徒步" | |
| 351 | + android:text="--" | |
| 351 | 352 | android:textColor="@color/text_black" |
| 352 | 353 | android:textSize="15sp" |
| 353 | 354 | android:textStyle="bold" /> | ... | ... |
moudle_pedometer/src/main/res/layout/layout_run_detail_street_introduce.xml