├── .idea
├── .name
├── .gitignore
├── codeStyles
│ ├── codeStyleConfig.xml
│ └── Project.xml
├── vcs.xml
├── compiler.xml
├── kotlinc.xml
├── misc.xml
└── gradle.xml
├── app
├── .gitignore
├── src
│ └── main
│ │ ├── ic_launcher-playstore.png
│ │ ├── res
│ │ ├── drawable-nodpi
│ │ │ ├── kids.jpg
│ │ │ ├── work.jpg
│ │ │ ├── photo.jpg
│ │ │ ├── travel.jpg
│ │ │ ├── friends.jpg
│ │ │ └── workout.jpg
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── values
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── dimensions.xml
│ │ │ ├── strings.xml
│ │ │ ├── colors.xml
│ │ │ └── themes.xml
│ │ ├── layout
│ │ │ ├── filament_host.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── list_item_category.xml
│ │ │ ├── fragment_wakeup_calls.xml
│ │ │ └── fragment_categories.xml
│ │ ├── anim
│ │ │ ├── slide_in_right.xml
│ │ │ ├── slide_in_left.xml
│ │ │ ├── slide_out_left.xml
│ │ │ └── slide_out_right.xml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── drawable-v24
│ │ │ ├── outline_add_24.xml
│ │ │ ├── add_alarm_24.xml
│ │ │ ├── outline_alarm_on_24.xml
│ │ │ └── outline_alarm_off_24.xml
│ │ ├── drawable
│ │ │ ├── sharp_table_rows_24.xml
│ │ │ ├── outline_expand_more_24.xml
│ │ │ ├── sharp_grid_view_24.xml
│ │ │ └── ic_launcher_foreground.xml
│ │ └── navigation
│ │ │ └── nav_graph.xml
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── wakemeup
│ │ │ ├── ui
│ │ │ └── theme
│ │ │ │ ├── Colors.kt
│ │ │ │ ├── Shape.kt
│ │ │ │ ├── Theme.kt
│ │ │ │ └── Type.kt
│ │ │ ├── math
│ │ │ ├── Ray.kt
│ │ │ ├── Scalar.kt
│ │ │ ├── Matrix.kt
│ │ │ └── Vector.kt
│ │ │ ├── Text.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── WakeupCalls.kt
│ │ │ ├── Filament.kt
│ │ │ ├── CategoriesFragment.kt
│ │ │ ├── graphics
│ │ │ ├── Viewer.kt
│ │ │ └── Atmosphere.kt
│ │ │ └── WakeupCallsFragment.kt
│ │ └── materials
│ │ └── sky.mat
├── proguard-rules.pro
└── build.gradle
├── assets
├── keynote_demo_1.png
└── keynote_demo_2.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── settings.gradle
├── filament
└── bin
│ └── README.md
├── .gitignore
├── LICENSE
├── gradle.properties
├── README.md
├── gradlew.bat
└── gradlew
/.idea/.name:
--------------------------------------------------------------------------------
1 | Wake Me Up
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/assets/keynote_demo_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/assets/keynote_demo_1.png
--------------------------------------------------------------------------------
/assets/keynote_demo_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/assets/keynote_demo_2.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/kids.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/drawable-nodpi/kids.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/work.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/drawable-nodpi/work.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/photo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/drawable-nodpi/photo.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/travel.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/drawable-nodpi/travel.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/friends.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/drawable-nodpi/friends.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/workout.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/drawable-nodpi/workout.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romainguy/sample-wake-me-up/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FF3E4757
4 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimensions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 160dp
5 |
6 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | dependencyResolutionManagement {
2 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 | }
8 | rootProject.name = "Wake Me Up"
9 | include ':app'
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/filament_host.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/filament/bin/README.md:
--------------------------------------------------------------------------------
1 | To build this demo, you must first download a copy of
2 | [Filament](https://github.com/google/filament/releases) for your operating system.
3 |
4 | After downloading the release, extract it and copy the binary called `matc` (Linux and macOS) or
5 | `matc.exe` (Windows) into folder `./filament/bin`. This binary is necessary to compile the shaders
6 | used by this demo.
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | /filament/bin/matc
14 | /filament/bin/matc.exe
15 | /app/src/main/assets/materials/*.filamat
16 | .externalNativeBuild
17 | .cxx
18 | local.properties
19 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/outline_add_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/sharp_table_rows_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/outline_expand_more_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Alarms
3 | Wake Me Up
4 | Add alarm
5 | Add group
6 | Grid view
7 | List view
8 | Most recent
9 | Decoration
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FF000000
4 | #FFFFFFFF
5 |
6 | #FF3E4757
7 | #FF3E4757
8 | #FF1A1B1E
9 | #FFC4C4C4
10 | #FF9DECFC
11 | #FF9DECFC
12 | #FF000000
13 | #FF9DECFC
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/add_alarm_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/outline_alarm_on_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/sharp_grid_view_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
13 |
16 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
11 |
14 |
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
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/outline_alarm_off_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
24 |
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Romain Guy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/app/src/main/res/navigation/nav_graph.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
18 |
19 |
20 |
24 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/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
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/wakemeup/ui/theme/Colors.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2021 Romain Guy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.example.wakemeup.ui.theme
26 |
27 | import androidx.compose.ui.graphics.Color
28 |
29 | val NightBlue = Color(0xFF14598F)
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/wakemeup/math/Ray.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2021 Romain Guy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.example.wakemeup.math
26 |
27 | data class Ray(var origin: Float3 = Float3(), var direction: Float3)
28 |
29 | fun pointAt(r: Ray, t: Float) = r.origin + r.direction * t
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Wake Me Up
2 |
3 | Wake Me Up is a sample app showcased in the
4 | [Google I/O 2021 Developer Keynote](https://youtu.be/D_mVOAXcrtc?t=817) that demonstrates
5 | interoperability between [Jetpack Compose](https://developer.android.com/jetpack/compose) and the
6 | Android UI Toolkit, including fragments, `SurfaceView`, and more.
7 |
8 | ## How to build
9 |
10 | To build this demo, you must first download a copy of
11 | [Filament](https://github.com/google/filament/releases) for your operating system. Make sure to
12 | select a release that matches the version listed in [build.gradle](./build.gradle). The current
13 | release to use is [1.12.8](https://github.com/google/filament/releases/tag/v1.12.8).
14 |
15 | After downloading the release, extract it and copy the binary called `matc` (Linux and macOS) or
16 | `matc.exe` (Windows) into this project's `./filament/bin`. This binary is necessary to compile the
17 | shaders used by this demo.
18 |
19 | # Screenshots
20 |
21 |
22 |
23 |
24 |
25 |
26 | ## License
27 |
28 | All photos licensed under [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/)
29 | and available on [Flickr](https://www.flickr.com/photos/romainguy/).
30 |
31 | Licensed under MIT License. Please see [LICENSE](./LICENSE) for more information.
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_category.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
18 |
19 |
25 |
26 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/wakemeup/ui/theme/Shape.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2021 Romain Guy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.example.wakemeup.ui.theme
26 |
27 | import androidx.compose.foundation.shape.RoundedCornerShape
28 | import androidx.compose.material.Shapes
29 | import androidx.compose.ui.unit.dp
30 |
31 | val Shapes = Shapes(
32 | small = RoundedCornerShape(4.dp),
33 | medium = RoundedCornerShape(4.dp),
34 | large = RoundedCornerShape(0.dp)
35 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/example/wakemeup/Text.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2021 Romain Guy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.example.wakemeup
26 |
27 | import com.example.wakemeup.math.fract
28 | import java.time.LocalDate
29 | import java.time.LocalDateTime
30 | import java.time.LocalTime
31 | import java.time.format.DateTimeFormatter
32 | import java.time.format.FormatStyle
33 | import kotlin.math.floor
34 |
35 | fun formattedTime(time: Float): String {
36 | val dateTime = LocalDateTime.of(
37 | LocalDate.now(),
38 | LocalTime.of(floor(time).toInt(), (fract(time) * 60.0f).toInt())
39 | )
40 | val formatter = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT)
41 | return dateTime.format(formatter)
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/wakemeup/MainActivity.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2021 Romain Guy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.example.wakemeup
26 |
27 | import android.os.Bundle
28 | import androidx.appcompat.app.AppCompatActivity
29 | import androidx.core.view.WindowCompat
30 | import com.example.wakemeup.databinding.ActivityMainBinding
31 | import com.google.android.filament.Filament
32 |
33 | class MainActivity : AppCompatActivity() {
34 | companion object {
35 | init { Filament.init() }
36 | }
37 |
38 | override fun onCreate(savedInstanceState: Bundle?) {
39 | super.onCreate(savedInstanceState)
40 |
41 | WindowCompat.setDecorFitsSystemWindows(window, false)
42 |
43 | val binding = ActivityMainBinding.inflate(layoutInflater)
44 | setContentView(binding.root)
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/wakemeup/ui/theme/Theme.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2021 Romain Guy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.example.wakemeup.ui.theme
26 |
27 | import androidx.compose.material.MaterialTheme
28 | import androidx.compose.material.lightColors
29 | import androidx.compose.runtime.Composable
30 | import androidx.compose.ui.graphics.Color
31 |
32 | private val LightColorPalette = lightColors(
33 | primary = Color(0xFF3E4757),
34 | primaryVariant = Color(0xFF1A1B1E),
35 | secondary = Color(0xFF9DECFC),
36 | secondaryVariant = Color(0xFFC4C4C4),
37 |
38 | background = Color(0xFF3E4757),
39 | onBackground = Color(0xFF9DECFC),
40 | surface = Color(0xFFFFFFFF),
41 | onSurface = Color(0xFF000000),
42 | onPrimary = Color(0xFF9DECFC),
43 | onSecondary = Color(0xFF000000),
44 | )
45 |
46 | @Composable
47 | fun WakeMeUpTheme(content: @Composable() () -> Unit) {
48 | MaterialTheme(
49 | colors = LightColorPalette,
50 | typography = Typography,
51 | shapes = Shapes,
52 | content = content
53 | )
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/wakemeup/math/Scalar.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2021 Romain Guy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | @file:Suppress("NOTHING_TO_INLINE")
26 |
27 | package com.example.wakemeup.math
28 |
29 | import kotlin.math.floor
30 |
31 | const val Pi = 3.1415926536f
32 | const val HalfPi = Pi * 0.5f
33 | const val TwoPi = Pi * 2.0f
34 | const val FourPi = Pi * 4.0f
35 | const val InvPi = 1.0f / Pi
36 | const val InvTwoPi = InvPi * 0.5f
37 | const val InvFourPi = InvPi * 0.25f
38 |
39 | inline fun clamp(x: Float, min: Float, max: Float)= if (x < min) min else (if (x > max) max else x)
40 |
41 | inline fun saturate(x: Float) = clamp(x, 0.0f, 1.0f)
42 |
43 | inline fun mix(a: Float, b: Float, x: Float) = a * (1.0f - x) + b * x
44 |
45 | inline fun degrees(v: Float) = v * (180.0f * InvPi)
46 |
47 | inline fun radians(v: Float) = v * (Pi / 180.0f)
48 |
49 | inline fun fract(v: Float) = v - floor(v)
50 |
51 | inline fun sqr(v: Float) = v * v
52 |
53 | inline fun pow(x: Float, y: Float) = StrictMath.pow(x.toDouble(), y.toDouble()).toFloat()
54 |
55 | inline fun smoothstep(e0: Float, e1: Float, x: Float): Float {
56 | val t = clamp((x - e0) / (e1 - e0), 0.0f, 1.0f)
57 | return t * t * (3.0f - 2.0f * t)
58 | }
59 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | }
5 |
6 | apply plugin: FilamentToolsPlugin
7 |
8 | android {
9 | compileSdk 33
10 | buildToolsVersion "33.0.0"
11 |
12 | defaultConfig {
13 | applicationId "com.example.wakemeup"
14 | minSdk 28
15 | targetSdk 33
16 | versionCode 1
17 | versionName "1.0"
18 |
19 | vectorDrawables {
20 | useSupportLibrary true
21 | }
22 | }
23 |
24 | namespace 'com.example.wakemeup'
25 |
26 | buildTypes {
27 | release {
28 | minifyEnabled true
29 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
30 | }
31 | }
32 |
33 | compileOptions {
34 | sourceCompatibility JavaVersion.VERSION_1_8
35 | targetCompatibility JavaVersion.VERSION_1_8
36 | }
37 |
38 | kotlinOptions {
39 | jvmTarget = '1.8'
40 | }
41 |
42 | buildFeatures {
43 | compose true
44 | viewBinding true
45 | }
46 |
47 | composeOptions {
48 | kotlinCompilerExtensionVersion compose_version
49 | }
50 |
51 | aaptOptions {
52 | noCompress("filamat", "ktx", "glb")
53 | }
54 | }
55 |
56 | tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { compile ->
57 | kotlinOptions {
58 | // Allow use of @OptIn
59 | freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
60 | }
61 | }
62 |
63 | dependencies {
64 | implementation "androidx.core:core-ktx:1.9.0"
65 | implementation 'androidx.appcompat:appcompat:1.5.1'
66 | implementation "androidx.compose.ui:ui:$compose_version"
67 | implementation "androidx.compose.material:material:$compose_version"
68 | implementation "androidx.compose.ui:ui-tooling:$compose_version"
69 | implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1"
70 | implementation "androidx.navigation:navigation-fragment-ktx:2.5.3"
71 | implementation "androidx.navigation:navigation-ui-ktx:2.5.3"
72 | implementation "com.google.android.material:material:1.7.0"
73 |
74 | implementation 'org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:0.3.5'
75 |
76 | implementation "net.e175.klaus:solarpositioning:0.0.9"
77 |
78 | implementation "com.google.android.filament:filament-android:$filament_version"
79 | implementation "com.google.android.filament:filament-utils-android:$filament_version"
80 | }
81 |
82 | filamentTools {
83 | materialInputDir.value(project.layout.projectDirectory.dir("src/main/materials"))
84 | materialOutputDir.value(project.layout.projectDirectory.dir("src/main/assets/materials"))
85 | }
86 |
87 | clean.doFirst {
88 | delete "src/main/assets"
89 | }
90 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_wakeup_calls.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
27 |
28 |
36 |
37 |
38 |
39 |
40 |
41 |
47 |
48 |
53 |
54 |
55 |
56 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/wakemeup/ui/theme/Type.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2021 Romain Guy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.example.wakemeup.ui.theme
26 |
27 | import androidx.compose.material.Typography
28 | import androidx.compose.ui.text.TextStyle
29 | import androidx.compose.ui.text.font.Font
30 | import androidx.compose.ui.text.font.FontFamily
31 | import androidx.compose.ui.text.font.FontWeight
32 | import androidx.compose.ui.unit.em
33 | import androidx.compose.ui.unit.sp
34 | import com.example.wakemeup.R
35 |
36 | val Typography= Typography(
37 | h1 = TextStyle(
38 | fontWeight = FontWeight.W100,
39 | fontSize = 76.sp,
40 | ),
41 | h2 = TextStyle(
42 | fontWeight = FontWeight.SemiBold,
43 | fontSize = 44.sp,
44 | letterSpacing = 1.5.sp
45 | ),
46 | h3 = TextStyle(
47 | fontWeight = FontWeight.W400,
48 | fontSize = 18.sp
49 | ),
50 | h4 = TextStyle(
51 | fontWeight = FontWeight.W700,
52 | fontSize = 18.sp
53 | ),
54 | h5 = TextStyle(
55 | fontWeight = FontWeight.W400,
56 | fontSize = 18.sp
57 | ),
58 | h6 = TextStyle(
59 | fontWeight = FontWeight.W400,
60 | fontSize = 15.sp
61 | ),
62 | subtitle1 = TextStyle(
63 | fontWeight = FontWeight.Light,
64 | fontSize = 14.sp,
65 | lineHeight = 20.sp,
66 | letterSpacing = 3.sp
67 | ),
68 | subtitle2 = TextStyle(
69 | fontWeight = FontWeight.Normal,
70 | fontSize = 14.sp,
71 | letterSpacing = 0.1.em
72 | ),
73 | body1 = TextStyle(
74 | fontWeight = FontWeight.Normal,
75 | fontSize = 16.sp,
76 | letterSpacing = 0.1.em
77 | ),
78 | body2 = TextStyle(
79 | fontWeight = FontWeight.Normal,
80 | fontSize = 14.sp,
81 | lineHeight = 20.sp,
82 | letterSpacing = 0.1.em
83 | ),
84 | button = TextStyle(
85 | fontWeight = FontWeight.Bold,
86 | fontSize = 14.sp,
87 | lineHeight = 16.sp,
88 | letterSpacing = 0.2.em
89 | ),
90 | caption = TextStyle(
91 | fontWeight = FontWeight.W500,
92 | fontSize = 12.sp
93 | ),
94 | overline = TextStyle(
95 | fontWeight = FontWeight.W500,
96 | fontSize = 10.sp
97 | )
98 | )
99 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
26 |
27 |
28 |
32 |
33 |
37 |
38 |
42 |
43 |
49 |
50 |
56 |
57 |
63 |
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/wakemeup/WakeupCalls.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2021 Romain Guy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.example.wakemeup
26 |
27 | import androidx.compose.runtime.getValue
28 | import androidx.compose.runtime.mutableStateOf
29 | import androidx.compose.runtime.setValue
30 | import com.example.wakemeup.graphics.computeSunriseTime
31 | import com.example.wakemeup.graphics.computeSunsetTime
32 | import java.util.*
33 |
34 | class WakeupCall(
35 | val id: Long,
36 | enabled: Boolean,
37 | time: Float,
38 | location: Pair,
39 | elevation: Double,
40 | timeZone: TimeZone,
41 | name: String
42 | ) {
43 | var enabled by mutableStateOf(enabled)
44 | var time by mutableStateOf(time)
45 | var location by mutableStateOf(location)
46 | var elevation by mutableStateOf(elevation)
47 | var timeZone by mutableStateOf(timeZone)
48 | var name by mutableStateOf(name)
49 | }
50 |
51 | data class Category(val id: Long, val name: String, val photo: Int)
52 |
53 | val Categories = listOf(
54 | Category(0, "Work", R.drawable.work),
55 | Category(1, "Friends", R.drawable.friends),
56 | Category(2, "Travel", R.drawable.travel),
57 | Category(3, "Kids", R.drawable.kids),
58 | Category(4, "Photo", R.drawable.photo),
59 | Category(5, "Workout", R.drawable.workout)
60 | )
61 |
62 | val WakeupCalls = listOf(
63 | WakeupCall(
64 | 0,
65 | true,
66 | 10.50f,
67 | 37.45 to -122.18,
68 | 10.0,
69 | TimeZone.getTimeZone("America/Los_Angeles"),
70 | "Mountain View"
71 | ),
72 | WakeupCall(
73 | 2,
74 | true,
75 | computeSunsetTime(48.85 to 2.35, TimeZone.getTimeZone("Europe/Paris")) - 0.3f,
76 | 48.85 to 2.35,
77 | 30.0,
78 | TimeZone.getTimeZone("Europe/Paris"),
79 | "Paris"
80 | ),
81 | WakeupCall(
82 | 3,
83 | false,
84 | computeSunriseTime(48.85 to 2.35, TimeZone.getTimeZone("Europe/Paris")) + 1.5f,
85 | 48.85 to 2.35,
86 | 30.0,
87 | TimeZone.getTimeZone("Europe/Paris"),
88 | "Paris"
89 | ),
90 | WakeupCall(
91 | 4,
92 | true,
93 | 5.84f,
94 | 64.15 to -21.95,
95 | 60.0,
96 | TimeZone.getTimeZone("UTC+0"),
97 | "Reykjavík"
98 | ),
99 | WakeupCall(
100 | 5,
101 | false,
102 | 15.75f,
103 | 37.45 to -122.18,
104 | 10.0,
105 | TimeZone.getTimeZone("America/Los_Angeles"),
106 | "Mountain View"
107 | ),
108 | )
109 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_categories.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
26 |
27 |
45 |
46 |
61 |
62 |
73 |
74 |
84 |
85 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |