Отображение большого поля между каждым элементом строки в представлении реселлера с помощью менеджера компоновки сетки - PullRequest
0 голосов
/ 11 ноября 2019

У меня есть следующий XML, который я надуваю в Recyclerview с помощью менеджера компоновки сетки -

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:background="@color/white"
    android:orientation="vertical"
    android:padding="20dp">

    <ImageView
        android:id="@+id/products_row_item_product_image_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@mipmap/ic_launcher" />

    <TextView
        android:id="@+id/products_row_item_product_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/fragment_marketplace_products_row_item_product_title"
        android:textSize="17sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/products_row_item_description_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/products_row_item_product_description" />

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/very_light_grey"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">


        <TextView
            android:id="@+id/products_row_item_price_text_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:text="@string/products_row_item_price_text"
            android:textStyle="bold" />

        <ImageView
            android:id="@+id/products_row_item_heart_image_view"
            android:layout_width="27dp"
            android:layout_height="27dp"
            android:layout_marginEnd="5dp"
            android:layout_marginRight="5dp"
            android:scaleType="fitXY"
            android:src="@drawable/like_heart" />

        <TextView
            android:id="@+id/products_row_item_likes"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="end"
            android:text="@string/fragment_marketplace_products_row_item_likes"
            android:textSize="20sp" />
    </LinearLayout>
</LinearLayout>

XML выглядит так на моем телефоне -

enter image description here

Но результат, которого я хочу достичь, состоит в том, чтобы пользовательский интерфейс имел гораздо большую прибыль, создавая ощущение, что элементы строк «плавают» внутри них. Вот демонстрация -

enter image description here

Итак, мои вопросы следующие -

1) Как мне изменить свой XML-файл, чтобы он выгляделтак же, как разыскиваемый? 2) Как вы можете видеть, сердечные и подобные значки склеены с ценником. Я хочу отделить их, как на картинке.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...