Commit 63a7c081c70d8dc1b2cff29ad7dbfa0de0e08ee6
1 parent
27981300
分享页面数据
Showing
5 changed files
with
36 additions
and
32 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/MyRecordView.java
| 1 | package com.cnlive.moudle.pedometer.frame.view; | 1 | package com.cnlive.moudle.pedometer.frame.view; |
| 2 | 2 | ||
| 3 | -import android.content.Intent; | ||
| 4 | import android.support.v7.widget.LinearLayoutManager; | 3 | import android.support.v7.widget.LinearLayoutManager; |
| 5 | import android.view.View; | 4 | import android.view.View; |
| 6 | 5 | ||
| 7 | -import com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity; | ||
| 8 | -import com.cnlive.moudle.pedometer.ui.adapter.MyRecordAdapter; | ||
| 9 | import com.cnlive.moudle.pedometer.ui.fragment.MyRecordFragment; | 6 | import com.cnlive.moudle.pedometer.ui.fragment.MyRecordFragment; |
| 10 | -import com.example.moudle_pedometer.R; | ||
| 11 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 7 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 12 | 8 | ||
| 13 | import java.util.ArrayList; | 9 | import java.util.ArrayList; |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RaceRecorView.java
| @@ -55,10 +55,11 @@ public class RaceRecorView implements MvpView { | @@ -55,10 +55,11 @@ public class RaceRecorView implements MvpView { | ||
| 55 | list.clear(); | 55 | list.clear(); |
| 56 | list.addAll(raceRecordInfoBaseInfo.getData().getEventRouteRecordBeanVoList()); | 56 | list.addAll(raceRecordInfoBaseInfo.getData().getEventRouteRecordBeanVoList()); |
| 57 | if(adapter == null){ | 57 | if(adapter == null){ |
| 58 | - fragment.binding.kilometerNum.setText(raceRecordInfoBaseInfo.getData().getBestResult().getMileage()); | ||
| 59 | - fragment.binding.stepNum.setText(raceRecordInfoBaseInfo.getData().getBestResult().getStep()); | ||
| 60 | - fragment.binding.kilometerTime.setText(raceRecordInfoBaseInfo.getData().getBestResult().getEmployTime()); | ||
| 61 | - fragment.binding.kilometerSpeed.setText(raceRecordInfoBaseInfo.getData().getBestResult().getPace()); | 58 | + RaceRecordInfo.BestResultBean bestResultBean = raceRecordInfoBaseInfo.getData().getBestResult(); |
| 59 | + fragment.binding.kilometerNum.setText(bestResultBean.getMileage()); | ||
| 60 | + fragment.binding.stepNum.setText(bestResultBean.getStep()); | ||
| 61 | + fragment.binding.kilometerTime.setText(bestResultBean.getEmployTime()); | ||
| 62 | + fragment.binding.kilometerSpeed.setText(bestResultBean.getPace()); | ||
| 62 | fragment.binding.recordRecy.setLayoutManager(new LinearLayoutManager(fragment.getActivity())); | 63 | fragment.binding.recordRecy.setLayoutManager(new LinearLayoutManager(fragment.getActivity())); |
| 63 | adapter = new RaceRecordAdapter(list,fragment.getActivity()); | 64 | adapter = new RaceRecordAdapter(list,fragment.getActivity()); |
| 64 | fragment.binding.recordRecy.setAdapter(adapter); | 65 | fragment.binding.recordRecy.setAdapter(adapter); |
| @@ -71,7 +72,8 @@ public class RaceRecorView implements MvpView { | @@ -71,7 +72,8 @@ public class RaceRecorView implements MvpView { | ||
| 71 | fragment.binding.topbar.addRightImageButton(R.drawable.share_img, R.id.fragment_more) | 72 | fragment.binding.topbar.addRightImageButton(R.drawable.share_img, R.id.fragment_more) |
| 72 | .setOnClickListener(v -> { | 73 | .setOnClickListener(v -> { |
| 73 | //分享 | 74 | //分享 |
| 74 | - ShareRecordActivity.newInstance(fragment.getActivity(),fragment.raceTitle); | 75 | + ShareRecordActivity.newInstance(fragment.getActivity(),fragment.raceTitle,bestResultBean.getMileage(),bestResultBean.getStep(), |
| 76 | + bestResultBean.getEmployTime(),bestResultBean.getPace()); | ||
| 75 | }); | 77 | }); |
| 76 | 78 | ||
| 77 | }else { | 79 | }else { |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/SelfRecordView.java
| @@ -43,7 +43,7 @@ public class SelfRecordView implements MvpView{ | @@ -43,7 +43,7 @@ public class SelfRecordView implements MvpView{ | ||
| 43 | fragment.binding.topbar.addRightImageButton(R.drawable.share_img, R.id.fragment_more) | 43 | fragment.binding.topbar.addRightImageButton(R.drawable.share_img, R.id.fragment_more) |
| 44 | .setOnClickListener(v -> { | 44 | .setOnClickListener(v -> { |
| 45 | //分享 | 45 | //分享 |
| 46 | - ShareRecordActivity.newInstance(fragment.getActivity(),""); | 46 | + ShareRecordActivity.newInstance(fragment.getActivity(),"","","","",""); |
| 47 | }); | 47 | }); |
| 48 | } | 48 | } |
| 49 | 49 |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/ShareRecordActivity.java
| @@ -24,9 +24,13 @@ public class ShareRecordActivity extends AppCompatActivity { | @@ -24,9 +24,13 @@ public class ShareRecordActivity extends AppCompatActivity { | ||
| 24 | private ImageView share_back; | 24 | private ImageView share_back; |
| 25 | private TextView share,cord_name; | 25 | private TextView share,cord_name; |
| 26 | private RelativeLayout ry_cen; | 26 | private RelativeLayout ry_cen; |
| 27 | - public static void newInstance(Activity context,String title){ | 27 | + public static void newInstance(Activity context,String title,String kilo,String step,String time,String speed){ |
| 28 | Intent intent = new Intent(context,ShareRecordActivity.class); | 28 | Intent intent = new Intent(context,ShareRecordActivity.class); |
| 29 | intent.putExtra("raceTitle",title); | 29 | intent.putExtra("raceTitle",title); |
| 30 | + intent.putExtra("kilo",kilo); | ||
| 31 | + intent.putExtra("step",step); | ||
| 32 | + intent.putExtra("time",time); | ||
| 33 | + intent.putExtra("speed",speed); | ||
| 30 | context.startActivity(intent); | 34 | context.startActivity(intent); |
| 31 | } | 35 | } |
| 32 | 36 | ||
| @@ -38,7 +42,11 @@ public class ShareRecordActivity extends AppCompatActivity { | @@ -38,7 +42,11 @@ public class ShareRecordActivity extends AppCompatActivity { | ||
| 38 | setContentView(R.layout.activity_share_record); | 42 | setContentView(R.layout.activity_share_record); |
| 39 | 43 | ||
| 40 | cord_name = findViewById(R.id.cord_name); | 44 | cord_name = findViewById(R.id.cord_name); |
| 41 | - cord_name.setText("用户在"+getIntent().getStringExtra("raceTitle")+"中的最佳成绩"); | 45 | + cord_name.setText("我在"+getIntent().getStringExtra("raceTitle")+"中的最佳成绩"); |
| 46 | + ((TextView) findViewById(R.id.kilo_share)).setText(getIntent().getStringExtra("kilo")); | ||
| 47 | + ((TextView) findViewById(R.id.step_share)).setText(getIntent().getStringExtra("step")); | ||
| 48 | + ((TextView) findViewById(R.id.time_share)).setText(getIntent().getStringExtra("time")); | ||
| 49 | + ((TextView) findViewById(R.id.speed_share)).setText(getIntent().getStringExtra("speed")); | ||
| 42 | share_back = findViewById(R.id.share_back); | 50 | share_back = findViewById(R.id.share_back); |
| 43 | share = findViewById(R.id.share); | 51 | share = findViewById(R.id.share); |
| 44 | ry_cen = findViewById(R.id.ry_cen); | 52 | ry_cen = findViewById(R.id.ry_cen); |
moudle_pedometer/src/main/res/layout/activity_share_record.xml
| @@ -89,9 +89,9 @@ | @@ -89,9 +89,9 @@ | ||
| 89 | android:layout_marginRight="20dp"> | 89 | android:layout_marginRight="20dp"> |
| 90 | 90 | ||
| 91 | <TextView | 91 | <TextView |
| 92 | + android:id="@+id/kilo_share" | ||
| 92 | android:layout_width="wrap_content" | 93 | android:layout_width="wrap_content" |
| 93 | android:layout_height="wrap_content" | 94 | android:layout_height="wrap_content" |
| 94 | - android:text="1.53" | ||
| 95 | android:textColor="#333333" | 95 | android:textColor="#333333" |
| 96 | android:textSize="30sp" /> | 96 | android:textSize="30sp" /> |
| 97 | 97 | ||
| @@ -111,7 +111,7 @@ | @@ -111,7 +111,7 @@ | ||
| 111 | android:layout_height="wrap_content" | 111 | android:layout_height="wrap_content" |
| 112 | android:layout_below="@id/tv_pr" | 112 | android:layout_below="@id/tv_pr" |
| 113 | android:layout_marginLeft="20dp" | 113 | android:layout_marginLeft="20dp" |
| 114 | - android:layout_marginTop="20dp" | 114 | + android:layout_marginTop="10dp" |
| 115 | android:layout_marginRight="20dp"> | 115 | android:layout_marginRight="20dp"> |
| 116 | 116 | ||
| 117 | <LinearLayout | 117 | <LinearLayout |
| @@ -121,7 +121,6 @@ | @@ -121,7 +121,6 @@ | ||
| 121 | android:orientation="vertical"> | 121 | android:orientation="vertical"> |
| 122 | 122 | ||
| 123 | <TextView | 123 | <TextView |
| 124 | - android:id="@+id/kilometer" | ||
| 125 | android:layout_width="wrap_content" | 124 | android:layout_width="wrap_content" |
| 126 | android:layout_height="wrap_content" | 125 | android:layout_height="wrap_content" |
| 127 | android:layout_gravity="center" | 126 | android:layout_gravity="center" |
| @@ -130,25 +129,22 @@ | @@ -130,25 +129,22 @@ | ||
| 130 | android:textSize="12sp" /> | 129 | android:textSize="12sp" /> |
| 131 | 130 | ||
| 132 | <TextView | 131 | <TextView |
| 132 | + android:id="@+id/step_share" | ||
| 133 | android:layout_width="wrap_content" | 133 | android:layout_width="wrap_content" |
| 134 | android:layout_height="wrap_content" | 134 | android:layout_height="wrap_content" |
| 135 | - android:layout_below="@id/kilometer" | ||
| 136 | android:layout_marginTop="5dp" | 135 | android:layout_marginTop="5dp" |
| 137 | - android:text="1234" | ||
| 138 | android:textColor="#333333" | 136 | android:textColor="#333333" |
| 139 | android:textSize="23sp" /> | 137 | android:textSize="23sp" /> |
| 140 | </LinearLayout> | 138 | </LinearLayout> |
| 141 | 139 | ||
| 142 | 140 | ||
| 143 | <LinearLayout | 141 | <LinearLayout |
| 144 | - android:id="@+id/foot_ly" | ||
| 145 | android:layout_width="wrap_content" | 142 | android:layout_width="wrap_content" |
| 146 | android:layout_height="wrap_content" | 143 | android:layout_height="wrap_content" |
| 147 | android:layout_centerInParent="true" | 144 | android:layout_centerInParent="true" |
| 148 | android:orientation="vertical"> | 145 | android:orientation="vertical"> |
| 149 | 146 | ||
| 150 | <TextView | 147 | <TextView |
| 151 | - android:id="@+id/foot" | ||
| 152 | android:layout_width="wrap_content" | 148 | android:layout_width="wrap_content" |
| 153 | android:layout_height="wrap_content" | 149 | android:layout_height="wrap_content" |
| 154 | android:layout_gravity="center" | 150 | android:layout_gravity="center" |
| @@ -157,11 +153,11 @@ | @@ -157,11 +153,11 @@ | ||
| 157 | android:textSize="12sp" /> | 153 | android:textSize="12sp" /> |
| 158 | 154 | ||
| 159 | <TextView | 155 | <TextView |
| 156 | + android:id="@+id/time_share" | ||
| 160 | android:layout_width="wrap_content" | 157 | android:layout_width="wrap_content" |
| 161 | android:layout_height="wrap_content" | 158 | android:layout_height="wrap_content" |
| 162 | android:layout_gravity="center" | 159 | android:layout_gravity="center" |
| 163 | android:layout_marginTop="5dp" | 160 | android:layout_marginTop="5dp" |
| 164 | - android:text="00:27:23" | ||
| 165 | android:textColor="#333333" | 161 | android:textColor="#333333" |
| 166 | android:textSize="23sp" /> | 162 | android:textSize="23sp" /> |
| 167 | </LinearLayout> | 163 | </LinearLayout> |
| @@ -173,7 +169,6 @@ | @@ -173,7 +169,6 @@ | ||
| 173 | android:orientation="vertical"> | 169 | android:orientation="vertical"> |
| 174 | 170 | ||
| 175 | <TextView | 171 | <TextView |
| 176 | - android:id="@+id/kilometer_time" | ||
| 177 | android:layout_width="wrap_content" | 172 | android:layout_width="wrap_content" |
| 178 | android:layout_height="wrap_content" | 173 | android:layout_height="wrap_content" |
| 179 | android:layout_gravity="center" | 174 | android:layout_gravity="center" |
| @@ -182,11 +177,11 @@ | @@ -182,11 +177,11 @@ | ||
| 182 | android:textSize="12sp" /> | 177 | android:textSize="12sp" /> |
| 183 | 178 | ||
| 184 | <TextView | 179 | <TextView |
| 180 | + android:id="@+id/speed_share" | ||
| 185 | android:layout_width="wrap_content" | 181 | android:layout_width="wrap_content" |
| 186 | android:layout_height="wrap_content" | 182 | android:layout_height="wrap_content" |
| 187 | android:layout_gravity="center" | 183 | android:layout_gravity="center" |
| 188 | android:layout_marginTop="5dp" | 184 | android:layout_marginTop="5dp" |
| 189 | - android:text="22'22''" | ||
| 190 | android:textColor="#333333" | 185 | android:textColor="#333333" |
| 191 | android:textSize="23sp" /> | 186 | android:textSize="23sp" /> |
| 192 | </LinearLayout> | 187 | </LinearLayout> |
| @@ -205,33 +200,35 @@ | @@ -205,33 +200,35 @@ | ||
| 205 | android:layout_width="match_parent" | 200 | android:layout_width="match_parent" |
| 206 | android:layout_height="wrap_content" | 201 | android:layout_height="wrap_content" |
| 207 | android:layout_below="@id/kilometer_ry" | 202 | android:layout_below="@id/kilometer_ry" |
| 208 | - android:layout_marginTop="30dp" | 203 | + android:layout_marginTop="20dp" |
| 209 | android:orientation="horizontal" | 204 | android:orientation="horizontal" |
| 210 | android:weightSum="3" | 205 | android:weightSum="3" |
| 211 | android:padding="10dp"> | 206 | android:padding="10dp"> |
| 212 | 207 | ||
| 213 | <RelativeLayout | 208 | <RelativeLayout |
| 214 | - android:layout_width="wrap_content" | 209 | + android:layout_width="0dp" |
| 215 | android:layout_height="wrap_content" | 210 | android:layout_height="wrap_content" |
| 216 | - android:layout_weight="3"> | 211 | + android:layout_marginRight="20dp" |
| 212 | + android:padding="5dp" | ||
| 213 | + android:layout_weight="2"> | ||
| 217 | 214 | ||
| 218 | <TextView | 215 | <TextView |
| 219 | android:id="@+id/cord_name" | 216 | android:id="@+id/cord_name" |
| 220 | android:layout_width="match_parent" | 217 | android:layout_width="match_parent" |
| 221 | android:layout_height="wrap_content" | 218 | android:layout_height="wrap_content" |
| 222 | android:gravity="left" | 219 | android:gravity="left" |
| 223 | - android:text="ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" | ||
| 224 | android:textColor="#333333" | 220 | android:textColor="#333333" |
| 221 | + android:lines="2" | ||
| 225 | android:textSize="12sp" /> | 222 | android:textSize="12sp" /> |
| 226 | 223 | ||
| 227 | <LinearLayout | 224 | <LinearLayout |
| 228 | android:layout_width="match_parent" | 225 | android:layout_width="match_parent" |
| 229 | android:layout_height="wrap_content" | 226 | android:layout_height="wrap_content" |
| 230 | android:layout_below="@id/cord_name" | 227 | android:layout_below="@id/cord_name" |
| 231 | - android:layout_marginTop="20dp" | 228 | + android:layout_marginTop="15dp" |
| 232 | android:background="@drawable/cc_bg_circle" | 229 | android:background="@drawable/cc_bg_circle" |
| 233 | android:orientation="vertical" | 230 | android:orientation="vertical" |
| 234 | - android:padding="10dp"> | 231 | + android:padding="5dp"> |
| 235 | 232 | ||
| 236 | <TextView | 233 | <TextView |
| 237 | android:id="@+id/tv_tv" | 234 | android:id="@+id/tv_tv" |
| @@ -241,23 +238,24 @@ | @@ -241,23 +238,24 @@ | ||
| 241 | android:textColor="#333333" | 238 | android:textColor="#333333" |
| 242 | android:textSize="10sp" /> | 239 | android:textSize="10sp" /> |
| 243 | 240 | ||
| 244 | - <TextView | 241 | + <EditText |
| 245 | android:layout_width="match_parent" | 242 | android:layout_width="match_parent" |
| 246 | android:layout_height="wrap_content" | 243 | android:layout_height="wrap_content" |
| 247 | android:layout_below="@id/tv_tv" | 244 | android:layout_below="@id/tv_tv" |
| 248 | android:layout_marginTop="7dp" | 245 | android:layout_marginTop="7dp" |
| 249 | - android:text="点击这里写下你的心情标签" | 246 | + android:hint="点击这里写下你的心情标签心情标签心情标签最多两行" |
| 250 | android:textColor="#999999" | 247 | android:textColor="#999999" |
| 248 | + android:background="@null" | ||
| 249 | + android:lines="2" | ||
| 251 | android:textSize="10sp" /> | 250 | android:textSize="10sp" /> |
| 252 | </LinearLayout> | 251 | </LinearLayout> |
| 253 | </RelativeLayout> | 252 | </RelativeLayout> |
| 254 | 253 | ||
| 255 | 254 | ||
| 256 | <ImageView | 255 | <ImageView |
| 257 | - android:layout_width="wrap_content" | 256 | + android:layout_width="0dp" |
| 258 | android:layout_height="wrap_content" | 257 | android:layout_height="wrap_content" |
| 259 | android:layout_weight="1" | 258 | android:layout_weight="1" |
| 260 | - android:layout_alignParentRight="true" | ||
| 261 | android:src="@drawable/erwe" /> | 259 | android:src="@drawable/erwe" /> |
| 262 | </LinearLayout> | 260 | </LinearLayout> |
| 263 | </RelativeLayout> | 261 | </RelativeLayout> |