Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/rootView"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#ececec"
- android:descendantFocusability="beforeDescendants"
- android:focusableInTouchMode="true">
- <ScrollView
- android:id="@+id/scrollView"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_above="@+id/cardview2"
- android:layout_alignParentTop="true">
- <androidx.constraintlayout.widget.ConstraintLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <GridLayout
- android:id="@+id/mainGrid"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginEnd="8dp"
- android:layout_marginLeft="8dp"
- android:layout_marginRight="8dp"
- android:layout_marginStart="8dp"
- android:layout_marginTop="4dp"
- android:alignmentMode="alignMargins"
- android:columnCount="1"
- android:rowCount="3"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.0"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent">
- <androidx.cardview.widget.CardView
- android:id="@+id/cardview"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="3dp"
- android:layout_marginBottom="8dp"
- android:layout_marginTop="8dp"
- app:cardCornerRadius="5dp"
- app:cardElevation="2dp">
- <androidx.constraintlayout.widget.ConstraintLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/ripple_effect"
- android:clickable="true">
- <ImageView
- android:id="@+id/imageView2"
- android:layout_width="100dp"
- android:layout_height="100dp"
- android:layout_marginBottom="16dp"
- android:layout_marginLeft="8dp"
- android:layout_marginStart="8dp"
- android:layout_marginTop="16dp"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- app:srcCompat="@mipmap/ic_plus" />
- <ImageView
- android:id="@+id/imageView3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="8dp"
- android:layout_marginRight="8dp"
- android:layout_marginTop="8dp"
- android:adjustViewBounds="true"
- android:maxHeight="30dp"
- android:maxWidth="30dp"
- android:scaleType="fitCenter"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- app:srcCompat="@mipmap/ic_arrow_def" />
- <LinearLayout
- android:id="@+id/nutritionInfo_layout"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
- android:layout_marginEnd="8dp"
- android:layout_marginLeft="8dp"
- android:layout_marginRight="8dp"
- android:layout_marginStart="8dp"
- android:layout_marginTop="8dp"
- android:background="@drawable/nutrition_shape"
- android:baselineAligned="false"
- android:orientation="vertical"
- android:padding="1dp"
- android:weightSum="3"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toEndOf="@+id/imageView2"
- app:layout_constraintTop_toBottomOf="@+id/textView18">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:baselineAligned="false"
- android:orientation="horizontal">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_margin="5dp"
- android:layout_weight="0.95"
- android:orientation="vertical">
- <TextView
- android:id="@+id/textView1"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/main_cals"
- android:textAlignment="center"
- android:textColor="@color/colorCalorie"
- android:textSize="10sp" />
- <TextView
- android:id="@+id/textView_cals"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/main_def"
- android:textColor="@color/colorCalorie"
- android:textSize="10sp" />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_margin="5dp"
- android:layout_weight="1"
- android:orientation="vertical">
- <TextView
- android:id="@+id/textView2"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/main_prot"
- android:textAlignment="center"
- android:textColor="@color/colorProtein"
- android:textSize="10sp" />
- <TextView
- android:id="@+id/textView_prot"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/main_def"
- android:textColor="@color/colorProtein"
- android:textSize="10sp" />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_margin="5dp"
- android:layout_weight="1"
- android:orientation="vertical">
- <TextView
- android:id="@+id/textView3"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/main_carb"
- android:textAlignment="center"
- android:textColor="@color/colorCarb"
- android:textSize="10sp" />
- <TextView
- android:id="@+id/textView_carb"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/main_def"
- android:textColor="@color/colorCarb"
- android:textSize="10sp" />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_margin="5dp"
- android:layout_weight="1"
- android:orientation="vertical">
- <TextView
- android:id="@+id/textView4"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/main_fats"
- android:textAlignment="center"
- android:textColor="@color/colorFat"
- android:textSize="10sp" />
- <TextView
- android:id="@+id/textView_fats"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/main_def"
- android:textColor="@color/colorFat"
- android:textSize="10sp" />
- </LinearLayout>
- </LinearLayout>
- <TextView
- android:id="@+id/textView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginTop="2dp"
- android:text="@string/per100"
- android:textColor="@color/colorAccent"
- android:textSize="10sp"
- tools:ignore="SmallSp" />
- <View
- android:id="@+id/divider"
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:layout_marginTop="1dp"
- android:background="?android:attr/listDivider" />
- </LinearLayout>
- <TextView
- android:id="@+id/textView18"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="16dp"
- android:padding="4dp"
- android:text="Food name"
- android:textColor="@android:color/black"
- android:textSize="20sp"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toEndOf="@+id/imageView2"
- app:layout_constraintTop_toTopOf="parent" />
- </androidx.constraintlayout.widget.ConstraintLayout>
- </androidx.cardview.widget.CardView>
- <androidx.cardview.widget.CardView
- android:id="@+id/cardView_amount"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="3dp"
- android:layout_marginBottom="8dp"
- app:cardCornerRadius="5dp"
- app:cardElevation="2dp">
- <androidx.constraintlayout.widget.ConstraintLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <TextView
- android:id="@+id/textView19"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
- android:text="Amount"
- android:textColor="@android:color/black"
- android:textSize="20sp"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
- <View
- android:id="@+id/divider14"
- android:layout_width="0dp"
- android:layout_height="1dp"
- android:layout_marginTop="4dp"
- android:background="?android:attr/listDivider"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/textView19" />
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/edittextlayout"
- style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
- android:layout_width="250dp"
- android:layout_height="wrap_content"
- android:layout_marginEnd="40dp"
- android:layout_marginLeft="40dp"
- android:layout_marginRight="40dp"
- android:layout_marginStart="40dp"
- android:layout_marginTop="8dp"
- android:textAlignment="center"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/divider14">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/editText_amount"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="Grams"
- android:inputType="numberDecimal"
- android:maxLines="1"
- android:textAlignment="center" />
- </com.google.android.material.textfield.TextInputLayout>
- <Button
- android:id="@+id/button_add"
- style="@style/Widget.AppCompat.Button.Borderless"
- android:layout_width="120dp"
- android:layout_height="40dp"
- android:layout_marginBottom="16dp"
- android:layout_marginLeft="40dp"
- android:layout_marginStart="40dp"
- android:layout_marginTop="16dp"
- android:background="@drawable/button"
- android:text="Add"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/button_custom_input"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/edittextlayout"
- app:layout_constraintVertical_bias="0.0" />
- <Button
- android:id="@+id/button_custom_input"
- style="@style/Widget.AppCompat.Button.Borderless.Colored"
- android:layout_width="120dp"
- android:layout_height="40dp"
- android:layout_marginBottom="16dp"
- android:layout_marginEnd="40dp"
- android:layout_marginRight="40dp"
- android:layout_marginTop="16dp"
- android:text="Custom value"
- android:textSize="12sp"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toEndOf="@+id/button_add"
- app:layout_constraintTop_toBottomOf="@+id/edittextlayout"
- app:layout_constraintVertical_bias="0.0" />
- </androidx.constraintlayout.widget.ConstraintLayout>
- </androidx.cardview.widget.CardView>
- <androidx.cardview.widget.CardView
- android:id="@+id/cardview_goal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="3dp"
- android:layout_marginBottom="8dp"
- app:cardCornerRadius="5dp"
- app:cardElevation="2dp">
- </androidx.cardview.widget.CardView>
- </GridLayout>
- </androidx.constraintlayout.widget.ConstraintLayout>
- </ScrollView>
- <androidx.cardview.widget.CardView
- android:id="@+id/cardview2"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- app:cardCornerRadius="8dp"
- app:cardElevation="2dp">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/ripple_effect"
- android:orientation="vertical">
- <LinearLayout
- android:id="@+id/linearLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:weightSum="2"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent">
- <Spinner
- android:id="@+id/spinner_type"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="2"
- android:background="@drawable/type_shape"
- android:textAlignment="center" />
- </LinearLayout>
- <TextView
- android:id="@+id/textview_type"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:padding="10dp"
- android:text="@string/main_cals"
- android:textAlignment="center"
- android:textColor="@color/colorCalorie"
- android:textSize="20sp"
- android:visibility="gone" />
- <TextView
- android:id="@+id/textview_total"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/main_default"
- android:textAlignment="center"
- android:textColor="@android:color/black"
- android:textSize="60sp" />
- <View
- android:id="@+id/divider15"
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="?android:attr/listDivider" />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal"
- android:weightSum="2">
- <Button
- android:id="@+id/button_reset"
- style="@style/Widget.AppCompat.Button.Borderless.Colored"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:enabled="false"
- android:text="@string/main_reset"
- android:textColor="@color/colorDarkerGrey"
- android:textSize="12sp" />
- <View
- android:id="@+id/divider13"
- android:layout_width="1dp"
- android:layout_height="match_parent"
- android:layout_weight="0"
- android:background="?android:attr/listDivider" />
- <Button
- android:id="@+id/button_undo"
- style="@style/Widget.AppCompat.Button.Borderless.Colored"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:enabled="false"
- android:text="@string/main_undo"
- android:textAllCaps="false"
- android:textColor="@android:color/darker_gray"
- android:textSize="12sp" />
- </LinearLayout>
- </LinearLayout>
- </androidx.cardview.widget.CardView>
- </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement