├── 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 | 
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 | 
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 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/screens/home/components/SolSunsetSunrise.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.components
17 |
18 | import androidx.compose.foundation.layout.Arrangement
19 | import androidx.compose.foundation.layout.Row
20 | import androidx.compose.foundation.layout.fillMaxWidth
21 | import androidx.compose.runtime.Composable
22 | import androidx.compose.ui.Modifier
23 | import androidx.compose.ui.res.stringResource
24 | import androidx.compose.ui.tooling.preview.Preview
25 | import com.example.androiddevchallenge.R
26 | import com.example.androiddevchallenge.domain.models.Sol
27 | import com.example.androiddevchallenge.domain.repository.SolRepository
28 | import com.example.androiddevchallenge.ui.components.WeatherValueComponent
29 |
30 | @Composable
31 | fun SolSunsetSunrise(sol: Sol, modifier: Modifier = Modifier) {
32 | Row(modifier = modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween) {
33 | WeatherValueComponent(
34 | label = stringResource(id = R.string.sunrise),
35 | value = sol.sunriseTime
36 | )
37 | WeatherValueComponent(
38 | label = stringResource(id = R.string.sunset),
39 | value = sol.sunsetTime
40 | )
41 | }
42 | }
43 |
44 | @Preview
45 | @Composable
46 | fun PreviewSolSunsetSunrise() {
47 | SolSunsetSunrise(sol = SolRepository.getLatestSol())
48 | }
49 |
--------------------------------------------------------------------------------
/.github/workflows/Check.yaml:
--------------------------------------------------------------------------------
1 | name: Check
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | timeout-minutes: 30
12 |
13 | steps:
14 | - name: Checkout
15 | uses: actions/checkout@v2
16 |
17 | - name: Copy CI gradle.properties
18 | run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
19 |
20 | - name: Set up JDK 11
21 | uses: actions/setup-java@v1
22 | with:
23 | java-version: 11
24 |
25 | - name: Build project
26 | run: ./gradlew spotlessCheck assembleDebug lintDebug --stacktrace
27 |
28 | - name: Upload build outputs (APKs)
29 | uses: actions/upload-artifact@v2
30 | with:
31 | name: build-outputs
32 | path: app/build/outputs
33 |
34 | - name: Upload build reports
35 | if: always()
36 | uses: actions/upload-artifact@v2
37 | with:
38 | name: build-reports
39 | path: app/build/reports
40 |
41 | test:
42 | needs: build
43 | runs-on: macOS-latest # enables hardware acceleration in the virtual machine
44 | timeout-minutes: 30
45 | strategy:
46 | matrix:
47 | api-level: [23, 26, 29]
48 |
49 | steps:
50 | - name: Checkout
51 | uses: actions/checkout@v2
52 |
53 | - name: Copy CI gradle.properties
54 | run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
55 |
56 | - name: Set up JDK 11
57 | uses: actions/setup-java@v1
58 | with:
59 | java-version: 11
60 |
61 | - name: Run instrumentation tests
62 | uses: reactivecircus/android-emulator-runner@v2
63 | with:
64 | api-level: ${{ matrix.api-level }}
65 | arch: x86
66 | disable-animations: true
67 | script: ./gradlew connectedCheck --stacktrace
68 |
69 | - name: Upload test reports
70 | if: always()
71 | uses: actions/upload-artifact@v2
72 | with:
73 | name: test-reports
74 | path: app/build/reports
75 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/screens/home/components/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.ui.screens.home.components
17 |
18 | import androidx.compose.foundation.layout.Arrangement
19 | import androidx.compose.foundation.layout.Row
20 | import androidx.compose.foundation.layout.fillMaxWidth
21 | import androidx.compose.runtime.Composable
22 | import androidx.compose.ui.Modifier
23 | import androidx.compose.ui.res.stringResource
24 | import androidx.compose.ui.tooling.preview.Preview
25 | import com.example.androiddevchallenge.R
26 | import com.example.androiddevchallenge.domain.models.Sol
27 | import com.example.androiddevchallenge.domain.models.SolTemperature
28 | import com.example.androiddevchallenge.domain.repository.SolRepository
29 | import com.example.androiddevchallenge.ui.components.WeatherValueComponent
30 | import com.example.androiddevchallenge.ui.toDegreesString
31 |
32 | @Composable
33 | fun SolTemperature(sol: Sol, modifier: Modifier = Modifier) {
34 | Row(modifier = modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween) {
35 | WeatherValueComponent(
36 | label = stringResource(id = R.string.temperature_max),
37 | value = sol.temperature.maxCelsius.toDegreesString()
38 | )
39 | WeatherValueComponent(
40 | label = stringResource(id = R.string.temperature_min),
41 | value = sol.temperature.minCelsius.toDegreesString()
42 | )
43 | }
44 | }
45 |
46 | @Preview
47 | @Composable
48 | fun PreviewSolTemperature() {
49 | SolTemperature(sol = SolRepository.getLatestSol())
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/screens/home/pages/PreviousSolPage.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.pages
17 |
18 | import androidx.compose.foundation.layout.Arrangement
19 | import androidx.compose.foundation.layout.Column
20 | import androidx.compose.foundation.layout.aspectRatio
21 | import androidx.compose.foundation.layout.fillMaxSize
22 | import androidx.compose.foundation.layout.fillMaxWidth
23 | import androidx.compose.foundation.layout.padding
24 | import androidx.compose.runtime.Composable
25 | import androidx.compose.ui.Alignment
26 | import androidx.compose.ui.Modifier
27 | import androidx.compose.ui.unit.dp
28 | import com.example.androiddevchallenge.domain.models.Sol
29 | import com.example.androiddevchallenge.ui.components.MarsGlobeComponent
30 | import com.example.androiddevchallenge.ui.screens.home.components.SolSunsetSunrise
31 | import com.example.androiddevchallenge.ui.screens.home.components.SolTemperature
32 |
33 | @Composable
34 | fun PreviousSolPage(sol: Sol) {
35 | Column(
36 | modifier = Modifier.fillMaxSize(),
37 | horizontalAlignment = Alignment.CenterHorizontally,
38 | verticalArrangement = Arrangement.Center
39 | ) {
40 | SolTemperature(
41 | sol = sol,
42 | modifier = Modifier.padding(horizontal = 32.dp)
43 | )
44 | MarsGlobeComponent(
45 | modifier = Modifier
46 | .fillMaxWidth(0.7f)
47 | .aspectRatio(1f)
48 | )
49 | SolSunsetSunrise(
50 | sol,
51 | modifier = Modifier.padding(horizontal = 32.dp)
52 | )
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/components/AnimatedDashedCircle.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.animation.core.rememberInfiniteTransition
19 | import androidx.compose.foundation.Canvas
20 | import androidx.compose.material.MaterialTheme
21 | import androidx.compose.runtime.Composable
22 | import androidx.compose.ui.Modifier
23 | import androidx.compose.ui.graphics.Color
24 | import androidx.compose.ui.graphics.PathEffect
25 | import androidx.compose.ui.graphics.drawscope.Stroke
26 | import androidx.compose.ui.graphics.drawscope.rotate
27 | import androidx.compose.ui.tooling.preview.Preview
28 | import com.example.androiddevchallenge.ui.animations.rotationAnimation
29 |
30 | @Composable
31 | fun AnimatedDashedCircle(
32 | modifier: Modifier = Modifier,
33 | color: Color = MaterialTheme.colors.secondary
34 | ) {
35 | val transformation = rememberInfiniteTransition()
36 | val degreeState = transformation.rotationAnimation(targetValue = 360f)
37 | Canvas(
38 | modifier = modifier
39 | ) {
40 | rotate(degreeState.value) {
41 | val path = PathEffect.dashPathEffect(
42 | floatArrayOf(
43 | size.width / 2,
44 | size.width / 2,
45 | size.width / 8,
46 | size.width / 8
47 | ),
48 | 3f
49 | )
50 | drawCircle(
51 | color = color,
52 | style = Stroke(
53 | width = 1.3f,
54 | pathEffect = path
55 | )
56 | )
57 | }
58 | }
59 | }
60 |
61 | @Preview
62 | @Composable
63 | fun PreviewCircle() {
64 | AnimatedDashedCircle()
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
11 |
17 |
18 |
19 |
25 |
28 |
31 |
32 |
33 |
34 |
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/components/MarsGlobeComponent.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.animation.core.rememberInfiniteTransition
19 | import androidx.compose.foundation.layout.Box
20 | import androidx.compose.foundation.layout.aspectRatio
21 | import androidx.compose.foundation.layout.fillMaxSize
22 | import androidx.compose.foundation.layout.fillMaxWidth
23 | import androidx.compose.runtime.Composable
24 | import androidx.compose.runtime.getValue
25 | import androidx.compose.ui.Alignment
26 | import androidx.compose.ui.Modifier
27 | import androidx.compose.ui.layout.ContentScale
28 | import androidx.compose.ui.platform.LocalContext
29 | import androidx.compose.ui.tooling.preview.Preview
30 | import com.example.androiddevchallenge.domain.ImageProvider
31 | import com.example.androiddevchallenge.ui.animations.rotationAnimation
32 | import com.google.accompanist.glide.GlideImage
33 |
34 | @Composable
35 | fun MarsGlobeComponent(modifier: Modifier = Modifier) {
36 | val context = LocalContext.current
37 | val infiniteTransition = rememberInfiniteTransition()
38 | val frame by infiniteTransition.rotationAnimation(targetValue = 96f)
39 | Box(
40 | modifier = modifier, contentAlignment = Alignment.Center
41 | ) {
42 | ImageProvider.getFrame(context, frame.toInt())?.let {
43 | GlideImage(
44 | data = it,
45 | contentDescription = "frame",
46 | modifier = Modifier
47 | .fillMaxWidth(0.7f)
48 | .aspectRatio(1f),
49 | contentScale = ContentScale.Crop
50 | )
51 | }
52 | AnimatedDashedCircle(modifier = Modifier.fillMaxSize(0.8f))
53 | }
54 | }
55 |
56 | @Preview
57 | @Composable
58 | fun PreviewMarsGlobeComponent() {
59 | MarsGlobeComponent()
60 | }
61 |
--------------------------------------------------------------------------------
/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 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
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 Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/screens/home/pages/ForecastPage.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.pages
17 |
18 | import androidx.compose.foundation.background
19 | import androidx.compose.foundation.layout.Arrangement
20 | import androidx.compose.foundation.layout.Column
21 | import androidx.compose.foundation.layout.Spacer
22 | import androidx.compose.foundation.layout.fillMaxSize
23 | import androidx.compose.foundation.layout.fillMaxWidth
24 | import androidx.compose.foundation.layout.height
25 | import androidx.compose.foundation.layout.padding
26 | import androidx.compose.foundation.lazy.LazyColumn
27 | import androidx.compose.material.MaterialTheme
28 | import androidx.compose.runtime.Composable
29 | import androidx.compose.ui.Alignment
30 | import androidx.compose.ui.Modifier
31 | import androidx.compose.ui.unit.dp
32 | import com.example.androiddevchallenge.domain.models.DayForecast
33 | import com.example.androiddevchallenge.ui.screens.home.components.DayForecastItem
34 | import com.example.androiddevchallenge.ui.screens.home.components.WarningMessageComponent
35 |
36 | @Composable
37 | fun ForecastPage(list: List) {
38 | Column(
39 | modifier = Modifier.fillMaxSize(),
40 | horizontalAlignment = Alignment.CenterHorizontally,
41 | verticalArrangement = Arrangement.Top
42 | ) {
43 | LazyColumn(
44 |
45 | modifier = Modifier.padding(horizontal = 16.dp),
46 | horizontalAlignment = Alignment.CenterHorizontally
47 | ) {
48 | item("globe") {
49 | WarningMessageComponent()
50 | }
51 | items(3) { index ->
52 | DayForecastItem(dayForecast = list[index])
53 | if (index != list.count().dec()) {
54 | Spacer(
55 | modifier = Modifier
56 | .fillMaxWidth()
57 | .height(0.2.dp)
58 | .background(MaterialTheme.colors.secondary.copy(alpha = 0.2f))
59 | )
60 | }
61 | }
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/screens/home/SolScreen.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.compose.foundation.layout.padding
19 | import androidx.compose.material.Scaffold
20 | import androidx.compose.runtime.Composable
21 | import androidx.compose.runtime.livedata.observeAsState
22 | import androidx.compose.ui.Modifier
23 | import androidx.compose.ui.tooling.preview.Preview
24 | import androidx.compose.ui.unit.dp
25 | import androidx.lifecycle.viewmodel.compose.viewModel
26 | import com.example.androiddevchallenge.ui.screens.home.components.SolMenuComponent
27 | import com.example.androiddevchallenge.ui.screens.home.components.SolPage
28 | import com.example.androiddevchallenge.ui.screens.home.pages.ForecastPage
29 | import com.example.androiddevchallenge.ui.screens.home.pages.LatestSolPage
30 | import com.example.androiddevchallenge.ui.screens.home.pages.PreviousSolPage
31 |
32 | @Composable
33 | fun SolScreen(viewModel: SolViewModel) {
34 | val state = viewModel.viewState.observeAsState()
35 | Scaffold(
36 | topBar = {
37 | SolMenuComponent(
38 | items = state.value?.sols ?: listOf(),
39 | modifier = Modifier
40 | .padding(vertical = 16.dp)
41 | .padding(horizontal = 8.dp),
42 | current = state.value?.selectedSol,
43 | onSolNumberSelected = {
44 | viewModel.onSolNumberSelected(it)
45 | }
46 | )
47 | }
48 | ) {
49 | state.value?.selectedSol?.let { sol ->
50 | when {
51 | sol is SolPage.Forecast -> {
52 | ForecastPage(viewModel.viewState.value?.forecast ?: listOf())
53 | }
54 | sol is SolPage.SolHeader && sol.sol == state.value?.latestSol -> {
55 | LatestSolPage(sol = sol.sol)
56 | }
57 | sol is SolPage.SolHeader -> {
58 | PreviousSolPage(sol = sol.sol)
59 | }
60 | }
61 | }
62 | }
63 | }
64 |
65 | @Preview
66 | @Composable
67 | fun PreviewSolScreen() {
68 | SolScreen(viewModel = viewModel())
69 | }
70 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/screens/home/components/SolCurrentComponent.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.components
17 |
18 | import androidx.compose.foundation.layout.Arrangement
19 | import androidx.compose.foundation.layout.Box
20 | import androidx.compose.foundation.layout.Column
21 | import androidx.compose.foundation.layout.aspectRatio
22 | import androidx.compose.foundation.layout.fillMaxWidth
23 | import androidx.compose.material.MaterialTheme
24 | import androidx.compose.material.Text
25 | import androidx.compose.runtime.Composable
26 | import androidx.compose.ui.Alignment
27 | import androidx.compose.ui.Modifier
28 | import androidx.compose.ui.tooling.preview.Preview
29 | import androidx.compose.ui.unit.sp
30 | import com.example.androiddevchallenge.domain.models.Sol
31 | import com.example.androiddevchallenge.domain.repository.SolRepository
32 | import com.example.androiddevchallenge.ui.components.AnimatedDashedCircle
33 | import com.example.androiddevchallenge.ui.theme.MyTheme
34 | import com.example.androiddevchallenge.ui.toDegreesString
35 |
36 | @Composable
37 | fun SolCurrentTemperatureComponent(sol: Sol, modifier: Modifier = Modifier) {
38 | Box(contentAlignment = Alignment.Center, modifier = modifier.fillMaxWidth()) {
39 | Column(
40 | modifier = Modifier
41 | .fillMaxWidth(0.8f)
42 | .aspectRatio(1f),
43 | horizontalAlignment = Alignment.CenterHorizontally,
44 | verticalArrangement = Arrangement.Center
45 | ) {
46 | Text(
47 | text = sol.temperature.currentCelsius.toDegreesString(),
48 | style = MaterialTheme.typography.h3.copy(fontSize = 86.sp)
49 | )
50 | Text(
51 | text = sol.atmosphereOpacity,
52 | style = MaterialTheme.typography.subtitle1.copy(fontSize = 24.sp),
53 | color = MaterialTheme.colors.secondary
54 | )
55 | }
56 | AnimatedDashedCircle(
57 | modifier = Modifier
58 | .fillMaxWidth(0.8f)
59 | .aspectRatio(1f)
60 | )
61 | }
62 | }
63 |
64 | @Preview()
65 | @Composable
66 | fun PreviewSolComponent() {
67 | MyTheme {
68 | SolCurrentTemperatureComponent(SolRepository.getLatestSol())
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/screens/home/pages/LatestSolPage.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.pages
17 |
18 | import androidx.compose.foundation.layout.Arrangement
19 | import androidx.compose.foundation.layout.Column
20 | import androidx.compose.foundation.layout.Row
21 | import androidx.compose.foundation.layout.Spacer
22 | import androidx.compose.foundation.layout.fillMaxSize
23 | import androidx.compose.foundation.layout.fillMaxWidth
24 | import androidx.compose.foundation.layout.height
25 | import androidx.compose.foundation.layout.padding
26 | import androidx.compose.material.MaterialTheme
27 | import androidx.compose.material.Text
28 | import androidx.compose.runtime.Composable
29 | import androidx.compose.ui.Alignment
30 | import androidx.compose.ui.Modifier
31 | import androidx.compose.ui.res.stringResource
32 | import androidx.compose.ui.unit.dp
33 | import com.example.androiddevchallenge.R
34 | import com.example.androiddevchallenge.domain.models.Sol
35 | import com.example.androiddevchallenge.ui.components.WeatherValueComponent
36 | import com.example.androiddevchallenge.ui.screens.home.components.SolCurrentTemperatureComponent
37 | import com.example.androiddevchallenge.ui.toKmHString
38 | import com.example.androiddevchallenge.ui.toPressureString
39 |
40 | @Composable
41 | fun LatestSolPage(sol: Sol) {
42 | Column(
43 | modifier = Modifier.fillMaxSize(),
44 | horizontalAlignment = Alignment.CenterHorizontally,
45 | verticalArrangement = Arrangement.Center
46 | ) {
47 | Text(text = stringResource(id = R.string.header), style = MaterialTheme.typography.h1)
48 | Spacer(modifier = Modifier.height(32.dp))
49 | SolCurrentTemperatureComponent(sol = sol)
50 | Row(
51 | modifier = Modifier
52 | .fillMaxWidth(0.8f)
53 | .padding(top = 32.dp),
54 | horizontalArrangement = Arrangement.SpaceBetween
55 | ) {
56 | WeatherValueComponent(
57 | value = sol.pressure.value.toPressureString(),
58 | label = stringResource(id = R.string.pressure)
59 | )
60 | WeatherValueComponent(
61 | value = sol.windSpeedKmh.toKmHString(),
62 | label = stringResource(id = R.string.wind_speed)
63 | )
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/screens/home/components/WarningMessageComponent.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.components
17 |
18 | import androidx.compose.foundation.layout.Arrangement
19 | import androidx.compose.foundation.layout.Box
20 | import androidx.compose.foundation.layout.Column
21 | import androidx.compose.foundation.layout.Spacer
22 | import androidx.compose.foundation.layout.aspectRatio
23 | import androidx.compose.foundation.layout.fillMaxSize
24 | import androidx.compose.foundation.layout.fillMaxWidth
25 | import androidx.compose.foundation.layout.height
26 | import androidx.compose.material.Icon
27 | import androidx.compose.material.MaterialTheme
28 | import androidx.compose.material.Text
29 | import androidx.compose.material.icons.Icons
30 | import androidx.compose.material.icons.filled.Warning
31 | import androidx.compose.runtime.Composable
32 | import androidx.compose.ui.Alignment
33 | import androidx.compose.ui.Modifier
34 | import androidx.compose.ui.graphics.Color
35 | import androidx.compose.ui.res.stringResource
36 | import androidx.compose.ui.text.style.TextAlign
37 | import androidx.compose.ui.unit.dp
38 | import com.example.androiddevchallenge.R
39 | import com.example.androiddevchallenge.ui.components.AnimatedDashedCircle
40 |
41 | @Composable
42 | fun WarningMessageComponent() {
43 | Box(
44 | modifier = Modifier
45 | .fillMaxWidth(0.6f)
46 | .aspectRatio(1f),
47 | contentAlignment = Alignment.Center
48 | ) {
49 | Column(
50 | modifier = Modifier.fillMaxSize(),
51 | horizontalAlignment = Alignment.CenterHorizontally,
52 | verticalArrangement = Arrangement.Center
53 | ) {
54 | Icon(
55 | imageVector = Icons.Default.Warning,
56 | contentDescription = "warning",
57 | tint = Color.Red
58 | )
59 |
60 | Spacer(modifier = Modifier.height(16.dp))
61 |
62 | Text(
63 | text = stringResource(id = R.string.warning),
64 | style = MaterialTheme.typography.h1,
65 | textAlign = TextAlign.Center
66 | )
67 | }
68 | AnimatedDashedCircle(
69 | modifier = Modifier
70 | .fillMaxWidth()
71 | .aspectRatio(1f)
72 | )
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/screens/home/components/DayForecastItem.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.components
17 |
18 | import androidx.compose.foundation.layout.Arrangement
19 | import androidx.compose.foundation.layout.Column
20 | import androidx.compose.foundation.layout.Row
21 | import androidx.compose.foundation.layout.fillMaxWidth
22 | import androidx.compose.foundation.layout.padding
23 | import androidx.compose.material.MaterialTheme
24 | import androidx.compose.material.Text
25 | import androidx.compose.runtime.Composable
26 | import androidx.compose.ui.Alignment
27 | import androidx.compose.ui.Modifier
28 | import androidx.compose.ui.text.style.TextAlign
29 | import androidx.compose.ui.unit.dp
30 | import androidx.compose.ui.unit.sp
31 | import com.example.androiddevchallenge.domain.extensions.format
32 | import com.example.androiddevchallenge.domain.models.DayForecast
33 | import com.example.androiddevchallenge.ui.toDegreesString
34 | import com.example.androiddevchallenge.ui.toSolString
35 |
36 | @Composable
37 | fun DayForecastItem(dayForecast: DayForecast, modifier: Modifier = Modifier) {
38 | Row(
39 | modifier = modifier
40 | .fillMaxWidth()
41 | .padding(vertical = 8.dp),
42 | horizontalArrangement = Arrangement.SpaceBetween,
43 | verticalAlignment = Alignment.CenterVertically
44 | ) {
45 | Column {
46 | Text(
47 | text = dayForecast.number.toSolString(),
48 | style = MaterialTheme.typography.h1.copy(fontSize = 16.sp)
49 | )
50 | Text(
51 | text = dayForecast.date.format(),
52 | style = MaterialTheme.typography.caption
53 | )
54 | }
55 |
56 | Row(horizontalArrangement = Arrangement.End) {
57 | Column {
58 | Text(
59 | modifier = Modifier.fillMaxWidth(),
60 | text = dayForecast.temperature.maxCelsius.toDegreesString(),
61 | style = MaterialTheme.typography.h3,
62 | textAlign = TextAlign.End
63 | )
64 | Text(
65 | modifier = Modifier.fillMaxWidth(),
66 | text = dayForecast.temperature.minCelsius.toDegreesString(),
67 | style = MaterialTheme.typography.h3.copy(fontSize = 22.sp),
68 | color = MaterialTheme.colors.secondary,
69 | textAlign = TextAlign.End
70 | )
71 | }
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | }
5 |
6 | android {
7 | compileSdkVersion 30
8 |
9 | lintOptions {
10 | abortOnError false
11 | }
12 |
13 | defaultConfig {
14 | applicationId "com.example.androiddevchallenge"
15 | minSdkVersion 23
16 | targetSdkVersion 30
17 | versionCode 1
18 | versionName "1.0"
19 |
20 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
21 | }
22 |
23 | signingConfigs {
24 | // We use a bundled debug keystore, to allow debug builds from CI to be upgradable
25 | debug {
26 | storeFile rootProject.file('debug.keystore')
27 | storePassword 'android'
28 | keyAlias 'androiddebugkey'
29 | keyPassword 'android'
30 | }
31 | }
32 |
33 | buildTypes {
34 | debug {
35 | signingConfig signingConfigs.debug
36 | }
37 | release {
38 | minifyEnabled false
39 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
40 | }
41 | }
42 |
43 | kotlinOptions {
44 | jvmTarget = "1.8"
45 | }
46 |
47 | buildFeatures {
48 | compose true
49 |
50 | // Disable unused AGP features
51 | buildConfig false
52 | aidl false
53 | renderScript false
54 | resValues false
55 | shaders false
56 | }
57 |
58 | composeOptions {
59 | kotlinCompilerExtensionVersion compose_version
60 | }
61 |
62 | packagingOptions {
63 | // Multiple dependency bring these files in. Exclude them to enable
64 | // our test APK to build (has no effect on our AARs)
65 | excludes += "/META-INF/AL2.0"
66 | excludes += "/META-INF/LGPL2.1"
67 | }
68 | }
69 |
70 | dependencies {
71 | implementation 'androidx.core:core-ktx:1.3.2'
72 | implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
73 | implementation 'com.google.android.material:material:1.3.0'
74 | implementation "androidx.activity:activity-compose:1.3.0-alpha04"
75 | implementation "androidx.compose.ui:ui:$compose_version"
76 | implementation "androidx.compose.material:material:$compose_version"
77 | implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0'
78 | implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.0"
79 | implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0"
80 | implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0'
81 | implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'
82 | implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
83 | implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha03"
84 | implementation "androidx.compose.material:material-icons-extended:$compose_version"
85 | implementation "androidx.compose.ui:ui-tooling:$compose_version"
86 | implementation "com.google.accompanist:accompanist-glide:0.6.2"
87 | implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha05"
88 |
89 |
90 | testImplementation 'junit:junit:4.13.2'
91 |
92 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
93 | androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
94 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/theme/Type.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.Typography
19 | import androidx.compose.ui.text.font.Font
20 | import androidx.compose.ui.text.font.FontFamily
21 | import androidx.compose.ui.text.font.FontStyle
22 | import androidx.compose.ui.text.font.FontWeight
23 | import androidx.compose.ui.unit.sp
24 | import com.example.androiddevchallenge.R
25 |
26 | val rajdFamily = FontFamily(
27 | listOf(
28 | Font(R.font.rajd_regular, FontWeight.Normal, FontStyle.Normal),
29 | Font(R.font.rajd_light, FontWeight.Light, FontStyle.Normal),
30 | Font(R.font.rajd_bold, FontWeight.Bold, FontStyle.Normal),
31 | )
32 | )
33 |
34 | val orbitronFamily = FontFamily(
35 | listOf(
36 | Font(R.font.orbitron_regular, FontWeight.Normal, FontStyle.Normal),
37 | Font(R.font.orbitron_semibold, FontWeight.Bold, FontStyle.Normal),
38 | Font(R.font.orbitron_medium, FontWeight.Medium, FontStyle.Normal),
39 | )
40 | )
41 |
42 | private val defaultTypography = Typography()
43 | val appTypography = Typography(
44 | h1 = defaultTypography.h1.copy(
45 | fontFamily = orbitronFamily,
46 | fontSize = 20.sp,
47 | fontWeight = FontWeight.Medium,
48 | letterSpacing = 1.15.sp
49 | ),
50 | h2 = defaultTypography.h2.copy(
51 | fontFamily = orbitronFamily,
52 | fontSize = 13.sp,
53 | fontWeight = FontWeight.Normal,
54 | letterSpacing = 1.15.sp
55 | ),
56 | h3 = defaultTypography.h3.copy(
57 | fontFamily = rajdFamily,
58 | fontSize = 28.sp,
59 | fontWeight = FontWeight.Thin,
60 | letterSpacing = 1.15.sp
61 | ),
62 | h4 = defaultTypography.h4,
63 | h5 = defaultTypography.h5,
64 | h6 = defaultTypography.h6,
65 | subtitle1 = defaultTypography.subtitle1.copy(
66 | fontFamily = orbitronFamily,
67 | fontSize = 12.sp,
68 | fontWeight = FontWeight.Normal,
69 | letterSpacing = 1.15.sp
70 | ),
71 | subtitle2 = defaultTypography.subtitle2,
72 | body1 = defaultTypography.body1.copy(
73 | fontFamily = rajdFamily,
74 | fontSize = 14.sp,
75 | fontWeight = FontWeight.Normal
76 | ),
77 | body2 = defaultTypography.body2,
78 | button = defaultTypography.button.copy(
79 | fontFamily = rajdFamily,
80 | fontSize = 14.sp,
81 | fontWeight = FontWeight.Bold,
82 | letterSpacing = 1.15.sp
83 | ),
84 | caption = defaultTypography.caption.copy(
85 | fontFamily = rajdFamily,
86 | fontSize = 12.sp,
87 | fontWeight = FontWeight.Normal,
88 | letterSpacing = 1.15.sp
89 | ),
90 | overline = defaultTypography.overline
91 | )
92 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/domain/repository/SolRepository.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.repository
17 |
18 | import com.example.androiddevchallenge.domain.extensions.toDate
19 | import com.example.androiddevchallenge.domain.models.DayForecast
20 | import com.example.androiddevchallenge.domain.models.Pressure
21 | import com.example.androiddevchallenge.domain.models.Sol
22 | import com.example.androiddevchallenge.domain.models.SolTemperature
23 | import java.util.Date
24 | import kotlin.random.Random
25 |
26 | object SolRepository {
27 |
28 | private const val DAY_MS = 86_400_000
29 |
30 | fun getLatestSol(): Sol {
31 | return SOL_LATEST
32 | }
33 |
34 | fun getForecast(): List {
35 | return List(7) {
36 | DayForecast(
37 | temperature = SOLS.random().temperature,
38 | windSpeed = Random.nextInt(25, 56),
39 | number = 3061 + it.inc(),
40 | date = Date().apply { time += it.inc() * DAY_MS }
41 | )
42 | }
43 | }
44 |
45 | fun getSolByNumber(number: Int): Sol? {
46 | return SOLS.find { it.number == number }
47 | }
48 |
49 | fun getAvailableSols(): List = SOLS.sortedBy { it.number }
50 |
51 | private val SOL_LATEST = Sol(
52 | number = 3061,
53 | date = Date(),
54 | season = "Month 1",
55 | temperature = SolTemperature(-74, -13, -54),
56 | pressure = Pressure(837, "Higher"),
57 | atmosphereOpacity = "Sunny",
58 | sunriseTime = "6:31",
59 | sunsetTime = "18:26",
60 | windSpeedKmh = 25
61 | )
62 |
63 | private val SOLS = listOf(
64 | SOL_LATEST,
65 | Sol(
66 | number = 3060,
67 | date = "2021-03-16".toDate(),
68 | season = "Month 1",
69 | temperature = SolTemperature(-73, -14, -54),
70 | pressure = Pressure(839, "Higher"),
71 | atmosphereOpacity = "Sunny",
72 | sunriseTime = "6:31",
73 | sunsetTime = "18:26"
74 | ),
75 | Sol(
76 | number = 3059,
77 | date = "2021-03-15".toDate(),
78 | season = "Month 1",
79 | temperature = SolTemperature(-77, -16),
80 | pressure = Pressure(836, "Higher"),
81 | atmosphereOpacity = "Sunny",
82 | sunriseTime = "6:32",
83 | sunsetTime = "18:27"
84 | ),
85 | Sol(
86 | number = 3058,
87 | date = "2021-03-14".toDate(),
88 | season = "Month 1",
89 | temperature = SolTemperature(-73, -15),
90 | pressure = Pressure(837, "Higher"),
91 | atmosphereOpacity = "Sunny",
92 | sunriseTime = "6:32",
93 | sunsetTime = "18:27"
94 | ),
95 | Sol(
96 | number = 3057,
97 | date = "2021-03-13".toDate(),
98 | season = "Month 1",
99 | temperature = SolTemperature(-73, -13),
100 | pressure = Pressure(837, "Higher"),
101 | atmosphereOpacity = "Sunny",
102 | sunriseTime = "6:31",
103 | sunsetTime = "18:26"
104 | )
105 | )
106 | }
107 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/androiddevchallenge/ui/screens/home/components/SolMenuComponent.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.components
17 |
18 | import androidx.compose.foundation.clickable
19 | import androidx.compose.foundation.layout.fillMaxWidth
20 | import androidx.compose.material.MaterialTheme
21 | import androidx.compose.material.Text
22 | import androidx.compose.runtime.Composable
23 | import androidx.compose.ui.Modifier
24 | import androidx.compose.ui.tooling.preview.Preview
25 | import androidx.constraintlayout.compose.ConstraintLayout
26 | import com.example.androiddevchallenge.domain.extensions.format
27 | import com.example.androiddevchallenge.domain.extensions.nextAfter
28 | import com.example.androiddevchallenge.domain.extensions.previousBefore
29 | import com.example.androiddevchallenge.domain.models.Sol
30 | import com.example.androiddevchallenge.domain.repository.SolRepository
31 | import com.example.androiddevchallenge.ui.theme.MyTheme
32 | import com.example.androiddevchallenge.ui.toSolString
33 |
34 | sealed class SolPage(val id: Int) {
35 | object Forecast : SolPage(-1)
36 | data class SolHeader(val sol: Sol) : SolPage(sol.number)
37 | }
38 |
39 | @Composable
40 | fun SolMenuComponent(
41 | items: List,
42 | current: SolPage?,
43 | modifier: Modifier = Modifier,
44 | onSolNumberSelected: (Int) -> Unit = {}
45 | ) {
46 |
47 | if (items.isNotEmpty() && current != null) {
48 | val next = items.nextAfter(current)
49 | val previous = items.previousBefore(current)
50 | ConstraintLayout(
51 | modifier = modifier.fillMaxWidth()
52 | ) {
53 |
54 | val (firstRef, currentRef, nextRef, dateRef) = createRefs()
55 |
56 | val firstConstraint = Modifier.constrainAs(firstRef) {
57 | bottom.linkTo(parent.bottom)
58 | start.linkTo(parent.start)
59 | top.linkTo(parent.top)
60 | }
61 |
62 | val currentConstraint = Modifier.constrainAs(currentRef) {
63 | bottom.linkTo(parent.bottom)
64 | start.linkTo(parent.start)
65 | end.linkTo(parent.end)
66 | }
67 |
68 | val dateConstrain = Modifier.constrainAs(dateRef) {
69 | top.linkTo(currentRef.bottom)
70 | start.linkTo(currentRef.start)
71 | end.linkTo(currentRef.end)
72 | }
73 |
74 | val nextConstraint = Modifier.constrainAs(nextRef) {
75 | bottom.linkTo(parent.bottom)
76 | end.linkTo(parent.end)
77 | top.linkTo(parent.top)
78 | }
79 |
80 | previous?.let {
81 | SolMenuModel(
82 | model = it,
83 | active = false,
84 | modifier = firstConstraint.clickable {
85 | onSolNumberSelected.invoke(it.id)
86 | }
87 | )
88 | }
89 |
90 | SolMenuModel(
91 | model = items.first { it == current },
92 | active = true,
93 | modifier = currentConstraint
94 | )
95 |
96 | if (current is SolPage.SolHeader) {
97 | Text(
98 | text = current.sol.date.format(),
99 | modifier = dateConstrain,
100 | color = MaterialTheme.colors.secondary,
101 | style = MaterialTheme.typography.subtitle1
102 | )
103 | }
104 |
105 | next?.let {
106 | SolMenuModel(
107 | model = it,
108 | active = false,
109 | modifier = nextConstraint.clickable {
110 | onSolNumberSelected.invoke(it.id)
111 | }
112 | )
113 | }
114 | }
115 | }
116 | }
117 |
118 | @Composable
119 | fun SolMenuModel(model: SolPage, active: Boolean, modifier: Modifier = Modifier) {
120 | val text = when (model) {
121 | is SolPage.Forecast -> "Forecast"
122 | is SolPage.SolHeader -> model.sol.number.toSolString()
123 | }
124 | Text(
125 | text = text,
126 | color = if (active) MaterialTheme.colors.primary else MaterialTheme.colors.secondary,
127 | style = if (active) MaterialTheme.typography.h1 else MaterialTheme.typography.h2,
128 | modifier = modifier
129 | )
130 | }
131 |
132 | @Preview
133 | @Composable
134 | fun PreviewSolMenuComponent() {
135 | val items = SolRepository.getAvailableSols()
136 | MyTheme {
137 | SolMenuComponent(items = items.map { SolPage.SolHeader(it) }, current = SolPage.SolHeader(items.last()))
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
17 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
175 |
180 |
181 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
--------------------------------------------------------------------------------