├── settings.gradle ├── debug.keystore ├── results ├── video.mp4 ├── screenshot_1.png └── screenshot_2.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── app ├── src │ ├── main │ │ ├── res │ │ │ ├── font │ │ │ │ ├── rajd_bold.ttf │ │ │ │ ├── rajd_light.ttf │ │ │ │ ├── rajd_regular.ttf │ │ │ │ ├── orbitron_medium.ttf │ │ │ │ ├── orbitron_regular.ttf │ │ │ │ └── orbitron_semibold.ttf │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.webp │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.webp │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.webp │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.webp │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ └── ic_launcher.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── themes.xml │ │ │ ├── values-night │ │ │ │ └── themes.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── assets │ │ │ └── mars │ │ │ │ ├── frame_00_delay-0.07s.png │ │ │ │ ├── frame_01_delay-0.06s.png │ │ │ │ ├── frame_02_delay-0.07s.png │ │ │ │ ├── frame_03_delay-0.07s.png │ │ │ │ ├── frame_04_delay-0.06s.png │ │ │ │ ├── frame_05_delay-0.07s.png │ │ │ │ ├── frame_06_delay-0.07s.png │ │ │ │ ├── frame_07_delay-0.06s.png │ │ │ │ ├── frame_08_delay-0.07s.png │ │ │ │ ├── frame_09_delay-0.07s.png │ │ │ │ ├── frame_10_delay-0.06s.png │ │ │ │ ├── frame_11_delay-0.07s.png │ │ │ │ ├── frame_12_delay-0.07s.png │ │ │ │ ├── frame_13_delay-0.06s.png │ │ │ │ ├── frame_14_delay-0.07s.png │ │ │ │ ├── frame_15_delay-0.07s.png │ │ │ │ ├── frame_16_delay-0.06s.png │ │ │ │ ├── frame_17_delay-0.07s.png │ │ │ │ ├── frame_18_delay-0.07s.png │ │ │ │ ├── frame_19_delay-0.06s.png │ │ │ │ ├── frame_20_delay-0.07s.png │ │ │ │ ├── frame_21_delay-0.07s.png │ │ │ │ ├── frame_22_delay-0.06s.png │ │ │ │ ├── frame_23_delay-0.07s.png │ │ │ │ ├── frame_24_delay-0.07s.png │ │ │ │ ├── frame_25_delay-0.06s.png │ │ │ │ ├── frame_26_delay-0.07s.png │ │ │ │ ├── frame_27_delay-0.07s.png │ │ │ │ ├── frame_28_delay-0.06s.png │ │ │ │ ├── frame_29_delay-0.07s.png │ │ │ │ ├── frame_30_delay-0.07s.png │ │ │ │ ├── frame_31_delay-0.06s.png │ │ │ │ ├── frame_32_delay-0.07s.png │ │ │ │ ├── frame_33_delay-0.07s.png │ │ │ │ ├── frame_34_delay-0.06s.png │ │ │ │ ├── frame_35_delay-0.07s.png │ │ │ │ ├── frame_36_delay-0.07s.png │ │ │ │ ├── frame_37_delay-0.06s.png │ │ │ │ ├── frame_38_delay-0.07s.png │ │ │ │ ├── frame_39_delay-0.07s.png │ │ │ │ ├── frame_40_delay-0.06s.png │ │ │ │ ├── frame_41_delay-0.07s.png │ │ │ │ ├── frame_42_delay-0.07s.png │ │ │ │ ├── frame_43_delay-0.06s.png │ │ │ │ ├── frame_44_delay-0.07s.png │ │ │ │ ├── frame_45_delay-0.07s.png │ │ │ │ ├── frame_46_delay-0.06s.png │ │ │ │ ├── frame_47_delay-0.07s.png │ │ │ │ ├── frame_48_delay-0.07s.png │ │ │ │ ├── frame_49_delay-0.06s.png │ │ │ │ ├── frame_50_delay-0.07s.png │ │ │ │ ├── frame_51_delay-0.07s.png │ │ │ │ ├── frame_52_delay-0.06s.png │ │ │ │ ├── frame_53_delay-0.07s.png │ │ │ │ ├── frame_54_delay-0.07s.png │ │ │ │ ├── frame_55_delay-0.06s.png │ │ │ │ ├── frame_56_delay-0.07s.png │ │ │ │ ├── frame_57_delay-0.07s.png │ │ │ │ ├── frame_58_delay-0.06s.png │ │ │ │ ├── frame_59_delay-0.07s.png │ │ │ │ ├── frame_60_delay-0.07s.png │ │ │ │ ├── frame_61_delay-0.06s.png │ │ │ │ ├── frame_62_delay-0.07s.png │ │ │ │ ├── frame_63_delay-0.07s.png │ │ │ │ ├── frame_64_delay-0.06s.png │ │ │ │ ├── frame_65_delay-0.07s.png │ │ │ │ ├── frame_66_delay-0.07s.png │ │ │ │ ├── frame_67_delay-0.06s.png │ │ │ │ ├── frame_68_delay-0.07s.png │ │ │ │ ├── frame_69_delay-0.07s.png │ │ │ │ ├── frame_70_delay-0.06s.png │ │ │ │ ├── frame_71_delay-0.07s.png │ │ │ │ ├── frame_72_delay-0.07s.png │ │ │ │ ├── frame_73_delay-0.06s.png │ │ │ │ ├── frame_74_delay-0.07s.png │ │ │ │ ├── frame_75_delay-0.07s.png │ │ │ │ ├── frame_76_delay-0.06s.png │ │ │ │ ├── frame_77_delay-0.07s.png │ │ │ │ ├── frame_78_delay-0.07s.png │ │ │ │ ├── frame_79_delay-0.06s.png │ │ │ │ ├── frame_80_delay-0.07s.png │ │ │ │ ├── frame_81_delay-0.07s.png │ │ │ │ ├── frame_82_delay-0.06s.png │ │ │ │ ├── frame_83_delay-0.07s.png │ │ │ │ ├── frame_84_delay-0.07s.png │ │ │ │ ├── frame_85_delay-0.06s.png │ │ │ │ ├── frame_86_delay-0.07s.png │ │ │ │ ├── frame_87_delay-0.07s.png │ │ │ │ ├── frame_88_delay-0.06s.png │ │ │ │ ├── frame_89_delay-0.07s.png │ │ │ │ ├── frame_90_delay-0.07s.png │ │ │ │ ├── frame_91_delay-0.06s.png │ │ │ │ ├── frame_92_delay-0.07s.png │ │ │ │ ├── frame_93_delay-0.07s.png │ │ │ │ ├── frame_94_delay-0.06s.png │ │ │ │ ├── frame_95_delay-0.07s.png │ │ │ │ └── frame_96_delay-0.07s.png │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── androiddevchallenge │ │ │ │ ├── domain │ │ │ │ ├── models │ │ │ │ │ ├── Pressure.kt │ │ │ │ │ ├── SolTemperature.kt │ │ │ │ │ ├── DayForecast.kt │ │ │ │ │ └── Sol.kt │ │ │ │ ├── extensions │ │ │ │ │ ├── ListExtenstions.kt │ │ │ │ │ └── DateExtensions.kt │ │ │ │ ├── ImageProvider.kt │ │ │ │ └── repository │ │ │ │ │ └── SolRepository.kt │ │ │ │ ├── ui │ │ │ │ ├── theme │ │ │ │ │ ├── Color.kt │ │ │ │ │ ├── Shape.kt │ │ │ │ │ ├── Theme.kt │ │ │ │ │ └── Type.kt │ │ │ │ ├── screens │ │ │ │ │ └── home │ │ │ │ │ │ ├── SolViewState.kt │ │ │ │ │ │ ├── SolViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ ├── SolSunsetSunrise.kt │ │ │ │ │ │ ├── SolTemperature.kt │ │ │ │ │ │ ├── SolCurrentComponent.kt │ │ │ │ │ │ ├── WarningMessageComponent.kt │ │ │ │ │ │ ├── DayForecastItem.kt │ │ │ │ │ │ └── SolMenuComponent.kt │ │ │ │ │ │ ├── pages │ │ │ │ │ │ ├── PreviousSolPage.kt │ │ │ │ │ │ ├── ForecastPage.kt │ │ │ │ │ │ └── LatestSolPage.kt │ │ │ │ │ │ └── SolScreen.kt │ │ │ │ ├── Extensions.kt │ │ │ │ ├── animations │ │ │ │ │ └── RotationAnimation.kt │ │ │ │ └── components │ │ │ │ │ ├── WeatherValueComponent.kt │ │ │ │ │ ├── AnimatedDashedCircle.kt │ │ │ │ │ └── MarsGlobeComponent.kt │ │ │ │ └── MainActivity.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── androiddevchallenge │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── example │ │ └── androiddevchallenge │ │ └── ExampleInstrumentedTest.kt ├── .gitignore ├── proguard-rules.pro └── build.gradle ├── .gitignore ├── spotless └── copyright.kt ├── .github ├── ci-gradle.properties └── workflows │ └── Check.yaml ├── CONTRIBUTING.md ├── gradle.properties ├── README.md ├── README-template.md ├── gradlew.bat ├── gradlew └── LICENSE /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = "AndroidDevChallenge" 2 | include ':app' 3 | -------------------------------------------------------------------------------- /debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/debug.keystore -------------------------------------------------------------------------------- /results/video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/results/video.mp4 -------------------------------------------------------------------------------- /results/screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/results/screenshot_1.png -------------------------------------------------------------------------------- /results/screenshot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/results/screenshot_2.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/font/rajd_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/font/rajd_bold.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/rajd_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/font/rajd_light.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/rajd_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/font/rajd_regular.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/orbitron_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/font/orbitron_medium.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/orbitron_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/font/orbitron_regular.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/orbitron_semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/font/orbitron_semibold.ttf -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_00_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_00_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_01_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_01_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_02_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_02_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_03_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_03_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_04_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_04_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_05_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_05_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_06_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_06_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_07_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_07_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_08_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_08_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_09_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_09_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_10_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_10_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_11_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_11_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_12_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_12_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_13_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_13_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_14_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_14_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_15_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_15_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_16_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_16_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_17_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_17_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_18_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_18_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_19_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_19_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_20_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_20_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_21_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_21_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_22_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_22_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_23_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_23_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_24_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_24_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_25_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_25_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_26_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_26_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_27_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_27_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_28_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_28_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_29_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_29_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_30_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_30_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_31_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_31_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_32_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_32_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_33_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_33_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_34_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_34_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_35_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_35_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_36_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_36_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_37_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_37_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_38_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_38_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_39_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_39_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_40_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_40_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_41_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_41_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_42_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_42_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_43_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_43_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_44_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_44_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_45_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_45_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_46_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_46_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_47_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_47_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_48_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_48_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_49_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_49_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_50_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_50_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_51_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_51_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_52_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_52_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_53_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_53_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_54_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_54_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_55_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_55_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_56_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_56_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_57_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_57_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_58_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_58_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_59_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_59_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_60_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_60_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_61_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_61_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_62_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_62_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_63_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_63_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_64_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_64_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_65_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_65_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_66_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_66_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_67_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_67_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_68_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_68_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_69_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_69_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_70_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_70_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_71_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_71_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_72_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_72_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_73_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_73_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_74_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_74_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_75_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_75_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_76_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_76_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_77_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_77_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_78_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_78_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_79_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_79_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_80_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_80_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_81_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_81_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_82_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_82_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_83_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_83_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_84_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_84_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_85_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_85_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_86_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_86_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_87_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_87_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_88_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_88_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_89_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_89_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_90_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_90_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_91_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_91_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_92_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_92_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_93_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_93_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_94_delay-0.06s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_94_delay-0.06s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_95_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_95_delay-0.07s.png -------------------------------------------------------------------------------- /app/src/main/assets/mars/frame_96_delay-0.07s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levinzonr/compose-challenge-w4/HEAD/app/src/main/assets/mars/frame_96_delay-0.07s.png -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | # Gradle 2 | .gradle 3 | build/ 4 | 5 | captures 6 | 7 | /local.properties 8 | 9 | # IntelliJ .idea folder 10 | /.idea 11 | *.iml 12 | 13 | # General 14 | .DS_Store 15 | .externalNativeBuild -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Feb 24 18:05:51 CET 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Mac files 6 | .DS_Store 7 | 8 | # files for the dex VM 9 | *.dex 10 | 11 | # Java class files 12 | *.class 13 | 14 | # generated files 15 | bin/ 16 | gen/ 17 | 18 | # Ignore gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | proguard-project.txt 28 | 29 | # Eclipse files 30 | .project 31 | .classpath 32 | .settings/ 33 | 34 | # Android Studio/IDEA 35 | *.iml 36 | .idea -------------------------------------------------------------------------------- /spotless/copyright.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright $YEAR The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/domain/models/Pressure.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.domain.models 17 | 18 | data class Pressure( 19 | val value: Int, 20 | val description: String 21 | ) 22 | -------------------------------------------------------------------------------- /.github/ci-gradle.properties: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Copyright 2020 The Android Open Source Project 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.gradle.daemon=false 19 | org.gradle.parallel=true 20 | org.gradle.jvmargs=-Xmx5120m 21 | org.gradle.workers.max=2 22 | 23 | kotlin.incremental=false 24 | kotlin.compiler.execution.strategy=in-process 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/ui/theme/Color.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.ui.theme 17 | 18 | import androidx.compose.ui.graphics.Color 19 | 20 | val white = Color.White 21 | val black = Color.Black 22 | val redLight = Color(0xFFE9957A) 23 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/domain/models/SolTemperature.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.domain.models 17 | 18 | data class SolTemperature( 19 | val minCelsius: Int, 20 | val maxCelsius: Int, 21 | val currentCelsius: Int = listOf(minCelsius, maxCelsius).average().toInt() 22 | ) 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/domain/models/DayForecast.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.domain.models 17 | 18 | import java.util.Date 19 | 20 | data class DayForecast( 21 | val date: Date, 22 | val temperature: SolTemperature, 23 | val windSpeed: Int, 24 | val number: Int 25 | ) 26 | -------------------------------------------------------------------------------- /app/src/test/java/com/example/androiddevchallenge/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge 17 | 18 | /** 19 | * Example local unit test, which will execute on the development machine (host). 20 | * 21 | * See [testing documentation](http://d.android.com/tools/testing). 22 | */ 23 | class ExampleUnitTest { 24 | // Add unit tests here 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | #FFBB86FC 14 | #FF6200EE 15 | #FF3700B3 16 | #FF03DAC5 17 | #FF018786 18 | #FF000000 19 | #FFFFFFFF 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/domain/extensions/ListExtenstions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.domain.extensions 17 | 18 | fun List.nextAfter(item: T): T? { 19 | val index = indexOf(item) 20 | return getOrNull(index.inc()) 21 | } 22 | 23 | fun List.previousBefore(item: T): T? { 24 | val index = indexOf(item) 25 | return getOrNull(index.dec()) 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/ui/theme/Shape.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.ui.theme 17 | 18 | import androidx.compose.foundation.shape.RoundedCornerShape 19 | import androidx.compose.material.Shapes 20 | import androidx.compose.ui.unit.dp 21 | 22 | val shapes = Shapes( 23 | small = RoundedCornerShape(4.dp), 24 | medium = RoundedCornerShape(4.dp), 25 | large = RoundedCornerShape(0.dp) 26 | ) 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/domain/models/Sol.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.domain.models 17 | 18 | import java.util.Date 19 | 20 | data class Sol( 21 | val number: Int, 22 | val date: Date, 23 | val temperature: SolTemperature, 24 | val pressure: Pressure, 25 | val sunriseTime: String, 26 | val sunsetTime: String, 27 | val atmosphereOpacity: String, 28 | val season: String, 29 | val windSpeedKmh: Int = 0 30 | ) 31 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution, 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | 25 | ## Community Guidelines 26 | 27 | This project follows [Google's Open Source Community 28 | Guidelines](https://opensource.google.com/conduct/). -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/domain/extensions/DateExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.domain.extensions 17 | 18 | import java.text.SimpleDateFormat 19 | import java.util.Date 20 | import java.util.Locale 21 | 22 | fun String.toDate(): Date { 23 | val format = "yyyy-MM-dd" 24 | return SimpleDateFormat(format, Locale.getDefault()).parse(this)!! 25 | } 26 | 27 | fun Date.format(): String { 28 | val format = "MMM dd" 29 | return SimpleDateFormat(format, Locale.getDefault()).format(this) 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/ui/screens/home/SolViewState.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.ui.screens.home 17 | 18 | import com.example.androiddevchallenge.domain.models.DayForecast 19 | import com.example.androiddevchallenge.domain.models.Sol 20 | import com.example.androiddevchallenge.ui.screens.home.components.SolPage 21 | 22 | data class SolViewState( 23 | val sols: List = listOf(), 24 | val forecast: List = listOf(), 25 | val latestSol: Sol, 26 | val selectedSol: SolPage = SolPage.SolHeader(latestSol) 27 | ) 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/ui/theme/Theme.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.ui.theme 17 | 18 | import androidx.compose.material.MaterialTheme 19 | import androidx.compose.material.darkColors 20 | import androidx.compose.runtime.Composable 21 | 22 | private val DarkColorPalette = darkColors( 23 | primary = white, 24 | primaryVariant = white, 25 | secondary = redLight, 26 | surface = black, 27 | background = black 28 | ) 29 | 30 | @Composable 31 | fun MyTheme(content: @Composable() () -> Unit) { 32 | MaterialTheme( 33 | colors = DarkColorPalette, 34 | typography = appTypography, 35 | shapes = shapes, 36 | content = content 37 | ) 38 | } 39 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/example/androiddevchallenge/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge 17 | 18 | import androidx.compose.ui.test.junit4.createAndroidComposeRule 19 | import androidx.test.ext.junit.runners.AndroidJUnit4 20 | import org.junit.Rule 21 | import org.junit.Test 22 | import org.junit.runner.RunWith 23 | 24 | /** 25 | * Instrumented test, which will execute on an Android device. 26 | * 27 | * See [testing documentation](http://d.android.com/tools/testing). 28 | */ 29 | @RunWith(AndroidJUnit4::class) 30 | class ExampleInstrumentedTest { 31 | @get:Rule 32 | val composeTestRule = createAndroidComposeRule() 33 | 34 | @Test 35 | fun sampleTest() { 36 | // Add instrumented tests here 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/ui/Extensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.ui 17 | 18 | import androidx.compose.runtime.Composable 19 | import androidx.compose.ui.res.stringResource 20 | import com.example.androiddevchallenge.R 21 | 22 | @Composable fun Int.toDegreesString(): String { 23 | return stringResource(id = R.string.degrees_celsius, this.toString()) 24 | } 25 | 26 | @Composable fun Int.toSolString(): String { 27 | return stringResource(id = R.string.sol, this.toString()) 28 | } 29 | 30 | @Composable fun Int.toKmHString(): String { 31 | return stringResource(id = R.string.value_wind_speed, this.toString()) 32 | } 33 | 34 | @Composable fun Int.toPressureString(): String { 35 | return stringResource(id = R.string.value_pressure, this.toString()) 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | AndroidDevChallenge 13 | MAX 14 | MIN 15 | Sunrise 16 | Sunset 17 | SOL %1$s" 18 | %1$s °C" 19 | %1$s km/h 20 | %1$s km/h 21 | Wind Speed 22 | Pressure 23 | %1$s Pa 24 | Today at ColonyX 25 | 75% chance of wind storms tommorrow 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/ui/animations/RotationAnimation.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.ui.animations 17 | 18 | import androidx.compose.animation.core.InfiniteTransition 19 | import androidx.compose.animation.core.RepeatMode 20 | import androidx.compose.animation.core.animateFloat 21 | import androidx.compose.animation.core.infiniteRepeatable 22 | import androidx.compose.animation.core.keyframes 23 | import androidx.compose.runtime.Composable 24 | import androidx.compose.runtime.State 25 | 26 | @Composable 27 | fun InfiniteTransition.rotationAnimation(durationMs: Int = 6000, targetValue: Float): State { 28 | val spec = infiniteRepeatable( 29 | animation = keyframes { durationMillis = durationMs }, 30 | repeatMode = RepeatMode.Restart 31 | ) 32 | return animateFloat( 33 | initialValue = 0f, 34 | targetValue = targetValue, 35 | animationSpec = spec 36 | ) 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/domain/ImageProvider.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.domain 17 | 18 | import android.content.Context 19 | import android.net.Uri 20 | import androidx.core.net.toUri 21 | import java.io.File 22 | 23 | object ImageProvider { 24 | 25 | fun init(context: Context) { 26 | val dir = context.filesDir 27 | context.assets.list("mars")?.forEach { 28 | val name = it.split("-").first() 29 | val frameFile = File(dir, name) 30 | if (!frameFile.exists()) { 31 | frameFile.createNewFile() 32 | frameFile.writeBytes(context.assets.open("mars/$it").readBytes()) 33 | } 34 | } 35 | } 36 | 37 | fun getFrame(context: Context, number: Int): Uri? { 38 | val name = "frame_${if (number < 10) "0$number" else number.toString()}_delay" 39 | return context.filesDir.listFiles()?.find { it.name == name }?.toUri() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 15 | 16 | 17 | 18 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ColonyX Weather 2 | 3 | 4 | 5 | ![Workflow result](https://github.com/levinzonr/compose-challenge-w4/workflows/Check/badge.svg) 6 | 7 | 8 | ## :scroll: Description 9 | ColonyX Weather provides a weather data for a remote Mars colony named ColonyX. The application provides current 10 | weather conditions for the current day and time as well for other statistical data for previous sols 11 | 12 | ## :bulb: Motivation and Context 13 | With this app I decided to fantasize for a bit about the weather app for the users of the future, 14 | which might get a new home planet some day :). The data used by the app is based on the [data gathered by Curiosity Rover](https://mars.nasa.gov/msl/weather/) 15 | 16 | 17 | ## :camera_flash: Screenshots 18 | 19 | 20 | 21 | ## License 22 | ``` 23 | Copyright 2020 The Android Open Source Project 24 | 25 | Licensed under the Apache License, Version 2.0 (the "License"); 26 | you may not use this file except in compliance with the License. 27 | You may obtain a copy of the License at 28 | 29 | https://www.apache.org/licenses/LICENSE-2.0 30 | 31 | Unless required by applicable law or agreed to in writing, software 32 | distributed under the License is distributed on an "AS IS" BASIS, 33 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 34 | See the License for the specific language governing permissions and 35 | limitations under the License. 36 | ``` -------------------------------------------------------------------------------- /README-template.md: -------------------------------------------------------------------------------- 1 | # ColonyX Weather 2 | 3 | 4 | 5 | ![Workflow result](https://github.com/levinzonr/compose-challenge-w4/workflows/Check/badge.svg) 6 | 7 | 8 | ## :scroll: Description 9 | ColonyX Weather provides a weather data for a remote Mars colony named ColonyX. The application provides current 10 | weather conditions for the current day and time as well for other statistical data for previous sols 11 | 12 | ## :bulb: Motivation and Context 13 | With this app I decided to fantasize for a bit about the weather app for the users of the future, 14 | which might get a new home planet some day :). The data used by the app is based on the (data gathered by Curiosity Rover)[https://mars.nasa.gov/msl/weather/] 15 | 16 | 17 | ## :camera_flash: Screenshots 18 | 19 | 20 | 21 | ## License 22 | ``` 23 | Copyright 2020 The Android Open Source Project 24 | 25 | Licensed under the Apache License, Version 2.0 (the "License"); 26 | you may not use this file except in compliance with the License. 27 | You may obtain a copy of the License at 28 | 29 | https://www.apache.org/licenses/LICENSE-2.0 30 | 31 | Unless required by applicable law or agreed to in writing, software 32 | distributed under the License is distributed on an "AS IS" BASIS, 33 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 34 | See the License for the specific language governing permissions and 35 | limitations under the License. 36 | ``` -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/ui/components/WeatherValueComponent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.ui.components 17 | 18 | import androidx.compose.foundation.layout.Column 19 | import androidx.compose.material.MaterialTheme 20 | import androidx.compose.material.Text 21 | import androidx.compose.runtime.Composable 22 | import androidx.compose.ui.Alignment 23 | import androidx.compose.ui.Modifier 24 | import androidx.compose.ui.tooling.preview.Preview 25 | 26 | @Composable 27 | fun WeatherValueComponent(value: String, label: String, modifier: Modifier = Modifier) { 28 | Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = modifier) { 29 | Text( 30 | text = value, 31 | style = MaterialTheme.typography.h3 32 | ) 33 | Text( 34 | text = label, 35 | style = MaterialTheme.typography.subtitle1, 36 | color = MaterialTheme.colors.secondary 37 | ) 38 | } 39 | } 40 | 41 | @Preview 42 | @Composable 43 | fun PreviewWeatherValue() { 44 | WeatherValueComponent(label = "Label", value = "value") 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/MainActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge 17 | 18 | import android.os.Bundle 19 | import androidx.activity.compose.setContent 20 | import androidx.appcompat.app.AppCompatActivity 21 | import androidx.compose.material.MaterialTheme 22 | import androidx.compose.material.Surface 23 | import androidx.compose.runtime.Composable 24 | import androidx.compose.ui.tooling.preview.Preview 25 | import androidx.lifecycle.viewmodel.compose.viewModel 26 | import com.example.androiddevchallenge.domain.ImageProvider 27 | import com.example.androiddevchallenge.ui.screens.home.SolScreen 28 | import com.example.androiddevchallenge.ui.theme.MyTheme 29 | 30 | class MainActivity : AppCompatActivity() { 31 | override fun onCreate(savedInstanceState: Bundle?) { 32 | super.onCreate(savedInstanceState) 33 | ImageProvider.init(this) 34 | setContent { 35 | MyTheme { 36 | MyApp() 37 | } 38 | } 39 | } 40 | } 41 | 42 | // Start building your app here! 43 | @Composable 44 | fun MyApp() { 45 | Surface(color = MaterialTheme.colors.background) { 46 | SolScreen(viewModel = viewModel()) 47 | } 48 | } 49 | 50 | @Preview("App", widthDp = 360, heightDp = 640) 51 | @Composable 52 | fun LightPreview() { 53 | MyTheme { 54 | MyApp() 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/androiddevchallenge/ui/screens/home/SolViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.androiddevchallenge.ui.screens.home 17 | 18 | import androidx.lifecycle.LiveData 19 | import androidx.lifecycle.MutableLiveData 20 | import androidx.lifecycle.ViewModel 21 | import com.example.androiddevchallenge.domain.repository.SolRepository 22 | import com.example.androiddevchallenge.ui.screens.home.components.SolPage 23 | 24 | class SolViewModel : ViewModel() { 25 | 26 | private val _state = MutableLiveData(SolViewState(latestSol = SolRepository.getLatestSol())) 27 | val viewState: LiveData get() = _state 28 | 29 | init { 30 | val sols = SolRepository.getAvailableSols() 31 | _state.value = SolViewState( 32 | forecast = SolRepository.getForecast(), 33 | sols = sols.map { SolPage.SolHeader(it) }.toMutableList().apply { add(SolPage.Forecast) }, 34 | selectedSol = SolPage.SolHeader(SolRepository.getLatestSol()), 35 | latestSol = SolRepository.getLatestSol() 36 | ) 37 | } 38 | 39 | fun onSolNumberSelected(number: Int) { 40 | SolRepository.getSolByNumber(number).let { 41 | val model = it?.let { SolPage.SolHeader(it) } ?: SolPage.Forecast 42 | _state.value = _state.value?.copy(selectedSol = model) 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 27 | 28 | 32 | 33 |