Im trying to design a CardView to implement it in a RecyclerView whith a GridLayout. I designed the cardView but when I prove my design in different mobiles with different screen sizes the design doesn't scale itself. I used "dp" unity and "sp" unity like "Android developers" page shows.I don't know if I must create a design for each screen size or each screen density.
Can you help me?
Code:
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:cardCornerRadius="6dp"
app:cardElevation="4dp"
app:cardUseCompatPadding="true"
android:id="@+id/dlvsr_CardView">
<LinearLayout
android:layout_width="170dp"
android:layout_height="170dp"
android:orientation="vertical"
android:padding="4dp">
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_launcher_background" />
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="30dp"
android:ellipsize="end"
android:maxLines="1"
android:text="Text view tittle"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Text view subtittle" />
</LinearLayout>
Here are the examples:
https://i.stack.imgur.com/nRpBY.png
https://i.stack.imgur.com/scL7K.png