Задача: в списке элемента сделать фиксироваными отступы сверху, снизу и между строками. Я задал отступы в корневом элементе, если задать эти отступы в LinearLayout котором находятся TextView, то текст тоже не масштабируется, а нижние и верхние края залазят на текст и перекрывают его. Как сделать так что бы размер шрифта менялся? При этом высота элемента списка должна быть фиксированной.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="97.5dp"
android:orientation="horizontal"
android:background="@color/colorWhite"
android:layout_paddingTop="20dp"
android:layout_marginBottom="20dp"
>
<!-- Progress Bar -->
<com.github.lzyzsd.circleprogress.DonutProgress
android:id="@+id/progress_bar"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:paddingTop="20dp"
android:paddingBottom="20dp"
custom:donut_progress="70"
custom:donut_text_size="10sp"
custom:donut_text_color="@color/colorBlack"
custom:donut_finished_color="@color/colorGreen"
custom:donut_unfinished_color="@color/colorBackgroundDarckGrey"
custom:donut_finished_stroke_width="4.5dp"
custom:donut_unfinished_stroke_width="4.5dp"
/>
<!-- Title of package-->
<LinearLayout
android:id="@+id/titleDescriptionCase"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:layout_toRightOf="@+id/progress_bar"
android:layout_toEndOf="@+id/progress_bar"
android:layout_toLeftOf="@+id/buyCase"
>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="Rihanna Love the way"
android:textColor="@color/colorFontBlue"
android:textSize="16sp"
android:singleLine="false"
/>
<TextView
android:id="@+id/description"
android:layout_width="196dp"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:layout_marginTop="6dp"
android:singleLine="false"
android:text="Just gona stand there and ..."
android:textColor="#535353"
android:textSize="13sp"
/>
</LinearLayout>
<!--Buy and about-->
<LinearLayout
android:id="@+id/buyCase"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingRight="16dp"
android:paddingLeft="16dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignTop="@+id/titleDescriptionCase">
<!-- Buy button -->
<Button
android:id="@+id/btnBuy"
android:layout_width="62.5dp"
android:layout_height="26dp"
android:background="@drawable/button_board_baground"
android:text="4.99 $"
android:textColor="@color/colorFontBlue"
android:textSize="14sp"
/>
<!-- Short description about package -->
<TextView
android:id="@+id/count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginTop="9dp"
android:text="230 words"
android:textSize="14sp"
/>
</LinearLayout>
<!-- SHADOWS -->
<LinearLayout
android:id="@+id/shadowLayoutBottom"
android:layout_width="match_parent"
android:layout_height="2.5dp"
android:layout_alignParentBottom="true"
android:background="@drawable/shadow_bottom"
android:orientation="horizontal" />
<LinearLayout
android:id="@+id/linearLayoutTop"
android:layout_width="match_parent"
android:layout_height="1.7dp"
android:layout_alignParentTop="true"
android:background="@drawable/shadow_top"
android:orientation="vertical" />
</RelativeLayout>