Commit d21f413b60248f755a9ef430498a29ea31bc1589
1 parent
f58e15ec
1.;跑步结束页面
Showing
21 changed files
with
608 additions
and
362 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunMainFragmentView.java
| ... | ... | @@ -11,6 +11,7 @@ import android.view.MotionEvent; |
| 11 | 11 | import android.view.View; |
| 12 | 12 | import android.widget.Chronometer; |
| 13 | 13 | |
| 14 | +import com.cnlive.moudle.pedometer.model.RunningFinishBean; | |
| 14 | 15 | import com.cnlive.moudle.pedometer.model.RunningMapBean; |
| 15 | 16 | import com.cnlive.moudle.pedometer.model.Constant; |
| 16 | 17 | import com.cnlive.moudle.pedometer.model.MessageEvent; |
| ... | ... | @@ -183,7 +184,7 @@ public class RunMainFragmentView implements MvpView { |
| 183 | 184 | public void onClick(View view) { |
| 184 | 185 | //继续记录轨迹 |
| 185 | 186 | if (StepService.mClient != null && StepService.traceListener != null) { |
| 186 | - StepService.mClient.startTrace(StepService.mTrace,StepService.traceListener); | |
| 187 | + StepService.mClient.startTrace(StepService.mTrace, StepService.traceListener); | |
| 187 | 188 | } |
| 188 | 189 | needWriteDataFlag = true; |
| 189 | 190 | //将当前计时器时间戳写入数据库 |
| ... | ... | @@ -248,6 +249,7 @@ public class RunMainFragmentView implements MvpView { |
| 248 | 249 | SelectDialog selectDialog = new SelectDialog(fragment.getActivity(), "确定结束运动吗?", "确定", new SelectDialog.DialogInterface() { |
| 249 | 250 | @Override |
| 250 | 251 | public void onClick(SelectDialog dialog) { |
| 252 | + MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putBoolean("writeUserStep:" + uid, false); | |
| 251 | 253 | fragment.binding.cpCurrent.setVisibility(View.GONE); |
| 252 | 254 | ButtonAnimUtil.setViewDefault(fragment.binding.flStop); |
| 253 | 255 | //清空数据 |
| ... | ... | @@ -259,7 +261,15 @@ public class RunMainFragmentView implements MvpView { |
| 259 | 261 | MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putLong("stepStartTime", 0); |
| 260 | 262 | fragment.getActivity().stopService(new Intent(fragment.getActivity(), StepService.class)); |
| 261 | 263 | MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putString("userId", ""); |
| 262 | - RunningFinishActivity.startActivity(fragment.getActivity()); | |
| 264 | + RunningFinishBean runningFinishBean = new RunningFinishBean(); | |
| 265 | + runningFinishBean.setStartPoint("开始地点"); | |
| 266 | + runningFinishBean.setEndPoint("结束地点"); | |
| 267 | + runningFinishBean.setRunDistance(fragment.binding.tvRunDistance.getText().toString()); | |
| 268 | + runningFinishBean.setSpeed(fragment.binding.tvSpeed.getText().toString()); | |
| 269 | + runningFinishBean.setStep(fragment.binding.tvStepCount.getText().toString()); | |
| 270 | + runningFinishBean.setTime(fragment.binding.chronometer.getText().toString()); | |
| 271 | + runningFinishBean.setDate(TimeUtil.getFormatNowTime()); | |
| 272 | + RunningFinishActivity.startActivity(fragment.getActivity(), runningFinishBean); | |
| 263 | 273 | fragment.getActivity().finish(); |
| 264 | 274 | } |
| 265 | 275 | }, "取消", new SelectDialog.DialogInterface() { |
| ... | ... | @@ -337,7 +347,7 @@ public class RunMainFragmentView implements MvpView { |
| 337 | 347 | //暂停计步 |
| 338 | 348 | EventBus.getDefault().post(new MessageEvent(Constant.SERVICE_STEP_COUNT_PAUSE, "")); |
| 339 | 349 | //重置速度 |
| 340 | - resetSpeed(); | |
| 350 | +// resetSpeed(); | |
| 341 | 351 | } |
| 342 | 352 | }); |
| 343 | 353 | //gps点击事件 |
| ... | ... | @@ -409,7 +419,7 @@ public class RunMainFragmentView implements MvpView { |
| 409 | 419 | //设置行走公里 |
| 410 | 420 | fragment.binding.tvRunDistance.setText(StepUtil.getWalkDistanceKM(step) + ""); |
| 411 | 421 | //设置行走步数 |
| 412 | - fragment.binding.tvStepCount.setText(step + "步"); | |
| 422 | + fragment.binding.tvStepCount.setText(step+""); | |
| 413 | 423 | //设置S速度 |
| 414 | 424 | int second = (int) ((SystemClock.elapsedRealtime() - fragment.binding.chronometer.getBase()) / 1000); |
| 415 | 425 | if (second != 0) { | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| ... | ... | @@ -257,6 +257,16 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 257 | 257 | fragment.binding.includeStreet.fiveJoinPerson.setOnClickListener(v -> { |
| 258 | 258 | TakePartActivity.newInstance(fragment.getActivity()); |
| 259 | 259 | }); |
| 260 | + //返回按钮 | |
| 261 | + fragment.binding.ivBack.setOnClickListener(new View.OnClickListener() { | |
| 262 | + @Override | |
| 263 | + public void onClick(View view) { | |
| 264 | + if (fragment.getActivity()==null){ | |
| 265 | + return; | |
| 266 | + } | |
| 267 | + fragment.getActivity().finish(); | |
| 268 | + } | |
| 269 | + }); | |
| 260 | 270 | } |
| 261 | 271 | |
| 262 | 272 | private void initMap() { | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunningFinishFragmentView.java
| 1 | 1 | package com.cnlive.moudle.pedometer.frame.view; |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | +import android.view.View; | |
| 4 | 5 | |
| 6 | +import com.cnlive.moudle.pedometer.model.RunningFinishBean; | |
| 5 | 7 | import com.cnlive.moudle.pedometer.ui.fragment.RunningFinishFragment; |
| 6 | 8 | import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; |
| 7 | 9 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| ... | ... | @@ -16,4 +18,33 @@ public class RunningFinishFragmentView implements MvpView { |
| 16 | 18 | public Context getContext() { |
| 17 | 19 | return fragment == null ? null : fragment.getActivity(); |
| 18 | 20 | } |
| 21 | + | |
| 22 | + public void initView(RunningFinishBean runningFinishBean) { | |
| 23 | + //设置距离 | |
| 24 | + fragment.binding.includeFinishUserInfo.tvDistance.setText(runningFinishBean.getRunDistance()); | |
| 25 | + //设置配速 | |
| 26 | + fragment.binding.includeFinishUserInfo.tvSpeed.setText(runningFinishBean.getSpeed()); | |
| 27 | + //设置用时 | |
| 28 | + fragment.binding.includeFinishUserInfo.tvTimer.setText(runningFinishBean.getTime()); | |
| 29 | + //设置日期 | |
| 30 | + fragment.binding.includeFinishUserInfo.tvDate.setText(runningFinishBean.getDate()); | |
| 31 | + //设置步数 | |
| 32 | + fragment.binding.includeFinishStep.tvStep.setText(runningFinishBean.getStep()); | |
| 33 | + //设置起点位置 | |
| 34 | + fragment.binding.includeFinishRunRoute.tvStartPoint.setText(runningFinishBean.getStartPoint()); | |
| 35 | + //设置终点位置 | |
| 36 | + fragment.binding.includeFinishRunRoute.tvEndPoint.setText(runningFinishBean.getEndPoint()); | |
| 37 | + //设置时间 | |
| 38 | + fragment.binding.includeFinishRunRoute.tvTimer.setText(runningFinishBean.getTime()); | |
| 39 | + //返回按钮点击 | |
| 40 | + fragment.binding.flBack.setOnClickListener(new View.OnClickListener() { | |
| 41 | + @Override | |
| 42 | + public void onClick(View view) { | |
| 43 | + if (fragment.getActivity() == null) { | |
| 44 | + return; | |
| 45 | + } | |
| 46 | + fragment.getActivity().finish(); | |
| 47 | + } | |
| 48 | + }); | |
| 49 | + } | |
| 19 | 50 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/model/RunningFinishBean.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.model; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * 跑步结束相关数据 | |
| 7 | + * | |
| 8 | + * @author ShinnyYang | |
| 9 | + */ | |
| 10 | +public class RunningFinishBean implements Serializable { | |
| 11 | + private String runDistance; | |
| 12 | + private String speed; | |
| 13 | + private String time; | |
| 14 | + private String step; | |
| 15 | + private String startPoint; | |
| 16 | + private String endPoint; | |
| 17 | + private String date; | |
| 18 | + | |
| 19 | + public String getRunDistance() { | |
| 20 | + return runDistance; | |
| 21 | + } | |
| 22 | + | |
| 23 | + public void setRunDistance(String runDistance) { | |
| 24 | + this.runDistance = runDistance; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public String getSpeed() { | |
| 28 | + return speed; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void setSpeed(String speed) { | |
| 32 | + this.speed = speed; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public String getTime() { | |
| 36 | + return time; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setTime(String time) { | |
| 40 | + this.time = time; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public String getStep() { | |
| 44 | + return step; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public void setStep(String step) { | |
| 48 | + this.step = step; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public String getStartPoint() { | |
| 52 | + return startPoint; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setStartPoint(String startPoint) { | |
| 56 | + this.startPoint = startPoint; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public String getEndPoint() { | |
| 60 | + return endPoint; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setEndPoint(String endPoint) { | |
| 64 | + this.endPoint = endPoint; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public String getDate() { | |
| 68 | + return date; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setDate(String date) { | |
| 72 | + this.date = date; | |
| 73 | + } | |
| 74 | +} | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/StepService.java
| ... | ... | @@ -360,12 +360,13 @@ public class StepService extends Service implements SensorEventListener { |
| 360 | 360 | // userId=intent.getExtras().getString("userId"); |
| 361 | 361 | userId = MySpHelper.getInstance(getApplicationContext(), Context.MODE_MULTI_PROCESS).getString("userId", ""); |
| 362 | 362 | if (userId != null && !TextUtils.isEmpty(userId)) { |
| 363 | - entityName = userId; | |
| 364 | - initTodayData(userId); | |
| 365 | - initTrace(); | |
| 366 | 363 | if (!EventBus.getDefault().isRegistered(this)) { |
| 367 | 364 | EventBus.getDefault().register(this); |
| 368 | 365 | } |
| 366 | + MySpHelper.getInstance(getApplicationContext(), Context.MODE_MULTI_PROCESS).putBoolean("writeUserStep:" + userId, true); | |
| 367 | + entityName = userId; | |
| 368 | + initTodayData(userId); | |
| 369 | + initTrace(); | |
| 369 | 370 | //显示计步通知 |
| 370 | 371 | showStartForegroundNotification(); |
| 371 | 372 | new Thread(new Runnable() { |
| ... | ... | @@ -532,7 +533,7 @@ public class StepService extends Service implements SensorEventListener { |
| 532 | 533 | if (userId == null || CURRENT_DATE == null) { |
| 533 | 534 | return; |
| 534 | 535 | } |
| 535 | -// //获取当天的数据,用于展示 CURRENT_DATE | |
| 536 | + //获取当天的数据,用于展示 CURRENT_DATE | |
| 536 | 537 | List<UserStepEntity> list = DbCore.getDaoSession().getUserStepEntityDao().queryBuilder().where(UserStepEntityDao.Properties.UserId.eq(userId), UserStepEntityDao.Properties.Date.eq(CURRENT_DATE)).list(); |
| 537 | 538 | if (list == null) { |
| 538 | 539 | return; |
| ... | ... | @@ -895,10 +896,10 @@ public class StepService extends Service implements SensorEventListener { |
| 895 | 896 | * 保存记步数据 |
| 896 | 897 | */ |
| 897 | 898 | private void save() { |
| 898 | -// boolean isWriteUserStep = MySpHelper.getInstance(getApplicationContext(), Context.MODE_MULTI_PROCESS).getBoolean("writeUserStep:" + userId, false); | |
| 899 | -// if (!isWriteUserStep) { | |
| 900 | -// return; | |
| 901 | -// } | |
| 899 | + boolean isWriteUserStep = MySpHelper.getInstance(getApplicationContext(), Context.MODE_MULTI_PROCESS).getBoolean("writeUserStep:" + userId, false); | |
| 900 | + if (!isWriteUserStep) { | |
| 901 | + return; | |
| 902 | + } | |
| 902 | 903 | int tempStep = CURRENT_STEP; |
| 903 | 904 | List<UserStepEntity> list = DbCore.getDaoSession().getUserStepEntityDao().queryBuilder().where(UserStepEntityDao.Properties.UserId.eq(userId), UserStepEntityDao.Properties.Date.eq(CURRENT_DATE)).list(); |
| 904 | 905 | if (list.size() == 0 || list.isEmpty()) { | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/PedometerMainActivity.java
| 1 | 1 | package com.cnlive.moudle.pedometer.ui.activity; |
| 2 | 2 | |
| 3 | 3 | import android.Manifest; |
| 4 | +import android.app.Activity; | |
| 4 | 5 | import android.content.Context; |
| 5 | 6 | import android.content.Intent; |
| 6 | 7 | import android.content.pm.PackageInfo; |
| ... | ... | @@ -240,6 +241,7 @@ public class PedometerMainActivity extends QMUIFragmentActivity { |
| 240 | 241 | } |
| 241 | 242 | |
| 242 | 243 | |
| 244 | + | |
| 243 | 245 | @Override |
| 244 | 246 | public void onBackPressed() { |
| 245 | 247 | return; | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/RunningFinishActivity.java
| ... | ... | @@ -9,6 +9,7 @@ import com.alibaba.android.arouter.facade.annotation.Route; |
| 9 | 9 | import com.cnlive.libs.base.ui.QMUIFragment; |
| 10 | 10 | import com.cnlive.libs.base.ui.QMUIFragmentActivity; |
| 11 | 11 | import com.cnlive.libs.base.util.StatusBarUtil2; |
| 12 | +import com.cnlive.moudle.pedometer.model.RunningFinishBean; | |
| 12 | 13 | import com.cnlive.moudle.pedometer.model.RunningMapBean; |
| 13 | 14 | import com.cnlive.moudle.pedometer.ui.fragment.RunRaceDetailFragment; |
| 14 | 15 | import com.cnlive.moudle.pedometer.ui.fragment.RunningFinishFragment; |
| ... | ... | @@ -31,12 +32,15 @@ public class RunningFinishActivity extends QMUIFragmentActivity { |
| 31 | 32 | protected void onCreate(Bundle savedInstanceState) { |
| 32 | 33 | super.onCreate(savedInstanceState); |
| 33 | 34 | StatusBarUtil2.setColor(this, getResources().getColor(R.color.run_main_bg), 0); |
| 34 | - addFragment(); | |
| 35 | + if (getIntent().getSerializableExtra("runningFinishBean") != null) { | |
| 36 | + addFragment((RunningFinishBean) getIntent().getSerializableExtra("runningFinishBean")); | |
| 37 | + } | |
| 38 | + | |
| 35 | 39 | |
| 36 | 40 | } |
| 37 | 41 | |
| 38 | - private void addFragment() { | |
| 39 | - QMUIFragment fragment = new RunningFinishFragment(); | |
| 42 | + private void addFragment(RunningFinishBean runningFinishBean) { | |
| 43 | + QMUIFragment fragment = RunningFinishFragment.instance(runningFinishBean); | |
| 40 | 44 | getSupportFragmentManager().beginTransaction() |
| 41 | 45 | .add(getContextViewId(), fragment, fragment.getClass().getSimpleName()) |
| 42 | 46 | .addToBackStack(fragment.getClass().getSimpleName()) |
| ... | ... | @@ -51,8 +55,9 @@ public class RunningFinishActivity extends QMUIFragmentActivity { |
| 51 | 55 | } |
| 52 | 56 | } |
| 53 | 57 | |
| 54 | - public static void startActivity(Activity activity) { | |
| 58 | + public static void startActivity(Activity activity, RunningFinishBean runningFinishBean) { | |
| 55 | 59 | Intent intent = new Intent(activity, RunningFinishActivity.class); |
| 60 | + intent.putExtra("runningFinishBean", runningFinishBean); | |
| 56 | 61 | activity.startActivity(intent); |
| 57 | 62 | } |
| 58 | 63 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunningFinishFragment.java
| 1 | 1 | package com.cnlive.moudle.pedometer.ui.fragment; |
| 2 | 2 | |
| 3 | +import android.os.Bundle; | |
| 4 | +import android.support.annotation.Nullable; | |
| 5 | +import android.view.View; | |
| 6 | + | |
| 3 | 7 | import com.cnlive.libs.base.ui.QMUIFragment; |
| 4 | 8 | import com.cnlive.moudle.pedometer.frame.presenter.RunningFinishFragmetPresenter; |
| 5 | 9 | import com.cnlive.moudle.pedometer.frame.view.RunningFinishFragmentView; |
| 10 | +import com.cnlive.moudle.pedometer.model.RunningFinishBean; | |
| 6 | 11 | import com.example.moudle_pedometer.R; |
| 7 | 12 | import com.example.moudle_pedometer.databinding.FragmentFinishRunMapBinding; |
| 8 | 13 | |
| 9 | 14 | public class RunningFinishFragment extends QMUIFragment<RunningFinishFragmentView, RunningFinishFragmetPresenter, FragmentFinishRunMapBinding> { |
| 15 | + private RunningFinishBean runningFinishBean; | |
| 16 | + | |
| 17 | + public static RunningFinishFragment instance(RunningFinishBean runningFinishBean) { | |
| 18 | + RunningFinishFragment fragment = new RunningFinishFragment(); | |
| 19 | + Bundle bundle = null; | |
| 20 | + if (runningFinishBean != null) { | |
| 21 | + bundle = new Bundle(); | |
| 22 | + bundle.putSerializable("runningFinishBean", runningFinishBean); | |
| 23 | + } | |
| 24 | + fragment.setArguments(bundle); | |
| 25 | + return fragment; | |
| 26 | + } | |
| 27 | + | |
| 10 | 28 | @Override |
| 11 | 29 | protected int getToolbarId() { |
| 12 | 30 | return 0; |
| ... | ... | @@ -21,4 +39,17 @@ public class RunningFinishFragment extends QMUIFragment<RunningFinishFragmentVie |
| 21 | 39 | protected int getLayoutId() { |
| 22 | 40 | return R.layout.fragment_finish_run_map; |
| 23 | 41 | } |
| 42 | + | |
| 43 | + @Override | |
| 44 | + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | |
| 45 | + super.onViewCreated(view, savedInstanceState); | |
| 46 | + if (getArguments() != null) { | |
| 47 | + runningFinishBean = (RunningFinishBean) getArguments().getSerializable("runningFinishBean"); | |
| 48 | + if (runningFinishBean != null) { | |
| 49 | + if (getMvpView() != null) { | |
| 50 | + getMvpView().initView(runningFinishBean); | |
| 51 | + } | |
| 52 | + } | |
| 53 | + } | |
| 54 | + } | |
| 24 | 55 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/TimeUtil.java
| 1 | 1 | package com.cnlive.moudle.pedometer.utils; |
| 2 | 2 | |
| 3 | +import java.text.ParseException; | |
| 4 | +import java.text.SimpleDateFormat; | |
| 5 | +import java.util.Date; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * @author ShinnyYang | |
| 9 | + */ | |
| 3 | 10 | public class TimeUtil { |
| 4 | 11 | /** |
| 5 | 12 | * 获取当前时间戳(单位:秒) |
| ... | ... | @@ -10,4 +17,84 @@ public class TimeUtil { |
| 10 | 17 | return System.currentTimeMillis() / 1000; |
| 11 | 18 | } |
| 12 | 19 | |
| 20 | + /** | |
| 21 | + * 日期格式字符串转换成时间戳 | |
| 22 | + * | |
| 23 | + * @param dateStr 字符串日期 | |
| 24 | + * @return | |
| 25 | + */ | |
| 26 | + public static long DateToTimeStamp(String dateStr) { | |
| 27 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 28 | + try { | |
| 29 | + Date date = simpleDateFormat.parse(dateStr); | |
| 30 | + long ts = date.getTime() / 1000; | |
| 31 | + return ts; | |
| 32 | + } catch (ParseException e) { | |
| 33 | + return 0; | |
| 34 | + } | |
| 35 | + } | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 取得当前时间戳(精确到秒) | |
| 39 | + * | |
| 40 | + * @return time(long型的时间) | |
| 41 | + */ | |
| 42 | + public static long getNowTimeStamp() { | |
| 43 | + long time = System.currentTimeMillis() / 1000; | |
| 44 | + return time; | |
| 45 | + } | |
| 46 | + | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 取得当前格式化的时间戳 | |
| 50 | + * | |
| 51 | + * @return 格式化后的日期 | |
| 52 | + */ | |
| 53 | + public static String getFormatNowTime() { | |
| 54 | + SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm"); | |
| 55 | + long time = System.currentTimeMillis(); | |
| 56 | + return df.format(time); | |
| 57 | + } | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 取得指定时间的格式化的时间戳(精确到秒) | |
| 61 | + * | |
| 62 | + * @return 格式化后的日期 | |
| 63 | + */ | |
| 64 | + public static String getFormatTimeStamp(String timeType) { | |
| 65 | + SimpleDateFormat df = new SimpleDateFormat(timeType); | |
| 66 | + long time = System.currentTimeMillis(); | |
| 67 | + return df.format(time); | |
| 68 | + } | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * 取得指定时间的格式化的时间戳(精确到秒) | |
| 72 | + * | |
| 73 | + * @return 格式化后的日期 | |
| 74 | + */ | |
| 75 | + public static String getStampToTime(long time) { | |
| 76 | + String res; | |
| 77 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 78 | + long lt = new Long(time * 1000); | |
| 79 | + Date date = new Date(lt); | |
| 80 | + res = simpleDateFormat.format(date); | |
| 81 | + return res; | |
| 82 | + } | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * 计算时间差 | |
| 86 | + * | |
| 87 | + * @return | |
| 88 | + */ | |
| 89 | + public static String getWorkTime(long startTime, long workTime) { | |
| 90 | + int days = (int) ((workTime - startTime) / (1000 * 60 * 60 * 24)); | |
| 91 | + int hours = (int) ((workTime - startTime) / (1000 * 60 * 60)); | |
| 92 | + int minute = (int) ((workTime - startTime) / (1000 * 60)); | |
| 93 | + return "据上班时间还有:" + hours + "小时," + minute + "分钟"; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public static String getCurrentTimeStr(String formate) { | |
| 97 | + SimpleDateFormat df = new SimpleDateFormat(formate); | |
| 98 | + return df.format(new Date()); | |
| 99 | + } | |
| 13 | 100 | } | ... | ... |
moudle_pedometer/src/main/res/drawable-hdpi/xqt_share.png
0 → 100644
2.84 KB
moudle_pedometer/src/main/res/drawable-hdpi/xqy_return.png
0 → 100644
2.39 KB
moudle_pedometer/src/main/res/drawable-xhdpi/xqt_share.png
0 → 100644
2.34 KB
moudle_pedometer/src/main/res/drawable-xhdpi/xqy_return.png
0 → 100644
2.16 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/xqt_share.png
0 → 100644
7.72 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/xqy_return.png
0 → 100644
6.58 KB
moudle_pedometer/src/main/res/drawable/shape_10dp_white_raduis_bg.xml
moudle_pedometer/src/main/res/layout/fragment_finish_run_map.xml
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | sothree:umanoDragView="@+id/dragView" |
| 11 | 11 | sothree:umanoFadeColor="@color/black_20" |
| 12 | 12 | sothree:umanoOverlay="true" |
| 13 | - sothree:umanoPanelHeight="220dp" | |
| 13 | + sothree:umanoPanelHeight="360dp" | |
| 14 | 14 | sothree:umanoParallaxOffset="100dp" |
| 15 | 15 | sothree:umanoScrollableView="@+id/scrollView" |
| 16 | 16 | sothree:umanoShadowHeight="0dp"> | ... | ... |
moudle_pedometer/src/main/res/layout/fragment_run_race_detail.xml
| ... | ... | @@ -25,32 +25,22 @@ |
| 25 | 25 | android:layout_width="match_parent" |
| 26 | 26 | android:layout_height="match_parent"></com.baidu.mapapi.map.MapView> |
| 27 | 27 | |
| 28 | - <FrameLayout | |
| 29 | - android:layout_width="40dp" | |
| 30 | - android:layout_height="40dp" | |
| 28 | + | |
| 29 | + <ImageView | |
| 30 | + android:id="@+id/iv_back" | |
| 31 | + android:layout_width="35dp" | |
| 32 | + android:layout_height="35dp" | |
| 31 | 33 | android:layout_margin="10dp" |
| 32 | - android:background="@drawable/shape_circle_50_black"> | |
| 33 | - | |
| 34 | - <ImageView | |
| 35 | - android:layout_width="10dp" | |
| 36 | - android:layout_height="20dp" | |
| 37 | - android:layout_gravity="center" | |
| 38 | - android:background="@drawable/ic_white_back" /> | |
| 39 | - </FrameLayout> | |
| 40 | - | |
| 41 | - <FrameLayout | |
| 42 | - android:layout_width="40dp" | |
| 43 | - android:layout_height="40dp" | |
| 34 | + android:background="@drawable/xqy_return" /> | |
| 35 | + | |
| 36 | + | |
| 37 | + <ImageView | |
| 38 | + android:id="@+id/iv_share" | |
| 39 | + android:layout_width="35dp" | |
| 40 | + android:layout_height="35dp" | |
| 44 | 41 | android:layout_gravity="right" |
| 45 | 42 | android:layout_margin="10dp" |
| 46 | - android:background="@drawable/shape_circle_50_black"> | |
| 47 | - | |
| 48 | - <ImageView | |
| 49 | - android:layout_width="15dp" | |
| 50 | - android:layout_height="15dp" | |
| 51 | - android:layout_gravity="center" | |
| 52 | - android:background="@drawable/icon_share" /> | |
| 53 | - </FrameLayout> | |
| 43 | + android:background="@drawable/xqt_share" /> | |
| 54 | 44 | <!----> |
| 55 | 45 | |
| 56 | 46 | ... | ... |
moudle_pedometer/src/main/res/layout/layout_finish_running_route.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | - android:layout_width="match_parent" | |
| 4 | - android:layout_height="wrap_content" | |
| 5 | - android:layout_margin="10dp" | |
| 6 | - android:background="@drawable/shape_10dp_white_raduis_bg" | |
| 7 | - android:orientation="vertical"> | |
| 8 | - <!--跑步路线--> | |
| 9 | - <LinearLayout | |
| 10 | - android:layout_width="match_parent" | |
| 11 | - android:layout_height="wrap_content" | |
| 12 | - android:layout_marginTop="10dp" | |
| 13 | - android:gravity="bottom"> | |
| 14 | - | |
| 15 | - <ImageView | |
| 16 | - android:layout_width="18dp" | |
| 17 | - android:layout_height="18dp" | |
| 18 | - android:layout_marginLeft="10dp" | |
| 19 | - android:background="@drawable/icon_run_route" /> | |
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 20 | 3 | |
| 21 | - <TextView | |
| 22 | - android:layout_width="wrap_content" | |
| 23 | - android:layout_height="match_parent" | |
| 24 | - android:layout_marginLeft="5dp" | |
| 25 | - android:layout_marginBottom="1dp" | |
| 26 | - android:gravity="bottom" | |
| 27 | - android:text="跑步路线" | |
| 28 | - android:textColor="@color/text_black" | |
| 29 | - android:textSize="12sp" /> | |
| 30 | - </LinearLayout> | |
| 31 | - <!--起点--> | |
| 32 | 4 | <LinearLayout |
| 33 | 5 | android:layout_width="match_parent" |
| 34 | 6 | android:layout_height="wrap_content" |
| 35 | - android:layout_marginTop="10dp" | |
| 36 | - android:gravity="center_vertical"> | |
| 37 | - | |
| 38 | - <View | |
| 39 | - android:layout_width="6dp" | |
| 40 | - android:layout_height="6dp" | |
| 41 | - android:layout_marginLeft="15dp" | |
| 42 | - android:background="@drawable/shape_circle_green" /> | |
| 43 | - | |
| 44 | - <TextView | |
| 45 | - android:layout_width="wrap_content" | |
| 46 | - android:layout_height="wrap_content" | |
| 47 | - android:layout_marginLeft="10dp" | |
| 48 | - android:text="@string/layout_street_start_point" | |
| 49 | - android:textColor="@color/text_gray" | |
| 50 | - android:textSize="12sp" /> | |
| 51 | - | |
| 52 | - <TextView | |
| 53 | - android:id="@+id/tv_start_point" | |
| 54 | - android:layout_width="wrap_content" | |
| 7 | + android:layout_margin="10dp" | |
| 8 | + android:background="@drawable/shape_10dp_white_raduis_bg" | |
| 9 | + android:orientation="vertical"> | |
| 10 | + <!--跑步路线--> | |
| 11 | + <LinearLayout | |
| 12 | + android:layout_width="match_parent" | |
| 55 | 13 | android:layout_height="wrap_content" |
| 56 | - android:layout_marginLeft="10dp" | |
| 57 | - android:text="首都师范大学操场东门" | |
| 58 | - android:textColor="@color/black" | |
| 59 | - android:textSize="12sp" /> | |
| 60 | - </LinearLayout> | |
| 61 | - <!--竖线--> | |
| 62 | - <View | |
| 63 | - android:layout_width="1dp" | |
| 64 | - android:layout_height="18dp" | |
| 65 | - android:layout_marginLeft="17dp" | |
| 66 | - android:layout_marginTop="-3dp" | |
| 67 | - android:background="@color/vertical_line" /> | |
| 68 | - <!--终点--> | |
| 69 | - <LinearLayout | |
| 70 | - android:layout_width="match_parent" | |
| 71 | - android:layout_height="wrap_content" | |
| 72 | - android:layout_marginTop="-3dp" | |
| 73 | - android:gravity="center_vertical"> | |
| 14 | + android:layout_marginTop="10dp" | |
| 15 | + android:gravity="bottom"> | |
| 74 | 16 | |
| 75 | - <View | |
| 76 | - android:layout_width="6dp" | |
| 77 | - android:layout_height="6dp" | |
| 78 | - android:layout_marginLeft="15dp" | |
| 79 | - android:background="@drawable/shape_circle_red" /> | |
| 17 | + <ImageView | |
| 18 | + android:layout_width="18dp" | |
| 19 | + android:layout_height="18dp" | |
| 20 | + android:layout_marginLeft="10dp" | |
| 21 | + android:background="@drawable/icon_run_route" /> | |
| 80 | 22 | |
| 81 | - <TextView | |
| 82 | - android:layout_width="wrap_content" | |
| 23 | + <TextView | |
| 24 | + android:layout_width="wrap_content" | |
| 25 | + android:layout_height="match_parent" | |
| 26 | + android:layout_marginLeft="5dp" | |
| 27 | + android:layout_marginBottom="1dp" | |
| 28 | + android:gravity="bottom" | |
| 29 | + android:text="跑步路线" | |
| 30 | + android:textColor="@color/text_black" | |
| 31 | + android:textSize="12sp" /> | |
| 32 | + </LinearLayout> | |
| 33 | + <!--起点--> | |
| 34 | + <LinearLayout | |
| 35 | + android:layout_width="match_parent" | |
| 83 | 36 | android:layout_height="wrap_content" |
| 84 | - android:layout_marginLeft="10dp" | |
| 85 | - android:text="@string/layout_street_end_point" | |
| 86 | - android:textColor="@color/text_gray" | |
| 87 | - android:textSize="12sp" /> | |
| 37 | + android:layout_marginTop="10dp" | |
| 38 | + android:gravity="center_vertical"> | |
| 88 | 39 | |
| 89 | - <TextView | |
| 90 | - android:id="@+id/tv_end_point" | |
| 91 | - android:layout_width="wrap_content" | |
| 92 | - android:layout_height="wrap_content" | |
| 93 | - android:layout_marginLeft="10dp" | |
| 94 | - android:text="首都师范大学操场东门" | |
| 95 | - android:textColor="@color/black" | |
| 96 | - android:textSize="12sp" /> | |
| 97 | - </LinearLayout> | |
| 98 | - <!--竖线--> | |
| 99 | - <View | |
| 100 | - android:layout_width="1dp" | |
| 101 | - android:layout_height="25dp" | |
| 102 | - android:layout_marginLeft="17dp" | |
| 103 | - android:layout_marginTop="-3dp" | |
| 104 | - android:background="@color/vertical_line" /> | |
| 105 | - <!--时间--> | |
| 106 | - <LinearLayout | |
| 107 | - android:layout_width="match_parent" | |
| 108 | - android:layout_height="wrap_content" | |
| 109 | - android:layout_marginTop="-15dp" | |
| 110 | - android:gravity="center_vertical"> | |
| 40 | + <View | |
| 41 | + android:layout_width="6dp" | |
| 42 | + android:layout_height="6dp" | |
| 43 | + android:layout_marginLeft="15dp" | |
| 44 | + android:background="@drawable/shape_circle_green" /> | |
| 111 | 45 | |
| 112 | - <View | |
| 113 | - android:layout_width="4dp" | |
| 114 | - android:layout_height="4dp" | |
| 115 | - android:layout_marginLeft="16dp" | |
| 116 | - android:background="@drawable/shape_circle_gray" /> | |
| 46 | + <TextView | |
| 47 | + android:layout_width="wrap_content" | |
| 48 | + android:layout_height="wrap_content" | |
| 49 | + android:layout_marginLeft="10dp" | |
| 50 | + android:text="@string/layout_street_start_point" | |
| 51 | + android:textColor="@color/text_gray" | |
| 52 | + android:textSize="12sp" /> | |
| 117 | 53 | |
| 54 | + <TextView | |
| 55 | + android:id="@+id/tv_start_point" | |
| 56 | + android:layout_width="wrap_content" | |
| 57 | + android:layout_height="wrap_content" | |
| 58 | + android:layout_marginLeft="10dp" | |
| 59 | + android:text="首都师范大学操场东门" | |
| 60 | + android:textColor="@color/black" | |
| 61 | + android:textSize="12sp" /> | |
| 62 | + </LinearLayout> | |
| 63 | + <!--竖线--> | |
| 64 | + <View | |
| 65 | + android:layout_width="1dp" | |
| 66 | + android:layout_height="18dp" | |
| 67 | + android:layout_marginLeft="17dp" | |
| 68 | + android:layout_marginTop="-3dp" | |
| 69 | + android:background="@color/vertical_line" /> | |
| 70 | + <!--终点--> | |
| 118 | 71 | <LinearLayout |
| 119 | 72 | android:layout_width="match_parent" |
| 120 | 73 | android:layout_height="wrap_content" |
| 121 | - android:orientation="vertical"> | |
| 74 | + android:layout_marginTop="-3dp" | |
| 75 | + android:gravity="center_vertical"> | |
| 76 | + | |
| 77 | + <View | |
| 78 | + android:layout_width="6dp" | |
| 79 | + android:layout_height="6dp" | |
| 80 | + android:layout_marginLeft="15dp" | |
| 81 | + android:background="@drawable/shape_circle_red" /> | |
| 122 | 82 | |
| 123 | 83 | <TextView |
| 124 | - android:id="@+id/tv_timer" | |
| 125 | 84 | android:layout_width="wrap_content" |
| 126 | 85 | android:layout_height="wrap_content" |
| 127 | 86 | android:layout_marginLeft="10dp" |
| 128 | - android:layout_marginTop="5dp" | |
| 129 | - android:text="00:27:23" | |
| 130 | - android:textColor="@color/text_black" | |
| 131 | - android:textSize="18sp" | |
| 132 | - android:textStyle="bold" /> | |
| 87 | + android:text="@string/layout_street_end_point" | |
| 88 | + android:textColor="@color/text_gray" | |
| 89 | + android:textSize="12sp" /> | |
| 133 | 90 | |
| 134 | 91 | <TextView |
| 92 | + android:id="@+id/tv_end_point" | |
| 135 | 93 | android:layout_width="wrap_content" |
| 136 | 94 | android:layout_height="wrap_content" |
| 137 | - android:layout_marginLeft="11dp" | |
| 138 | - android:text="跑步记录时长" | |
| 139 | - android:textColor="@color/text_gray" | |
| 140 | - android:textSize="11sp" /> | |
| 141 | - <!----> | |
| 95 | + android:layout_marginLeft="10dp" | |
| 96 | + android:text="首都师范大学操场东门" | |
| 97 | + android:textColor="@color/black" | |
| 98 | + android:textSize="12sp" /> | |
| 142 | 99 | </LinearLayout> |
| 143 | - </LinearLayout> | |
| 144 | - <!--竖线--> | |
| 145 | - <View | |
| 146 | - android:layout_width="1dp" | |
| 147 | - android:layout_height="25dp" | |
| 148 | - android:layout_marginLeft="17dp" | |
| 149 | - android:layout_marginTop="-15dp" | |
| 150 | - android:background="@color/vertical_line" /> | |
| 151 | - <!----> | |
| 152 | - <LinearLayout | |
| 153 | - android:layout_width="match_parent" | |
| 154 | - android:layout_height="wrap_content" | |
| 155 | - android:layout_marginTop="-5dp" | |
| 156 | - android:layout_marginBottom="10dp" | |
| 157 | - android:gravity="center_vertical" | |
| 158 | - android:paddingTop="5dp"> | |
| 159 | - | |
| 100 | + <!--竖线--> | |
| 160 | 101 | <View |
| 161 | - android:layout_width="4dp" | |
| 162 | - android:layout_height="4dp" | |
| 163 | - android:layout_marginLeft="16dp" | |
| 164 | - android:background="@drawable/shape_circle_gray" /> | |
| 102 | + android:layout_width="1dp" | |
| 103 | + android:layout_height="25dp" | |
| 104 | + android:layout_marginLeft="17dp" | |
| 105 | + android:layout_marginTop="-3dp" | |
| 106 | + android:background="@color/vertical_line" /> | |
| 107 | + <!--时间--> | |
| 108 | + <LinearLayout | |
| 109 | + android:layout_width="match_parent" | |
| 110 | + android:layout_height="wrap_content" | |
| 111 | + android:layout_marginTop="-15dp" | |
| 112 | + android:gravity="center_vertical"> | |
| 113 | + | |
| 114 | + <View | |
| 115 | + android:layout_width="4dp" | |
| 116 | + android:layout_height="4dp" | |
| 117 | + android:layout_marginLeft="16dp" | |
| 118 | + android:background="@drawable/shape_circle_gray" /> | |
| 119 | + | |
| 120 | + <LinearLayout | |
| 121 | + android:layout_width="match_parent" | |
| 122 | + android:layout_height="wrap_content" | |
| 123 | + android:orientation="vertical"> | |
| 124 | + | |
| 125 | + <TextView | |
| 126 | + android:id="@+id/tv_timer" | |
| 127 | + android:layout_width="wrap_content" | |
| 128 | + android:layout_height="wrap_content" | |
| 129 | + android:layout_marginLeft="10dp" | |
| 130 | + android:layout_marginTop="5dp" | |
| 131 | + android:text="00:27:23" | |
| 132 | + android:textColor="@color/text_black" | |
| 133 | + android:textSize="18sp" | |
| 134 | + android:textStyle="bold" /> | |
| 165 | 135 | |
| 166 | - <TextView | |
| 167 | - android:layout_width="wrap_content" | |
| 136 | + <TextView | |
| 137 | + android:layout_width="wrap_content" | |
| 138 | + android:layout_height="wrap_content" | |
| 139 | + android:layout_marginLeft="11dp" | |
| 140 | + android:text="跑步记录时长" | |
| 141 | + android:textColor="@color/text_gray" | |
| 142 | + android:textSize="11sp" /> | |
| 143 | + <!----> | |
| 144 | + </LinearLayout> | |
| 145 | + </LinearLayout> | |
| 146 | + <!--竖线--> | |
| 147 | + <View | |
| 148 | + android:layout_width="1dp" | |
| 149 | + android:layout_height="25dp" | |
| 150 | + android:layout_marginLeft="17dp" | |
| 151 | + android:layout_marginTop="-15dp" | |
| 152 | + android:background="@color/vertical_line" /> | |
| 153 | + <!----> | |
| 154 | + <LinearLayout | |
| 155 | + android:layout_width="match_parent" | |
| 168 | 156 | android:layout_height="wrap_content" |
| 169 | - android:layout_marginLeft="10dp" | |
| 170 | - android:text="路线完成" | |
| 171 | - android:textColor="@color/text_gray" | |
| 172 | - android:textSize="11sp" /> | |
| 157 | + android:layout_marginTop="-5dp" | |
| 158 | + android:layout_marginBottom="10dp" | |
| 159 | + android:gravity="center_vertical" | |
| 160 | + android:paddingTop="5dp"> | |
| 161 | + | |
| 162 | + <View | |
| 163 | + android:layout_width="4dp" | |
| 164 | + android:layout_height="4dp" | |
| 165 | + android:layout_marginLeft="16dp" | |
| 166 | + android:background="@drawable/shape_circle_gray" /> | |
| 167 | + | |
| 168 | + <TextView | |
| 169 | + android:layout_width="wrap_content" | |
| 170 | + android:layout_height="wrap_content" | |
| 171 | + android:layout_marginLeft="10dp" | |
| 172 | + android:text="路线完成" | |
| 173 | + android:textColor="@color/text_gray" | |
| 174 | + android:textSize="11sp" /> | |
| 175 | + </LinearLayout> | |
| 176 | + <!----> | |
| 173 | 177 | </LinearLayout> |
| 174 | - <!----> | |
| 175 | -</LinearLayout> | |
| 176 | 178 | \ No newline at end of file |
| 179 | +</layout> | |
| 177 | 180 | \ No newline at end of file | ... | ... |
moudle_pedometer/src/main/res/layout/layout_finish_step.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | - android:layout_width="match_parent" | |
| 4 | - android:layout_height="80dp" | |
| 5 | - android:layout_margin="10dp" | |
| 6 | - android:background="@drawable/shape_10dp_white_raduis_bg" | |
| 7 | - android:orientation="vertical"> | |
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 8 | 3 | |
| 9 | 4 | <LinearLayout |
| 10 | - android:layout_width="wrap_content" | |
| 11 | - android:layout_height="wrap_content" | |
| 12 | - android:layout_marginLeft="10dp" | |
| 13 | - android:layout_marginTop="10dp" | |
| 14 | - android:gravity="bottom"> | |
| 15 | - | |
| 16 | - <ImageView | |
| 17 | - android:layout_width="16dp" | |
| 18 | - android:layout_height="18dp" | |
| 19 | - android:background="@drawable/icon_step" /> | |
| 5 | + android:layout_width="match_parent" | |
| 6 | + android:layout_height="80dp" | |
| 7 | + android:layout_margin="10dp" | |
| 8 | + android:background="@drawable/shape_10dp_white_raduis_bg" | |
| 9 | + android:orientation="vertical"> | |
| 20 | 10 | |
| 21 | - <TextView | |
| 11 | + <LinearLayout | |
| 22 | 12 | android:layout_width="wrap_content" |
| 23 | 13 | android:layout_height="wrap_content" |
| 24 | 14 | android:layout_marginLeft="10dp" |
| 25 | - android:text="总步数" | |
| 26 | - android:textSize="12sp" /> | |
| 27 | - </LinearLayout> | |
| 28 | - <!----> | |
| 29 | - <LinearLayout | |
| 30 | - android:layout_width="match_parent" | |
| 31 | - android:layout_height="match_parent" | |
| 32 | - android:gravity="center" | |
| 33 | - android:paddingBottom="10dp"> | |
| 15 | + android:layout_marginTop="10dp" | |
| 16 | + android:gravity="bottom"> | |
| 34 | 17 | |
| 35 | - <TextView | |
| 36 | - android:id="@+id/tv_step" | |
| 37 | - android:layout_width="wrap_content" | |
| 38 | - android:layout_height="wrap_content" | |
| 39 | - android:text="1233" | |
| 40 | - android:textColor="@color/green_round" | |
| 41 | - android:textSize="28sp" | |
| 42 | - android:textStyle="bold" /> | |
| 18 | + <ImageView | |
| 19 | + android:layout_width="16dp" | |
| 20 | + android:layout_height="18dp" | |
| 21 | + android:background="@drawable/icon_step" /> | |
| 43 | 22 | |
| 44 | - <TextView | |
| 45 | - android:layout_width="wrap_content" | |
| 46 | - android:layout_height="wrap_content" | |
| 47 | - android:layout_marginLeft="10dp" | |
| 48 | - android:layout_marginTop="4dp" | |
| 49 | - android:text="步" | |
| 50 | - android:textColor="@color/text_black" | |
| 51 | - android:textSize="12sp" /> | |
| 23 | + <TextView | |
| 24 | + android:layout_width="wrap_content" | |
| 25 | + android:layout_height="wrap_content" | |
| 26 | + android:layout_marginLeft="10dp" | |
| 27 | + android:text="总步数" | |
| 28 | + android:textSize="12sp" /> | |
| 29 | + </LinearLayout> | |
| 30 | + <!----> | |
| 31 | + <LinearLayout | |
| 32 | + android:layout_width="match_parent" | |
| 33 | + android:layout_height="match_parent" | |
| 34 | + android:gravity="center" | |
| 35 | + android:paddingBottom="10dp"> | |
| 36 | + | |
| 37 | + <TextView | |
| 38 | + android:id="@+id/tv_step" | |
| 39 | + android:layout_width="wrap_content" | |
| 40 | + android:layout_height="wrap_content" | |
| 41 | + android:text="1233" | |
| 42 | + android:textColor="@color/green_round" | |
| 43 | + android:textSize="28sp" | |
| 44 | + android:textStyle="bold" /> | |
| 45 | + | |
| 46 | + <TextView | |
| 47 | + android:layout_width="wrap_content" | |
| 48 | + android:layout_height="wrap_content" | |
| 49 | + android:layout_marginLeft="10dp" | |
| 50 | + android:layout_marginTop="4dp" | |
| 51 | + android:text="步" | |
| 52 | + android:textColor="@color/text_black" | |
| 53 | + android:textSize="12sp" /> | |
| 54 | + </LinearLayout> | |
| 55 | + <!----> | |
| 52 | 56 | </LinearLayout> |
| 53 | - <!----> | |
| 54 | -</LinearLayout> | |
| 55 | 57 | \ No newline at end of file |
| 58 | +</layout> | |
| 56 | 59 | \ No newline at end of file | ... | ... |
moudle_pedometer/src/main/res/layout/layout_finish_user_info.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 4 | - android:layout_width="match_parent" | |
| 5 | - android:layout_height="match_parent" | |
| 6 | - android:layout_margin="10dp"> | |
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 7 | 3 | |
| 8 | - <LinearLayout | |
| 4 | + <FrameLayout xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 9 | 5 | android:layout_width="match_parent" |
| 10 | - android:layout_height="170dp" | |
| 11 | - android:layout_marginTop="30dp" | |
| 12 | - android:background="@drawable/shape_10dp_white_raduis_bg" | |
| 13 | - android:orientation="vertical"> | |
| 6 | + android:layout_height="match_parent" | |
| 7 | + android:layout_margin="10dp"> | |
| 14 | 8 | |
| 15 | - <TextView | |
| 16 | - android:id="@+id/tv_user_nickName" | |
| 17 | - android:layout_width="wrap_content" | |
| 18 | - android:layout_height="wrap_content" | |
| 19 | - android:layout_marginLeft="80dp" | |
| 20 | - android:layout_marginTop="10dp" | |
| 21 | - android:text="用户昵称" | |
| 22 | - android:textColor="@color/text_black" | |
| 23 | - android:textSize="13sp" /> | |
| 24 | - <!----> | |
| 25 | 9 | <LinearLayout |
| 26 | 10 | android:layout_width="match_parent" |
| 27 | - android:layout_height="wrap_content" | |
| 28 | - android:gravity="center_vertical"> | |
| 11 | + android:layout_height="170dp" | |
| 12 | + android:layout_marginTop="30dp" | |
| 13 | + android:background="@drawable/shape_10dp_white_raduis_bg" | |
| 14 | + android:orientation="vertical"> | |
| 29 | 15 | |
| 30 | - <LinearLayout | |
| 31 | - android:layout_width="0dp" | |
| 16 | + <TextView | |
| 17 | + android:id="@+id/tv_user_nickName" | |
| 18 | + android:layout_width="wrap_content" | |
| 32 | 19 | android:layout_height="wrap_content" |
| 33 | - android:layout_weight="1" | |
| 34 | - android:orientation="vertical"> | |
| 35 | - | |
| 36 | - <TextView | |
| 37 | - android:id="@+id/tv_street_name" | |
| 38 | - android:layout_width="wrap_content" | |
| 39 | - android:layout_height="wrap_content" | |
| 40 | - android:layout_marginLeft="15dp" | |
| 41 | - android:layout_marginTop="15dp" | |
| 42 | - android:text="奥森公园南路" | |
| 43 | - android:textColor="@color/text_black" | |
| 44 | - android:textSize="15sp" /> | |
| 45 | - | |
| 46 | - <TextView | |
| 47 | - android:id="@+id/tv_date" | |
| 48 | - android:layout_width="wrap_content" | |
| 49 | - android:layout_height="wrap_content" | |
| 50 | - android:layout_marginLeft="15dp" | |
| 51 | - android:layout_marginTop="5dp" | |
| 52 | - android:text="2019/06/10 9:51" | |
| 53 | - android:textSize="10sp" | |
| 54 | - android:textColor="@color/text_gray" /> | |
| 55 | - </LinearLayout> | |
| 20 | + android:layout_marginLeft="80dp" | |
| 21 | + android:layout_marginTop="10dp" | |
| 22 | + android:text="用户昵称" | |
| 23 | + android:textColor="@color/text_black" | |
| 24 | + android:textSize="13sp" /> | |
| 56 | 25 | <!----> |
| 57 | 26 | <LinearLayout |
| 58 | - android:layout_width="0dp" | |
| 27 | + android:layout_width="match_parent" | |
| 59 | 28 | android:layout_height="wrap_content" |
| 60 | - android:layout_weight="1" | |
| 61 | - android:gravity="right|bottom"> | |
| 29 | + android:gravity="center_vertical"> | |
| 62 | 30 | |
| 63 | - <TextView | |
| 64 | - android:id="@+id/tv_distance" | |
| 65 | - android:layout_width="wrap_content" | |
| 31 | + <LinearLayout | |
| 32 | + android:layout_width="0dp" | |
| 66 | 33 | android:layout_height="wrap_content" |
| 67 | - android:layout_marginRight="10dp" | |
| 68 | - android:text="1.53" | |
| 69 | - android:textColor="@color/text_black" | |
| 70 | - android:textSize="45sp" | |
| 71 | - android:textStyle="bold" /> | |
| 34 | + android:layout_weight="1" | |
| 35 | + android:orientation="vertical"> | |
| 72 | 36 | |
| 73 | - <TextView | |
| 74 | - android:layout_width="wrap_content" | |
| 75 | - android:layout_height="wrap_content" | |
| 76 | - android:layout_marginRight="15dp" | |
| 77 | - android:text="公里" | |
| 78 | - android:textColor="@color/text_black" | |
| 79 | - android:textSize="15sp" /> | |
| 80 | - </LinearLayout> | |
| 81 | - <!----> | |
| 82 | - </LinearLayout> | |
| 83 | - <!--横线--> | |
| 84 | - <View | |
| 85 | - android:layout_width="match_parent" | |
| 86 | - android:layout_height="1dp" | |
| 87 | - android:layout_marginTop="10dp" | |
| 88 | - android:background="@color/line" /> | |
| 89 | - <!--配速和用时--> | |
| 90 | - <LinearLayout | |
| 91 | - android:layout_width="match_parent" | |
| 92 | - android:layout_height="wrap_content" | |
| 93 | - android:layout_marginTop="10sp"> | |
| 94 | - <!----> | |
| 95 | - <LinearLayout | |
| 96 | - android:layout_width="0dp" | |
| 97 | - android:layout_height="wrap_content" | |
| 98 | - android:layout_weight="1" | |
| 99 | - android:gravity="center" | |
| 100 | - android:orientation="vertical"> | |
| 37 | + <TextView | |
| 38 | + android:id="@+id/tv_street_name" | |
| 39 | + android:layout_width="wrap_content" | |
| 40 | + android:layout_height="wrap_content" | |
| 41 | + android:layout_marginLeft="15dp" | |
| 42 | + android:layout_marginTop="15dp" | |
| 43 | + android:text="奥森公园南路" | |
| 44 | + android:textColor="@color/text_black" | |
| 45 | + android:textSize="15sp" /> | |
| 101 | 46 | |
| 102 | - <TextView | |
| 103 | - android:id="@+id/tv_speed" | |
| 104 | - android:layout_width="wrap_content" | |
| 47 | + <TextView | |
| 48 | + android:id="@+id/tv_date" | |
| 49 | + android:layout_width="wrap_content" | |
| 50 | + android:layout_height="wrap_content" | |
| 51 | + android:layout_marginLeft="15dp" | |
| 52 | + android:layout_marginTop="5dp" | |
| 53 | + android:text="2019/06/10 9:51" | |
| 54 | + android:textColor="@color/text_gray" | |
| 55 | + android:textSize="10sp" /> | |
| 56 | + </LinearLayout> | |
| 57 | + <!----> | |
| 58 | + <LinearLayout | |
| 59 | + android:layout_width="0dp" | |
| 105 | 60 | android:layout_height="wrap_content" |
| 106 | - android:text="34'33''" | |
| 107 | - android:textColor="@color/text_black" | |
| 108 | - android:textSize="20sp" | |
| 109 | - android:textStyle="bold" /> | |
| 61 | + android:layout_weight="1" | |
| 62 | + android:gravity="right|bottom"> | |
| 110 | 63 | |
| 111 | - <TextView | |
| 112 | - android:layout_width="wrap_content" | |
| 113 | - android:layout_height="wrap_content" | |
| 114 | - android:layout_marginTop="5dp" | |
| 115 | - android:text="配速" | |
| 116 | - android:textColor="@color/text_black" | |
| 117 | - android:textSize="15sp" /> | |
| 64 | + <TextView | |
| 65 | + android:id="@+id/tv_distance" | |
| 66 | + android:layout_width="wrap_content" | |
| 67 | + android:layout_height="wrap_content" | |
| 68 | + android:layout_marginRight="10dp" | |
| 69 | + android:text="1.53" | |
| 70 | + android:textColor="@color/text_black" | |
| 71 | + android:textSize="45sp" | |
| 72 | + android:textStyle="bold" /> | |
| 73 | + | |
| 74 | + <TextView | |
| 75 | + android:layout_width="wrap_content" | |
| 76 | + android:layout_height="wrap_content" | |
| 77 | + android:layout_marginRight="15dp" | |
| 78 | + android:text="公里" | |
| 79 | + android:textColor="@color/text_black" | |
| 80 | + android:textSize="15sp" /> | |
| 81 | + </LinearLayout> | |
| 82 | + <!----> | |
| 118 | 83 | </LinearLayout> |
| 119 | - <!----> | |
| 84 | + <!--横线--> | |
| 85 | + <View | |
| 86 | + android:layout_width="match_parent" | |
| 87 | + android:layout_height="1dp" | |
| 88 | + android:layout_marginTop="10dp" | |
| 89 | + android:background="@color/line" /> | |
| 90 | + <!--配速和用时--> | |
| 120 | 91 | <LinearLayout |
| 121 | - android:layout_width="0dp" | |
| 92 | + android:layout_width="match_parent" | |
| 122 | 93 | android:layout_height="wrap_content" |
| 123 | - android:layout_weight="1" | |
| 124 | - android:gravity="center" | |
| 125 | - android:orientation="vertical"> | |
| 126 | - | |
| 127 | - <TextView | |
| 128 | - android:id="@+id/tv_timer" | |
| 129 | - android:layout_width="wrap_content" | |
| 94 | + android:layout_marginTop="10sp"> | |
| 95 | + <!----> | |
| 96 | + <LinearLayout | |
| 97 | + android:layout_width="0dp" | |
| 130 | 98 | android:layout_height="wrap_content" |
| 131 | - android:text="00:00:00" | |
| 132 | - android:textColor="@color/text_black" | |
| 133 | - android:textSize="20sp" | |
| 134 | - android:textStyle="bold" /> | |
| 99 | + android:layout_weight="1" | |
| 100 | + android:gravity="center" | |
| 101 | + android:orientation="vertical"> | |
| 102 | + | |
| 103 | + <TextView | |
| 104 | + android:id="@+id/tv_speed" | |
| 105 | + android:layout_width="wrap_content" | |
| 106 | + android:layout_height="wrap_content" | |
| 107 | + android:text="34'33''" | |
| 108 | + android:textColor="@color/text_black" | |
| 109 | + android:textSize="20sp" | |
| 110 | + android:textStyle="bold" /> | |
| 135 | 111 | |
| 136 | - <TextView | |
| 137 | - android:layout_width="wrap_content" | |
| 112 | + <TextView | |
| 113 | + android:layout_width="wrap_content" | |
| 114 | + android:layout_height="wrap_content" | |
| 115 | + android:layout_marginTop="5dp" | |
| 116 | + android:text="配速" | |
| 117 | + android:textColor="@color/text_black" | |
| 118 | + android:textSize="15sp" /> | |
| 119 | + </LinearLayout> | |
| 120 | + <!----> | |
| 121 | + <LinearLayout | |
| 122 | + android:layout_width="0dp" | |
| 138 | 123 | android:layout_height="wrap_content" |
| 139 | - android:layout_marginTop="5dp" | |
| 140 | - android:text="用时" | |
| 141 | - android:textColor="@color/text_black" | |
| 142 | - android:textSize="15sp" /> | |
| 124 | + android:layout_weight="1" | |
| 125 | + android:gravity="center" | |
| 126 | + android:orientation="vertical"> | |
| 127 | + | |
| 128 | + <TextView | |
| 129 | + android:id="@+id/tv_timer" | |
| 130 | + android:layout_width="wrap_content" | |
| 131 | + android:layout_height="wrap_content" | |
| 132 | + android:text="00:00:00" | |
| 133 | + android:textColor="@color/text_black" | |
| 134 | + android:textSize="20sp" | |
| 135 | + android:textStyle="bold" /> | |
| 136 | + | |
| 137 | + <TextView | |
| 138 | + android:layout_width="wrap_content" | |
| 139 | + android:layout_height="wrap_content" | |
| 140 | + android:layout_marginTop="5dp" | |
| 141 | + android:text="用时" | |
| 142 | + android:textColor="@color/text_black" | |
| 143 | + android:textSize="15sp" /> | |
| 144 | + </LinearLayout> | |
| 145 | + <!----> | |
| 143 | 146 | </LinearLayout> |
| 144 | 147 | <!----> |
| 145 | 148 | </LinearLayout> |
| 146 | - <!----> | |
| 147 | - </LinearLayout> | |
| 148 | 149 | |
| 149 | - <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |
| 150 | - android:id="@+id/qm_iv_icon" | |
| 151 | - android:layout_width="60dp" | |
| 152 | - android:layout_height="60dp" | |
| 153 | - android:layout_marginLeft="10dp" | |
| 154 | - android:background="@drawable/tc_ic_workout_level_adjust_coach" | |
| 155 | - app:qmui_corner_radius="100dp" /> | |
| 156 | -</FrameLayout> | |
| 157 | 150 | \ No newline at end of file |
| 151 | + <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |
| 152 | + android:id="@+id/qm_iv_icon" | |
| 153 | + android:layout_width="60dp" | |
| 154 | + android:layout_height="60dp" | |
| 155 | + android:layout_marginLeft="10dp" | |
| 156 | + android:background="@drawable/tc_ic_workout_level_adjust_coach" | |
| 157 | + app:qmui_corner_radius="100dp" /> | |
| 158 | + </FrameLayout> | |
| 159 | +</layout> | |
| 158 | 160 | \ No newline at end of file | ... | ... |