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