I have a row item layout that is being inflated by recyclerview.
Inside the row I have 2 elements that are action not as expected - Imageview image comes out constricted and the Textview text is linebreaking words in the middle of them.
For the image I tried to add scaleType="centerCrop" and that did not help
for the textView I added the following -
android:breakStrategy="simple"
android:hyphenationFrequency="none"
and yet again, did not help.
Here is my XML file:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_margin="10dp"
android:background="#b0b3b7"
app:cardCornerRadius="10dp"
android:elevation="10dp"
android:tag="0"
android:layout_height="wrap_content">
<android.support.constraint.ConstraintLayout
android:layout_width="395dp"
android:layout_height="170dp"
android:background="#b0b3b7"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/heroImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ProgressBar
android:id="@+id/adapterProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/heroTitle"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="5dp"
android:autoSizeMaxTextSize="25dp"
android:autoSizeMinTextSize="15dp"
android:text="Hero Title"
android:textColor="#000"
android:textSize="25dp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/heroAbilities"
app:layout_constraintEnd_toStartOf="@+id/heartImageView"
app:layout_constraintStart_toEndOf="@+id/heroImage"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/heroAbilities"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
android:autoSizeMaxTextSize="25dp"
android:autoSizeMinTextSize="15dp"
android:breakStrategy="simple"
android:hyphenationFrequency="none"
android:text="TextView"
android:textColor="#444"
android:textSize="18dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/heroImage"
app:layout_constraintTop_toBottomOf="@+id/heroTitle" />
<ImageView
android:id="@+id/heartImageView"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="9dp"
android:layout_marginEnd="24dp"
android:src="@drawable/empty_heart"
android:tag="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/heroTitle"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
and here is an image of what happens with the image and text -
https://github.com/alonsd/HeroApp/blob/master/HeroAppFront.jpeg