Commit 7b49da7e95660b37fe042ea1c546ab8f88961921

Authored by 杨帅
1 parent a8fb0b5a

1 在未获取到用户头像时,显示默认头像

config.gradle
... ... @@ -21,7 +21,7 @@ ext {
21 21 //编译方式
22 22 debug : false,
23 23 //版本号
24   - version: "0.6.17",
  24 + version: "0.6.18",
25 25 //Lib库前缀
26 26 packeg : "com.cnlive.module",
27 27 //Lib库名称
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunningFinishFragmentView.java
... ... @@ -27,6 +27,7 @@ import com.baidu.trace.api.fence.MonitoredStatusResponse;
27 27 import com.baidu.trace.api.fence.OnFenceListener;
28 28 import com.baidu.trace.api.fence.UpdateFenceResponse;
29 29 import com.baidu.trace.model.SortType;
  30 +import com.bumptech.glide.Glide;
30 31 import com.cnlive.libs.base.logic.Event;
31 32 import com.cnlive.libs.base.logic.callback.FailureCallback;
32 33 import com.cnlive.libs.base.logic.callback.SuccessCallback;
... ... @@ -121,6 +122,8 @@ public class CollRunningFinishFragmentView implements MvpView, OnFenceListener {
121 122 String faceUrl = CommonInfo.getUserIcon(getContext());
122 123 if (!TextUtils.isEmpty(faceUrl)) {
123 124 GlideApp.with(getContext()).load(faceUrl).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
  125 + }else {
  126 + GlideApp.with(getContext()).load(getContext().getResources().getString(R.string.default_face_url)).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
124 127 }
125 128 //设置标题
126 129 if (!TextUtils.isEmpty(collUserStepEntity.getStreetTitle())) {
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunningMapFragmentView.java
... ... @@ -672,9 +672,9 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener
672 672 } else {
673 673 //不是第一次定位状态
674 674 //过滤定位精度
675   - if (location.getRadius() > Constant.LOCA_ACCURACY) {
676   - return;
677   - }
  675 +// if (location.getRadius() > Constant.LOCA_ACCURACY) {
  676 +// return;
  677 +// }
678 678 if (null != currentWalkPoints) {
679 679 if (currentWalkPoints.size() > 0) {
680 680 //进行判断
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollTraceListDetailFragmentView.java
... ... @@ -246,13 +246,15 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener
246 246 }
247 247  
248 248  
249   - //设置用户头像
  249 + //设置用户昵称
250 250 if (!TextUtils.isEmpty(eventShoeLinesBean.getUserMsg().getNickName())) {
251 251 fragment.binding.includeFinishUserInfo.tvUserNickName.setText(eventShoeLinesBean.getUserMsg().getNickName());
252 252 }
253 253 //设置用户头像
254 254 if (!TextUtils.isEmpty(eventShoeLinesBean.getUserMsg().getImage())) {
255   - Glide.with(getContext()).load(eventShoeLinesBean.getUserMsg().getImage()).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
  255 + GlideApp.with(getContext()).load(eventShoeLinesBean.getUserMsg().getImage()).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
  256 + }else {
  257 + GlideApp.with(getContext()).load(getContext().getResources().getString(R.string.default_face_url)).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
256 258 }
257 259 //设置用户行走公里
258 260 if (!TextUtils.isEmpty(eventShoeLinesBean.getMileage())) {
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/StartTraceFragmentView.java
... ... @@ -425,9 +425,9 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener {
425 425 }
426 426  
427 427 //过滤定位精度
428   - if (location.getRadius() > Constant.LOCA_ACCURACY) {
429   - return;
430   - }
  428 +// if (location.getRadius() > Constant.LOCA_ACCURACY) {
  429 +// return;
  430 +// }
431 431 currentLatLng = new LatLng(location.getLatitude(),
432 432 location.getLongitude());
433 433 followMyLocation = new MyLocationData.Builder()
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunningFinishFragmentView.java
... ... @@ -21,6 +21,7 @@ import com.cnlive.moudle.pedometer.ui.widget.SelectDialog;
21 21 import com.cnlive.moudle.pedometer.utils.MyMapUtil;
22 22 import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil;
23 23 import com.cnlive.moudle.pedometer.utils.StepUtil;
  24 +import com.cnlive.strike.application.GlideApp;
24 25 import com.example.moudle_pedometer.R;
25 26 import com.hannesdorfmann.mosby3.mvp.MvpView;
26 27 import com.sothree.slidinguppanel.SlidingUpPanelLayout;
... ... @@ -53,7 +54,9 @@ public class RunningFinishFragmentView implements MvpView {
53 54 //设置用户头像
54 55 String faceUrl = CommonInfo.getUserIcon(getContext());
55 56 if (!TextUtils.isEmpty(faceUrl)) {
56   - Glide.with(getContext()).load(faceUrl).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
  57 + GlideApp.with(getContext()).load(faceUrl).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
  58 + }else {
  59 + GlideApp.with(getContext()).load(getContext().getResources().getString(R.string.default_face_url)).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
57 60 }
58 61 //设置用户昵称
59 62 String nickName = CommonInfo.getUserNickName(getContext());
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/UploadFailDetailFragmentView.java
... ... @@ -13,6 +13,7 @@ import com.cnlive.moudle.pedometer.commonInfo.CommonInfo;
13 13 import com.cnlive.moudle.pedometer.sql.entity.FailedEntity;
14 14 import com.cnlive.moudle.pedometer.ui.fragment.UploadFailDetailFragment;
15 15 import com.cnlive.moudle.pedometer.utils.TimeUtil;
  16 +import com.cnlive.strike.application.GlideApp;
16 17 import com.example.moudle_pedometer.R;
17 18 import com.hannesdorfmann.mosby3.mvp.MvpView;
18 19  
... ... @@ -53,7 +54,9 @@ public class UploadFailDetailFragmentView implements MvpView {
53 54 //设置用户头像
54 55 String faceUrl = CommonInfo.getUserIcon(getContext());
55 56 if (!TextUtils.isEmpty(faceUrl)) {
56   - Glide.with(getContext()).load(faceUrl).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
  57 + GlideApp.with(getContext()).load(faceUrl).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
  58 + }else {
  59 + GlideApp.with(getContext()).load(getContext().getResources().getString(R.string.default_face_url)).into(fragment.binding.includeFinishUserInfo.qmIvIcon);
57 60 }
58 61 //设置赛事标题
59 62 if (!TextUtils.isEmpty(failedEntity.getStreetTitle())) {
... ...
moudle_pedometer/src/main/res/layout/layout_coll_finish_user_info.xml
... ... @@ -112,7 +112,6 @@
112 112 android:layout_width="60dp"
113 113 android:layout_height="60dp"
114 114 android:layout_marginLeft="10dp"
115   - android:background="@drawable/tc_ic_workout_level_adjust_coach"
116 115 app:qmui_corner_radius="100dp" />
117 116 </FrameLayout>
118 117 </layout>
119 118 \ No newline at end of file
... ...
moudle_pedometer/src/main/res/values/strings.xml
... ... @@ -92,6 +92,6 @@
92 92 <string name="run_race_far_tip">您距离起点较远\n请到达起点附近再开始</string>
93 93 <string name="run_race_arrive_end_tip">您已到达终点附近\n可以结束运动了</string>
94 94 <string name="layout_coll_take_point_text">(打点)</string>
95   -
96   -
  95 + <!--默认头像url-->
  96 + <string name="default_face_url">http://wjj.ys1.cnliveimg.com/769/img/2018/0416/head_c.png</string>
97 97 </resources>
... ...