WeatherApp #8: WeatherModel, list_item.xml

WeatherModel

data class WeatherModel(
val city: String,
val time: String,
val condition: String,
val currentTemp: String,
val maxTemp: String,
val minTemp: String,
val imageUrl: String,
val hours: String
)

list_item.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.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_height="wrap_content"
android:layout_marginTop="3dp"
android:backgroundTint="@color/card_blue_bg"
app:cardCornerRadius="5dp"
app:cardElevation="0dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/tvDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:fontFamily="@font/aubrey"
android:text="Lunes 22 /12/2022"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tvCondition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:fontFamily="@font/aubrey"
android:text="Sunny"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/tvDate"
app:layout_constraintTop_toBottomOf="@+id/tvDate" />

<ImageView
android:id="@+id/im"
android:layout_width="50dp"
android:layout_height="50dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_launcher_foreground" />

<TextView
android:id="@+id/tvTemp"
android:layout_width="0dp"
android:layout_height="0dp"
android:fontFamily="@font/aubrey"
android:gravity="center"
android:text="25ºC"
android:textColor="@color/white"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/im"
app:layout_constraintStart_toEndOf="@+id/tvDate"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>

Добавить комментарий

Ваш адрес email не будет опубликован.