gpt-3.5-turbo-0301· OpenAI
WildChat-4.8M (AI2)
Вот код : <androidx.cardview.widget.CardView…
- User
Вот код : <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_margin="10dp" android:elevation="6dp" app:cardCornerRadius="8dp">
<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="10dp"> <ImageView android:id="@+id/product_image" android:layout_width="96dp" android:layout_height="96dp" android:layout_alignParentStart="true" android:layout_marginStart="5dp" /> <TextView android:id="@+id/product_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginStart="33dp" android:layout_marginTop="15dp" android:layout_marginEnd="16dp" android:layout_toEndOf="@id/product_image" android:textSize="24sp" /> <TextView android:id="@+id/product_description" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/product_name" android:layout_marginStart="33dp" android:layout_marginTop="0dp" android:layout_marginEnd="16dp" android:layout_toEndOf="@id/product_image" android:textSize="16sp" /> <TextView android:id="@+id/product_rating" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:textSize="24sp" /> <Button android:id="@+id/add_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/product_description" android:layout_alignBottom="@+id/product_image" android:layout_alignParentEnd="true" android:layout_gravity="center_vertical|end" android:layout_marginTop="-12dp" android:layout_marginEnd="4dp" android:layout_marginBottom="-8dp" android:text="Добавить" /> <TextView android:id="@+id/price_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_marginStart="0dp" android:layout_marginTop="0dp" android:text="@string/price" android:textColor="@android:color/black" android:textSize="16sp" /> </RelativeLayout></androidx.cardview.widget.CardView> (Добавь расстояние между картинкой и ценой)
- Assistant
Для этого нужно добавить свойство
android:layout_marginTopкTextViewс idprice_text_view. Например, для установки расстояния в 10dp нужно добавитьandroid:layout_marginTop="10dp"в данномTextView: