Commit ebbc1d16bc0be355ae0342666d2a04e9e55ac3e1
1 parent
498d6e65
1 线上赛事列表增加赛事结束图标显示
Showing
8 changed files
with
28 additions
and
5 deletions
config.gradle
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| ... | ... | @@ -178,6 +178,8 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 178 | 178 | } |
| 179 | 179 | WebViewUtil.setPtoHtmlData(fragment.getActivity(), html, webView, Constant.WEBVIEW_FONT_SIZE); |
| 180 | 180 | fragment.binding.includeStreetIntroduce.llWebview.addView(webView); |
| 181 | + fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); | |
| 182 | + | |
| 181 | 183 | } |
| 182 | 184 | |
| 183 | 185 | public void initView(RunRaceDetailInfo runRaceDetailInfo) { | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/net/bean/RunLineInfo.java
| ... | ... | @@ -16,7 +16,7 @@ public class RunLineInfo { |
| 16 | 16 | * totalPage : 1 |
| 17 | 17 | * totalRecord : 8 |
| 18 | 18 | */ |
| 19 | - | |
| 19 | + public static final String TYPE_END = "1";//赛事结束 | |
| 20 | 20 | private boolean hasNext; |
| 21 | 21 | private int pageNumber; |
| 22 | 22 | private int pageSize; |
| ... | ... | @@ -25,6 +25,7 @@ public class RunLineInfo { |
| 25 | 25 | private int totalRecord; |
| 26 | 26 | private List<ListBean> list; |
| 27 | 27 | |
| 28 | + | |
| 28 | 29 | public boolean isHasNext() { |
| 29 | 30 | return hasNext; |
| 30 | 31 | } |
| ... | ... | @@ -104,6 +105,15 @@ public class RunLineInfo { |
| 104 | 105 | private String mileage; |
| 105 | 106 | private List<String> faceUrl; |
| 106 | 107 | private String e_subtitle; |
| 108 | + private String activityState;//1-已结束 0-默认 | |
| 109 | + | |
| 110 | + public String getActivityState() { | |
| 111 | + return activityState; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public void setActivityState(String activityState) { | |
| 115 | + this.activityState = activityState; | |
| 116 | + } | |
| 107 | 117 | |
| 108 | 118 | public String getE_subtitle() { |
| 109 | 119 | return e_subtitle; | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/adapter/RunLineAdapter.java
| ... | ... | @@ -2,6 +2,7 @@ package com.cnlive.moudle.pedometer.ui.adapter; |
| 2 | 2 | |
| 3 | 3 | import android.app.Activity; |
| 4 | 4 | import android.support.annotation.NonNull; |
| 5 | +import android.support.v4.content.ContextCompat; | |
| 5 | 6 | import android.support.v7.widget.RecyclerView; |
| 6 | 7 | import android.text.TextUtils; |
| 7 | 8 | import android.view.LayoutInflater; |
| ... | ... | @@ -50,11 +51,22 @@ public class RunLineAdapter extends RecyclerView.Adapter<RunLineAdapter.MyViewHo |
| 50 | 51 | public void onBindViewHolder(@NonNull MyViewHolder myViewHolder, int i) { |
| 51 | 52 | |
| 52 | 53 | myViewHolder.my_record_ry.setVisibility(View.GONE); |
| 53 | - if (list.get(i).isSignResult()) { | |
| 54 | + //先判断赛事是否结束 | |
| 55 | + if (RunLineInfo.TYPE_END.equals(list.get(i).getActivityState())) { | |
| 54 | 56 | myViewHolder.has_report.setVisibility(View.VISIBLE); |
| 57 | + myViewHolder.has_report.setBackground(ContextCompat.getDrawable(context, R.drawable.icon_pedometer_end)); | |
| 55 | 58 | } else { |
| 59 | + //赛事没有结束 | |
| 56 | 60 | myViewHolder.has_report.setVisibility(View.GONE); |
| 61 | + //判断是否显示报名 | |
| 62 | + if (list.get(i).isSignResult()) { | |
| 63 | + myViewHolder.has_report.setVisibility(View.VISIBLE); | |
| 64 | + myViewHolder.has_report.setBackground(ContextCompat.getDrawable(context, R.drawable.pedometer_yplx_registered)); | |
| 65 | + } else { | |
| 66 | + myViewHolder.has_report.setVisibility(View.GONE); | |
| 67 | + } | |
| 57 | 68 | } |
| 69 | + | |
| 58 | 70 | if (clickListener != null) { |
| 59 | 71 | myViewHolder.item_ly.setOnClickListener(v -> clickListener.onClickListener(list.get(i), i)); |
| 60 | 72 | } | ... | ... |
moudle_pedometer/src/main/res/drawable-hdpi/icon_pedometer_end.png
0 → 100644
3.38 KB
moudle_pedometer/src/main/res/drawable-xhdpi/icon_pedometer_end.png
0 → 100644
2.21 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/icon_pedometer_end.png
0 → 100644
7.43 KB
moudle_pedometer/src/main/res/layout/item_my_record.xml
| ... | ... | @@ -178,6 +178,5 @@ |
| 178 | 178 | android:layout_height="wrap_content" |
| 179 | 179 | android:layout_alignParentRight="true" |
| 180 | 180 | android:layout_marginTop="7dp" |
| 181 | - android:layout_marginRight="5dp" | |
| 182 | - android:src="@drawable/pedometer_yplx_registered" /> | |
| 181 | + android:layout_marginRight="5dp" /> | |
| 183 | 182 | </RelativeLayout> |
| 184 | 183 | \ No newline at end of file | ... | ... |