|
<?xml version="1.0" encoding="utf-8"?> |
|
<!-- |
|
~ Copyright 2018 Google LLC |
|
~ |
|
~ Licensed under the Apache License, Version 2.0 (the "License"); |
|
~ you may not use this file except in compliance with the License. |
|
~ You may obtain a copy of the License at |
|
~ |
|
~ https://www.apache.org/licenses/LICENSE-2.0 |
|
~ |
|
~ Unless required by applicable law or agreed to in writing, software |
|
~ distributed under the License is distributed on an "AS IS" BASIS, |
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
~ See the License for the specific language governing permissions and |
|
~ limitations under the License. |
|
--> |
|
<layout 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"> |
|
|
|
<data> |
|
<variable |
|
name="plant" |
|
type="com.example.android.advancedcoroutines.Plant"/> |
|
</data> |
|
|
|
<com.example.android.advancedcoroutines.ui.MaskedCardView |
|
android:layout_width="match_parent" |
|
android:layout_height="wrap_content" |
|
android:layout_marginStart="@dimen/card_side_margin" |
|
android:layout_marginEnd="@dimen/card_side_margin" |
|
android:layout_marginBottom="@dimen/card_bottom_margin" |
|
app:cardElevation="@dimen/card_elevation" |
|
app:cardPreventCornerOverlap="false" |
|
app:shapeAppearanceOverlay="@style/ShapeAppearance.Sunflower.Card"> |
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout |
|
android:layout_width="match_parent" |
|
android:layout_height="wrap_content"> |
|
|
|
<ImageView |
|
android:id="@+id/plant_item_image" |
|
android:layout_width="0dp" |
|
android:layout_height="@dimen/plant_item_image_height" |
|
android:contentDescription="@string/a11y_plant_item_image" |
|
android:scaleType="centerCrop" |
|
app:imageFromUrl="@{plant.imageUrl}" |
|
app:layout_constraintEnd_toEndOf="parent" |
|
app:layout_constraintStart_toStartOf="parent" |
|
app:layout_constraintTop_toTopOf="parent" /> |
|
|
|
<TextView |
|
android:id="@+id/plant_item_title" |
|
android:layout_width="0dp" |
|
android:layout_height="wrap_content" |
|
android:layout_marginBottom="@dimen/margin_normal" |
|
android:layout_marginTop="@dimen/margin_normal" |
|
android:text="@{plant.name}" |
|
android:textAppearance="?attr/textAppearanceListItem" |
|
android:gravity="center_horizontal" |
|
app:layout_constraintEnd_toEndOf="parent" |
|
app:layout_constraintStart_toStartOf="parent" |
|
app:layout_constraintTop_toBottomOf="@id/plant_item_image" |
|
app:layout_constraintBottom_toBottomOf="parent" |
|
tools:text="Tomato"/> |
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout> |
|
|
|
</com.example.android.advancedcoroutines.ui.MaskedCardView> |
|
|
|
</layout> |