├── .idea
├── .name
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── vcs.xml
├── modules.xml
├── runConfigurations.xml
├── gradle.xml
├── compiler.xml
└── misc.xml
├── app
├── .gitignore
├── libs
│ ├── locSDK_3.1.jar
│ └── baidumapapi_v2_1_2.jar
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── logo.jpg
│ │ │ │ ├── bg_new.jpg
│ │ │ │ ├── bg_sky.jpg
│ │ │ │ ├── bg_title.jpg
│ │ │ │ ├── icon_shirt.png
│ │ │ │ ├── bg_rain_cloud1.png
│ │ │ │ ├── icon_car_wash.png
│ │ │ │ ├── icon_first_aid.png
│ │ │ │ ├── icon_umbrella.png
│ │ │ │ ├── icon_wash_car.png
│ │ │ │ ├── sunny_day_wave1.png
│ │ │ │ ├── bg_night_cloud_s.png
│ │ │ │ ├── bg_moderate_rain_day.jpg
│ │ │ │ ├── icon_happy_cartoon.png
│ │ │ │ ├── sunny_day_sunshine.png
│ │ │ │ ├── sunny_night_seawater.png
│ │ │ │ ├── ic_trending_up_black_24dp.xml
│ │ │ │ ├── slidingtab_bg.xml
│ │ │ │ ├── ic_add_location_black_24dp.xml
│ │ │ │ ├── ic_feedback_black_24dp.xml
│ │ │ │ ├── rectangle_left_select.xml
│ │ │ │ ├── rectangle_right_select.xml
│ │ │ │ ├── ic_location_city_black_24dp.xml
│ │ │ │ ├── ic_search_black_24dp.xml
│ │ │ │ ├── icon_humidity.xml
│ │ │ │ ├── icon_cloth.xml
│ │ │ │ ├── rectangle_left.xml
│ │ │ │ ├── rectangle_right.xml
│ │ │ │ ├── icon_time.xml
│ │ │ │ ├── icon_sport.xml
│ │ │ │ ├── icon_temp.xml
│ │ │ │ ├── icon_wind.xml
│ │ │ │ └── icon_travel.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── a100.png
│ │ │ │ ├── a101.png
│ │ │ │ ├── a102.png
│ │ │ │ ├── a103.png
│ │ │ │ ├── a104.png
│ │ │ │ ├── b200.png
│ │ │ │ ├── b201.png
│ │ │ │ ├── b202.png
│ │ │ │ ├── b203.png
│ │ │ │ ├── b204.png
│ │ │ │ ├── b205.png
│ │ │ │ ├── b206.png
│ │ │ │ ├── b207.png
│ │ │ │ ├── b208.png
│ │ │ │ ├── b209.png
│ │ │ │ ├── b210.png
│ │ │ │ ├── b211.png
│ │ │ │ ├── b212.png
│ │ │ │ ├── b213.png
│ │ │ │ ├── c300.png
│ │ │ │ ├── c301.png
│ │ │ │ ├── c302.png
│ │ │ │ ├── c303.png
│ │ │ │ ├── c304.png
│ │ │ │ ├── c305.png
│ │ │ │ ├── c306.png
│ │ │ │ ├── c307.png
│ │ │ │ ├── c308.png
│ │ │ │ ├── c309.png
│ │ │ │ ├── c310.png
│ │ │ │ ├── c311.png
│ │ │ │ ├── c312.png
│ │ │ │ ├── c313.png
│ │ │ │ ├── d400.png
│ │ │ │ ├── d401.png
│ │ │ │ ├── d402.png
│ │ │ │ ├── d403.png
│ │ │ │ ├── d404.png
│ │ │ │ ├── d405.png
│ │ │ │ ├── d406.png
│ │ │ │ ├── d407.png
│ │ │ │ ├── e500.png
│ │ │ │ ├── e501.png
│ │ │ │ ├── e502.png
│ │ │ │ ├── e503.png
│ │ │ │ ├── e504.png
│ │ │ │ ├── e507.png
│ │ │ │ ├── e508.png
│ │ │ │ ├── e900.png
│ │ │ │ ├── e901.png
│ │ │ │ ├── e999.png
│ │ │ │ ├── icon_sex.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── icon_avatar.png
│ │ │ │ ├── icon_collect.png
│ │ │ │ ├── icon_user_msg.png
│ │ │ │ ├── icon_avatar_none.png
│ │ │ │ ├── icon_user_follow.png
│ │ │ │ ├── icon_expand_select.png
│ │ │ │ └── icon_user_editprofile.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── values
│ │ │ │ ├── icons.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ ├── values-v21
│ │ │ │ ├── attrs.xml
│ │ │ │ └── styles.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ ├── layout
│ │ │ │ ├── recycler_view.xml
│ │ │ │ ├── city_name_item.xml
│ │ │ │ ├── activity_selected_city_layout.xml
│ │ │ │ ├── forecast_fragment_layout.xml
│ │ │ │ ├── activity_trend.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── ic_headerbar.xml
│ │ │ │ ├── suggestion_item_layout.xml
│ │ │ │ ├── view_navigationbar.xml
│ │ │ │ ├── item_hourly_forecast.xml
│ │ │ │ ├── content_main.xml
│ │ │ │ ├── activity_home.xml
│ │ │ │ ├── item_daily_forecast.xml
│ │ │ │ ├── now_weather_cardview.xml
│ │ │ │ └── view_userinfo_header.xml
│ │ │ └── menu
│ │ │ │ ├── menu_main.xml
│ │ │ │ └── main.xml
│ │ ├── jniLibs
│ │ │ └── armeabi
│ │ │ │ └── liblocSDK3.so
│ │ ├── java
│ │ │ ├── br
│ │ │ │ └── com
│ │ │ │ │ └── mauker
│ │ │ │ │ └── MsvAuthority.java
│ │ │ └── com
│ │ │ │ └── jc
│ │ │ │ └── heweather
│ │ │ │ ├── model
│ │ │ │ ├── IDataSource.java
│ │ │ │ ├── entity
│ │ │ │ │ ├── Weather.java
│ │ │ │ │ ├── Error.java
│ │ │ │ │ ├── VerifyMessage.java
│ │ │ │ │ ├── DailyForecastWeather.java
│ │ │ │ │ ├── TrendData.java
│ │ │ │ │ ├── Location.java
│ │ │ │ │ ├── WeatherItem.java
│ │ │ │ │ ├── BasicInfo.java
│ │ │ │ │ ├── Suggestion.java
│ │ │ │ │ ├── HourlyForecastItem.java
│ │ │ │ │ ├── NowWeather.java
│ │ │ │ │ └── DailyForecastItem.java
│ │ │ │ └── WeatherDataSource.java
│ │ │ │ ├── presenter
│ │ │ │ ├── IMainPresenter.java
│ │ │ │ └── WeatherPresenter.java
│ │ │ │ ├── utils
│ │ │ │ ├── EventBus.java
│ │ │ │ ├── ConstantData.java
│ │ │ │ ├── SharedPreferenceUtil.java
│ │ │ │ └── ScrollableHelper.java
│ │ │ │ ├── view
│ │ │ │ ├── IMainView.java
│ │ │ │ ├── SuggestionFragment.java
│ │ │ │ ├── DailyForecastWeatherFragment.java
│ │ │ │ ├── WeatherTrendActivity.java
│ │ │ │ └── ScrollableLayout.java
│ │ │ │ ├── adapter
│ │ │ │ ├── FragmentViewPagerAdapter.java
│ │ │ │ ├── HourlyWeatherAdapter.java
│ │ │ │ ├── SuggestionAdapter.java
│ │ │ │ └── DailyWeatherAdapter.java
│ │ │ │ ├── network
│ │ │ │ ├── NetStatusReceiver.java
│ │ │ │ └── NetworkUtil.java
│ │ │ │ ├── WeatherApplication.java
│ │ │ │ └── weight
│ │ │ │ └── LineChart.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── jc
│ │ │ └── heweather
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── jc
│ │ └── heweather
│ │ └── ApplicationTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── app.apk
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── README.md
├── gradle.properties
├── gradlew.bat
└── gradlew
/.idea/.name:
--------------------------------------------------------------------------------
1 | HeWeather
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/app.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app.apk
--------------------------------------------------------------------------------
/app/libs/locSDK_3.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/libs/locSDK_3.1.jar
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/libs/baidumapapi_v2_1_2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/libs/baidumapapi_v2_1_2.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/logo.jpg
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_new.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/bg_new.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_sky.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/bg_sky.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/a100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/a100.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/a101.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/a101.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/a102.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/a102.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/a103.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/a103.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/a104.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/a104.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b200.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b201.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b201.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b202.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b202.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b203.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b203.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b204.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b204.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b205.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b205.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b206.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b206.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b207.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b207.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b208.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b208.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b209.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b209.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b210.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b210.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b211.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b211.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b212.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b212.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/b213.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/b213.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c300.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c300.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c301.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c301.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c302.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c302.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c303.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c303.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c304.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c304.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c305.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c305.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c306.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c306.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c307.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c307.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c308.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c308.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c309.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c309.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c310.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c311.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c311.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c312.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c312.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/c313.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/c313.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/d400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/d400.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/d401.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/d401.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/d402.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/d402.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/d403.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/d403.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/d404.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/d404.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/d405.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/d405.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/d406.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/d406.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/d407.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/d407.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/e500.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/e500.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/e501.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/e501.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/e502.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/e502.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/e503.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/e503.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/e504.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/e504.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/e507.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/e507.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/e508.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/e508.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/e900.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/e900.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/e901.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/e901.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/e999.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/e999.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_title.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/bg_title.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_shirt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/icon_shirt.png
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/liblocSDK3.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/jniLibs/armeabi/liblocSDK3.so
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/icon_sex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/icon_sex.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_rain_cloud1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/bg_rain_cloud1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_car_wash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/icon_car_wash.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_first_aid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/icon_first_aid.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_umbrella.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/icon_umbrella.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_wash_car.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/icon_wash_car.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/sunny_day_wave1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/sunny_day_wave1.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/icon_avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/icon_avatar.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/icon_collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/icon_collect.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_night_cloud_s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/bg_night_cloud_s.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/icon_user_msg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/icon_user_msg.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_moderate_rain_day.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/bg_moderate_rain_day.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_happy_cartoon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/icon_happy_cartoon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/sunny_day_sunshine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/sunny_day_sunshine.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/sunny_night_seawater.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/drawable/sunny_night_seawater.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/icon_avatar_none.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/icon_avatar_none.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/icon_user_follow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/icon_user_follow.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/icon_expand_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/icon_expand_select.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/icon_user_editprofile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/githubhaohao/RainbowWeather/HEAD/app/src/main/res/mipmap-hdpi/icon_user_editprofile.png
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/br/com/mauker/MsvAuthority.java:
--------------------------------------------------------------------------------
1 | package br.com.mauker;
2 |
3 | public class MsvAuthority {
4 | public static final String CONTENT_AUTHORITY = "br.com.mauker.materialsearchview.searchhistorydatabase";
5 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/icons.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Sep 28 11:13:04 CST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/IDataSource.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model;
2 |
3 | /**
4 | * Created by HaohaoChang on 2016/8/19.
5 | */
6 | public interface IDataSource {
7 | void getWeatherDataById(String city_id);
8 | void getWeatherDataByName(String city_name);
9 | void verifyCity(String cityName);
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #aa66cc
6 | #BDBDBD
7 | #85fdbe01
8 |
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RainbowWeather
2 | 一个精简的天气 APP 。MVP 架构,具有定位、城市查询以及温度走势分析功能。
3 |
4 | ## APK
5 | [download](https://github.com/githubhaohao/RainbowWeather/raw/master/app.apk)
6 |
7 | ## Preview
8 | 
9 | 
10 | 
11 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/presenter/IMainPresenter.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.presenter;
2 |
3 | /**
4 | * Created by HaohaoChang on 2016/8/19.
5 | */
6 | public interface IMainPresenter {
7 | void loadWeatherDataById(String city_id);
8 | void loadWeatherDataByName(String city_name);
9 | void queryCity(String city_name);
10 | void start();
11 | void stop();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycler_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/test/java/com/jc/heweather/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/Weather.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | /**
7 | * Created by HaohaoChang on 2016/8/19.
8 | */
9 | public class Weather implements Serializable {
10 | private List weather;
11 |
12 | public List getWeather() {
13 | return weather;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/utils/EventBus.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.utils;
2 |
3 | import com.squareup.otto.Bus;
4 |
5 | /**
6 | * Created by HaohaoChang on 2016/8/19.
7 | */
8 | public class EventBus extends Bus {
9 | private static Bus bus;
10 | public static Bus getInstance() {
11 | if (null == bus) {
12 | bus = new Bus();
13 | }
14 | return bus;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_trending_up_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/jc/heweather/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/slidingtab_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add_location_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_feedback_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/city_name_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_selected_city_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/Error.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | /**
4 | * Created by HaohaoChang on 2016/8/26.
5 | */
6 | public class Error {
7 | private String message;
8 | private String path;
9 |
10 | public Error(String message, String path) {
11 | this.message = message;
12 | this.path = path;
13 | }
14 |
15 | public String getMessage() {
16 | return message;
17 | }
18 |
19 | public String getPath() {
20 | return path;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rectangle_left_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rectangle_right_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/VerifyMessage.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | /**
4 | * Created by HaohaoChang on 2016/8/27.
5 | */
6 | public class VerifyMessage {
7 | private boolean isOk;
8 | private String message;
9 |
10 | public VerifyMessage(boolean isOk, String message) {
11 | this.isOk = isOk;
12 | this.message = message;
13 | }
14 |
15 | public boolean isOk() {
16 | return isOk;
17 | }
18 |
19 | public String getMessage() {
20 | return message;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/DailyForecastWeather.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | /**
7 | * Created by HaohaoChang on 2016/8/25.
8 | */
9 | public class DailyForecastWeather implements Serializable{
10 |
11 | private List data = null;
12 |
13 | public DailyForecastWeather(List data) {
14 | this.data = data;
15 | }
16 |
17 | public List getData() {
18 | return data;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/view/IMainView.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.view;
2 |
3 | import com.jc.heweather.model.entity.Location;
4 | import com.jc.heweather.model.entity.VerifyMessage;
5 | import com.jc.heweather.model.entity.WeatherItem;
6 |
7 | /**
8 | * Created by HaohaoChang on 2016/8/19.
9 | */
10 | public interface IMainView {
11 | void showLoadingView();
12 | void hideLoadingView();
13 | void showWeatherData(WeatherItem weatherItem);
14 | void showError(String error);
15 | void showVerifyMessage(VerifyMessage message);
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_location_city_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/forecast_fragment_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/utils/ConstantData.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.utils;
2 |
3 | import com.jc.heweather.WeatherApplication;
4 |
5 | /**
6 | * Created by HaohaoChang on 2016/8/18.
7 | */
8 | public class ConstantData {
9 | public static String BASE_URL = "https://api.heweather.com/x3/weather?key=8ba059b69caa46b38ace4827370daf5a&cityid=";
10 | public static String CITY_NAME_URL = "https://api.heweather.com/x3/weather?key=8ba059b69caa46b38ace4827370daf5a&city=";
11 | public static String APP_KEY = "8ba059b69caa46b38ace4827370daf5a";
12 | public static String CITY_ID = "CN101181608";//新蔡
13 | public static String CITY_NAME = "新蔡";
14 | public static String JSON_KEY = "HeWeather data service 3.0";
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/adapter/FragmentViewPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.adapter;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | import android.support.v4.app.FragmentPagerAdapter;
6 |
7 | import com.jc.heweather.view.DailyForecastWeatherFragment;
8 |
9 | /**
10 | * Created by HaohaoChang on 2016/8/24.
11 | */
12 | public class FragmentViewPagerAdapter extends FragmentPagerAdapter {
13 | public FragmentViewPagerAdapter(FragmentManager fm) {
14 | super(fm);
15 | }
16 |
17 | @Override
18 | public Fragment getItem(int position) {
19 | return new DailyForecastWeatherFragment();
20 | }
21 |
22 | @Override
23 | public int getCount() {
24 | return 2;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 彩虹天气
3 | Settings
4 | °
5 |
6 |
7 | - 新蔡
8 | - 杭州
9 | - 南京
10 | - 上海
11 | - 广州
12 | - 深圳
13 | - 北京
14 | - 重庆
15 | - 昆明
16 | - 信阳
17 | - 郑州
18 | - 合肥
19 | - 阜阳
20 | - 苏州
21 | - 南通
22 | - 固始
23 | - 徐州
24 | - 如皋
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_humidity.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in K:\AndroidSDK/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 | -keep class br.com.mauker.MsvAuthority
19 | -keepclassmembers class br.com.mauker.** { *; }
20 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/TrendData.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * Created by HaohaoChang on 2016/12/3.
7 | */
8 | public class TrendData implements Serializable {
9 | private int[] maxTemps;
10 | private int[] minTemps;
11 | private String[] xAxisTexts;
12 |
13 | public TrendData(int[] maxTemps, int[] minTemps, String[] xAxisTexts) {
14 | this.maxTemps = maxTemps;
15 | this.minTemps = minTemps;
16 | this.xAxisTexts = xAxisTexts;
17 | }
18 |
19 | public int[] getMaxTemps() {
20 | return maxTemps;
21 | }
22 |
23 | public int[] getMinTemps() {
24 | return minTemps;
25 | }
26 |
27 | public String[] getxAxisTexts() {
28 | return xAxisTexts;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/Location.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | /**
4 | * Created by HaohaoChang on 2016/8/26.
5 | */
6 | public class Location {
7 | private String location;
8 | private boolean isOk;
9 |
10 | public Location(String s) {
11 | if (s.contains("省") && s.contains("市")) {
12 | location = s.substring(s.indexOf("省") + 1, s.indexOf("市"));
13 | isOk = true;
14 | } else if (s.contains("市")) {
15 | location = s.substring(0, s.indexOf("市"));
16 | isOk = true;
17 | } else {
18 | location = "新蔡";
19 | isOk = false;
20 | }
21 | }
22 |
23 | public String getLocation() {
24 | return location;
25 | }
26 |
27 | public boolean isOk() {
28 | return isOk;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_cloth.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/app/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/WeatherItem.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | /**
7 | * Created by HaohaoChang on 2016/8/18.
8 | */
9 | public class WeatherItem implements Serializable {
10 | private BasicInfo basic;
11 | private List daily_forecast;
12 | private List hourly_forecast;
13 | private NowWeather now;
14 | private String status;
15 | private Suggestion suggestion;
16 |
17 | public BasicInfo getBasic() {
18 | return basic;
19 | }
20 |
21 | public List getDaily_forecast() {
22 | return daily_forecast;
23 | }
24 |
25 | public List getHourly_forecast() {
26 | return hourly_forecast;
27 | }
28 |
29 | public NowWeather getNow() {
30 | return now;
31 | }
32 |
33 | public String getStatus() {
34 | return status;
35 | }
36 |
37 | public Suggestion getSuggestion() {
38 | return suggestion;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rectangle_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
7 |
8 |
9 |
10 |
11 |
12 | -
13 |
14 |
17 |
22 |
23 |
24 |
25 |
26 | -
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rectangle_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
7 |
8 |
9 |
10 |
11 |
12 | -
13 |
14 |
17 |
22 |
23 |
24 |
25 |
26 | -
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/BasicInfo.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * Created by HaohaoChang on 2016/8/18.
7 | */
8 | public class BasicInfo implements Serializable {
9 | private String city;
10 | private String cnty;
11 | private String id;
12 | private String lat;
13 | private String lon;
14 | private Update update;
15 |
16 | public String getCity() {
17 | return city;
18 | }
19 |
20 | public String getCnty() {
21 | return cnty;
22 | }
23 |
24 | public String getId() {
25 | return id;
26 | }
27 |
28 | public String getLat() {
29 | return lat;
30 | }
31 |
32 | public String getLon() {
33 | return lon;
34 | }
35 |
36 | public Update getUpdate() {
37 | return update;
38 | }
39 |
40 | private class Update {
41 | String loc;
42 | String utc;
43 |
44 | public String getLoc() {
45 | return loc;
46 | }
47 |
48 | public String getUtc() {
49 | return utc;
50 | }
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_trend.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
10 |
15 |
21 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
18 |
19 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/Suggestion.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * Created by HaohaoChang on 2016/8/18.
7 | */
8 | public class Suggestion implements Serializable {
9 | private Description comf; //感觉
10 | private Description cw; //洗车指数
11 | private Description drsg; //穿衣指数
12 | private Description flu; //感冒指数
13 | private Description sport; //运动指数
14 | private Description trav; //旅游指数
15 | private Description uv; //紫外线指数
16 |
17 | public Description getComf() {
18 | return comf;
19 | }
20 |
21 | public Description getCw() {
22 | return cw;
23 | }
24 |
25 | public Description getDrsg() {
26 | return drsg;
27 | }
28 |
29 | public Description getFlu() {
30 | return flu;
31 | }
32 |
33 | public Description getSport() {
34 | return sport;
35 | }
36 |
37 | public Description getTrav() {
38 | return trav;
39 | }
40 |
41 | public Description getUv() {
42 | return uv;
43 | }
44 |
45 | public class Description {
46 | String brf;
47 | String txt;
48 |
49 | public String getBrf() {
50 | return brf;
51 | }
52 |
53 | public String getTxt() {
54 | return txt;
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/HourlyForecastItem.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * Created by HaohaoChang on 2016/8/18.
7 | */
8 | public class HourlyForecastItem implements Serializable{
9 | private String date; //当地日期和时间
10 | private String hum; //当前温度(摄氏度)
11 | private String pop; //降水概率
12 | private String pres; //气压
13 | private String tmp; //当前温度(摄氏度)
14 | private Wind wind; //风力状况
15 |
16 | public Wind getWind() {
17 | return wind;
18 | }
19 |
20 | public class Wind { //风力状况
21 | String deg; //风向(角度)
22 | String dir; //风向(方向)
23 | String sc; //风力等级
24 | String spd; //风速(Kmph)
25 |
26 | public String getDeg() {
27 | return deg;
28 | }
29 |
30 | public String getDir() {
31 | return dir;
32 | }
33 |
34 | public String getSc() {
35 | return sc;
36 | }
37 |
38 | public String getSpd() {
39 | return spd;
40 | }
41 | }
42 |
43 | public String getDate() {
44 | return date;
45 | }
46 |
47 | public String getHum() {
48 | return hum;
49 | }
50 |
51 | public String getPop() {
52 | return pop;
53 | }
54 |
55 | public String getPres() {
56 | return pres;
57 | }
58 |
59 | public String getTmp() {
60 | return tmp;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/NowWeather.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * Created by HaohaoChang on 2016/8/18.
7 | */
8 | public class NowWeather implements Serializable {
9 | private HourlyForecastItem.Wind wind; //风力状况
10 | private String fl; //体感温度
11 | private String hum; //湿度(%)
12 | private String pcpn; //降雨量(mm)
13 | private String pres; //气压
14 | private String tmp; //当前温度(摄氏度)
15 | private String vis; //能见度(km)
16 | private Cond cond; //天气状况
17 |
18 | public HourlyForecastItem.Wind getWind() {
19 | return wind;
20 | }
21 |
22 | public String getFl() {
23 | return fl;
24 | }
25 |
26 | public String getHum() {
27 | return hum;
28 | }
29 |
30 | public String getPcpn() {
31 | return pcpn;
32 | }
33 |
34 | public String getPres() {
35 | return pres;
36 | }
37 |
38 | public String getTmp() {
39 | return tmp;
40 | }
41 |
42 | public String getVis() {
43 | return vis;
44 | }
45 |
46 | public Cond getCond() {
47 | return cond;
48 | }
49 |
50 | public class Cond { //天气状况
51 | String code; //天气代码
52 | String txt; // 天气描述
53 |
54 | public String getCode() {
55 | return code;
56 | }
57 |
58 | public String getTxt() {
59 | return txt;
60 | }
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/network/NetStatusReceiver.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.network;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.net.ConnectivityManager;
7 | import android.net.NetworkInfo;
8 | import android.widget.Toast;
9 |
10 | /**
11 | * Created by HaohaoChang on 2016/3/19.
12 | */
13 | public class NetStatusReceiver extends BroadcastReceiver {
14 |
15 | public static boolean isConnected = false;
16 |
17 | @Override
18 | public void onReceive(Context context, Intent intent) {
19 | ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(context.CONNECTIVITY_SERVICE);
20 | NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
21 | if (activeNetworkInfo == null || !activeNetworkInfo.isAvailable()) {
22 | Toast.makeText(context, "网络连接不可用", Toast.LENGTH_SHORT).show();
23 | isConnected = false;
24 | } else {
25 | int networkType = activeNetworkInfo.getType();
26 | if (networkType == ConnectivityManager.TYPE_WIFI) {
27 | Toast.makeText(context,"正在使用wifi连接", Toast.LENGTH_SHORT).show();
28 | isConnected = true;
29 | } else if (networkType == connectivityManager.TYPE_MOBILE) {
30 | Toast.makeText(context, "正在使用移动网络", Toast.LENGTH_SHORT).show();
31 | isConnected = true;
32 |
33 | }
34 | }
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_time.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion "24.0.1"
6 |
7 | defaultConfig {
8 | applicationId "com.jc.heweather"
9 | minSdkVersion 19
10 | targetSdkVersion 21
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 |
21 | lintOptions {
22 | abortOnError false
23 | }
24 |
25 | }
26 |
27 | dependencies {
28 | compile fileTree(include: ['*.jar'], dir: 'libs')
29 | testCompile 'junit:junit:4.12'
30 | compile 'com.android.support:appcompat-v7:24.0.0-beta1'
31 | compile 'com.android.support:design:24.0.0-beta1'
32 | compile 'com.android.support:recyclerview-v7:24.0.0'
33 | compile 'com.android.support:palette-v7:24.0.0'
34 | compile 'com.squareup:otto:+'
35 | compile 'com.jakewharton:butterknife:7.0.0'
36 | compile 'com.android.support:cardview-v7:24.0.0'
37 | compile 'com.orhanobut:logger:1.3'
38 | //compile 'com.squareup.retrofit:retrofit:1.9.0'
39 | compile 'in.srain.cube:ultra-ptr:1.0.11'
40 | compile 'com.android.volley:volley:1.0.0'
41 | compile 'com.google.code.gson:gson:2.2.4'
42 | compile 'com.github.bumptech.glide:glide:3.6.1'
43 | compile 'com.github.rubensousa:FloatingToolbar:1.1.1'
44 | compile 'br.com.mauker.materialsearchview:materialsearchview:1.1.3'
45 | compile files('libs/locSDK_3.1.jar')
46 | compile files('libs/baidumapapi_v2_1_2.jar')
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_sport.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ic_headerbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
24 |
33 |
34 |
35 |
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/suggestion_item_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
20 |
21 |
22 |
29 |
35 |
36 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/utils/SharedPreferenceUtil.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.utils;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 |
6 | import com.jc.heweather.WeatherApplication;
7 |
8 | /**
9 | * Created by HaohaoChang on 2016/8/20.
10 | */
11 | public class SharedPreferenceUtil {
12 | public static final String CITY_COUNT = "city_count";
13 | public static final String STORAGE_STATUS = "storage_status";
14 | public static final String CITY_NAME = "city_name";
15 | public static final String IS_READY = "is_ready";
16 | private static SharedPreferenceUtil instance;
17 | private SharedPreferences preferences;
18 |
19 | public SharedPreferenceUtil(Context context) {
20 | preferences = context.getSharedPreferences("Setting",Context.MODE_PRIVATE);
21 | }
22 |
23 | public static SharedPreferenceUtil getInstance() {
24 | if (instance == null) {
25 | instance = new SharedPreferenceUtil(WeatherApplication.applicationContext);
26 | }
27 | return instance;
28 | }
29 |
30 | public int getInt(String key,int def) {
31 | return preferences.getInt(key,def);
32 | }
33 |
34 | public void putInt(String key,int value) {
35 |
36 | preferences.edit().putInt(key,value).apply();
37 | }
38 |
39 | public String getString(String key,String def) {
40 | return preferences.getString(key,def);
41 | }
42 |
43 | public void putString(String key,String value) {
44 | preferences.edit().putString(key,value).apply();
45 | }
46 |
47 | public boolean getBoolean(String key,boolean def) {
48 |
49 | return preferences.getBoolean(key,def);
50 |
51 | }
52 |
53 | public void putBoolean(String key,boolean value) {
54 | preferences.edit().putBoolean(key,value).apply();
55 | }
56 |
57 | public void commit() {
58 | preferences.edit().commit();
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/network/NetworkUtil.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.network;
2 |
3 | import android.content.Context;
4 | import android.content.DialogInterface;
5 | import android.content.Intent;
6 | import android.net.ConnectivityManager;
7 | import android.net.NetworkInfo;
8 | import android.support.v7.app.AlertDialog;
9 |
10 | /**
11 | * Created by HaohaoChang on 2016/5/26.
12 | */
13 | public class NetworkUtil {
14 |
15 | public static boolean isConnected(Context context) {
16 | ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
17 | NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
18 | if (networkInfo != null) {
19 | return true;
20 | } else {
21 | return false;
22 | }
23 | }
24 |
25 | public static void noNetworkAlert(final Context context) {
26 | new AlertDialog.Builder(context)
27 | .setTitle("网络状态提醒")
28 | .setMessage("当前网络不可用,是否打开网络设置?")
29 | .setPositiveButton("确定", new DialogInterface.OnClickListener() {
30 | @Override
31 | public void onClick(DialogInterface dialog, int which) {
32 | if (android.os.Build.VERSION.SDK_INT > 10) {
33 | context.startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS));
34 | } else {
35 | context.startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));
36 | }
37 | }
38 | })
39 | .setNegativeButton("取消", new DialogInterface.OnClickListener() {
40 | @Override
41 | public void onClick(DialogInterface dialog, int which) {
42 |
43 | }
44 | })
45 | .show();
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_navigationbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
16 |
22 |
29 |
30 |
36 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_hourly_forecast.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
25 |
26 |
34 |
35 |
36 |
44 |
45 |
53 |
54 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_temp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/presenter/WeatherPresenter.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.presenter;
2 |
3 | import android.content.Context;
4 |
5 | import com.jc.heweather.model.WeatherDataSource;
6 | import com.jc.heweather.model.entity.Error;
7 | import com.jc.heweather.model.entity.Location;
8 | import com.jc.heweather.model.entity.VerifyMessage;
9 | import com.jc.heweather.model.entity.WeatherItem;
10 | import com.jc.heweather.utils.EventBus;
11 | import com.jc.heweather.view.IMainView;
12 | import com.squareup.otto.Bus;
13 | import com.squareup.otto.Subscribe;
14 |
15 | /**
16 | * Created by HaohaoChang on 2016/8/20.
17 | */
18 | public class WeatherPresenter implements IMainPresenter {
19 |
20 | private IMainView mainView;
21 | private WeatherDataSource weatherDataSource;
22 | private Bus bus;
23 |
24 | public WeatherPresenter(Context context,IMainView mainView) {
25 | this.mainView = mainView;
26 | this.bus = EventBus.getInstance();
27 | weatherDataSource = new WeatherDataSource(context,bus);
28 |
29 | }
30 |
31 | @Subscribe
32 | public void onWeatherData(WeatherItem weatherItem) {
33 |
34 | mainView.hideLoadingView();
35 | mainView.showWeatherData(weatherItem);
36 |
37 | }
38 |
39 | @Subscribe
40 | public void onError(Error error) {
41 |
42 | mainView.hideLoadingView();
43 | mainView.showError(error.getMessage());
44 |
45 | }
46 |
47 | @Subscribe
48 | public void onVerifyMessage(VerifyMessage message) {
49 | mainView.hideLoadingView();
50 | mainView.showVerifyMessage(message);
51 | }
52 |
53 |
54 | @Override
55 | public void loadWeatherDataById(String city_id) {
56 |
57 | //mainView.showLoadingView();
58 | weatherDataSource.getWeatherDataById(city_id);
59 |
60 | }
61 |
62 | @Override
63 | public void loadWeatherDataByName(String city_name) {
64 | //mainView.showLoadingView();
65 | weatherDataSource.getWeatherDataByName(city_name);
66 | }
67 |
68 | @Override
69 | public void queryCity(String city_name) {
70 | weatherDataSource.verifyCity(city_name);
71 | }
72 |
73 |
74 | @Override
75 | public void start() {
76 |
77 | bus.register(this);
78 |
79 | }
80 |
81 | @Override
82 | public void stop() {
83 |
84 | bus.unregister(this);
85 |
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/view/SuggestionFragment.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.view;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.support.v7.widget.LinearLayoutManager;
7 | import android.support.v7.widget.RecyclerView;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 |
12 | import com.jc.heweather.R;
13 | import com.jc.heweather.adapter.SuggestionAdapter;
14 | import com.jc.heweather.model.entity.Suggestion;
15 | import com.jc.heweather.utils.EventBus;
16 | import com.jc.heweather.utils.ScrollableHelper;
17 | import com.squareup.otto.Bus;
18 | import com.squareup.otto.Subscribe;
19 |
20 | import butterknife.Bind;
21 | import butterknife.ButterKnife;
22 |
23 | /**
24 | * Created by HaohaoChang on 2016/8/25.
25 | */
26 | public class SuggestionFragment extends Fragment implements ScrollableHelper.ScrollableContainer{
27 |
28 | @Bind(R.id.weather_recycler_view)
29 | RecyclerView weatherRecyclerView;
30 | private SuggestionAdapter suggestionAdapter;
31 | private Bus bus;
32 |
33 | public static SuggestionFragment getInstance() {
34 | SuggestionFragment fragment = new SuggestionFragment();
35 | return fragment;
36 | }
37 |
38 | @Nullable
39 | @Override
40 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
41 | View rootView = inflater.inflate(R.layout.forecast_fragment_layout, container, false);
42 | ButterKnife.bind(this, rootView);
43 | initData();
44 | return rootView;
45 | }
46 |
47 | private void initData() {
48 | bus = EventBus.getInstance();
49 | bus.register(this);
50 | weatherRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false));
51 | }
52 |
53 | @Subscribe
54 | public void onSuggestionData(Suggestion suggestion) {
55 | suggestionAdapter = new SuggestionAdapter(getActivity(),suggestion);
56 | weatherRecyclerView.setAdapter(suggestionAdapter);
57 | }
58 |
59 | @Override
60 | public void onDestroyView() {
61 | super.onDestroyView();
62 | ButterKnife.unbind(this);
63 | bus.unregister(this);
64 | }
65 |
66 | @Override
67 | public View getScrollableView() {
68 | return weatherRecyclerView;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
20 |
21 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
44 |
45 |
51 |
52 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/view/DailyForecastWeatherFragment.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.view;
2 |
3 | import android.support.v4.app.Fragment;;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 | import android.support.v7.widget.LinearLayoutManager;
7 | import android.support.v7.widget.RecyclerView;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 |
12 | import com.jc.heweather.R;
13 | import com.jc.heweather.adapter.DailyWeatherAdapter;
14 | import com.jc.heweather.model.entity.DailyForecastWeather;
15 | import com.jc.heweather.utils.EventBus;
16 | import com.jc.heweather.utils.ScrollableHelper;
17 | import com.squareup.otto.Bus;
18 | import com.squareup.otto.Subscribe;
19 |
20 |
21 | import butterknife.Bind;
22 | import butterknife.ButterKnife;
23 |
24 | /**
25 | * Created by HaohaoChang on 2016/8/24.
26 | */
27 | public class DailyForecastWeatherFragment extends Fragment implements ScrollableHelper.ScrollableContainer{
28 |
29 | @Bind(R.id.weather_recycler_view)
30 | RecyclerView dailyWeatherRecyclerView;
31 | private DailyWeatherAdapter dailyWeatherAdapter;
32 | private Bus bus;
33 |
34 | public static DailyForecastWeatherFragment getInstance() {
35 | DailyForecastWeatherFragment fragment = new DailyForecastWeatherFragment();
36 | return fragment;
37 | }
38 | @Nullable
39 | @Override
40 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
41 | View rootView = inflater.inflate(R.layout.forecast_fragment_layout, container, false);
42 | ButterKnife.bind(this, rootView);
43 | initData();
44 | return rootView;
45 | }
46 |
47 | private void initData() {
48 | bus = EventBus.getInstance();
49 | bus.register(this);
50 | dailyWeatherRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false));
51 | dailyWeatherAdapter = new DailyWeatherAdapter(getActivity());
52 | dailyWeatherRecyclerView.setAdapter(dailyWeatherAdapter);
53 | }
54 |
55 | @Subscribe
56 | public void onDailyForecastData(DailyForecastWeather weather) {
57 | dailyWeatherAdapter.refreshData(weather.getData());
58 | }
59 |
60 | @Override
61 | public void onDestroyView() {
62 | super.onDestroyView();
63 | ButterKnife.unbind(this);
64 | bus.unregister(this);
65 | }
66 |
67 | @Override
68 | public View getScrollableView() {
69 | return dailyWeatherRecyclerView;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/adapter/HourlyWeatherAdapter.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.TextView;
9 |
10 | import com.jc.heweather.R;
11 | import com.jc.heweather.model.entity.HourlyForecastItem;
12 |
13 | import java.util.List;
14 |
15 | import butterknife.Bind;
16 | import butterknife.ButterKnife;
17 |
18 | /**
19 | * Created by HaohaoChang on 2016/8/23.
20 | */
21 | public class HourlyWeatherAdapter extends RecyclerView.Adapter {
22 |
23 | private List data;
24 | private Context context;
25 |
26 | public HourlyWeatherAdapter(List data, Context context) {
27 | this.data = data;
28 | this.context = context;
29 | }
30 |
31 | @Override
32 | public HourlyWeatherViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
33 | View rootView = LayoutInflater.from(context).inflate(R.layout.item_hourly_forecast, parent, false);
34 | return new HourlyWeatherViewHolder(rootView);
35 | }
36 |
37 | @Override
38 | public void onBindViewHolder(HourlyWeatherViewHolder holder, int position) {
39 | HourlyForecastItem hourlyForecastItem = data.get(position);
40 | String timeString = hourlyForecastItem.getDate();
41 | holder.clockText.setText(timeString.substring(timeString.indexOf(" "),timeString.length()));
42 | holder.tempText.setText(String.format("%s℃",hourlyForecastItem.getTmp()));
43 | holder.popText.setText(String.format("%s%%",hourlyForecastItem.getPop()));
44 | String windSc = hourlyForecastItem.getWind().getSc();
45 | if (hourlyForecastItem.getWind().getSc().equals("-")) {
46 | windSc += "级";
47 | }
48 | holder.windText.setText(windSc);
49 |
50 | }
51 |
52 | @Override
53 | public int getItemCount() {
54 | return data.size();
55 | }
56 |
57 | public class HourlyWeatherViewHolder extends RecyclerView.ViewHolder {
58 | @Bind(R.id.clock_text)
59 | TextView clockText;
60 | @Bind(R.id.temp_text)
61 | TextView tempText;
62 | @Bind(R.id.pop_text)
63 | TextView popText;
64 | @Bind(R.id.wind_text)
65 | TextView windText;
66 |
67 | public HourlyWeatherViewHolder(View itemView) {
68 | super(itemView);
69 | ButterKnife.bind(this, itemView);
70 | }
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 1.8
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
22 |
23 |
27 |
32 |
39 |
44 |
45 |
46 |
53 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/view/WeatherTrendActivity.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.view;
2 |
3 | import android.graphics.Color;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 | import android.view.Window;
8 | import android.view.WindowManager;
9 | import android.widget.RelativeLayout;
10 | import android.widget.TextView;
11 |
12 | import com.jc.heweather.R;
13 | import com.jc.heweather.WeatherApplication;
14 | import com.jc.heweather.model.entity.TrendData;
15 | import com.jc.heweather.weight.LineChart;
16 |
17 | import butterknife.Bind;
18 | import butterknife.ButterKnife;
19 | import butterknife.OnClick;
20 |
21 | /**
22 | * Created by HaohaoChang on 2016/12/3.
23 | */
24 | public class WeatherTrendActivity extends AppCompatActivity {
25 | @Bind(R.id.tv_page1)
26 | TextView tvPage1;
27 | @Bind(R.id.ly_page1)
28 | RelativeLayout lyPage1;
29 | @Bind(R.id.tv_page2)
30 | TextView tvPage2;
31 | @Bind(R.id.ly_page2)
32 | RelativeLayout lyPage2;
33 | @Bind(R.id.line_chart)
34 | LineChart lineChart;
35 | private int[] maxTemps = new int[7];
36 | private int[] minTemps = new int[7];
37 | private TrendData trendData;
38 |
39 | @Override
40 | protected void onCreate(Bundle savedInstanceState) {
41 | this.requestWindowFeature(Window.FEATURE_NO_TITLE);
42 | super.onCreate(savedInstanceState);
43 | setContentView(R.layout.activity_trend);
44 | ButterKnife.bind(this);
45 | initEvent();
46 | }
47 |
48 | private void initEvent() {
49 | tvPage1.setText("最高温度");
50 | tvPage2.setText("最低温度");
51 | trendData = WeatherApplication.getApplication().getTrendData();
52 | if (trendData != null) {
53 | lineChart.setScore(trendData.getMaxTemps());
54 | lineChart.setxAxisTexts(trendData.getxAxisTexts());
55 | }
56 | }
57 |
58 | @OnClick({R.id.ly_page1, R.id.ly_page2})
59 | public void onClick(View view) {
60 | switch (view.getId()) {
61 | case R.id.ly_page1:
62 | if (trendData != null) {
63 | lineChart.setScore(trendData.getMaxTemps());
64 | }
65 | lyPage1.setBackgroundResource(R.drawable.rectangle_left_select);
66 | tvPage1.setTextColor(Color.parseColor("#ffffff"));
67 | lyPage2.setBackgroundResource(R.drawable.rectangle_right);
68 | tvPage2.setTextColor(Color.parseColor("#435356"));
69 | break;
70 | case R.id.ly_page2:
71 | if (trendData != null) {
72 | lineChart.setScore(trendData.getMinTemps());
73 | }
74 | lyPage1.setBackgroundResource(R.drawable.rectangle_left);
75 | tvPage1.setTextColor(Color.parseColor("#435356"));
76 | lyPage2.setBackgroundResource(R.drawable.rectangle_right_select);
77 | tvPage2.setTextColor(Color.parseColor("#ffffff"));
78 | break;
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/model/entity/DailyForecastItem.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.model.entity;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * Created by HaohaoChang on 2016/8/18.
7 | */
8 | public class DailyForecastItem implements Serializable {
9 | private String date;
10 | private String hum; //湿度(%)
11 | private String pcpn; //降雨量(mm)
12 | private String pop; //降水概率
13 | private String pres; //气压
14 | private String vis; //能见度(km)
15 | private Tmp tmp;
16 | private Wind wind;
17 | private Astro astro;
18 | private Cond cond;
19 |
20 | public String getDate() {
21 | return date;
22 | }
23 |
24 | public String getHum() {
25 | return hum;
26 | }
27 |
28 | public String getPcpn() {
29 | return pcpn;
30 | }
31 |
32 | public String getPop() {
33 | return pop;
34 | }
35 |
36 | public String getPres() {
37 | return pres;
38 | }
39 |
40 | public String getVis() {
41 | return vis;
42 | }
43 |
44 | public Tmp getTmp() {
45 | return tmp;
46 | }
47 |
48 | public Wind getWind() {
49 | return wind;
50 | }
51 |
52 | public Astro getAstro() {
53 | return astro;
54 | }
55 |
56 | public Cond getCond() {
57 | return cond;
58 | }
59 |
60 | public class Tmp { //温度
61 | String max; //最高温度(摄氏度)
62 | String min; //最低温度(摄氏度)
63 |
64 | public String getMax() {
65 | return max;
66 | }
67 |
68 | public String getMin() {
69 | return min;
70 | }
71 | }
72 |
73 | public class Wind { //风力状况
74 | String deg; //风向(角度)
75 | String dir; //风向(方向)
76 | String spd; //风速(Kmph)
77 | String sc;
78 |
79 | public String getSc() {
80 | return sc;
81 | }
82 |
83 | public String getDeg() {
84 | return deg;
85 | }
86 |
87 | public String getDir() {
88 | return dir;
89 | }
90 |
91 | public String getSpd() {
92 | return spd;
93 | }
94 | }
95 |
96 |
97 | private class Astro {
98 | String sr;//日出时间
99 | String ss;//日落时间
100 |
101 | public String getSr() {
102 | return sr;
103 | }
104 |
105 | public String getSs() {
106 | return ss;
107 | }
108 | }
109 |
110 | public class Cond { //天气状况
111 | String code_d; //白天天气代码
112 | String code_n; //夜间天气代码
113 | String txt_d; //白天天气描述
114 | String txt_n; //夜间天气描述
115 |
116 | public String getCode_d() {
117 | return code_d;
118 | }
119 |
120 | public String getCode_n() {
121 | return code_n;
122 | }
123 |
124 | public String getTxt_d() {
125 | return txt_d;
126 | }
127 |
128 | public String getTxt_n() {
129 | return txt_n;
130 | }
131 | }
132 |
133 |
134 |
135 | }
136 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_wind.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_travel.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
18 |
19 |
30 |
31 |
36 |
37 |
43 |
48 |
55 |
61 |
62 |
63 |
64 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
92 |
93 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_daily_forecast.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
19 |
24 |
33 |
39 |
40 |
41 |
48 |
54 |
60 |
69 |
73 |
79 |
80 |
81 |
86 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jc/heweather/adapter/SuggestionAdapter.java:
--------------------------------------------------------------------------------
1 | package com.jc.heweather.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import com.jc.heweather.R;
12 | import com.jc.heweather.model.entity.Suggestion;
13 |
14 | import java.util.ArrayList;
15 | import java.util.HashMap;
16 | import java.util.List;
17 | import java.util.Map;
18 |
19 | import butterknife.Bind;
20 | import butterknife.ButterKnife;
21 |
22 | /**
23 | * Created by HaohaoChang on 2016/8/24.
24 | */
25 | public class SuggestionAdapter extends RecyclerView.Adapter {
26 | private Context context;
27 | private List