<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginVertical="8dp"
app:cardCornerRadius="16dp"
app:cardElevation="3dp"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Картинка блюда (растянута нормально без искажений) -->
<ImageView
android:id="@+id/ivRecipeImage"
android:layout_width="match_parent"
android:layout_height="180dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_launcher_background" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="14dp">
<!-- Название блюда -->
<TextView
android:id="@+id/tvRecipeTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Название блюда"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="?android:attr/textColorPrimary" />
<!-- Описание или подраздел -->
<TextView
android:id="@+id/tvRecipeSubtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Краткое описание"
android:textSize="14sp"
android:textColor="?android:attr/textColorSecondary" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<!-- Калорийность (из ТЗ) -->
<TextView
android:id="@+id/tvRecipeCalories"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="350 ккал"
android:textSize="13sp"
android:textStyle="bold"
android:textColor="#E65100" />
<!-- Оценка звездами (маленький индикатор) -->
<RatingBar
android:id="@+id/rbRecipeRating"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:numStars="5"
android:stepSize="0.5"
android:rating="4.5"
android:isIndicator="true" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>