Files
Xuewang365OSNeutral/app/src/main/res/layout-port/item_weather.xml
fanhuitong a29160563c version:4.1
fix:优化天气横竖屏报错
update:更新天气背景
2022-10-11 10:24:39 +08:00

76 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="300dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_margin="@dimen/dp_8"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/background_weather_sun"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_32"
android:layout_marginTop="@dimen/dp_32"
android:text="17:48"
android:textColor="@color/black"
android:textSize="@dimen/sp_20"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_weather"
android:layout_width="140dp"
android:layout_height="140dp"
android:adjustViewBounds="true"
android:layout_marginEnd="@dimen/dp_32"
android:scaleType="centerCrop"
android:src="@drawable/he100"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_weather"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="@dimen/sp_20"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/iv_bg" />
<TextView
android:id="@+id/tv_temp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="15-22"
android:layout_marginTop="@dimen/dp_8"
android:textColor="@color/black"
android:textSize="26sp"
app:layout_constraintEnd_toEndOf="@+id/iv_weather"
app:layout_constraintStart_toStartOf="@+id/iv_weather"
app:layout_constraintTop_toBottomOf="@+id/iv_weather" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>