126 lines
5.1 KiB
XML
126 lines
5.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<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"
|
|
tools:context=".activity.weather.main.WeatherMainActivity">
|
|
|
|
<data>
|
|
|
|
<variable
|
|
name="click"
|
|
type="com.ttstd.dialer.activity.weather.main.WeatherMainActivity.BtnClick" />
|
|
|
|
<variable
|
|
name="weatherNow"
|
|
type="com.qweather.sdk.response.weather.WeatherNow" />
|
|
</data>
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:background="@color/black">
|
|
|
|
|
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
android:id="@+id/coordinatorLayout"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="@dimen/dp_180"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent">
|
|
|
|
<LinearLayout
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
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_location"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center"
|
|
android:maxLines="1"
|
|
android:singleLine="true"
|
|
android:textColor="@color/white"
|
|
android:textSize="@dimen/sp_30"
|
|
tools:text="北京" />
|
|
|
|
<TextView
|
|
android:id="@+id/tv_temp"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center"
|
|
android:layout_marginTop="@dimen/dp_4"
|
|
android:maxLines="1"
|
|
android:singleLine="true"
|
|
android:text="@{weatherNow.temp+`°`}"
|
|
android:textColor="@color/white"
|
|
android:textSize="@dimen/sp_40"
|
|
tools:text="N/A°" />
|
|
|
|
<TextView
|
|
android:id="@+id/tv_weather_text"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center"
|
|
android:maxLines="1"
|
|
android:singleLine="true"
|
|
android:text="@{weatherNow.text}"
|
|
android:textColor="@color/white"
|
|
android:textSize="@dimen/sp_20"
|
|
tools:text="晴" />
|
|
|
|
<TextView
|
|
android:id="@+id/tv_temp_range"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center"
|
|
android:maxLines="1"
|
|
android:singleLine="true"
|
|
android:textColor="@color/white"
|
|
android:textSize="@dimen/sp_20"
|
|
tools:text="最高10° 最低0°" />
|
|
|
|
</LinearLayout>
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
|
|
<androidx.core.widget.NestedScrollView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/coordinatorLayout">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:orientation="vertical"
|
|
android:layout_height="wrap_content">
|
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:id="@+id/rv_hourly"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content" />
|
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:id="@+id/recyclerView"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent" />
|
|
|
|
</LinearLayout>
|
|
|
|
</androidx.core.widget.NestedScrollView>
|
|
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
|
</layout> |