├── app ├── .gitignore ├── src │ ├── main │ │ ├── ic_close-web.png │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ ├── ic_drop.png │ │ │ │ ├── ic_flag.png │ │ │ │ ├── ic_icon.png │ │ │ │ ├── moon_01.png │ │ │ │ ├── sun_01.png │ │ │ │ ├── clouds_01.png │ │ │ │ ├── ic_close.png │ │ │ │ ├── clouds_with_rain_01.png │ │ │ │ ├── clouds_with_snow_01.png │ │ │ │ ├── sun_with_1cloud_01.png │ │ │ │ ├── sun_with_3clouds_01.png │ │ │ │ ├── clouds_with_2lighting_01.png │ │ │ │ ├── clouds_with_lighting_01.png │ │ │ │ ├── clouds_with_littlerain_01.png │ │ │ │ ├── clouds_with_littlesnow_01.png │ │ │ │ ├── moon_with_clouds_snow_01.png │ │ │ │ ├── sun_with_2cloud_rain_01.png │ │ │ │ ├── sun_with_clouds_snow_01.png │ │ │ │ ├── clouds_with_lighting_rain_01.png │ │ │ │ ├── moon_with_clouds_littlesnow_01.png │ │ │ │ ├── sun_with_2cloud_littlerain_01.png │ │ │ │ ├── sun_with_clouds_littlesnow_01.png │ │ │ │ ├── clouds_with_lighting_littlerain_01.png │ │ │ │ └── moon_with_clouds_littlesnow_01_01.png │ │ │ ├── drawable-ldpi │ │ │ │ ├── ic_drop.png │ │ │ │ ├── ic_flag.png │ │ │ │ ├── ic_icon.png │ │ │ │ ├── moon_01.png │ │ │ │ ├── sun_01.png │ │ │ │ ├── clouds_01.png │ │ │ │ ├── clouds_with_rain_01.png │ │ │ │ ├── clouds_with_snow_01.png │ │ │ │ ├── sun_with_1cloud_01.png │ │ │ │ ├── sun_with_3clouds_01.png │ │ │ │ ├── clouds_with_2lighting_01.png │ │ │ │ ├── clouds_with_lighting_01.png │ │ │ │ ├── clouds_with_littlerain_01.png │ │ │ │ ├── clouds_with_littlesnow_01.png │ │ │ │ ├── moon_with_clouds_snow_01.png │ │ │ │ ├── sun_with_2cloud_rain_01.png │ │ │ │ ├── sun_with_clouds_snow_01.png │ │ │ │ ├── clouds_with_lighting_rain_01.png │ │ │ │ ├── moon_with_clouds_littlesnow_01.png │ │ │ │ ├── sun_with_2cloud_littlerain_01.png │ │ │ │ ├── sun_with_clouds_littlesnow_01.png │ │ │ │ ├── clouds_with_lighting_littlerain_01.png │ │ │ │ └── moon_with_clouds_littlesnow_01_01.png │ │ │ ├── drawable-mdpi │ │ │ │ ├── ic_drop.png │ │ │ │ ├── ic_flag.png │ │ │ │ ├── ic_icon.png │ │ │ │ ├── moon_01.png │ │ │ │ ├── sun_01.png │ │ │ │ ├── clouds_01.png │ │ │ │ ├── ic_close.png │ │ │ │ ├── clouds_with_rain_01.png │ │ │ │ ├── clouds_with_snow_01.png │ │ │ │ ├── sun_with_1cloud_01.png │ │ │ │ ├── sun_with_3clouds_01.png │ │ │ │ ├── clouds_with_2lighting_01.png │ │ │ │ ├── clouds_with_lighting_01.png │ │ │ │ ├── clouds_with_littlerain_01.png │ │ │ │ ├── clouds_with_littlesnow_01.png │ │ │ │ ├── moon_with_clouds_snow_01.png │ │ │ │ ├── sun_with_2cloud_rain_01.png │ │ │ │ ├── sun_with_clouds_snow_01.png │ │ │ │ ├── clouds_with_lighting_rain_01.png │ │ │ │ ├── moon_with_clouds_littlesnow_01.png │ │ │ │ ├── sun_with_2cloud_littlerain_01.png │ │ │ │ ├── sun_with_clouds_littlesnow_01.png │ │ │ │ ├── clouds_with_lighting_littlerain_01.png │ │ │ │ └── moon_with_clouds_littlesnow_01_01.png │ │ │ ├── drawable-xhdpi │ │ │ │ ├── sun_01.png │ │ │ │ ├── clouds_01.png │ │ │ │ ├── ic_close.png │ │ │ │ ├── ic_drop.png │ │ │ │ ├── ic_flag.png │ │ │ │ ├── ic_icon.png │ │ │ │ ├── moon_01.png │ │ │ │ ├── clouds_with_rain_01.png │ │ │ │ ├── clouds_with_snow_01.png │ │ │ │ ├── sun_with_1cloud_01.png │ │ │ │ ├── sun_with_3clouds_01.png │ │ │ │ ├── clouds_with_2lighting_01.png │ │ │ │ ├── clouds_with_lighting_01.png │ │ │ │ ├── moon_with_clouds_snow_01.png │ │ │ │ ├── sun_with_2cloud_rain_01.png │ │ │ │ ├── sun_with_clouds_snow_01.png │ │ │ │ ├── clouds_with_littlerain_01.png │ │ │ │ ├── clouds_with_littlesnow_01.png │ │ │ │ ├── clouds_with_lighting_rain_01.png │ │ │ │ ├── sun_with_2cloud_littlerain_01.png │ │ │ │ ├── sun_with_clouds_littlesnow_01.png │ │ │ │ ├── moon_with_clouds_littlesnow_01.png │ │ │ │ ├── clouds_with_lighting_littlerain_01.png │ │ │ │ └── moon_with_clouds_littlesnow_01_01.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_close.png │ │ │ │ ├── ic_drop.png │ │ │ │ ├── ic_flag.png │ │ │ │ ├── ic_icon.png │ │ │ │ ├── moon_01.png │ │ │ │ ├── sun_01.png │ │ │ │ ├── clouds_01.png │ │ │ │ ├── sun_with_1cloud_01.png │ │ │ │ ├── clouds_with_rain_01.png │ │ │ │ ├── clouds_with_snow_01.png │ │ │ │ ├── sun_with_3clouds_01.png │ │ │ │ ├── clouds_with_lighting_01.png │ │ │ │ ├── sun_with_2cloud_rain_01.png │ │ │ │ ├── sun_with_clouds_snow_01.png │ │ │ │ ├── clouds_with_2lighting_01.png │ │ │ │ ├── clouds_with_littlerain_01.png │ │ │ │ ├── clouds_with_littlesnow_01.png │ │ │ │ ├── moon_with_clouds_snow_01.png │ │ │ │ ├── clouds_with_lighting_rain_01.png │ │ │ │ ├── moon_with_clouds_littlesnow_01.png │ │ │ │ ├── sun_with_2cloud_littlerain_01.png │ │ │ │ ├── sun_with_clouds_littlesnow_01.png │ │ │ │ ├── moon_with_clouds_littlesnow_01_01.png │ │ │ │ └── clouds_with_lighting_littlerain_01.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── ic_drop.png │ │ │ │ ├── ic_flag.png │ │ │ │ ├── ic_icon.png │ │ │ │ ├── moon_01.png │ │ │ │ ├── sun_01.png │ │ │ │ ├── clouds_01.png │ │ │ │ ├── clouds_with_rain_01.png │ │ │ │ ├── clouds_with_snow_01.png │ │ │ │ ├── sun_with_1cloud_01.png │ │ │ │ ├── sun_with_3clouds_01.png │ │ │ │ ├── clouds_with_2lighting_01.png │ │ │ │ ├── clouds_with_lighting_01.png │ │ │ │ ├── moon_with_clouds_snow_01.png │ │ │ │ ├── sun_with_2cloud_rain_01.png │ │ │ │ ├── sun_with_clouds_snow_01.png │ │ │ │ ├── clouds_with_littlerain_01.png │ │ │ │ ├── clouds_with_littlesnow_01.png │ │ │ │ ├── clouds_with_lighting_rain_01.png │ │ │ │ ├── sun_with_2cloud_littlerain_01.png │ │ │ │ ├── sun_with_clouds_littlesnow_01.png │ │ │ │ ├── moon_with_clouds_littlesnow_01.png │ │ │ │ ├── clouds_with_lighting_littlerain_01.png │ │ │ │ └── moon_with_clouds_littlesnow_01_01.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-ldpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ └── colors.xml │ │ │ ├── values-hdpi │ │ │ │ └── dimens.xml │ │ │ ├── values-xhdpi │ │ │ │ └── dimens.xml │ │ │ ├── values-xxhdpi │ │ │ │ └── dimens.xml │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── layout │ │ │ │ ├── item_recycler_forecast.xml │ │ │ │ ├── dialog_forecast_info.xml │ │ │ │ └── activity_home.xml │ │ │ └── layout-land │ │ │ │ └── activity_home.xml │ │ ├── java │ │ │ └── app │ │ │ │ └── com │ │ │ │ └── thetechnocafe │ │ │ │ └── kotlinweather │ │ │ │ ├── Consts │ │ │ │ └── Constants.kt │ │ │ │ ├── Networking │ │ │ │ ├── MetaWeatherApi.kt │ │ │ │ └── NetworkService.kt │ │ │ │ ├── Home │ │ │ │ ├── HomeContract.kt │ │ │ │ ├── ForecastRecyclerAdapter.kt │ │ │ │ ├── HomePresenter.kt │ │ │ │ └── HomeActivity.kt │ │ │ │ ├── Utils │ │ │ │ └── WeatherToImage.kt │ │ │ │ ├── Models │ │ │ │ └── WeatherData.kt │ │ │ │ └── Dialogs │ │ │ │ └── ForecastDialogFragment.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── app │ │ │ └── com │ │ │ └── thetechnocafe │ │ │ └── kotlinweather │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── app │ │ └── com │ │ └── thetechnocafe │ │ └── kotlinweather │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── .idea ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── Screenshots ├── screenshot_1.png └── screenshot_2.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Screenshots/screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/Screenshots/screenshot_1.png -------------------------------------------------------------------------------- /Screenshots/screenshot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/Screenshots/screenshot_2.png -------------------------------------------------------------------------------- /app/src/main/ic_close-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/ic_close-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/ic_drop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/ic_flag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/ic_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/moon_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/moon_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/sun_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/sun_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/ic_drop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/ic_flag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/ic_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/moon_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/moon_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/sun_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/sun_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/ic_drop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/ic_flag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/ic_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/moon_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/moon_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/sun_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/sun_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/sun_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/sun_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/ic_close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/ic_close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/ic_close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/ic_drop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/ic_flag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/ic_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/moon_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/moon_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/ic_close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/ic_drop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/ic_flag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/ic_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/moon_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/moon_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/sun_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/sun_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/ic_drop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/ic_flag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/ic_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/moon_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/moon_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/sun_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/sun_01.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/mipmap-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clouds_with_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/clouds_with_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clouds_with_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/clouds_with_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/sun_with_1cloud_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/sun_with_1cloud_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/sun_with_3clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/sun_with_3clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/clouds_with_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/clouds_with_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/clouds_with_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/clouds_with_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/sun_with_1cloud_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/sun_with_1cloud_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/sun_with_3clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/sun_with_3clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clouds_with_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/clouds_with_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clouds_with_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/clouds_with_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/sun_with_1cloud_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/sun_with_1cloud_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/sun_with_3clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/sun_with_3clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clouds_with_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/clouds_with_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clouds_with_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/clouds_with_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/sun_with_1cloud_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/sun_with_1cloud_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/sun_with_3clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/sun_with_3clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/sun_with_1cloud_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/sun_with_1cloud_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clouds_with_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/clouds_with_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clouds_with_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/clouds_with_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/sun_with_3clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/sun_with_3clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/clouds_with_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/clouds_with_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/clouds_with_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/clouds_with_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/sun_with_1cloud_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/sun_with_1cloud_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/sun_with_3clouds_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/sun_with_3clouds_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clouds_with_2lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/clouds_with_2lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clouds_with_lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/clouds_with_lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clouds_with_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/clouds_with_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clouds_with_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/clouds_with_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/moon_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/moon_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/sun_with_2cloud_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/sun_with_2cloud_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/sun_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/sun_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/clouds_with_2lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/clouds_with_2lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/clouds_with_lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/clouds_with_lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/clouds_with_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/clouds_with_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/clouds_with_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/clouds_with_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/moon_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/moon_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/sun_with_2cloud_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/sun_with_2cloud_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/sun_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/sun_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clouds_with_2lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/clouds_with_2lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clouds_with_lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/clouds_with_lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clouds_with_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/clouds_with_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clouds_with_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/clouds_with_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/moon_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/moon_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/sun_with_2cloud_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/sun_with_2cloud_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/sun_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/sun_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clouds_with_2lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/clouds_with_2lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clouds_with_lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/clouds_with_lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/moon_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/moon_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/sun_with_2cloud_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/sun_with_2cloud_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/sun_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/sun_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clouds_with_lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/clouds_with_lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/sun_with_2cloud_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/sun_with_2cloud_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/sun_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/sun_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clouds_with_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/clouds_with_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clouds_with_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/clouds_with_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clouds_with_2lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/clouds_with_2lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clouds_with_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/clouds_with_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clouds_with_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/clouds_with_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/moon_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/moon_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/clouds_with_2lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/clouds_with_2lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/clouds_with_lighting_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/clouds_with_lighting_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/moon_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/moon_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/sun_with_2cloud_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/sun_with_2cloud_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/sun_with_clouds_snow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/sun_with_clouds_snow_01.png -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Kotlin Weather 3 | %1$s\u00B0 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clouds_with_lighting_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/clouds_with_lighting_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/moon_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/moon_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/sun_with_2cloud_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/sun_with_2cloud_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/sun_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/sun_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/clouds_with_lighting_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/clouds_with_lighting_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/moon_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/moon_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/sun_with_2cloud_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/sun_with_2cloud_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/sun_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/sun_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clouds_with_lighting_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/clouds_with_lighting_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/moon_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/moon_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/sun_with_2cloud_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/sun_with_2cloud_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/sun_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/sun_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clouds_with_lighting_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/clouds_with_lighting_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/sun_with_2cloud_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/sun_with_2cloud_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/sun_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/sun_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clouds_with_lighting_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/clouds_with_lighting_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/clouds_with_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/clouds_with_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/clouds_with_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/clouds_with_littlesnow_01.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/moon_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/moon_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/moon_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/moon_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/sun_with_2cloud_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/sun_with_2cloud_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/sun_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/sun_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/clouds_with_lighting_rain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/clouds_with_lighting_rain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/sun_with_2cloud_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/sun_with_2cloud_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/sun_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/sun_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clouds_with_lighting_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/clouds_with_lighting_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/moon_with_clouds_littlesnow_01_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-hdpi/moon_with_clouds_littlesnow_01_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/clouds_with_lighting_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/clouds_with_lighting_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/moon_with_clouds_littlesnow_01_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-ldpi/moon_with_clouds_littlesnow_01_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clouds_with_lighting_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/clouds_with_lighting_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/moon_with_clouds_littlesnow_01_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-mdpi/moon_with_clouds_littlesnow_01_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clouds_with_lighting_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/clouds_with_lighting_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/moon_with_clouds_littlesnow_01_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xhdpi/moon_with_clouds_littlesnow_01_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/moon_with_clouds_littlesnow_01_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/moon_with_clouds_littlesnow_01_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/moon_with_clouds_littlesnow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/moon_with_clouds_littlesnow_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clouds_with_lighting_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxhdpi/clouds_with_lighting_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/clouds_with_lighting_littlerain_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/clouds_with_lighting_littlerain_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/moon_with_clouds_littlesnow_01_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gurleensethi/kotlin-weather/HEAD/app/src/main/res/drawable-xxxhdpi/moon_with_clouds_littlesnow_01_01.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 160dp 4 | 56sp 5 | 56dp 6 | -------------------------------------------------------------------------------- /app/src/main/res/values-hdpi/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 160dp 4 | 64sp 5 | 56dp 6 | -------------------------------------------------------------------------------- /app/src/main/res/values-xhdpi/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 160dp 4 | 72sp 5 | 64dp 6 | -------------------------------------------------------------------------------- /app/src/main/res/values-xxhdpi/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 200dp 4 | 80sp 5 | 72dp 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | /app/app-release.apk 11 | /app/src/main/java/app/com/thetechnocafe/kotlinweather/Consts/Secrets.kt 12 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jun 14 13:55:17 IST 2017 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-3.3-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/java/app/com/thetechnocafe/kotlinweather/Consts/Constants.kt: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather.Consts 2 | 3 | /** 4 | * Created by gurleensethi on 21/06/17. 5 | */ 6 | object Constants { 7 | val BASE_URL = "https://simple-weather.p.mashape.com/" 8 | val TYPE_TEXT_PLAIN = "text/plain" 9 | val WEATHER_FILE_NAME = "weather_data" 10 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/test/java/app/com/thetechnocafe/kotlinweather/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package app.com.tedconsulting.kotlinweather; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/app/com/thetechnocafe/kotlinweather/Networking/MetaWeatherApi.kt: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather.Networking 2 | 3 | import app.com.thetechnocafe.kotlinweather.Models.WeatherData 4 | import io.reactivex.Observable 5 | import retrofit2.http.GET 6 | import retrofit2.http.Header 7 | import retrofit2.http.Query 8 | 9 | /** 10 | * Created by gurleensethi on 16/06/17. 11 | */ 12 | interface MetaWeatherApi { 13 | @GET("weatherdata") 14 | fun getLocationDetails(@Header("X-Mashape-Key") key: String, @Header("Accept") type: String, 15 | @Query("lat") lat: Double, @Query("lng") lng: Double): Observable 16 | } -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/java/app/com/thetechnocafe/kotlinweather/Home/HomeContract.kt: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather.Home 2 | 3 | import android.content.Context 4 | import app.com.thetechnocafe.kotlinweather.Models.WeatherData 5 | 6 | /** 7 | * Created by gurleensethi on 21/06/17. 8 | */ 9 | interface HomeContract { 10 | interface View { 11 | fun onDataFetched(weatherData: WeatherData?) 12 | 13 | fun onStoredDataFetched(weatherData: WeatherData?) 14 | 15 | fun onError() 16 | 17 | fun getContext(): Context 18 | } 19 | 20 | interface Presenter { 21 | fun subscribe(view: HomeContract.View) 22 | 23 | fun unSubscribe() 24 | 25 | fun refresh(lat: Double, long: Double); 26 | } 27 | } -------------------------------------------------------------------------------- /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 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /.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/androidTest/java/app/com/thetechnocafe/kotlinweather/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("app.com.tedconsulting.kotlinweather", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/app/com/thetechnocafe/kotlinweather/Networking/NetworkService.kt: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather.Networking 2 | 3 | import app.com.thetechnocafe.kotlinweather.Consts.Constants 4 | import retrofit2.Retrofit 5 | import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory 6 | import retrofit2.converter.gson.GsonConverterFactory 7 | import retrofit2.converter.scalars.ScalarsConverterFactory 8 | 9 | 10 | /** 11 | * Created by gurleensethi on 16/06/17. 12 | */ 13 | object NetworkService { 14 | val retrofit: Retrofit 15 | 16 | init { 17 | retrofit = Retrofit.Builder() 18 | .baseUrl(Constants.BASE_URL) 19 | .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) 20 | .addConverterFactory(ScalarsConverterFactory.create()) 21 | .addConverterFactory(GsonConverterFactory.create()) 22 | .build() 23 | } 24 | 25 | fun getMetaWeatherApi() = retrofit.create(MetaWeatherApi::class.java) 26 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_recycler_forecast.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 24 | 25 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/java/app/com/thetechnocafe/kotlinweather/Utils/WeatherToImage.kt: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather.Utils 2 | 3 | import app.com.thetechnocafe.kotlinweather.R 4 | 5 | /** 6 | * Created by gurleensethi on 23/06/17. 7 | */ 8 | object WeatherToImage { 9 | fun getImageForCode(code: String): Int = when (code) { 10 | "1" -> { 11 | R.drawable.clouds_with_lighting_littlerain_01 12 | } 13 | "3", "37", "38", "39" -> { 14 | R.drawable.clouds_with_2lighting_01 15 | } 16 | "4" -> { 17 | R.drawable.clouds_with_lighting_01 18 | } 19 | "5", "6", "7", "13", "14", "15", "16", "18", "41", "42", "43", "46" -> { 20 | R.drawable.clouds_with_snow_01 21 | } 22 | "10", "11", "12", "17", "35", "40", "47" -> { 23 | R.drawable.clouds_with_rain_01 24 | } 25 | "26", "27", "29", "44" -> { 26 | R.drawable.clouds_01 27 | } 28 | "28" -> { 29 | R.drawable.sun_with_3clouds_01 30 | } 31 | "30" -> { 32 | R.drawable.sun_with_1cloud_01 33 | } 34 | "31", "33" -> { 35 | R.drawable.moon_01 36 | } 37 | "32", "34", "36" -> { 38 | R.drawable.sun_01 39 | } 40 | "45" -> { 41 | R.drawable.clouds_with_lighting_rain_01 42 | } 43 | else -> { 44 | R.drawable.ic_icon 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /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 /Users/gurleensethi/Library/Android/sdk/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 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -keep class com.google.gson.** { *; } 27 | -keep class com.google.inject.** { *; } 28 | -keep class org.apache.http.** { *; } 29 | -keep class org.apache.james.mime4j.** { *; } 30 | -keep class javax.inject.** { *; } 31 | -keep class retrofit.** { *; } 32 | -dontwarn rx.** 33 | -keep class com.example.testobfuscation.** { *; } 34 | -keepattributes Signature 35 | -keep class sun.misc.Unsafe { *; } 36 | -ignorewarnings 37 | -keep class * { 38 | public private *; 39 | } -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion 25 6 | buildToolsVersion "25.0.3" 7 | defaultConfig { 8 | applicationId "app.com.thetechnocafe.kotlinweather" 9 | minSdkVersion 16 10 | targetSdkVersion 25 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | shrinkResources true 18 | minifyEnabled true 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | compile fileTree(dir: 'libs', include: ['*.jar']) 26 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 27 | exclude group: 'com.android.support', module: 'support-annotations' 28 | }) 29 | compile 'com.android.support:appcompat-v7:25.3.1' 30 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 31 | testCompile 'junit:junit:4.12' 32 | compile 'com.squareup.retrofit2:retrofit:2.3.0' 33 | compile 'com.squareup.picasso:picasso:2.5.2' 34 | compile 'com.google.code.gson:gson:2.8.0' 35 | compile 'com.squareup.retrofit2:converter-gson:2.3.0' 36 | compile 'com.android.support:recyclerview-v7:25.3.1' 37 | compile 'com.android.support:design:25.3.1' 38 | compile 'com.android.support:cardview-v7:25.3.1' 39 | compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 40 | compile 'com.squareup.okhttp3:logging-interceptor:3.6.0' 41 | compile 'com.squareup.retrofit2:converter-scalars:2.1.0' 42 | compile 'io.reactivex.rxjava2:rxandroid:2.0.1' 43 | compile 'io.reactivex.rxjava2:rxjava:2.1.0' 44 | compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' 45 | } 46 | repositories { 47 | mavenCentral() 48 | } 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kotlin-weather 2 | Simple android weather app developed in kotlin, demonstrating the use of RxJava, Retrofit and implementing MVP. 3 | 4 | 5 | Get it on Google Play 8 | 9 | 10 | # Screenshots 11 | 12 | 13 | # Overview 14 | Weather app created using the [Weather Api](https://market.mashape.com/fyhao/weather-13) from Mashape marketplace. 15 | This is not supposed to be a production scale application, it is meant to demonstrate the implementation of **MVP** architecture in Kotlin using following libraries: 16 | * RxJava 17 | * Retrofit 18 | 19 | ##### Still if you have any issues or suggestions, please feel free to open an [issue](https://github.com/gurleensethi/kotlin-weather/issues/new) 20 | 21 | ### General flow of data 22 | * Check if there is cached data present in the internal file, if yes then load the cached data. 23 | * Retrieve the latitude and longitude of the user. 24 | * Request data from Weather Api 25 | * If data received, cache it in internal file and show the updated data to user. 26 | * If error then notify user about it. 27 | 28 | ### Build the Project 29 | To build the project on your own follow these steps: 30 | * Clone the project 31 | * Get an API key from [Weather Api](https://market.mashape.com/fyhao/weather-13) 32 | * Create a Kotlin file named `Secrets.kt` 33 | * In that file create an `object` and add a variable `API_KEY` that contains the key that you got from the Weather Api. 34 | ```kotlin 35 | object Secrets { 36 | val API_KEY = "your_api_key" 37 | } 38 | ``` 39 | * Build the project! 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/src/main/java/app/com/thetechnocafe/kotlinweather/Home/ForecastRecyclerAdapter.kt: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather.Home 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 | import app.com.thetechnocafe.kotlinweather.Models.Forecast 11 | import app.com.thetechnocafe.kotlinweather.R 12 | import app.com.thetechnocafe.kotlinweather.Utils.WeatherToImage 13 | 14 | /** 15 | * Created by gurleensethi on 23/06/17. 16 | */ 17 | class ForecastRecyclerAdapter(val context: Context, val forecastList: List?) : RecyclerView.Adapter() { 18 | 19 | /* 20 | * Lambda function used as a callback 21 | * to listen to click events when any forecast item 22 | * is clicked 23 | * */ 24 | private var mListener: (forecast: Forecast) -> Unit = {} 25 | 26 | override fun getItemCount() = forecastList?.size ?: 0 27 | 28 | override fun onBindViewHolder(holder: ViewHolder?, position: Int) { 29 | holder?.bindData(position) 30 | } 31 | 32 | override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder { 33 | val view = LayoutInflater.from(context).inflate(R.layout.item_recycler_forecast, parent, false) 34 | return ViewHolder(view) 35 | } 36 | 37 | inner class ViewHolder(itemView: View?) : RecyclerView.ViewHolder(itemView), View.OnClickListener { 38 | 39 | init { 40 | itemView?.setOnClickListener(this) 41 | } 42 | 43 | val dayTextView = itemView?.findViewById(R.id.day_text_view) as TextView 44 | val weatherImageView = itemView?.findViewById(R.id.weather_image_view) as ImageView 45 | val temperatureTextView = itemView?.findViewById(R.id.temperature_text_view) as TextView 46 | 47 | fun bindData(position: Int) { 48 | val forecast = forecastList?.get(position) 49 | 50 | dayTextView.text = forecast?.day 51 | val high = forecast?.high?.toInt() ?: 0 52 | val low = forecast?.low?.toInt() ?: 0 53 | val formattedTemperatureText = String.format(context.getString(R.string.celcuis_temperature), ((high + low) / 2).toString()) 54 | temperatureTextView.text = formattedTemperatureText 55 | 56 | weatherImageView.setImageResource(WeatherToImage.getImageForCode(forecast?.code ?: "3200")) 57 | } 58 | 59 | override fun onClick(v: View?) { 60 | mListener(forecastList?.get(adapterPosition)!!) 61 | } 62 | } 63 | 64 | fun addActionListener(listener: (forecast: Forecast) -> Unit) { 65 | mListener = listener 66 | } 67 | } -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Android 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 62 | -------------------------------------------------------------------------------- /app/src/main/java/app/com/thetechnocafe/kotlinweather/Models/WeatherData.kt: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather.Models 2 | 3 | import java.io.Serializable 4 | 5 | /** 6 | * Created by gurleensethi on 16/06/17. 7 | */ 8 | 9 | data class WeatherData( 10 | val query: Query 11 | ) : Serializable 12 | 13 | data class Query( 14 | val count: Int, 15 | val created: String, 16 | val lang: String, 17 | val results: Results 18 | ) : Serializable 19 | 20 | data class Results( 21 | val channel: Channel 22 | ) : Serializable 23 | 24 | data class Channel( 25 | val title: String, 26 | val link: String, 27 | val description: String, 28 | val language: String, 29 | val lastBuildDate: String, 30 | val ttl: String, 31 | val location: Location, 32 | val units: Units, 33 | val wind: Wind, 34 | val atmosphere: Atmosphere, 35 | val astronomy: Astronomy, 36 | val image: Image, 37 | val item: Item 38 | ) : Serializable 39 | 40 | data class Location( 41 | val city: String, 42 | val country: String, 43 | val region: String 44 | ) : Serializable 45 | 46 | data class Units( 47 | val distance: String, 48 | val pressure: String, 49 | val speed: String, 50 | val temperature: String 51 | ) : Serializable 52 | 53 | data class Wind( 54 | val chill: String, 55 | val direction: String, 56 | val speed: String 57 | ) : Serializable 58 | 59 | data class Atmosphere( 60 | val humidity: String, 61 | val pressure: String, 62 | val rising: String, 63 | val visibility: String 64 | ) : Serializable 65 | 66 | data class Astronomy( 67 | val sunrise: String, 68 | val sunset: String 69 | ) : Serializable 70 | 71 | data class Image( 72 | val title: String, 73 | val width: String, 74 | val height: String, 75 | val link: String, 76 | val url: String 77 | ) : Serializable 78 | 79 | data class Item( 80 | val title: String, 81 | val lat: String, 82 | val long: String, 83 | val link: String, 84 | val pubDate: String, 85 | val condition: Condition, 86 | val description: String, 87 | val forecast: Array, 88 | val guid: Guid 89 | ) : Serializable 90 | 91 | data class Condition( 92 | val code: String, 93 | val date: String, 94 | val temp: String, 95 | val text: String 96 | ) : Serializable 97 | 98 | data class Forecast( 99 | val code: String, 100 | val date: String, 101 | val day: String, 102 | val high: String, 103 | val low: String, 104 | val text: String 105 | ) : Serializable 106 | 107 | data class Guid( 108 | val isPermaLink: String, 109 | val content: String 110 | ) : Serializable -------------------------------------------------------------------------------- /app/src/main/java/app/com/thetechnocafe/kotlinweather/Dialogs/ForecastDialogFragment.kt: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather.Dialogs 2 | 3 | import android.os.Bundle 4 | import android.support.v4.app.DialogFragment 5 | import android.view.* 6 | import android.widget.ImageView 7 | import android.widget.TextView 8 | import app.com.thetechnocafe.kotlinweather.Models.Forecast 9 | import app.com.thetechnocafe.kotlinweather.R 10 | import app.com.thetechnocafe.kotlinweather.Utils.WeatherToImage 11 | 12 | /** 13 | * Created by gurleensethi on 28/06/17. 14 | */ 15 | class ForecastDialogFragment : DialogFragment() { 16 | 17 | private var mWeatherImageView: ImageView? = null 18 | private var mHighTemperatureTextView: TextView? = null 19 | private var mLowTemperatureTextView: TextView? = null 20 | private var mTextTemperatureTextView: TextView? = null 21 | private var mDayTextView: TextView? = null 22 | private var mCloseImageView: ImageView? = null 23 | 24 | companion object { 25 | private val ARGS_FORECAST = "args_forecast" 26 | 27 | fun getInstance(forecast: Forecast): ForecastDialogFragment { 28 | val bundle = Bundle() 29 | bundle.putSerializable(ARGS_FORECAST, forecast) 30 | 31 | val fragment = ForecastDialogFragment() 32 | fragment.arguments = bundle 33 | 34 | return fragment 35 | } 36 | } 37 | 38 | override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View { 39 | val view = inflater?.inflate(R.layout.dialog_forecast_info, container, false) 40 | 41 | mWeatherImageView = view?.findViewById(R.id.weather_image_view) as ImageView 42 | mHighTemperatureTextView = view.findViewById(R.id.high_temperature_text_view) as TextView 43 | mLowTemperatureTextView = view.findViewById(R.id.low_temperature_text_view) as TextView 44 | mTextTemperatureTextView = view.findViewById(R.id.weather_condition_text_view) as TextView 45 | mDayTextView = view.findViewById(R.id.day_text_view) as TextView 46 | mCloseImageView = view.findViewById(R.id.close_image_view) as ImageView 47 | 48 | initViews() 49 | 50 | return view 51 | } 52 | 53 | override fun onResume() { 54 | super.onResume() 55 | dialog.window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT) 56 | dialog.window.requestFeature(Window.FEATURE_NO_TITLE) 57 | } 58 | 59 | private fun initViews() { 60 | val forecast = arguments.getSerializable(ARGS_FORECAST) as Forecast 61 | mWeatherImageView?.setImageResource(WeatherToImage.getImageForCode(forecast.code)) 62 | mHighTemperatureTextView?.text = forecast.high 63 | mLowTemperatureTextView?.text = forecast.low 64 | mTextTemperatureTextView?.text = forecast.text 65 | mDayTextView?.text = forecast.day 66 | 67 | mCloseImageView?.setOnClickListener { 68 | view -> 69 | dismiss() 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /app/src/main/java/app/com/thetechnocafe/kotlinweather/Home/HomePresenter.kt: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather.Home 2 | 3 | import android.content.Context 4 | import app.com.thetechnocafe.kotlinweather.Consts.Constants 5 | import app.com.thetechnocafe.kotlinweather.Models.WeatherData 6 | import app.com.thetechnocafe.kotlinweather.Networking.NetworkService 7 | import app.com.thetechnocafe.kotlinweather.Consts.Secrets 8 | import com.google.gson.Gson 9 | import io.reactivex.android.schedulers.AndroidSchedulers 10 | import io.reactivex.schedulers.Schedulers 11 | import java.io.File 12 | 13 | /** 14 | * Created by gurleensethi on 21/06/17. 15 | */ 16 | class HomePresenter : HomeContract.Presenter { 17 | 18 | var mView: HomeContract.View? = null 19 | 20 | override fun subscribe(view: HomeContract.View) { 21 | mView = view 22 | 23 | //Load data from internal storage 24 | val storedWeather = getFileFromStorage(mView?.getContext()) 25 | if (storedWeather != null) { 26 | mView?.onStoredDataFetched(storedWeather) 27 | } 28 | } 29 | 30 | override fun unSubscribe() { 31 | mView = null 32 | } 33 | 34 | override fun refresh(lat: Double, long: Double) { 35 | NetworkService.getMetaWeatherApi() 36 | .getLocationDetails(Secrets.API_KEY, Constants.TYPE_TEXT_PLAIN, lat, long) 37 | .subscribeOn(Schedulers.io()) 38 | .observeOn(AndroidSchedulers.mainThread()) 39 | .subscribe({ 40 | weatherData -> 41 | mView?.onDataFetched(weatherData) 42 | storeFileToExternalStorage(weatherData, mView?.getContext()) 43 | }, { 44 | error -> 45 | mView?.onError() 46 | }) 47 | } 48 | 49 | /* 50 | * Save the data in internal file as a json structure 51 | */ 52 | private fun storeFileToExternalStorage(weatherData: WeatherData, context: Context?) { 53 | val gson = Gson() 54 | val weatherJson = gson.toJson(weatherData) 55 | 56 | val weatherFile = File(mView?.getContext()?.filesDir, Constants.WEATHER_FILE_NAME) 57 | if (weatherFile.exists()) weatherFile.delete() 58 | weatherFile.createNewFile() 59 | 60 | val outputStream = mView?.getContext()?.openFileOutput(Constants.WEATHER_FILE_NAME, Context.MODE_PRIVATE) 61 | outputStream?.write(weatherJson.toByteArray()) 62 | outputStream?.close() 63 | } 64 | 65 | /* 66 | * Get the saved weather data from the file 67 | */ 68 | private fun getFileFromStorage(context: Context?): WeatherData? { 69 | try { 70 | val weatherFile = File(context?.filesDir, Constants.WEATHER_FILE_NAME) 71 | val weatherJson = weatherFile.readText() 72 | val gson = Gson() 73 | val weatherData = gson.fromJson(weatherJson, WeatherData::class.java) 74 | return weatherData 75 | } catch (e: Exception) { 76 | return null 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_forecast_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 21 | 22 | 29 | 30 | 35 | 36 | 42 | 43 | 51 | 52 | 62 | 63 | 64 | 65 | 72 | 73 | 79 | 80 | 88 | 89 | 99 | 100 | 101 | 102 | 103 | 104 | 112 | 113 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | 21 | 22 | 29 | 30 | 31 | 32 | 33 | 34 | 39 | 40 | 45 | 46 | 51 | 52 | 57 | 58 | 65 | 66 | 71 | 72 | 81 | 82 | 88 | 89 | 94 | 95 | 100 | 101 | 110 | 111 | 112 | 113 | 119 | 120 | 125 | 126 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /app/src/main/res/layout-land/activity_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 17 | 18 | 24 | 25 | 30 | 31 | 40 | 41 | 46 | 47 | 55 | 56 | 61 | 62 | 72 | 73 | 79 | 80 | 85 | 86 | 91 | 92 | 102 | 103 | 104 | 105 | 111 | 112 | 117 | 118 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /app/src/main/java/app/com/thetechnocafe/kotlinweather/Home/HomeActivity.kt: -------------------------------------------------------------------------------- 1 | package app.com.thetechnocafe.kotlinweather.Home 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import android.content.pm.PackageManager 6 | import android.location.Location 7 | import android.location.LocationListener 8 | import android.location.LocationManager 9 | import android.os.Build 10 | import android.os.Bundle 11 | import android.provider.Settings 12 | import android.support.design.widget.CoordinatorLayout 13 | import android.support.design.widget.Snackbar 14 | import android.support.v4.content.ContextCompat 15 | import android.support.v4.widget.SwipeRefreshLayout 16 | import android.support.v7.app.AlertDialog 17 | import android.support.v7.app.AppCompatActivity 18 | import android.support.v7.widget.LinearLayoutManager 19 | import android.support.v7.widget.RecyclerView 20 | import android.widget.ImageView 21 | import android.widget.TextView 22 | import app.com.thetechnocafe.kotlinweather.Dialogs.ForecastDialogFragment 23 | import app.com.thetechnocafe.kotlinweather.Models.WeatherData 24 | import app.com.thetechnocafe.kotlinweather.R 25 | import app.com.thetechnocafe.kotlinweather.Utils.WeatherToImage 26 | 27 | 28 | class HomeActivity : AppCompatActivity(), HomeContract.View { 29 | 30 | private val RC_ENABLE_LOCATION = 1 31 | private val RC_LOCATION_PERMISSION = 2 32 | private val TAG_FORECAST_DIALOG = "forecast_dialog" 33 | var mPresenter: HomeContract.Presenter? = null 34 | var mLocationManager: LocationManager? = null 35 | var mSwipeRefreshLayout: SwipeRefreshLayout? = null 36 | var mLocation: Location? = null 37 | 38 | /* 39 | * Refresh the weather location on location changed 40 | * */ 41 | var mLocationListener: LocationListener = object : LocationListener { 42 | override fun onLocationChanged(location: Location?) { 43 | mSwipeRefreshLayout?.isRefreshing = true 44 | mPresenter?.refresh(location?.latitude ?: 0.0, location?.longitude ?: 0.0) 45 | 46 | //Check if the location is not null 47 | //Remove the location listener as we don't need to fetch the weather again and again 48 | if (location?.latitude != null && location.latitude != 0.0 && location.longitude != 0.0) { 49 | mLocation = location 50 | mLocationManager?.removeUpdates(this) 51 | } 52 | } 53 | 54 | override fun onStatusChanged(provider: String?, status: Int, extras: Bundle?) { 55 | } 56 | 57 | override fun onProviderEnabled(provider: String?) { 58 | } 59 | 60 | override fun onProviderDisabled(provider: String?) { 61 | } 62 | } 63 | 64 | override fun onCreate(savedInstanceState: Bundle?) { 65 | super.onCreate(savedInstanceState) 66 | setContentView(R.layout.activity_home) 67 | 68 | mSwipeRefreshLayout = findViewById(R.id.swipe_refresh_layout) as SwipeRefreshLayout 69 | mLocationManager = getSystemService(Context.LOCATION_SERVICE) as LocationManager 70 | 71 | mPresenter = HomePresenter() 72 | mPresenter?.subscribe(this) 73 | 74 | initViews() 75 | 76 | if (checkAndAskForLocationPermissions()) { 77 | checkGpsEnabledAndPrompt() 78 | } 79 | } 80 | 81 | private fun initViews() { 82 | mSwipeRefreshLayout?.setOnRefreshListener { 83 | if (mLocation != null) { 84 | mPresenter?.refresh(mLocation?.latitude ?: 0.0, mLocation?.longitude ?: 0.0) 85 | } else { 86 | mSwipeRefreshLayout?.isRefreshing = false 87 | } 88 | } 89 | } 90 | 91 | override fun getContext() = this 92 | 93 | override fun onStoredDataFetched(weatherData: WeatherData?) { 94 | updateUI(weatherData) 95 | } 96 | 97 | override fun onDataFetched(weatherData: WeatherData?) { 98 | //Stop the swipe refresh layout 99 | mSwipeRefreshLayout?.isRefreshing = false 100 | updateUI(weatherData) 101 | } 102 | 103 | /* 104 | * Update the UI when the weather data is fetched from the network 105 | * */ 106 | private fun updateUI(weatherData: WeatherData?) { 107 | val temperatureTextView = findViewById(R.id.temperature_text_view) as TextView 108 | val windSpeedTextView = findViewById(R.id.wind_speed_text_view) as TextView 109 | val humidityTextView = findViewById(R.id.humidity_text_view) as TextView 110 | val weatherImageView = findViewById(R.id.weather_image_view) as ImageView 111 | val weatherConditionTextView = findViewById(R.id.weather_condition_text_view) as TextView 112 | val cityNameTextView = findViewById(R.id.city_name_text_view) as TextView 113 | 114 | val formattedTemperatureText = String.format(getString(R.string.celcuis_temperature), weatherData?.query?.results?.channel?.item?.condition?.temp ?: "") 115 | 116 | temperatureTextView.text = formattedTemperatureText 117 | windSpeedTextView.text = "${weatherData?.query?.results?.channel?.wind?.speed ?: ""} km/h" 118 | humidityTextView.text = "${weatherData?.query?.results?.channel?.atmosphere?.humidity ?: ""} %" 119 | 120 | //Set the weather conditions 121 | val weatherCode = weatherData?.query?.results?.channel?.item?.condition?.code ?: "3200" 122 | weatherImageView.setImageResource(WeatherToImage.getImageForCode(weatherCode)) 123 | weatherConditionTextView.text = weatherData?.query?.results?.channel?.item?.condition?.text ?: "" 124 | 125 | //Set the name 126 | val city = weatherData?.query?.results?.channel?.location?.city ?: "" 127 | val country = weatherData?.query?.results?.channel?.location?.country ?: "" 128 | val region = weatherData?.query?.results?.channel?.location?.region ?: "" 129 | cityNameTextView.text = "${city.trim()}, ${region.trim()}, ${country.trim()}" 130 | 131 | //Set up the forecast recycler view 132 | val forecastRecyclerView = findViewById(R.id.forecast_recycler_view) as RecyclerView 133 | val forecastRecyclerAdapter = ForecastRecyclerAdapter(this, weatherData?.query?.results?.channel?.item?.forecast?.asList()) 134 | forecastRecyclerAdapter.addActionListener { 135 | forecast -> 136 | val forecastDialog = ForecastDialogFragment.getInstance(forecast) 137 | forecastDialog.show(supportFragmentManager, TAG_FORECAST_DIALOG) 138 | 139 | } 140 | forecastRecyclerView.adapter = forecastRecyclerAdapter 141 | forecastRecyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false) 142 | } 143 | 144 | override fun onError() { 145 | mSwipeRefreshLayout?.isRefreshing = false 146 | 147 | //Show snackbar to retry 148 | val coordinatorLayout = findViewById(R.id.coordinator_layout) as CoordinatorLayout 149 | 150 | val retrySnackBar = Snackbar.make(coordinatorLayout, "Unable to fetch weather data.", Snackbar.LENGTH_INDEFINITE) 151 | retrySnackBar.setAction("Retry") { 152 | v -> 153 | mPresenter?.refresh(mLocation?.latitude ?: 0.0, mLocation?.longitude ?: 0.0) 154 | mSwipeRefreshLayout?.isRefreshing = true 155 | retrySnackBar.dismiss() 156 | } 157 | retrySnackBar.setActionTextColor(ContextCompat.getColor(this, R.color.md_white_1000)) 158 | retrySnackBar.show() 159 | } 160 | 161 | override fun onDestroy() { 162 | super.onDestroy() 163 | mPresenter?.unSubscribe() 164 | mLocationManager?.removeUpdates(mLocationListener) 165 | } 166 | 167 | /* 168 | * Check if the gps is enabled by the user 169 | * if not then prompt to enable gps 170 | * else start fetching the location 171 | * */ 172 | private fun checkGpsEnabledAndPrompt() { 173 | //Check if the gps is enabled 174 | val isLocationEnabled = mLocationManager!!.isProviderEnabled(LocationManager.NETWORK_PROVIDER) 175 | 176 | if (!isLocationEnabled) { 177 | //Show alert dialog to enable gps 178 | AlertDialog.Builder(this) 179 | .setCancelable(false) 180 | .setTitle("GPS is not enabled") 181 | .setMessage("This app required GPS to get the weather information. Do you want to enable GPS?") 182 | .setPositiveButton(android.R.string.ok, { 183 | dialog, which -> 184 | //Start settings to enable location 185 | val intent = Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS) 186 | startActivityForResult(intent, RC_ENABLE_LOCATION) 187 | 188 | dialog.dismiss() 189 | }) 190 | .setNegativeButton(android.R.string.cancel, { 191 | dialog, which -> 192 | dialog.dismiss() 193 | }) 194 | .create() 195 | .show() 196 | } else { 197 | requestLocationUpdates() 198 | } 199 | } 200 | 201 | /* 202 | * Start receiving the location updates 203 | * */ 204 | private fun requestLocationUpdates() { 205 | val provider = LocationManager.NETWORK_PROVIDER 206 | 207 | //Add the location listener and request updated 208 | mLocationManager?.requestLocationUpdates(provider, 0, 0.0f, mLocationListener) 209 | 210 | val location = mLocationManager?.getLastKnownLocation(provider) 211 | mLocationListener.onLocationChanged(location) 212 | } 213 | 214 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { 215 | super.onActivityResult(requestCode, resultCode, data) 216 | 217 | when (requestCode) { 218 | RC_ENABLE_LOCATION -> { 219 | checkGpsEnabledAndPrompt() 220 | } 221 | } 222 | } 223 | 224 | /* 225 | * Check if location permission have been granted by the user 226 | * */ 227 | private fun checkAndAskForLocationPermissions(): Boolean { 228 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 229 | if (checkSelfPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { 230 | requestPermissions(arrayOf(android.Manifest.permission.ACCESS_FINE_LOCATION), RC_LOCATION_PERMISSION) 231 | return false 232 | } 233 | } 234 | return true 235 | } 236 | 237 | override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { 238 | super.onRequestPermissionsResult(requestCode, permissions, grantResults) 239 | 240 | when (requestCode) { 241 | RC_LOCATION_PERMISSION -> { 242 | if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { 243 | checkGpsEnabledAndPrompt() 244 | } else { 245 | checkAndAskForLocationPermissions() 246 | } 247 | } 248 | } 249 | } 250 | } 251 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | 8 | #FFEBEE 9 | #FFCDD2 10 | #EF9A9A 11 | #E57373 12 | #EF5350 13 | #F44336 14 | #E53935 15 | #D32F2F 16 | #C62828 17 | #B71C1C 18 | #FF8A80 19 | #FF5252 20 | #FF1744 21 | #D50000 22 | 23 | 24 | #FCE4EC 25 | #F8BBD0 26 | #F48FB1 27 | #F06292 28 | #EC407A 29 | #E91E63 30 | #D81B60 31 | #C2185B 32 | #AD1457 33 | #880E4F 34 | #FF80AB 35 | #FF4081 36 | #F50057 37 | #C51162 38 | 39 | 40 | #F3E5F5 41 | #E1BEE7 42 | #CE93D8 43 | #BA68C8 44 | #AB47BC 45 | #9C27B0 46 | #8E24AA 47 | #7B1FA2 48 | #6A1B9A 49 | #4A148C 50 | #EA80FC 51 | #E040FB 52 | #D500F9 53 | #AA00FF 54 | 55 | 56 | #EDE7F6 57 | #D1C4E9 58 | #B39DDB 59 | #9575CD 60 | #7E57C2 61 | #673AB7 62 | #5E35B1 63 | #512DA8 64 | #4527A0 65 | #311B92 66 | #B388FF 67 | #7C4DFF 68 | #651FFF 69 | #6200EA 70 | 71 | 72 | #E8EAF6 73 | #C5CAE9 74 | #9FA8DA 75 | #7986CB 76 | #5C6BC0 77 | #3F51B5 78 | #3949AB 79 | #303F9F 80 | #283593 81 | #1A237E 82 | #8C9EFF 83 | #536DFE 84 | #3D5AFE 85 | #304FFE 86 | 87 | 88 | #E3F2FD 89 | #BBDEFB 90 | #90CAF9 91 | #64B5F6 92 | #42A5F5 93 | #2196F3 94 | #1E88E5 95 | #1976D2 96 | #1565C0 97 | #0D47A1 98 | #82B1FF 99 | #448AFF 100 | #2979FF 101 | #2962FF 102 | 103 | 104 | #E1F5FE 105 | #B3E5FC 106 | #81D4fA 107 | #4fC3F7 108 | #29B6FC 109 | #03A9F4 110 | #039BE5 111 | #0288D1 112 | #0277BD 113 | #01579B 114 | #80D8FF 115 | #40C4FF 116 | #00B0FF 117 | #0091EA 118 | 119 | 120 | #E0F7FA 121 | #B2EBF2 122 | #80DEEA 123 | #4DD0E1 124 | #26C6DA 125 | #00BCD4 126 | #00ACC1 127 | #0097A7 128 | #00838F 129 | #006064 130 | #84FFFF 131 | #18FFFF 132 | #00E5FF 133 | #00B8D4 134 | 135 | 136 | #E0F2F1 137 | #B2DFDB 138 | #80CBC4 139 | #4DB6AC 140 | #26A69A 141 | #009688 142 | #00897B 143 | #00796B 144 | #00695C 145 | #004D40 146 | #A7FFEB 147 | #64FFDA 148 | #1DE9B6 149 | #00BFA5 150 | 151 | 152 | #E8F5E9 153 | #C8E6C9 154 | #A5D6A7 155 | #81C784 156 | #66BB6A 157 | #4CAF50 158 | #43A047 159 | #388E3C 160 | #2E7D32 161 | #1B5E20 162 | #B9F6CA 163 | #69F0AE 164 | #00E676 165 | #00C853 166 | 167 | 168 | #F1F8E9 169 | #DCEDC8 170 | #C5E1A5 171 | #AED581 172 | #9CCC65 173 | #8BC34A 174 | #7CB342 175 | #689F38 176 | #558B2F 177 | #33691E 178 | #CCFF90 179 | #B2FF59 180 | #76FF03 181 | #64DD17 182 | 183 | 184 | #F9FBE7 185 | #F0F4C3 186 | #E6EE9C 187 | #DCE775 188 | #D4E157 189 | #CDDC39 190 | #C0CA33 191 | #A4B42B 192 | #9E9D24 193 | #827717 194 | #F4FF81 195 | #EEFF41 196 | #C6FF00 197 | #AEEA00 198 | 199 | 200 | #FFFDE7 201 | #FFF9C4 202 | #FFF590 203 | #FFF176 204 | #FFEE58 205 | #FFEB3B 206 | #FDD835 207 | #FBC02D 208 | #F9A825 209 | #F57F17 210 | #FFFF82 211 | #FFFF00 212 | #FFEA00 213 | #FFD600 214 | 215 | 216 | #FFF8E1 217 | #FFECB3 218 | #FFE082 219 | #FFD54F 220 | #FFCA28 221 | #FFC107 222 | #FFB300 223 | #FFA000 224 | #FF8F00 225 | #FF6F00 226 | #FFE57F 227 | #FFD740 228 | #FFC400 229 | #FFAB00 230 | 231 | 232 | #FFF3E0 233 | #FFE0B2 234 | #FFCC80 235 | #FFB74D 236 | #FFA726 237 | #FF9800 238 | #FB8C00 239 | #F57C00 240 | #EF6C00 241 | #E65100 242 | #FFD180 243 | #FFAB40 244 | #FF9100 245 | #FF6D00 246 | 247 | 248 | #FBE9A7 249 | #FFCCBC 250 | #FFAB91 251 | #FF8A65 252 | #FF7043 253 | #FF5722 254 | #F4511E 255 | #E64A19 256 | #D84315 257 | #BF360C 258 | #FF9E80 259 | #FF6E40 260 | #FF3D00 261 | #DD2600 262 | 263 | 264 | #EFEBE9 265 | #D7CCC8 266 | #BCAAA4 267 | #A1887F 268 | #8D6E63 269 | #795548 270 | #6D4C41 271 | #5D4037 272 | #4E342E 273 | #3E2723 274 | 275 | 276 | #FAFAFA 277 | #F5F5F5 278 | #EEEEEE 279 | #E0E0E0 280 | #BDBDBD 281 | #9E9E9E 282 | #757575 283 | #616161 284 | #424242 285 | #212121 286 | #000000 287 | #ffffff 288 | 289 | 290 | #ECEFF1 291 | #CFD8DC 292 | #B0BBC5 293 | #90A4AE 294 | #78909C 295 | #607D8B 296 | #546E7A 297 | #455A64 298 | #37474F 299 | #263238 300 | 301 | --------------------------------------------------------------------------------