Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.04 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <RelativeLayout 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:id="@+id/rootView"
  6. android:layout_width="match_parent"
  7. android:layout_height="match_parent"
  8. android:background="#ececec"
  9. android:descendantFocusability="beforeDescendants"
  10. android:focusableInTouchMode="true">
  11.  
  12. <ScrollView
  13. android:id="@+id/scrollView"
  14. android:layout_width="match_parent"
  15. android:layout_height="match_parent"
  16. android:layout_above="@+id/cardview2"
  17. android:layout_alignParentTop="true">
  18.  
  19. <androidx.constraintlayout.widget.ConstraintLayout
  20. android:layout_width="match_parent"
  21. android:layout_height="wrap_content">
  22.  
  23. <GridLayout
  24. android:id="@+id/mainGrid"
  25. android:layout_width="match_parent"
  26. android:layout_height="match_parent"
  27. android:layout_marginEnd="8dp"
  28. android:layout_marginLeft="8dp"
  29. android:layout_marginRight="8dp"
  30. android:layout_marginStart="8dp"
  31. android:layout_marginTop="4dp"
  32. android:alignmentMode="alignMargins"
  33. android:columnCount="1"
  34. android:rowCount="3"
  35. app:layout_constraintEnd_toEndOf="parent"
  36. app:layout_constraintHorizontal_bias="0.0"
  37. app:layout_constraintStart_toStartOf="parent"
  38. app:layout_constraintTop_toTopOf="parent">
  39.  
  40.  
  41. <androidx.cardview.widget.CardView
  42. android:id="@+id/cardview"
  43. android:layout_width="match_parent"
  44. android:layout_height="wrap_content"
  45. android:layout_margin="3dp"
  46. android:layout_marginBottom="8dp"
  47. android:layout_marginTop="8dp"
  48. app:cardCornerRadius="5dp"
  49. app:cardElevation="2dp">
  50.  
  51. <androidx.constraintlayout.widget.ConstraintLayout
  52. android:layout_width="match_parent"
  53. android:layout_height="match_parent"
  54. android:background="@drawable/ripple_effect"
  55. android:clickable="true">
  56.  
  57. <ImageView
  58. android:id="@+id/imageView2"
  59. android:layout_width="100dp"
  60. android:layout_height="100dp"
  61. android:layout_marginBottom="16dp"
  62. android:layout_marginLeft="8dp"
  63. android:layout_marginStart="8dp"
  64. android:layout_marginTop="16dp"
  65. app:layout_constraintBottom_toBottomOf="parent"
  66. app:layout_constraintStart_toStartOf="parent"
  67. app:layout_constraintTop_toTopOf="parent"
  68. app:srcCompat="@mipmap/ic_plus" />
  69.  
  70. <ImageView
  71. android:id="@+id/imageView3"
  72. android:layout_width="wrap_content"
  73. android:layout_height="wrap_content"
  74. android:layout_marginEnd="8dp"
  75. android:layout_marginRight="8dp"
  76. android:layout_marginTop="8dp"
  77. android:adjustViewBounds="true"
  78. android:maxHeight="30dp"
  79. android:maxWidth="30dp"
  80. android:scaleType="fitCenter"
  81. app:layout_constraintEnd_toEndOf="parent"
  82. app:layout_constraintTop_toTopOf="parent"
  83. app:srcCompat="@mipmap/ic_arrow_def" />
  84.  
  85. <LinearLayout
  86. android:id="@+id/nutritionInfo_layout"
  87. android:layout_width="0dp"
  88. android:layout_height="wrap_content"
  89. android:layout_marginBottom="16dp"
  90. android:layout_marginEnd="8dp"
  91. android:layout_marginLeft="8dp"
  92. android:layout_marginRight="8dp"
  93. android:layout_marginStart="8dp"
  94. android:layout_marginTop="8dp"
  95. android:background="@drawable/nutrition_shape"
  96. android:baselineAligned="false"
  97. android:orientation="vertical"
  98. android:padding="1dp"
  99. android:weightSum="3"
  100. app:layout_constraintBottom_toBottomOf="parent"
  101. app:layout_constraintEnd_toEndOf="parent"
  102. app:layout_constraintStart_toEndOf="@+id/imageView2"
  103. app:layout_constraintTop_toBottomOf="@+id/textView18">
  104.  
  105. <LinearLayout
  106. android:layout_width="match_parent"
  107. android:layout_height="wrap_content"
  108. android:baselineAligned="false"
  109. android:orientation="horizontal">
  110.  
  111. <LinearLayout
  112. android:layout_width="match_parent"
  113. android:layout_height="match_parent"
  114. android:layout_margin="5dp"
  115. android:layout_weight="0.95"
  116. android:orientation="vertical">
  117.  
  118. <TextView
  119. android:id="@+id/textView1"
  120. android:layout_width="match_parent"
  121. android:layout_height="wrap_content"
  122. android:layout_gravity="center"
  123. android:text="@string/main_cals"
  124. android:textAlignment="center"
  125. android:textColor="@color/colorCalorie"
  126. android:textSize="10sp" />
  127.  
  128. <TextView
  129. android:id="@+id/textView_cals"
  130. android:layout_width="wrap_content"
  131. android:layout_height="wrap_content"
  132. android:layout_gravity="center"
  133. android:text="@string/main_def"
  134. android:textColor="@color/colorCalorie"
  135. android:textSize="10sp" />
  136. </LinearLayout>
  137.  
  138. <LinearLayout
  139. android:layout_width="match_parent"
  140. android:layout_height="match_parent"
  141. android:layout_margin="5dp"
  142. android:layout_weight="1"
  143. android:orientation="vertical">
  144.  
  145. <TextView
  146. android:id="@+id/textView2"
  147. android:layout_width="match_parent"
  148. android:layout_height="wrap_content"
  149. android:layout_gravity="center"
  150. android:text="@string/main_prot"
  151. android:textAlignment="center"
  152. android:textColor="@color/colorProtein"
  153. android:textSize="10sp" />
  154.  
  155. <TextView
  156. android:id="@+id/textView_prot"
  157. android:layout_width="wrap_content"
  158. android:layout_height="wrap_content"
  159. android:layout_gravity="center"
  160. android:text="@string/main_def"
  161. android:textColor="@color/colorProtein"
  162. android:textSize="10sp" />
  163. </LinearLayout>
  164.  
  165. <LinearLayout
  166. android:layout_width="match_parent"
  167. android:layout_height="match_parent"
  168. android:layout_margin="5dp"
  169. android:layout_weight="1"
  170. android:orientation="vertical">
  171.  
  172. <TextView
  173. android:id="@+id/textView3"
  174. android:layout_width="match_parent"
  175. android:layout_height="wrap_content"
  176. android:layout_gravity="center"
  177. android:text="@string/main_carb"
  178. android:textAlignment="center"
  179. android:textColor="@color/colorCarb"
  180. android:textSize="10sp" />
  181.  
  182. <TextView
  183. android:id="@+id/textView_carb"
  184. android:layout_width="wrap_content"
  185. android:layout_height="wrap_content"
  186. android:layout_gravity="center"
  187. android:text="@string/main_def"
  188. android:textColor="@color/colorCarb"
  189. android:textSize="10sp" />
  190. </LinearLayout>
  191.  
  192. <LinearLayout
  193. android:layout_width="match_parent"
  194. android:layout_height="match_parent"
  195. android:layout_margin="5dp"
  196. android:layout_weight="1"
  197. android:orientation="vertical">
  198.  
  199. <TextView
  200. android:id="@+id/textView4"
  201. android:layout_width="match_parent"
  202. android:layout_height="wrap_content"
  203. android:layout_gravity="center"
  204. android:text="@string/main_fats"
  205. android:textAlignment="center"
  206. android:textColor="@color/colorFat"
  207. android:textSize="10sp" />
  208.  
  209. <TextView
  210. android:id="@+id/textView_fats"
  211. android:layout_width="wrap_content"
  212. android:layout_height="wrap_content"
  213. android:layout_gravity="center"
  214. android:text="@string/main_def"
  215. android:textColor="@color/colorFat"
  216. android:textSize="10sp" />
  217. </LinearLayout>
  218.  
  219. </LinearLayout>
  220.  
  221. <TextView
  222. android:id="@+id/textView"
  223. android:layout_width="wrap_content"
  224. android:layout_height="wrap_content"
  225. android:layout_gravity="center"
  226. android:layout_marginTop="2dp"
  227. android:text="@string/per100"
  228. android:textColor="@color/colorAccent"
  229. android:textSize="10sp"
  230. tools:ignore="SmallSp" />
  231.  
  232. <View
  233. android:id="@+id/divider"
  234. android:layout_width="match_parent"
  235. android:layout_height="1dp"
  236. android:layout_marginTop="1dp"
  237.  
  238. android:background="?android:attr/listDivider" />
  239.  
  240. </LinearLayout>
  241.  
  242. <TextView
  243. android:id="@+id/textView18"
  244. android:layout_width="wrap_content"
  245. android:layout_height="wrap_content"
  246. android:layout_marginTop="16dp"
  247. android:padding="4dp"
  248. android:text="Food name"
  249. android:textColor="@android:color/black"
  250. android:textSize="20sp"
  251. app:layout_constraintEnd_toEndOf="parent"
  252. app:layout_constraintStart_toEndOf="@+id/imageView2"
  253. app:layout_constraintTop_toTopOf="parent" />
  254. </androidx.constraintlayout.widget.ConstraintLayout>
  255.  
  256. </androidx.cardview.widget.CardView>
  257.  
  258. <androidx.cardview.widget.CardView
  259. android:id="@+id/cardView_amount"
  260. android:layout_width="match_parent"
  261. android:layout_height="wrap_content"
  262. android:layout_margin="3dp"
  263. android:layout_marginBottom="8dp"
  264. app:cardCornerRadius="5dp"
  265. app:cardElevation="2dp">
  266.  
  267. <androidx.constraintlayout.widget.ConstraintLayout
  268. android:layout_width="match_parent"
  269. android:layout_height="match_parent">
  270.  
  271. <TextView
  272. android:id="@+id/textView19"
  273. android:layout_width="wrap_content"
  274. android:layout_height="wrap_content"
  275. android:layout_marginTop="8dp"
  276. android:text="Amount"
  277. android:textColor="@android:color/black"
  278. android:textSize="20sp"
  279. app:layout_constraintEnd_toEndOf="parent"
  280. app:layout_constraintStart_toStartOf="parent"
  281. app:layout_constraintTop_toTopOf="parent" />
  282.  
  283. <View
  284. android:id="@+id/divider14"
  285. android:layout_width="0dp"
  286. android:layout_height="1dp"
  287. android:layout_marginTop="4dp"
  288. android:background="?android:attr/listDivider"
  289. app:layout_constraintEnd_toEndOf="parent"
  290. app:layout_constraintStart_toStartOf="parent"
  291. app:layout_constraintTop_toBottomOf="@+id/textView19" />
  292.  
  293. <com.google.android.material.textfield.TextInputLayout
  294. android:id="@+id/edittextlayout"
  295. style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
  296. android:layout_width="250dp"
  297. android:layout_height="wrap_content"
  298. android:layout_marginEnd="40dp"
  299. android:layout_marginLeft="40dp"
  300. android:layout_marginRight="40dp"
  301. android:layout_marginStart="40dp"
  302. android:layout_marginTop="8dp"
  303. android:textAlignment="center"
  304. app:layout_constraintEnd_toEndOf="parent"
  305. app:layout_constraintStart_toStartOf="parent"
  306. app:layout_constraintTop_toBottomOf="@+id/divider14">
  307.  
  308. <com.google.android.material.textfield.TextInputEditText
  309. android:id="@+id/editText_amount"
  310. android:layout_width="match_parent"
  311. android:layout_height="wrap_content"
  312. android:hint="Grams"
  313. android:inputType="numberDecimal"
  314. android:maxLines="1"
  315. android:textAlignment="center" />
  316.  
  317. </com.google.android.material.textfield.TextInputLayout>
  318.  
  319. <Button
  320. android:id="@+id/button_add"
  321. style="@style/Widget.AppCompat.Button.Borderless"
  322. android:layout_width="120dp"
  323. android:layout_height="40dp"
  324. android:layout_marginBottom="16dp"
  325. android:layout_marginLeft="40dp"
  326. android:layout_marginStart="40dp"
  327. android:layout_marginTop="16dp"
  328. android:background="@drawable/button"
  329. android:text="Add"
  330. app:layout_constraintBottom_toBottomOf="parent"
  331. app:layout_constraintEnd_toStartOf="@+id/button_custom_input"
  332. app:layout_constraintStart_toStartOf="parent"
  333. app:layout_constraintTop_toBottomOf="@+id/edittextlayout"
  334. app:layout_constraintVertical_bias="0.0" />
  335.  
  336. <Button
  337. android:id="@+id/button_custom_input"
  338. style="@style/Widget.AppCompat.Button.Borderless.Colored"
  339. android:layout_width="120dp"
  340. android:layout_height="40dp"
  341. android:layout_marginBottom="16dp"
  342. android:layout_marginEnd="40dp"
  343. android:layout_marginRight="40dp"
  344. android:layout_marginTop="16dp"
  345. android:text="Custom value"
  346. android:textSize="12sp"
  347. app:layout_constraintBottom_toBottomOf="parent"
  348. app:layout_constraintEnd_toEndOf="parent"
  349. app:layout_constraintStart_toEndOf="@+id/button_add"
  350. app:layout_constraintTop_toBottomOf="@+id/edittextlayout"
  351. app:layout_constraintVertical_bias="0.0" />
  352.  
  353. </androidx.constraintlayout.widget.ConstraintLayout>
  354. </androidx.cardview.widget.CardView>
  355.  
  356. <androidx.cardview.widget.CardView
  357. android:id="@+id/cardview_goal"
  358. android:layout_width="match_parent"
  359. android:layout_height="wrap_content"
  360. android:layout_margin="3dp"
  361. android:layout_marginBottom="8dp"
  362. app:cardCornerRadius="5dp"
  363. app:cardElevation="2dp">
  364.  
  365. </androidx.cardview.widget.CardView>
  366.  
  367.  
  368. </GridLayout>
  369. </androidx.constraintlayout.widget.ConstraintLayout>
  370. </ScrollView>
  371.  
  372. <androidx.cardview.widget.CardView
  373. android:id="@+id/cardview2"
  374. android:layout_width="match_parent"
  375. android:layout_height="wrap_content"
  376. android:layout_alignParentBottom="true"
  377. app:cardCornerRadius="8dp"
  378. app:cardElevation="2dp">
  379.  
  380. <LinearLayout
  381. android:layout_width="match_parent"
  382. android:layout_height="match_parent"
  383. android:background="@drawable/ripple_effect"
  384. android:orientation="vertical">
  385.  
  386. <LinearLayout
  387. android:id="@+id/linearLayout"
  388. android:layout_width="match_parent"
  389. android:layout_height="match_parent"
  390.  
  391. android:orientation="vertical"
  392. android:weightSum="2"
  393. app:layout_constraintEnd_toEndOf="parent"
  394. app:layout_constraintStart_toStartOf="parent"
  395. app:layout_constraintTop_toTopOf="parent">
  396.  
  397. <Spinner
  398. android:id="@+id/spinner_type"
  399. android:layout_width="match_parent"
  400. android:layout_height="0dp"
  401. android:layout_weight="2"
  402. android:background="@drawable/type_shape"
  403. android:textAlignment="center" />
  404. </LinearLayout>
  405.  
  406. <TextView
  407. android:id="@+id/textview_type"
  408. android:layout_width="match_parent"
  409. android:layout_height="wrap_content"
  410. android:padding="10dp"
  411. android:text="@string/main_cals"
  412. android:textAlignment="center"
  413. android:textColor="@color/colorCalorie"
  414. android:textSize="20sp"
  415. android:visibility="gone" />
  416.  
  417. <TextView
  418. android:id="@+id/textview_total"
  419. android:layout_width="match_parent"
  420. android:layout_height="wrap_content"
  421. android:text="@string/main_default"
  422. android:textAlignment="center"
  423. android:textColor="@android:color/black"
  424. android:textSize="60sp" />
  425.  
  426. <View
  427. android:id="@+id/divider15"
  428. android:layout_width="match_parent"
  429. android:layout_height="1dp"
  430. android:background="?android:attr/listDivider" />
  431.  
  432. <LinearLayout
  433. android:layout_width="match_parent"
  434. android:layout_height="match_parent"
  435. android:orientation="horizontal"
  436. android:weightSum="2">
  437.  
  438. <Button
  439. android:id="@+id/button_reset"
  440. style="@style/Widget.AppCompat.Button.Borderless.Colored"
  441. android:layout_width="match_parent"
  442. android:layout_height="wrap_content"
  443. android:layout_weight="1"
  444. android:enabled="false"
  445. android:text="@string/main_reset"
  446. android:textColor="@color/colorDarkerGrey"
  447. android:textSize="12sp" />
  448.  
  449. <View
  450. android:id="@+id/divider13"
  451. android:layout_width="1dp"
  452. android:layout_height="match_parent"
  453. android:layout_weight="0"
  454. android:background="?android:attr/listDivider" />
  455.  
  456. <Button
  457. android:id="@+id/button_undo"
  458. style="@style/Widget.AppCompat.Button.Borderless.Colored"
  459. android:layout_width="match_parent"
  460. android:layout_height="wrap_content"
  461. android:layout_weight="1"
  462. android:enabled="false"
  463. android:text="@string/main_undo"
  464. android:textAllCaps="false"
  465. android:textColor="@android:color/darker_gray"
  466. android:textSize="12sp" />
  467.  
  468. </LinearLayout>
  469.  
  470. </LinearLayout>
  471. </androidx.cardview.widget.CardView>
  472.  
  473. </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement