Я хотел бы предложить LinearLayout
здесь с атрибутами веса, чтобы каждый элемент в этой [ЦЕНА СДЕЛКИ - СКИДКА - АКТУАЛЬНАЯ ЦЕНА] занимала одинаковое пространство в макете, и это то, что вы хотите, насколько я понимаю,
Я подготовил макет, похожий на ваш. Я удалил стили, которые вы использовали, чтобы избежать ошибок (так как у меня их нет). Я также userd CardView
из библиотеки поддержки. Пожалуйста, посмотрите на следующий макет и дайте мне знать, если это соответствует вашим целям. Это просто, чтобы дать вам представление о том, как атрибут веса может служить вашим целям.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/just_in_store_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/just_in_deal_description"
android:layout_width="wrap_content"
android:layout_height="30dp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="#f2f2f2" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/ap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:text="Deal Price"
android:textColor="#757575"
android:textSize="16sp" />
<TextView
android:id="@+id/just_in_deal_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ap"
android:text="Deal Price"
android:textColor="#3691ea"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="@+id/apv_discount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="10% OFF"
android:textAlignment="center"
android:textColor="@color/colorPrimary"
android:textSize="18dp"
android:textStyle="bold"
android:visibility="visible" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginBottom="6dp"
android:text="Actual Price"
android:textColor="#757575"
android:textSize="16sp" />
<TextView
android:id="@+id/just_in_actual_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/dp"
android:layout_alignParentRight="true"
android:text="Actual Price"
android:textColor="#3691ea"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="#f2f2f2" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="72"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Coupon Code" />
<TextView
android:id="@+id/coupon_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:gravity="center"
android:text="Not Required"
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="#308fe9"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="#f2f2f2" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="72"
android:orientation="vertical">
<Button
android:id="@+id/just_in_target"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="GET DEAL" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
В моей Android Studio макет выглядит следующим образом.
Хорошего дня!