activity_main.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent"
  7. android:background="#FCFCFC"
  8. tools:context=".ui.activity.MainActivity">
  9. <LinearLayout
  10. android:id="@+id/main"
  11. android:layout_width="match_parent"
  12. android:layout_height="match_parent"
  13. android:background="#FCFCFC"
  14. android:orientation="vertical"
  15. tools:layout_editor_absoluteX="-85dp"
  16. tools:layout_editor_absoluteY="82dp">
  17. <LinearLayout
  18. android:id="@+id/main_top"
  19. android:layout_width="match_parent"
  20. android:layout_height="195dp"
  21. android:orientation="horizontal">
  22. <LinearLayout
  23. android:layout_width="match_parent"
  24. android:layout_height="match_parent"
  25. android:layout_weight="1"
  26. android:background="#028FE1"
  27. android:orientation="vertical">
  28. <TextView
  29. android:id="@+id/textView3"
  30. android:layout_width="match_parent"
  31. android:layout_height="58dp"
  32. android:layout_weight="1"
  33. android:gravity="center"
  34. android:text="心率带已连接 电量 39%"
  35. android:textColor="@color/white" />
  36. <LinearLayout
  37. android:layout_width="match_parent"
  38. android:layout_height="match_parent"
  39. android:layout_weight="1"
  40. android:orientation="horizontal">
  41. <LinearLayout
  42. android:layout_width="match_parent"
  43. android:layout_height="match_parent"
  44. android:layout_weight="1"
  45. android:orientation="vertical">
  46. <RelativeLayout
  47. android:layout_width="match_parent"
  48. android:layout_height="105dp">
  49. <TextView
  50. android:id="@+id/textView5"
  51. android:layout_width="match_parent"
  52. android:layout_height="82dp"
  53. android:layout_weight="1"
  54. android:gravity="center"
  55. android:text="38"
  56. android:textColor="@color/white"
  57. android:textSize="50dp" />
  58. <TextView
  59. android:id="@+id/percentIcon"
  60. android:layout_width="40dp"
  61. android:layout_height="82dp"
  62. android:layout_alignParentTop="true"
  63. android:layout_alignParentRight="true"
  64. android:text="%"
  65. android:textColor="@color/white"
  66. android:textSize="20dp" />
  67. </RelativeLayout>
  68. <TextView
  69. android:id="@+id/textView8"
  70. android:layout_width="90dp"
  71. android:layout_height="30dp"
  72. android:layout_gravity="center"
  73. android:background="@drawable/circle_btn"
  74. android:gravity="center"
  75. android:text="激活放松"
  76. android:textColor="@color/white" />
  77. </LinearLayout>
  78. <LinearLayout
  79. android:layout_width="match_parent"
  80. android:layout_height="match_parent"
  81. android:layout_weight="1"
  82. android:orientation="vertical">
  83. <ImageView
  84. android:id="@+id/imageView"
  85. android:layout_width="match_parent"
  86. android:layout_height="97dp"
  87. android:layout_centerHorizontal="true"
  88. android:gravity="center"
  89. android:src="@drawable/head" />
  90. <LinearLayout
  91. android:layout_width="match_parent"
  92. android:layout_height="match_parent"
  93. android:layout_weight="1"
  94. android:orientation="horizontal">
  95. <TextView
  96. android:id="@+id/textView10"
  97. android:layout_width="100dp"
  98. android:layout_height="match_parent"
  99. android:layout_weight="1"
  100. android:gravity="center_vertical|right"
  101. android:text="王仪涵"
  102. android:textColor="@color/white" />
  103. <ImageView
  104. android:id="@+id/sex"
  105. android:layout_width="38dp"
  106. android:layout_height="18dp"
  107. android:layout_weight="1"
  108. android:layout_centerHorizontal="true"
  109. android:gravity="center"
  110. android:layout_gravity="center"
  111. android:src="@drawable/male" />
  112. </LinearLayout>
  113. </LinearLayout>
  114. <LinearLayout
  115. android:layout_width="match_parent"
  116. android:layout_height="match_parent"
  117. android:layout_weight="1"
  118. android:orientation="vertical">
  119. <LinearLayout
  120. android:layout_width="match_parent"
  121. android:layout_height="match_parent"
  122. android:layout_weight="1"
  123. android:orientation="vertical">
  124. <RelativeLayout
  125. android:layout_width="match_parent"
  126. android:layout_height="105dp">
  127. <TextView
  128. android:id="@+id/heartReal"
  129. android:layout_width="match_parent"
  130. android:layout_height="82dp"
  131. android:layout_weight="1"
  132. android:gravity="center"
  133. android:text="38"
  134. android:textColor="@color/white"
  135. android:textSize="50dp" />
  136. <ImageView
  137. android:id="@+id/heart"
  138. android:layout_width="20dp"
  139. android:layout_height="20dp"
  140. android:layout_alignParentTop="true"
  141. android:layout_alignParentRight="true"
  142. android:layout_centerHorizontal="true"
  143. android:layout_marginTop="17dp"
  144. android:layout_marginRight="15dp"
  145. android:gravity="center"
  146. android:src="@drawable/heart" />
  147. </RelativeLayout>
  148. <TextView
  149. android:id="@+id/curentHr"
  150. android:layout_width="90dp"
  151. android:layout_height="30dp"
  152. android:layout_gravity="center"
  153. android:background="@drawable/circle_btn"
  154. android:gravity="center"
  155. android:text="瞬时心率"
  156. android:textColor="@color/white" />
  157. </LinearLayout>
  158. </LinearLayout>
  159. </LinearLayout>
  160. </LinearLayout>
  161. </LinearLayout>
  162. <LinearLayout
  163. android:layout_width="match_parent"
  164. android:layout_height="70dp"
  165. android:gravity="center"
  166. android:orientation="vertical">
  167. <LinearLayout
  168. android:layout_width="match_parent"
  169. android:layout_height="wrap_content"
  170. android:layout_weight="1"
  171. android:background="#fff"
  172. android:orientation="horizontal">
  173. <LinearLayout
  174. android:layout_width="match_parent"
  175. android:layout_height="match_parent"
  176. android:layout_weight="1"
  177. android:orientation="horizontal">
  178. <LinearLayout
  179. android:layout_width="match_parent"
  180. android:layout_height="match_parent"
  181. android:orientation="vertical">
  182. <TextView
  183. android:id="@+id/textView13"
  184. android:layout_width="match_parent"
  185. android:layout_height="wrap_content"
  186. android:gravity="center"
  187. android:text="0"
  188. android:textColor="#000"
  189. android:textSize="29dp" />
  190. <TextView
  191. android:id="@+id/textView14"
  192. android:layout_width="match_parent"
  193. android:layout_height="wrap_content"
  194. android:gravity="center"
  195. android:text="身高cm"
  196. android:textColor="#C4C4C4" />
  197. </LinearLayout>
  198. </LinearLayout>
  199. <View
  200. android:layout_width="1dip"
  201. android:layout_height="40dp"
  202. android:layout_gravity="center"
  203. android:background="#E2E2E2" />
  204. <LinearLayout
  205. android:id="@+id/main_middle"
  206. android:layout_width="match_parent"
  207. android:layout_height="match_parent"
  208. android:layout_weight="1"
  209. android:orientation="horizontal">
  210. <LinearLayout
  211. android:layout_width="match_parent"
  212. android:layout_height="131dp"
  213. android:orientation="vertical">
  214. <TextView
  215. android:id="@+id/textView15"
  216. android:layout_width="match_parent"
  217. android:layout_height="wrap_content"
  218. android:gravity="center"
  219. android:text="0"
  220. android:textColor="#000"
  221. android:textSize="29dp" />
  222. <TextView
  223. android:id="@+id/textView16"
  224. android:layout_width="match_parent"
  225. android:layout_height="wrap_content"
  226. android:gravity="center"
  227. android:text="年龄"
  228. android:textColor="#C4C4C4" />
  229. </LinearLayout>
  230. </LinearLayout>
  231. <View
  232. android:layout_width="1dip"
  233. android:layout_height="40dp"
  234. android:layout_gravity="center"
  235. android:background="#E2E2E2" />
  236. <LinearLayout
  237. android:layout_width="match_parent"
  238. android:layout_height="match_parent"
  239. android:layout_weight="1"
  240. android:orientation="horizontal">
  241. <LinearLayout
  242. android:layout_width="match_parent"
  243. android:layout_height="match_parent"
  244. android:orientation="vertical">
  245. <TextView
  246. android:id="@+id/textView17"
  247. android:layout_width="match_parent"
  248. android:layout_height="wrap_content"
  249. android:gravity="center"
  250. android:text="0"
  251. android:textColor="#000"
  252. android:textSize="29dp" />
  253. <TextView
  254. android:id="@+id/textView18"
  255. android:layout_width="match_parent"
  256. android:layout_height="wrap_content"
  257. android:gravity="center"
  258. android:text="体重kg"
  259. android:textColor="#C4C4C4" />
  260. </LinearLayout>
  261. </LinearLayout>
  262. <View
  263. android:layout_width="1dip"
  264. android:layout_height="40dp"
  265. android:layout_gravity="center"
  266. android:background="#E2E2E2" />
  267. <LinearLayout
  268. android:layout_width="match_parent"
  269. android:layout_height="match_parent"
  270. android:layout_weight="1"
  271. android:orientation="horizontal">
  272. <LinearLayout
  273. android:layout_width="match_parent"
  274. android:layout_height="match_parent"
  275. android:orientation="vertical">
  276. <TextView
  277. android:id="@+id/textView19"
  278. android:layout_width="match_parent"
  279. android:layout_height="wrap_content"
  280. android:gravity="center"
  281. android:text="0"
  282. android:textColor="#000"
  283. android:textSize="29dp" />
  284. <TextView
  285. android:id="@+id/textView20"
  286. android:layout_width="match_parent"
  287. android:layout_height="wrap_content"
  288. android:gravity="center"
  289. android:text="静息心率"
  290. android:textColor="#C4C4C4" />
  291. </LinearLayout>
  292. </LinearLayout>
  293. </LinearLayout>
  294. </LinearLayout>
  295. <LinearLayout
  296. android:id="@+id/contectPart"
  297. android:layout_width="wrap_content"
  298. android:layout_height="49dp"
  299. android:layout_gravity="center"
  300. android:orientation="horizontal">
  301. <ImageView
  302. android:id="@+id/chain"
  303. android:layout_width="20dp"
  304. android:layout_height="20dp"
  305. android:layout_centerHorizontal="true"
  306. android:layout_gravity="center"
  307. android:gravity="center"
  308. android:src="@drawable/chain" />
  309. <TextView
  310. android:id="@+id/unchain"
  311. android:layout_width="match_parent"
  312. android:layout_height="wrap_content"
  313. android:layout_gravity="center"
  314. android:layout_marginLeft="15dp"
  315. android:gravity="center"
  316. android:text="心率带未连接"
  317. android:textColor="#FF4040"
  318. android:textSize="14dp" />
  319. <Button
  320. android:id="@+id/chainBtn"
  321. android:layout_width="90dp"
  322. android:layout_height="24dp"
  323. android:layout_gravity="center"
  324. android:layout_marginLeft="15dp"
  325. android:layout_weight="1"
  326. android:background="@drawable/btn_contect"
  327. android:text="点击连接" />
  328. </LinearLayout>
  329. <LinearLayout
  330. android:id="@+id/main_bottom"
  331. android:layout_width="match_parent"
  332. android:layout_height="98dp"
  333. android:layout_marginTop="5dp"
  334. android:layout_marginBottom="5dp"
  335. android:background="#fff"
  336. android:orientation="horizontal">
  337. <LinearLayout
  338. android:layout_width="match_parent"
  339. android:layout_height="86dp"
  340. android:layout_weight="10"
  341. android:orientation="vertical">
  342. <LinearLayout
  343. android:layout_width="match_parent"
  344. android:layout_height="70dp"
  345. android:orientation="horizontal">
  346. <ImageView
  347. android:id="@+id/fire"
  348. android:layout_width="match_parent"
  349. android:layout_height="82dp"
  350. android:layout_gravity="center"
  351. android:layout_weight="1"
  352. android:src="@drawable/icon_sport" />
  353. <TextView
  354. android:id="@+id/calNum"
  355. android:layout_width="match_parent"
  356. android:layout_height="82dp"
  357. android:layout_gravity="center"
  358. android:layout_weight="1"
  359. android:gravity="center_vertical|left"
  360. android:text="0"
  361. android:textColor="#333"
  362. android:textSize="20dp" />
  363. <View
  364. android:layout_width="1dip"
  365. android:layout_height="40dp"
  366. android:layout_gravity="center"
  367. android:background="#E2E2E2" />
  368. </LinearLayout>
  369. <TextView
  370. android:id="@+id/caltext"
  371. android:layout_width="match_parent"
  372. android:layout_height="wrap_content"
  373. android:gravity="center"
  374. android:text="卡路里"
  375. android:textColor="#9A9A9A"
  376. android:textSize="10dp" />
  377. </LinearLayout>
  378. <LinearLayout
  379. android:layout_width="match_parent"
  380. android:layout_height="90dp"
  381. android:layout_weight="10"
  382. android:orientation="vertical">
  383. <LinearLayout
  384. android:layout_width="match_parent"
  385. android:layout_height="70dp"
  386. android:orientation="horizontal">
  387. <ImageView
  388. android:id="@+id/redfire"
  389. android:layout_width="match_parent"
  390. android:layout_height="82dp"
  391. android:layout_gravity="center"
  392. android:layout_weight="1"
  393. android:src="@drawable/icon_redsport" />
  394. <TextView
  395. android:id="@+id/sportNum"
  396. android:layout_width="match_parent"
  397. android:layout_height="82dp"
  398. android:layout_gravity="center"
  399. android:layout_weight="1"
  400. android:gravity="center_vertical|left"
  401. android:text="0"
  402. android:textColor="#333"
  403. android:textSize="20dp" />
  404. <View
  405. android:layout_width="1dip"
  406. android:layout_height="40dp"
  407. android:layout_gravity="center"
  408. android:background="#E2E2E2" />
  409. </LinearLayout>
  410. <TextView
  411. android:id="@+id/sportText"
  412. android:layout_width="match_parent"
  413. android:layout_height="wrap_content"
  414. android:gravity="center"
  415. android:text="运动卡路里"
  416. android:textColor="#9A9A9A"
  417. android:textSize="10dp" />
  418. </LinearLayout>
  419. <LinearLayout
  420. android:layout_width="match_parent"
  421. android:layout_height="89dp"
  422. android:layout_weight="10"
  423. android:orientation="vertical">
  424. <LinearLayout
  425. android:layout_width="match_parent"
  426. android:layout_height="match_parent"
  427. android:layout_weight="10"
  428. android:orientation="horizontal">
  429. <ImageView
  430. android:id="@+id/ckIcon"
  431. android:layout_width="110dp"
  432. android:layout_height="22dp"
  433. android:layout_gravity="center"
  434. android:layout_weight="1"
  435. android:src="@drawable/ck" />
  436. <TextView
  437. android:id="@+id/ckNum"
  438. android:layout_width="match_parent"
  439. android:layout_height="match_parent"
  440. android:layout_gravity="center"
  441. android:layout_weight="1"
  442. android:gravity="center_vertical|left"
  443. android:text="0"
  444. android:textColor="#333"
  445. android:textSize="20dp" />
  446. </LinearLayout>
  447. <TextView
  448. android:id="@+id/textView11"
  449. android:layout_width="match_parent"
  450. android:layout_height="20dp"
  451. android:layout_weight="1"
  452. android:gravity="center"
  453. android:text="CK"
  454. android:textColor="#9A9A9A"
  455. android:textSize="10dp" />
  456. </LinearLayout>
  457. </LinearLayout>
  458. <LinearLayout
  459. android:layout_width="match_parent"
  460. android:layout_height="10dp"
  461. android:layout_weight="1"
  462. android:background="#fff"
  463. android:layout_gravity="center"
  464. android:gravity="center"
  465. android:orientation="horizontal">
  466. <Button
  467. android:id="@+id/button"
  468. android:layout_width="60dp"
  469. android:layout_height="30dp"
  470. android:background="@drawable/gary_btn"
  471. android:gravity="center"
  472. android:layout_marginLeft="20dp"
  473. android:text="停止运动" />
  474. <Button
  475. android:id="@+id/linkBtn"
  476. android:layout_width="210dp"
  477. android:layout_height="30dp"
  478. android:background="@drawable/round_btn"
  479. android:gravity="center"
  480. android:text="运动时间 00:00:00"
  481. android:layout_marginLeft="15dp"
  482. android:layout_marginRight="15dp"
  483. android:textColor="#333" />
  484. <Button
  485. android:id="@+id/button3"
  486. android:layout_width="60dp"
  487. android:layout_height="30dp"
  488. android:background="@drawable/gary_btn"
  489. android:gravity="center"
  490. android:text="心率上报"
  491. android:layout_marginRight="20dp"
  492. android:textColor="#fff" />
  493. </LinearLayout>
  494. <TextView
  495. android:id="@+id/textView12"
  496. android:layout_width="match_parent"
  497. android:layout_height="wrap_content"
  498. android:background="#fff"
  499. android:gravity="center"
  500. android:text="5分钟心率趋势图"
  501. android:textColor="#000"
  502. android:textSize="20dp" />
  503. <TextView
  504. android:id="@+id/textView21"
  505. android:layout_width="match_parent"
  506. android:layout_height="wrap_content"
  507. android:background="#fff"
  508. android:gravity="center"
  509. android:text="最大心率 : 0 平均心率 : 0"
  510. android:textColor="#9A9A9A"
  511. android:textSize="15dp" />
  512. <LinearLayout
  513. android:layout_width="match_parent"
  514. android:layout_height="wrap_content"
  515. android:layout_weight="1"
  516. android:orientation="horizontal">
  517. <SurfaceView
  518. android:id="@+id/surfaceView2"
  519. android:layout_width="wrap_content"
  520. android:layout_height="73dp"
  521. android:layout_weight="1" />
  522. </LinearLayout>
  523. <com.google.android.material.bottomnavigation.BottomNavigationView
  524. android:id="@+id/nav_view"
  525. android:layout_width="match_parent"
  526. android:layout_height="wrap_content"
  527. android:background="#fff"
  528. app:itemIconTint="#333"
  529. app:itemTextColor="#333"
  530. app:menu="@menu/bottom_nav_menu"
  531. tools:ignore="MissingConstraints" />
  532. </LinearLayout>
  533. </androidx.constraintlayout.widget.ConstraintLayout>