Commit 7b49da7e95660b37fe042ea1c546ab8f88961921
1 parent
a8fb0b5a
1 在未获取到用户头像时,显示默认头像
Showing
9 changed files
with
24 additions
and
14 deletions
config.gradle
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,6 +27,7 @@ import com.baidu.trace.api.fence.MonitoredStatusResponse; | ||
| 27 | import com.baidu.trace.api.fence.OnFenceListener; | 27 | import com.baidu.trace.api.fence.OnFenceListener; |
| 28 | import com.baidu.trace.api.fence.UpdateFenceResponse; | 28 | import com.baidu.trace.api.fence.UpdateFenceResponse; |
| 29 | import com.baidu.trace.model.SortType; | 29 | import com.baidu.trace.model.SortType; |
| 30 | +import com.bumptech.glide.Glide; | ||
| 30 | import com.cnlive.libs.base.logic.Event; | 31 | import com.cnlive.libs.base.logic.Event; |
| 31 | import com.cnlive.libs.base.logic.callback.FailureCallback; | 32 | import com.cnlive.libs.base.logic.callback.FailureCallback; |
| 32 | import com.cnlive.libs.base.logic.callback.SuccessCallback; | 33 | import com.cnlive.libs.base.logic.callback.SuccessCallback; |
| @@ -121,6 +122,8 @@ public class CollRunningFinishFragmentView implements MvpView, OnFenceListener { | @@ -121,6 +122,8 @@ public class CollRunningFinishFragmentView implements MvpView, OnFenceListener { | ||
| 121 | String faceUrl = CommonInfo.getUserIcon(getContext()); | 122 | String faceUrl = CommonInfo.getUserIcon(getContext()); |
| 122 | if (!TextUtils.isEmpty(faceUrl)) { | 123 | if (!TextUtils.isEmpty(faceUrl)) { |
| 123 | GlideApp.with(getContext()).load(faceUrl).into(fragment.binding.includeFinishUserInfo.qmIvIcon); | 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 | if (!TextUtils.isEmpty(collUserStepEntity.getStreetTitle())) { | 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,9 +672,9 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | ||
| 672 | } else { | 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 | if (null != currentWalkPoints) { | 678 | if (null != currentWalkPoints) { |
| 679 | if (currentWalkPoints.size() > 0) { | 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,13 +246,15 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener | ||
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | 248 | ||
| 249 | - //设置用户头像 | 249 | + //设置用户昵称 |
| 250 | if (!TextUtils.isEmpty(eventShoeLinesBean.getUserMsg().getNickName())) { | 250 | if (!TextUtils.isEmpty(eventShoeLinesBean.getUserMsg().getNickName())) { |
| 251 | fragment.binding.includeFinishUserInfo.tvUserNickName.setText(eventShoeLinesBean.getUserMsg().getNickName()); | 251 | fragment.binding.includeFinishUserInfo.tvUserNickName.setText(eventShoeLinesBean.getUserMsg().getNickName()); |
| 252 | } | 252 | } |
| 253 | //设置用户头像 | 253 | //设置用户头像 |
| 254 | if (!TextUtils.isEmpty(eventShoeLinesBean.getUserMsg().getImage())) { | 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 | if (!TextUtils.isEmpty(eventShoeLinesBean.getMileage())) { | 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,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 | currentLatLng = new LatLng(location.getLatitude(), | 431 | currentLatLng = new LatLng(location.getLatitude(), |
| 432 | location.getLongitude()); | 432 | location.getLongitude()); |
| 433 | followMyLocation = new MyLocationData.Builder() | 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,6 +21,7 @@ import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; | ||
| 21 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; | 21 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; |
| 22 | import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | 22 | import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; |
| 23 | import com.cnlive.moudle.pedometer.utils.StepUtil; | 23 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| 24 | +import com.cnlive.strike.application.GlideApp; | ||
| 24 | import com.example.moudle_pedometer.R; | 25 | import com.example.moudle_pedometer.R; |
| 25 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 26 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 26 | import com.sothree.slidinguppanel.SlidingUpPanelLayout; | 27 | import com.sothree.slidinguppanel.SlidingUpPanelLayout; |
| @@ -53,7 +54,9 @@ public class RunningFinishFragmentView implements MvpView { | @@ -53,7 +54,9 @@ public class RunningFinishFragmentView implements MvpView { | ||
| 53 | //设置用户头像 | 54 | //设置用户头像 |
| 54 | String faceUrl = CommonInfo.getUserIcon(getContext()); | 55 | String faceUrl = CommonInfo.getUserIcon(getContext()); |
| 55 | if (!TextUtils.isEmpty(faceUrl)) { | 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 | String nickName = CommonInfo.getUserNickName(getContext()); | 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,6 +13,7 @@ import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | ||
| 13 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | 13 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; |
| 14 | import com.cnlive.moudle.pedometer.ui.fragment.UploadFailDetailFragment; | 14 | import com.cnlive.moudle.pedometer.ui.fragment.UploadFailDetailFragment; |
| 15 | import com.cnlive.moudle.pedometer.utils.TimeUtil; | 15 | import com.cnlive.moudle.pedometer.utils.TimeUtil; |
| 16 | +import com.cnlive.strike.application.GlideApp; | ||
| 16 | import com.example.moudle_pedometer.R; | 17 | import com.example.moudle_pedometer.R; |
| 17 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 18 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 18 | 19 | ||
| @@ -53,7 +54,9 @@ public class UploadFailDetailFragmentView implements MvpView { | @@ -53,7 +54,9 @@ public class UploadFailDetailFragmentView implements MvpView { | ||
| 53 | //设置用户头像 | 54 | //设置用户头像 |
| 54 | String faceUrl = CommonInfo.getUserIcon(getContext()); | 55 | String faceUrl = CommonInfo.getUserIcon(getContext()); |
| 55 | if (!TextUtils.isEmpty(faceUrl)) { | 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 | if (!TextUtils.isEmpty(failedEntity.getStreetTitle())) { | 62 | if (!TextUtils.isEmpty(failedEntity.getStreetTitle())) { |
moudle_pedometer/src/main/res/layout/layout_coll_finish_user_info.xml
| @@ -112,7 +112,6 @@ | @@ -112,7 +112,6 @@ | ||
| 112 | android:layout_width="60dp" | 112 | android:layout_width="60dp" |
| 113 | android:layout_height="60dp" | 113 | android:layout_height="60dp" |
| 114 | android:layout_marginLeft="10dp" | 114 | android:layout_marginLeft="10dp" |
| 115 | - android:background="@drawable/tc_ic_workout_level_adjust_coach" | ||
| 116 | app:qmui_corner_radius="100dp" /> | 115 | app:qmui_corner_radius="100dp" /> |
| 117 | </FrameLayout> | 116 | </FrameLayout> |
| 118 | </layout> | 117 | </layout> |
| 119 | \ No newline at end of file | 118 | \ No newline at end of file |
moudle_pedometer/src/main/res/values/strings.xml
| @@ -92,6 +92,6 @@ | @@ -92,6 +92,6 @@ | ||
| 92 | <string name="run_race_far_tip">您距离起点较远\n请到达起点附近再开始</string> | 92 | <string name="run_race_far_tip">您距离起点较远\n请到达起点附近再开始</string> |
| 93 | <string name="run_race_arrive_end_tip">您已到达终点附近\n可以结束运动了</string> | 93 | <string name="run_race_arrive_end_tip">您已到达终点附近\n可以结束运动了</string> |
| 94 | <string name="layout_coll_take_point_text">(打点)</string> | 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 | </resources> | 97 | </resources> |