Commit 2106a3adfda0d7b45eaf69847033ea3a2c2c3434

Authored by 杨帅
1 parent 933baf7c

1 修复用户报名赛事成功后,参与人数与头像未实时更新的问题

2 修改线上赛事ui
app/src/main/java/com/example/modulepedometer/MainActivity.java
... ... @@ -22,7 +22,9 @@ public class MainActivity extends AppCompatActivity {
22 22 super.onCreate(savedInstanceState);
23 23 setContentView(R.layout.activity_main);
24 24  
25   - String uid = "358916";
  25 +// String uid = "358916";
  26 + String uid = "358689";
  27 +
26 28 findViewById(R.id.recordd).setOnClickListener(new View.OnClickListener() {
27 29 @Override
28 30 public void onClick(View v) {
... ...
config.gradle
... ... @@ -21,7 +21,7 @@ ext {
21 21 //编译方式
22 22 debug : false,
23 23 //版本号
24   - version: "0.6.6",
  24 + version: "0.6.7",
25 25 //Lib库前缀
26 26 packeg : "com.cnlive.module",
27 27 //Lib库名称
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RegistrationInfoPresenter.java
... ... @@ -55,7 +55,13 @@ public class RegistrationInfoPresenter extends MvpBasePresenter<RegistrationInfo
55 55 }).<BaseInfo>event().setFailureCallback(new FailureCallback() {
56 56 @Override
57 57 public void onFailure(int code, String message) {
58   - Toast.makeText(context, "报名失败", Toast.LENGTH_LONG).show();
  58 +// if (408 == code) {
  59 +// if (getView() != null) {
  60 +// getView().toResult();
  61 +// }
  62 +// } else {
  63 + Toast.makeText(context, "报名失败", Toast.LENGTH_LONG).show();
  64 +// }
59 65 }
60 66 }).setSuccessCallback(new SuccessCallback<BaseInfo>() {
61 67 @Override
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
... ... @@ -111,6 +111,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
111 111 private final float INIT_MAP_OVERLOOK = -40f;//地图倾斜角度
112 112 private final float DEFAULT_MAP_AUTO_ZOOM = -0.8f;//根据点位,自动缩放的比例
113 113 private List<LatLng> queryResultPoints;//查询到的历史轨迹
  114 + private List<String> joinFaceIcon;//参与活动人数
114 115  
115 116 public RunRaceDetailFragmentView(RunRaceDetailFragment fragment) {
116 117 this.fragment = fragment;
... ... @@ -376,7 +377,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
376 377 //设置参加人数
377 378 fragment.binding.includeStreet.tvSignPerson.setText(runRaceDetailInfo.getSignupNum() + "");
378 379 //设置报名完成的头像
379   - List<String> joinFaceIcon = runRaceDetailInfo.getFaceUrl();
  380 + joinFaceIcon = runRaceDetailInfo.getFaceUrl();
380 381 if (joinFaceIcon != null && joinFaceIcon.size() > 0) {
381 382 fragment.binding.includeStreet.fiveJoinPerson.setVisibility(View.VISIBLE);
382 383 //设置头像数据
... ... @@ -1262,6 +1263,49 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
1262 1263 if (getContext() == null) {
1263 1264 return;
1264 1265 }
  1266 + //更新用户头像
  1267 + if (null != joinFaceIcon) {
  1268 + //获取用户头像
  1269 + if (TextUtils.isEmpty(CommonInfo.getUserIcon(getContext()))) {
  1270 + //添加默认头像
  1271 + joinFaceIcon.add(0, "http://wjj.ys1.cnliveimg.com/769/img/2018/0416/head_c.png");
  1272 + } else {
  1273 + //添加用户本身头像
  1274 + joinFaceIcon.add(0, CommonInfo.getUserIcon(getContext()));
  1275 +
  1276 + }
  1277 + }
  1278 + //没有一个用户头像
  1279 + else {
  1280 + joinFaceIcon = new ArrayList<>();
  1281 + //获取用户头像
  1282 + if (TextUtils.isEmpty(CommonInfo.getUserIcon(getContext()))) {
  1283 + //添加默认头像
  1284 + joinFaceIcon.add("http://wjj.ys1.cnliveimg.com/769/img/2018/0416/head_c.png");
  1285 + } else {
  1286 + //添加用户本身头像
  1287 + joinFaceIcon.add(CommonInfo.getUserIcon(getContext()));
  1288 +
  1289 + }
  1290 + }
  1291 +
  1292 + //开始更新头像
  1293 + if (null != joinFaceIcon) {
  1294 + fragment.binding.includeStreet.fiveJoinPerson.setVisibility(View.VISIBLE);
  1295 + //设置头像数据
  1296 + fragment.binding.includeStreet.fiveJoinPerson.initIconData(joinFaceIcon);
  1297 + }
  1298 + //更新参与人数
  1299 + if (!TextUtils.isEmpty(fragment.binding.includeStreet.tvSignPerson.getText().toString())) {
  1300 + if ("--".equals(fragment.binding.includeStreet.tvSignPerson.getText().toString())) {
  1301 + fragment.binding.includeStreet.tvSignPerson.setText("1");
  1302 + }
  1303 + if (null != runRaceDetailInfo) {
  1304 + fragment.binding.includeStreet.tvSignPerson.setText((runRaceDetailInfo.getSignupNum() + 1) + "");
  1305 + }
  1306 + } else {
  1307 + fragment.binding.includeStreet.tvSignPerson.setText("1");
  1308 + }
1265 1309 fragment.binding.rlScrollViewStartBtn.setTag("1");
1266 1310 fragment.binding.tvRunNow.setText("现在开始");
1267 1311 fragment.binding.tvGoTip.setVisibility(View.VISIBLE);
... ...
moudle_pedometer/src/main/res/layout/fragment_run_line.xml
... ... @@ -26,7 +26,6 @@
26 26 android:layout_centerVertical="true"
27 27 android:layout_marginLeft="10dp"
28 28 android:layout_toRightOf="@id/back_btn"
29   - android:drawableRight="@drawable/sport_dropdown"
30 29 android:drawablePadding="7dp"
31 30 android:text="@string/beijing"
32 31 android:textColor="#333333"
... ...