Improve view holder recipe layout
This commit is contained in:
@@ -4,7 +4,10 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/margin_small">
|
android:layout_marginVertical="7dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="19dp"
|
||||||
|
app:cardElevation="8dp">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -14,23 +17,30 @@
|
|||||||
android:id="@+id/name"
|
android:id="@+id/name"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/margin_small"
|
android:layout_marginTop="9dp"
|
||||||
android:gravity="center"
|
android:layout_marginBottom="5dp"
|
||||||
|
android:ellipsize="marquee"
|
||||||
|
android:singleLine="true"
|
||||||
android:textAppearance="?textAppearanceHeadline6"
|
android:textAppearance="?textAppearanceHeadline6"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="@+id/image"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="@+id/image"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/image"
|
app:layout_constraintTop_toBottomOf="@+id/image"
|
||||||
tools:text="A delicious cake" />
|
tools:text="A delicious cake" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/image"
|
android:id="@+id/image"
|
||||||
android:layout_width="@dimen/width_view_holder_recipe_image"
|
android:layout_width="300dp"
|
||||||
android:layout_height="@dimen/height_view_holder_recipe_image"
|
android:layout_height="@dimen/height_view_holder_recipe_image"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="13dp"
|
||||||
android:contentDescription="@string/content_description_view_holder_recipe_image"
|
android:contentDescription="@string/content_description_view_holder_recipe_image"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/name"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:srcCompat="@tools:sample/backgrounds/scenic" />
|
app:layout_constraintVertical_chainStyle="packed"
|
||||||
|
tools:srcCompat="@drawable/placeholder_recipe" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<dimen name="margin_small">8dp</dimen>
|
<dimen name="margin_small">8dp</dimen>
|
||||||
<dimen name="width_view_holder_recipe_image">360dp</dimen>
|
<dimen name="height_view_holder_recipe_image">182dp</dimen>
|
||||||
<dimen name="height_view_holder_recipe_image">180dp</dimen>
|
|
||||||
<dimen name="fragment_recipe_info_image_height">@dimen/height_view_holder_recipe_image</dimen>
|
<dimen name="fragment_recipe_info_image_height">@dimen/height_view_holder_recipe_image</dimen>
|
||||||
<dimen name="bottom_padding_instructions_list_fragment_recipe_info">30dp</dimen>
|
<dimen name="bottom_padding_instructions_list_fragment_recipe_info">30dp</dimen>
|
||||||
<dimen name="main_activity_toolbar_corner_radius">32dp</dimen>
|
<dimen name="main_activity_toolbar_corner_radius">32dp</dimen>
|
||||||
|
|||||||
Reference in New Issue
Block a user