<?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"
xmlns:bind="http://schemas.android.com/apk/res-auto">
<data>
<variable name="viewModel" type="com.king.weather.app.main.MainViewModel"/>
<variable name="live" type="com.amap.api.services.weather.LocalWeatherLive"/>
<variable name="forecast" type="com.amap.api.services.weather.LocalWeatherForecast"/>
</data>
<androidx.drawerlayout.widget.DrawerLayout
android:id="@+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/weather_bg">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_16">
<TextView
android:id="@+id/tvCity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_10"
android:textSize="@dimen/city_text_size"
android:textColor="@color/text_white"
android:text="@{live.city}"
tools:text="深圳"
android:singleLine="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<TextView
android:id="@+id/tvReportTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:textColor="@color/text_white"
bind:date="@{live.reportTime}"
tools:text="2019-7-25 10:00 发布"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
<View android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/tvTemperature"
app:layout_constraintBottom_toBottomOf="@+id/tvHumidity"
android:background="@drawable/shape_bg"/>
<TextView
android:id="@+id/tvTemperature"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:textSize="@dimen/temperature_text_size"
android:textColor="@color/text_white"
bind:temperature="@{live.temperature}"
tools:text="26℃"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvCity"/>
<TextView
android:id="@+id/tvWeather"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:textSize="@dimen/weather_text_size"
android:textColor="@color/text_white"
android:text="@{live.weather}"
tools:text="晴"
app:layout_constraintLeft_toRightOf="@+id/tvTemperature"
app:layout_constraintBottom_toBottomOf="@+id/tvTemperature"/>
<TextView
android:id="@+id/tvWind"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:textColor="@color/text_white"
bind:windDirection="@{live.windDirection}"
bind:windPower="@{live.windPower}"
tools:text="西北风 3级"
app:layout_constraintLeft_toLeftOf="@+id/tvWeather"
app:layout_constraintTop_toBottomOf="@+id/tvWeather"/>
<TextView
android:id="@+id/tvHumidity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/text_white"
android:layout_marginTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10"
bind:humidity="@{live.humidity}"
tools:text="湿度 52%"
app:layout_constraintLeft_toLeftOf="@+id/tvWeather"
app:layout_constraintTop_toBottomOf="@+id/tvWind"/>
<View android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_10"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvHumidity"
app:layout_constraintBottom_toBottomOf="@+id/rv"
android:background="@drawable/shape_bg"/>
<TextView
android:id="@+id/tvLabelForecast"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/text_white"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_20"
android:textSize="@dimen/sp_20"
android:text="@string/label_forecast"
没有合适的资源?快使用搜索试试~ 我知道了~
一个基于Jetpack构建的MVVM天气预报APP
共73个文件
png:23个
kt:18个
xml:16个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 198 浏览量
2023-12-31
10:27:56
上传
评论
收藏 12.87MB ZIP 举报
温馨提示
KingWeather 是基于MVVMFrame快速开发框架构建的一个简单的天气预报APP。主要用于熟悉Kotlin的基本语法
资源推荐
资源详情
资源评论
收起资源包目录
KingWeather-master.zip (73个子文件)
KingWeather-master
gradle.properties 1KB
gradle
wrapper
gradle-wrapper.jar 53KB
gradle-wrapper.properties 232B
app
src
androidTest
java
com
king
weather
ExampleInstrumentedTest.kt 620B
test
java
com
king
weather
ExampleUnitTest.kt 342B
main
ic_launcher-web.png 73KB
java
com
king
weather
binding
BindAdapter.kt 1KB
app
adapter
BindingHolder.kt 460B
BindingAdapter.kt 897B
main
MainActivity.kt 8KB
MainViewModel.kt 2KB
Constants.kt 241B
config
ConfigModule.kt 490B
api
ApiService.kt 337B
App.kt 1KB
util
WeatherUtils.kt 946B
di
component
ApplicationComponent.kt 492B
module
FragmentModule.kt 287B
ActivityModule.kt 470B
ApplicationModule.kt 336B
ViewModelModule.kt 498B
bean
City.kt 140B
res
mipmap-xxhdpi
ic_launcher_background.png 53KB
ic_launcher_round.png 14KB
ic_launcher_foreground.png 6KB
ic_launcher.png 9KB
mipmap-hdpi
ic_launcher_background.png 11KB
ic_launcher_round.png 5KB
ic_launcher_foreground.png 2KB
ic_launcher.png 3KB
drawable-v24
ic_launcher_foreground.xml 2KB
mipmap-anydpi-v26
ic_launcher.xml 266B
ic_launcher_round.xml 266B
drawable-xxhdpi
weather_bg.jpg 55KB
menu_home.png 652B
menu
search_view_menu.xml 391B
mipmap-mdpi
ic_launcher_background.png 4KB
ic_launcher_round.png 3KB
ic_launcher_foreground.png 2KB
ic_launcher.png 2KB
mipmap-xxxhdpi
ic_launcher_background.png 91KB
ic_launcher_round.png 21KB
ic_launcher_foreground.png 10KB
ic_launcher.png 15KB
mipmap-xhdpi
ic_launcher_background.png 22KB
ic_launcher_round.png 7KB
ic_launcher_foreground.png 4KB
ic_launcher.png 5KB
values
dimens.xml 1KB
ic_launcher_background.xml 120B
colors.xml 452B
strings.xml 718B
styles.xml 518B
layout
rv_forecast_item.xml 2KB
main_activity.xml 9KB
rv_city_item.xml 915B
drawable
ic_launcher_background.xml 5KB
shape_bg.xml 206B
list_divider.xml 198B
AndroidManifest.xml 2KB
proguard-rules.pro 751B
build.gradle 2KB
release
app-release.apk 10.83MB
output.json 234B
.gitignore 7B
LICENSE 1KB
gradlew.bat 2KB
GIF.gif 2.18MB
QR_KingWeather.png 17KB
build.gradle 661B
settings.gradle 15B
gradlew 5KB
.gitignore 87B
共 73 条
- 1
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6753
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功