app/src/main/res/layout/activity_recipe.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="40dp"
tools:context=".RecipeActivity">
<ImageView
android:id="@+id/recipePicture"
android:layout_width="335dp"
android:layout_height="282dp"
android:layout_marginTop="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/recipe_picture" />
<TextView
android:id="@+id/recipeNameText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:fontFamily="@font/inter"
android:text="Recipe Name"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/black"
android:textSize="24sp"
android:textStyle="bold"
android:typeface="normal"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/recipePicture" />
<ImageView
android:id="@+id/userAvatar"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="20dp"
app:layout_constraintStart_toStartOf="@+id/recipeNameText"
app:layout_constraintTop_toBottomOf="@+id/ratingBar"
app:srcCompat="@drawable/user_avatar" />
<TextView
android:id="@+id/userNameText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="28dp"
android:fontFamily="@font/inter"
android:text="User Name"
android:textColor="#101010"
app:layout_constraintStart_toEndOf="@+id/userAvatar"
app:layout_constraintTop_toBottomOf="@+id/ratingBar" />
<ImageView
android:id="@+id/infoBoxes"
android:layout_width="325dp"
android:layout_height="126dp"
android:layout_marginTop="188dp"
app:layout_constraintEnd_toEndOf="@+id/recipePicture"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/recipePicture"
app:srcCompat="@drawable/info_boxes" />
<TextView
android:id="@+id/prepTimeNbMins"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginTop="70dp"
android:text="0"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintStart_toStartOf="@+id/infoBoxes"
app:layout_constraintTop_toTopOf="@+id/infoBoxes" />
<TextView
android:id="@+id/kcalCount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="275dp"
android:layout_marginTop="70dp"
android:text="0"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintStart_toStartOf="@+id/infoBoxes"
app:layout_constraintTop_toTopOf="@+id/infoBoxes" />
<TextView
android:id="@+id/prepMinsText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="31dp"
android:text="mins"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintStart_toStartOf="@+id/infoBoxes"
app:layout_constraintTop_toBottomOf="@+id/prepTimeNbMins" />
<TextView
android:id="@+id/cookTimeNbMins"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="158dp"
android:layout_marginTop="70dp"
android:text="0"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintStart_toStartOf="@+id/infoBoxes"
app:layout_constraintTop_toTopOf="@+id/infoBoxes" />
<TextView
android:id="@+id/cookMinsText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="148dp"
android:text="mins"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintStart_toStartOf="@+id/infoBoxes"
app:layout_constraintTop_toBottomOf="@+id/cookTimeNbMins" />
<ImageView
android:id="@+id/ingredientsIcon"
android:layout_width="47dp"
android:layout_height="41dp"
android:layout_marginTop="50dp"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/cookNowButton"
app:srcCompat="@drawable/ingredients_image" />
<TextView
android:id="@+id/ingredientsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="56dp"
android:fontFamily="@font/inter_bold"
android:text="Ingredients"
android:textColor="#171616"
android:textSize="22sp"
app:layout_constraintStart_toEndOf="@+id/ingredientsIcon"
app:layout_constraintTop_toBottomOf="@+id/cookNowButton" />
<ImageView
android:id="@+id/servingsIcon"
android:layout_width="28dp"
android:layout_height="24dp"
android:layout_marginTop="24dp"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/ingredientsIcon"
app:srcCompat="@drawable/food_kitchenware_serving_dome" />
<TextView
android:id="@+id/nbServings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="24dp"
android:autoText="false"
android:digits="00"
android:fontFamily="@font/inter"
android:numeric="integer"
android:text="00"
android:textColor="#0E0E0E"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@+id/servingsIcon"
app:layout_constraintTop_toBottomOf="@+id/ingredientsIcon" />
<TextView
android:id="@+id/servingsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="24dp"
android:fontFamily="@font/inter"
android:text="servings"
android:textColor="#0B0A0A"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@+id/nbServings"
app:layout_constraintTop_toBottomOf="@+id/ingredientsIcon" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/nutritionalValueCard"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:layout_marginStart="1dp"
app:cardCornerRadius="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/ingredientsList"
app:strokeColor="@color/stroke_color"
app:strokeWidth="1dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="16dp">
<ImageView
android:id="@+id/nutritional_info_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@android:drawable/ic_menu_info_details"
app:tint="@color/purple_700" />
<TextView
android:id="@+id/nutritional_values_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/recipe_nutritional_value_title"
android:textColor="#00255E"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@+id/nutritional_info_icon"
app:layout_constraintTop_toTopOf="@+id/nutritional_info_icon"
app:layout_constraintVertical_bias="0.5" />
<ImageView
android:id="@+id/nutritionalCollapseToggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="@+id/nutritional_values_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/nutritional_values_title"
app:srcCompat="@android:drawable/arrow_down_float"
app:tint="@color/purple_700" />
<View
android:id="@+id/nutritional_horizontal_line"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="#CECECE"
app:layout_constraintEnd_toEndOf="@+id/nutritionalCollapseToggle"
app:layout_constraintStart_toStartOf="@+id/nutritional_info_icon"
app:layout_constraintTop_toBottomOf="@+id/nutritional_values_title" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/nutritionalValueContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nutritional_horizontal_line">
<LinearLayout
android:id="@+id/nutritionalValuesCalories"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/recipe_nutritional_value_calories_title" />
<TextView
android:id="@+id/nutritionalValuesCaloriesValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/nutritionalValuesFat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nutritionalValuesCalories">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/recipe_nutritional_value_fat_title" />
<TextView
android:id="@+id/nutritionalValuesFatValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/nutritionalValuesCarbohydrates"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nutritionalValuesFat">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/recipe_nutritional_value_carbohydrates_title" />
<TextView
android:id="@+id/nutritionalValuesCarbohydratesValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/nutritionalValuesSugar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nutritionalValuesCarbohydrates">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/recipe_nutritional_value_sugar_title" />
<TextView
android:id="@+id/nutritionalValuesSugarValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/nutritionalValuesProtein"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nutritionalValuesSugar">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/recipe_nutritional_value_protein_title" />
<TextView
android:id="@+id/nutritionalValuesProteinValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.Group
android:id="@+id/card_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="nutritionalValueContent, nutritional_horizontal_line"
tools:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<ImageView
android:id="@+id/utensilsIcon"
android:layout_width="45dp"
android:layout_height="40dp"
android:layout_marginTop="16dp"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/nutritionalValueCard"
app:srcCompat="@drawable/appliances_sauce_pan" />
<TextView
android:id="@+id/utensilTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:fontFamily="@font/inter_bold"
android:text="Utensils"
android:textColor="#0E0E0E"
android:textSize="22sp"
app:layout_constraintStart_toEndOf="@+id/utensilsIcon"
app:layout_constraintTop_toBottomOf="@+id/nutritionalValueCard" />
<TextView
android:id="@+id/utensilsList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:fontFamily="@font/inter"
android:text="Utensils here: knife, frying pan..."
android:textColor="#0C0C0C"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/utensilsIcon" />
<ImageView
android:id="@+id/stepsIcon"
android:layout_width="43dp"
android:layout_height="41dp"
android:layout_marginTop="50dp"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/utensilsList"
app:srcCompat="@drawable/steps_image" />
<TextView
android:id="@+id/stepsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="56dp"
android:fontFamily="@font/inter_bold"
android:text="Steps"
android:textColor="#0C0C0C"
android:textSize="22sp"
app:layout_constraintStart_toEndOf="@+id/stepsIcon"
app:layout_constraintTop_toBottomOf="@+id/utensilsList" />
<TextView
android:id="@+id/stepsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:fontFamily="@font/inter"
android:text="Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32."
android:textColor="#0C0C0C"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/stepsIcon" />
<ImageView
android:id="@+id/commentsIcon"
android:layout_width="46dp"
android:layout_height="43dp"
android:layout_marginTop="20dp"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/rateButton"
app:srcCompat="@drawable/comment" />
<TextView
android:id="@+id/commentsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="28dp"
android:fontFamily="@font/inter_bold"
android:text="Comments"
android:textColor="#101010"
android:textSize="22sp"
app:layout_constraintStart_toEndOf="@+id/commentsIcon"
app:layout_constraintTop_toBottomOf="@+id/rateButton" />
<RatingBar
android:id="@+id/ratingBar"
android:layout_width="237dp"
android:layout_height="46dp"
android:layout_marginStart="-37dp"
android:layout_marginTop="20dp"
android:isIndicator="true"
android:numStars="5"
android:progressTint="#f0ce37"
android:rating="4"
android:scaleX="0.7"
android:scaleY="0.7"
app:layout_constraintStart_toStartOf="@+id/recipeNameText"
app:layout_constraintTop_toBottomOf="@+id/recipeNameText" />
<Button
android:id="@+id/rateButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="45dp"
android:text="Rate Now !"
app:layout_constraintEnd_toStartOf="@+id/cookNowButton"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/stepsText" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/commentsList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="@+id/stepsText"
app:layout_constraintStart_toStartOf="@+id/stepsText"
app:layout_constraintTop_toBottomOf="@+id/commentsIcon" />
<EditText
android:id="@+id/enterComment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:background="@drawable/write_comment_box"
android:hint="Say Something"
android:paddingStart="10dp"
android:paddingLeft="15dp"
android:paddingTop="5dp"
android:paddingEnd="45dp"
android:paddingBottom="5dp"
android:text=""
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="@+id/commentsList"
app:layout_constraintStart_toStartOf="@+id/commentsList"
app:layout_constraintTop_toBottomOf="@+id/commentsList" />
<Button
android:id="@+id/sendCommentButton"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:background="@drawable/ic_send"
android:text="Button"
app:layout_constraintBottom_toBottomOf="@+id/enterComment"
app:layout_constraintEnd_toEndOf="@+id/enterComment"
app:layout_constraintTop_toTopOf="@+id/enterComment" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/ingredientsList"
android:layout_width="317dp"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="18dp"
app:layout_constraintEnd_toEndOf="@+id/recipePicture"
app:layout_constraintStart_toStartOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/servingsIcon" />
<ToggleButton
android:id="@+id/favoriteButton"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="25dp"
android:background="@drawable/heart_empty"
android:textOff=""
android:textOn=""
app:layout_constraintEnd_toEndOf="@+id/recipePicture"
app:layout_constraintTop_toBottomOf="@+id/recipeNameText" />
<Button
android:id="@+id/cookNowButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="45dp"
android:text="Cook Now !"
app:layout_constraintEnd_toEndOf="@+id/infoBoxes"
app:layout_constraintStart_toStartOf="@+id/infoBoxes"
app:layout_constraintTop_toBottomOf="@+id/infoBoxes" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
app:layout_constraintBottom_toBottomOf="@+id/servingsText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/servingsText">
<Button
android:id="@+id/minusButton"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="8dp"
android:background="@drawable/custom_btn_remove"
android:backgroundTint="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/plusButton"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="8dp"
android:background="@drawable/custom_btn_add"
android:backgroundTint="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/servings"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/inter"
android:inputType="number"
android:minEms="1"
android:text="1"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/black"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/plusButton"
app:layout_constraintStart_toEndOf="@id/minusButton"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>