Skip to content

Commit

Permalink
fix: food history view
Browse files Browse the repository at this point in the history
  • Loading branch information
moon0900 committed Dec 16, 2024
1 parent 45fb75a commit b29db1f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 46 deletions.
97 changes: 52 additions & 45 deletions app/src/main/res/layout/food_history_item.xml
Original file line number Diff line number Diff line change
@@ -1,52 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:app="http://schemas.android.com/apk/res-auto"
<FrameLayout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="169dp"
android:layout_width="136dp"
app:cardCornerRadius="10dp"
app:cardElevation="0dp"
xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/gray_50"
android:paddingEnd="16dp">

<androidx.constraintlayout.widget.ConstraintLayout
<androidx.cardview.widget.CardView
android:id="@+id/cardView"
android:layout_height="169dp"
android:layout_width="136dp"
app:cardCornerRadius="10dp"
app:cardElevation="0dp">

android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout

<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="0dp"
android:foreground="@drawable/gradient_foreground_gray"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/backgrounds/scenic" />
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:fontFamily="@font/wanted_sans_semi_bold"
android:text="@string/tmp_food_history_title"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="0dp"
android:foreground="@drawable/gradient_foreground_gray"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/backgrounds/scenic" />

<TextView
android:id="@+id/kcal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/wanted_sans_semi_bold"
android:text="@string/tmp_food_history_kcal"
android:textColor="#ccffffff"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/label"
app:layout_constraintTop_toBottomOf="@+id/label" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:fontFamily="@font/wanted_sans_semi_bold"
android:text="@string/tmp_food_history_title"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/kcal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/wanted_sans_semi_bold"
android:text="@string/tmp_food_history_kcal"
android:textColor="#ccffffff"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/label"
app:layout_constraintTop_toBottomOf="@+id/label" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</FrameLayout>
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_my_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@
android:id="@+id/historyRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="16dp"
android:orientation="horizontal" />

<include
Expand Down

0 comments on commit b29db1f

Please sign in to comment.