├── app
├── .gitignore
├── src
│ └── main
│ │ ├── res
│ │ ├── font
│ │ │ ├── lato_bold.ttf
│ │ │ ├── lato_regular.ttf
│ │ │ ├── kulim_park_light.ttf
│ │ │ └── kulim_park_regular.ttf
│ │ ├── drawable
│ │ │ ├── ab4_tabata.jpg
│ │ │ ├── ab5_hiit.jpg
│ │ │ ├── ab1_inversions.jpg
│ │ │ ├── ab2_quick_yoga.jpg
│ │ │ ├── ab3_stretching.jpg
│ │ │ ├── fc5_overwhelmed.jpg
│ │ │ ├── fc1_short_mantras.jpg
│ │ │ ├── fc4_self_massage.jpg
│ │ │ ├── ab6_pre_natal_yoga.jpg
│ │ │ ├── fc2_nature_meditations.jpg
│ │ │ ├── fc3_stress_and_anxiety.jpg
│ │ │ ├── fc6_nightly_wind_down.jpg
│ │ │ └── ic_launcher_background.xml
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ ├── values
│ │ │ ├── colors.xml
│ │ │ ├── themes.xml
│ │ │ └── strings.xml
│ │ ├── values-night
│ │ │ └── colors.xml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ └── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ ├── java
│ │ └── com
│ │ │ └── codelab
│ │ │ └── basiclayouts
│ │ │ ├── ui
│ │ │ └── theme
│ │ │ │ ├── Shape.kt
│ │ │ │ ├── Color.kt
│ │ │ │ ├── Type.kt
│ │ │ │ └── Theme.kt
│ │ │ └── MainActivity.kt
│ │ └── AndroidManifest.xml
├── proguard-rules.pro
└── build.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── spotless
└── copyright.kt
├── settings.gradle
├── gradle.properties
├── CONTRIBUTING.md
├── README.md
├── gradlew.bat
├── ASSETS_LICENSE
├── gradlew
└── LICENSE
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/src/main/res/font/lato_bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/font/lato_bold.ttf
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ab4_tabata.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/ab4_tabata.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ab5_hiit.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/ab5_hiit.jpg
--------------------------------------------------------------------------------
/app/src/main/res/font/lato_regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/font/lato_regular.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/kulim_park_light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/font/kulim_park_light.ttf
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ab1_inversions.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/ab1_inversions.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ab2_quick_yoga.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/ab2_quick_yoga.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ab3_stretching.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/ab3_stretching.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fc5_overwhelmed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/fc5_overwhelmed.jpg
--------------------------------------------------------------------------------
/app/src/main/res/font/kulim_park_regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/font/kulim_park_regular.ttf
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fc1_short_mantras.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/fc1_short_mantras.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fc4_self_massage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/fc4_self_massage.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ab6_pre_natal_yoga.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/ab6_pre_natal_yoga.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fc2_nature_meditations.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/fc2_nature_meditations.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fc3_stress_and_anxiety.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/fc3_stress_and_anxiety.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fc6_nightly_wind_down.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/drawable/fc6_nightly_wind_down.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rafigeovazi/BasicLayoutinCompose/main/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/*
5 | .DS_Store
6 | /build
7 | /captures
8 | .externalNativeBuild
9 | .cxx
10 | local.properties
11 | /buildSrc/.gradle/*
12 | .kotlin/
13 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/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 |
17 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 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 |
17 | rootProject.name = "MySoothe"
18 | include ':app'
19 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
14 |
15 | #F5F0EE
16 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
14 |
15 | #32302F
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/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/codelab/basiclayouts/ui/theme/Shape.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 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 |
17 | package com.codelab.basiclayouts.ui.theme
18 |
19 | import androidx.compose.foundation.shape.RoundedCornerShape
20 | import androidx.compose.material3.Shapes
21 | import androidx.compose.ui.unit.dp
22 |
23 | val shapes = Shapes(
24 | small = RoundedCornerShape(4.dp),
25 | medium = RoundedCornerShape(12.dp)
26 | )
27 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
13 |
14 | # Turn on parallel compilation, caching and on-demand configuration
15 | org.gradle.configureondemand=true
16 | org.gradle.caching=true
17 | org.gradle.parallel=true
18 |
19 | # AndroidX package structure to make it clearer which packages are bundled with the
20 | # Android operating system, and which are packaged with your app's APK
21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
22 | android.useAndroidX=true
23 |
24 | # Kotlin code style for this project: "official" or "obsolete":
25 | kotlin.code.style=official
--------------------------------------------------------------------------------
/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/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
23 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
14 |
15 | MySoothe
16 | Favorite Collections
17 | Align your Body
18 | Inversions
19 | Quick yoga
20 | Stretching
21 | Tabata
22 | HIIT
23 | Pre-natal yoga
24 | Short mantras
25 | Nature meditations
26 | Stress and anxiety
27 | Self massage
28 | Overwhelmed
29 | Nightly wind down
30 | start
31 | Home
32 | Profile
33 | Search
34 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Basic Layouts in Compose Codelab
2 |
3 | This folder contains the source code for
4 | the [Basic Layouts in Compose Codelab](https://developer.android.com/codelabs/jetpack-compose-layouts)
5 |
6 | ## License
7 |
8 | ```
9 | Copyright 2022 The Android Open Source Project
10 |
11 | Licensed under the Apache License, Version 2.0 (the "License");
12 | you may not use this file except in compliance with the License.
13 | You may obtain a copy of the License at
14 |
15 | https://www.apache.org/licenses/LICENSE-2.0
16 |
17 | Unless required by applicable law or agreed to in writing, software
18 | distributed under the License is distributed on an "AS IS" BASIS,
19 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 | See the License for the specific language governing permissions and
21 | limitations under the License.
22 | ```
23 |
24 | ## Image asset attributions
25 |
26 | [fc1_short_mantras.jpg](https://www.pexels.com/photo/body-of-water-view-1825206/) - Elizaveta Kozorezova
27 | [fc2_nature_meditations.jpg](https://www.pexels.com/photo/photo-of-green-leaves-3571551/) - Nothing Ahead
28 | [fc3_stress_and_anxiety.jpg](https://www.pexels.com/photo/aerial-view-of-body-of-water-1557238/) - Jim
29 | [fc4_self_massage.jpg](https://www.pexels.com/photo/photography-of-stones-1029604/) - Scott Webb
30 | [fc5_overwhelmed.jpg](https://www.pexels.com/photo/white-clouds-3560044/) - Ruvim
31 | [fc6_nightly_wind_down.jpg](https://www.pexels.com/photo/time-lapse-photo-of-stars-on-night-924824/) - Jakub Novacek
32 | [ab1_inversions.jpg](https://www.pexels.com/photo/low-angle-view-of-woman-relaxing-on-beach-against-blue-sky-317157/) - Chevanon Photography
33 | [ab2_quick_yoga.jpg](https://www.pexels.com/photo/photo-of-woman-stretching-her-body-1812964/) - Agung Pandit Wiguna
34 | [ab3_stretching.jpg](https://www.pexels.com/photo/photo-of-women-stretching-together-4056723/) - Cliff Booth
35 | [ab4_tabata.jpg](https://www.pexels.com/photo/fashion-man-people-art-4662438/) - Elly Fairytale
36 | [ab5_hiit.jpg](https://www.pexels.com/photo/man-wearing-white-pants-under-blue-sky-999309/) - The Lazy Artist Gallery
37 | [ab6_pre_natal_yoga.jpg](https://www.pexels.com/photo/woman-doing-yoga-396133/) - freestocks.org
38 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
14 |
20 |
21 |
22 |
28 |
31 |
34 |
35 |
36 |
37 |
43 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 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 |
17 | plugins {
18 | id 'com.android.application'
19 | id 'org.jetbrains.kotlin.android'
20 | id 'org.jetbrains.kotlin.plugin.compose'
21 | }
22 |
23 | android {
24 | namespace "com.codelab.basiclayouts"
25 | compileSdk 36
26 |
27 | defaultConfig {
28 | applicationId "com.codelab.basiclayouts"
29 | minSdk 23
30 | targetSdk 33
31 | versionCode 1
32 | versionName "1.0"
33 |
34 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
35 | vectorDrawables {
36 | useSupportLibrary true
37 | }
38 | }
39 |
40 | buildTypes {
41 | release {
42 | minifyEnabled false
43 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
44 | }
45 | }
46 | compileOptions {
47 | sourceCompatibility JavaVersion.VERSION_1_8
48 | targetCompatibility JavaVersion.VERSION_1_8
49 | }
50 | kotlinOptions {
51 | jvmTarget = '1.8'
52 | }
53 | buildFeatures {
54 | compose true
55 | }
56 | packagingOptions {
57 | resources {
58 | excludes += '/META-INF/{AL2.0,LGPL2.1}'
59 | }
60 | }
61 | }
62 |
63 | dependencies {
64 | def composeBom = platform('androidx.compose:compose-bom:2025.10.01')
65 | implementation(composeBom)
66 | androidTestImplementation(composeBom)
67 |
68 | implementation 'androidx.core:core-ktx:1.17.0'
69 | implementation "androidx.compose.ui:ui"
70 | implementation 'androidx.compose.material3:material3'
71 | implementation 'androidx.compose.material3:material3-window-size-class:1.4.0'
72 | implementation "androidx.compose.material:material-icons-extended"
73 | implementation "androidx.compose.ui:ui-tooling-preview"
74 | implementation "com.google.android.material:material:1.13.0"
75 | implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.9.4'
76 | implementation 'androidx.activity:activity-compose:1.11.0'
77 | testImplementation 'junit:junit:4.13.2'
78 | androidTestImplementation 'androidx.test.ext:junit:1.3.0'
79 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
80 | androidTestImplementation "androidx.compose.ui:ui-test-junit4"
81 | debugImplementation "androidx.compose.ui:ui-tooling"
82 | }
83 |
--------------------------------------------------------------------------------
/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 | @rem SPDX-License-Identifier: Apache-2.0
17 | @rem
18 |
19 | @if "%DEBUG%"=="" @echo off
20 | @rem ##########################################################################
21 | @rem
22 | @rem Gradle startup script for Windows
23 | @rem
24 | @rem ##########################################################################
25 |
26 | @rem Set local scope for the variables with windows NT shell
27 | if "%OS%"=="Windows_NT" setlocal
28 |
29 | set DIRNAME=%~dp0
30 | if "%DIRNAME%"=="" set DIRNAME=.
31 | @rem This is normally unused
32 | set APP_BASE_NAME=%~n0
33 | set APP_HOME=%DIRNAME%
34 |
35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37 |
38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
40 |
41 | @rem Find java.exe
42 | if defined JAVA_HOME goto findJavaFromJavaHome
43 |
44 | set JAVA_EXE=java.exe
45 | %JAVA_EXE% -version >NUL 2>&1
46 | if %ERRORLEVEL% equ 0 goto execute
47 |
48 | echo. 1>&2
49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50 | echo. 1>&2
51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52 | echo location of your Java installation. 1>&2
53 |
54 | goto fail
55 |
56 | :findJavaFromJavaHome
57 | set JAVA_HOME=%JAVA_HOME:"=%
58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
59 |
60 | if exist "%JAVA_EXE%" goto execute
61 |
62 | echo. 1>&2
63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64 | echo. 1>&2
65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66 | echo location of your Java installation. 1>&2
67 |
68 | goto fail
69 |
70 | :execute
71 | @rem Setup the command line
72 |
73 | set CLASSPATH=
74 |
75 |
76 | @rem Execute Gradle
77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
78 |
79 | :end
80 | @rem End local scope for the variables with windows NT shell
81 | if %ERRORLEVEL% equ 0 goto mainEnd
82 |
83 | :fail
84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
85 | rem the _cmd.exe /c_ return code!
86 | set EXIT_CODE=%ERRORLEVEL%
87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89 | exit /b %EXIT_CODE%
90 |
91 | :mainEnd
92 | if "%OS%"=="Windows_NT" endlocal
93 |
94 | :omega
95 |
--------------------------------------------------------------------------------
/app/src/main/java/com/codelab/basiclayouts/ui/theme/Color.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 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 |
17 | package com.codelab.basiclayouts.ui.theme
18 |
19 | import androidx.compose.ui.graphics.Color
20 |
21 | val md_theme_light_primary = Color(0xFF6B5C4D)
22 | val md_theme_light_onPrimary = Color(0xFFFFFFFF)
23 | val md_theme_light_primaryContainer = Color(0xFFF4DFCD)
24 | val md_theme_light_onPrimaryContainer = Color(0xFF241A0E)
25 | val md_theme_light_secondary = Color(0xFF635D59)
26 | val md_theme_light_onSecondary = Color(0xFFFFFFFF)
27 | val md_theme_light_secondaryContainer = Color(0xFFEAE1DB)
28 | val md_theme_light_onSecondaryContainer = Color(0xFF1F1B17)
29 | val md_theme_light_tertiary = Color(0xFF5E5F58)
30 | val md_theme_light_onTertiary = Color(0xFFFFFFFF)
31 | val md_theme_light_tertiaryContainer = Color(0xFFE3E3DA)
32 | val md_theme_light_onTertiaryContainer = Color(0xFF1B1C17)
33 | val md_theme_light_error = Color(0xFFBA1A1A)
34 | val md_theme_light_errorContainer = Color(0xFFFFDAD6)
35 | val md_theme_light_onError = Color(0xFFFFFFFF)
36 | val md_theme_light_onErrorContainer = Color(0xFF410002)
37 | val md_theme_light_background = Color(0xFFF5F0EE)
38 | val md_theme_light_onBackground = Color(0xFF1D1B1A)
39 | val md_theme_light_surface = Color(0xFFFFFBFF)
40 | val md_theme_light_onSurface = Color(0xFF1D1B1A)
41 | val md_theme_light_surfaceVariant = Color(0xFFE7E1DE)
42 | val md_theme_light_onSurfaceVariant = Color(0xFF494644)
43 | val md_theme_light_outline = Color(0xFF7A7674)
44 | val md_theme_light_inverseOnSurface = Color(0xFFF5F0EE)
45 |
46 | val md_theme_dark_primary = Color(0xFFD7C3B1)
47 | val md_theme_dark_onPrimary = Color(0xFF3A2E22)
48 | val md_theme_dark_primaryContainer = Color(0xFF524437)
49 | val md_theme_dark_onPrimaryContainer = Color(0xFFF4DFCD)
50 | val md_theme_dark_secondary = Color(0xFFCDC5BF)
51 | val md_theme_dark_onSecondary = Color(0xFF34302C)
52 | val md_theme_dark_secondaryContainer = Color(0xFF4B4642)
53 | val md_theme_dark_onSecondaryContainer = Color(0xFFEAE1DB)
54 | val md_theme_dark_tertiary = Color(0xFFC7C7BE)
55 | val md_theme_dark_onTertiary = Color(0xFF30312B)
56 | val md_theme_dark_tertiaryContainer = Color(0xFF464741)
57 | val md_theme_dark_onTertiaryContainer = Color(0xFFE3E3DA)
58 | val md_theme_dark_error = Color(0xFFFFB4AB)
59 | val md_theme_dark_errorContainer = Color(0xFF93000A)
60 | val md_theme_dark_onError = Color(0xFF690005)
61 | val md_theme_dark_onErrorContainer = Color(0xFFFFB4AB)
62 | val md_theme_dark_background = Color(0xFF32302F)
63 | val md_theme_dark_onBackground = Color(0xFFE6E1E0)
64 | val md_theme_dark_surface = Color(0xFF1D1B1A)
65 | val md_theme_dark_onSurface = Color(0xFFE6E1E0)
66 | val md_theme_dark_surfaceVariant = Color(0xFF494644)
67 | val md_theme_dark_onSurfaceVariant = Color(0xFFE6E1E0)
68 | val md_theme_dark_outline = Color(0xFF94908D)
69 |
--------------------------------------------------------------------------------
/app/src/main/java/com/codelab/basiclayouts/ui/theme/Type.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 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 |
17 | package com.codelab.basiclayouts.ui.theme
18 |
19 | import androidx.compose.material3.Typography
20 | import androidx.compose.ui.text.TextStyle
21 | import androidx.compose.ui.text.font.Font
22 | import androidx.compose.ui.text.font.FontFamily
23 | import androidx.compose.ui.text.font.FontWeight
24 | import androidx.compose.ui.text.style.TextAlign
25 | import androidx.compose.ui.unit.sp
26 | import com.codelab.basiclayouts.R
27 |
28 | private val fontFamilyKulim = FontFamily(
29 | listOf(
30 | Font(
31 | resId = R.font.kulim_park_regular
32 | ),
33 | Font(
34 | resId = R.font.kulim_park_light,
35 | weight = FontWeight.Light
36 | )
37 | )
38 | )
39 |
40 | private val fontFamilyLato = FontFamily(
41 | listOf(
42 | Font(
43 | resId = R.font.lato_regular
44 | ),
45 | Font(
46 | resId = R.font.lato_bold,
47 | weight = FontWeight.Bold
48 | )
49 | )
50 | )
51 |
52 | val typography = Typography(
53 | displayLarge = TextStyle(
54 | fontFamily = fontFamilyKulim,
55 | fontWeight = FontWeight.Light,
56 | fontSize = 57.sp,
57 | lineHeight = 64.sp,
58 | letterSpacing = (-0.25).sp
59 | ),
60 | displayMedium = TextStyle(
61 | fontFamily = fontFamilyKulim,
62 | fontSize = 45.sp,
63 | lineHeight = 52.sp
64 | ),
65 | displaySmall = TextStyle(
66 | fontFamily = fontFamilyKulim,
67 | fontSize = 36.sp,
68 | lineHeight = 44.sp
69 | ),
70 | titleMedium = TextStyle(
71 | fontFamily = fontFamilyLato,
72 | fontWeight = FontWeight(500),
73 | fontSize = 16.sp,
74 | lineHeight = 24.sp,
75 | letterSpacing = (0.15).sp
76 | ),
77 | bodySmall = TextStyle(
78 | fontFamily = fontFamilyLato,
79 | fontSize = 12.sp,
80 | lineHeight = 16.sp,
81 | letterSpacing = (0.4).sp
82 | ),
83 | bodyMedium = TextStyle(
84 | fontFamily = fontFamilyLato,
85 | fontSize = 14.sp,
86 | lineHeight = 20.sp,
87 | letterSpacing = (0.25).sp
88 | ),
89 | bodyLarge = TextStyle(
90 | fontFamily = fontFamilyLato,
91 | fontSize = 16.sp,
92 | lineHeight = 24.sp,
93 | letterSpacing = (0.5).sp
94 | ),
95 | labelMedium = TextStyle(
96 | fontFamily = fontFamilyLato,
97 | fontWeight = FontWeight(500),
98 | fontSize = 12.sp,
99 | lineHeight = 16.sp,
100 | letterSpacing = (0.5).sp,
101 | textAlign = TextAlign.Center
102 | ),
103 | labelLarge = TextStyle(
104 | fontFamily = fontFamilyLato,
105 | fontSize = 14.sp,
106 | lineHeight = 20.sp,
107 | letterSpacing = (0.1).sp
108 | )
109 | )
110 |
--------------------------------------------------------------------------------
/app/src/main/java/com/codelab/basiclayouts/ui/theme/Theme.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 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 |
17 | package com.codelab.basiclayouts.ui.theme
18 |
19 | import androidx.compose.foundation.isSystemInDarkTheme
20 | import androidx.compose.material3.MaterialTheme
21 | import androidx.compose.material3.darkColorScheme
22 | import androidx.compose.material3.lightColorScheme
23 |
24 | import androidx.compose.runtime.Composable
25 |
26 | private val LightColors = lightColorScheme(
27 | primary = md_theme_light_primary,
28 | onPrimary = md_theme_light_onPrimary,
29 | primaryContainer = md_theme_light_primaryContainer,
30 | onPrimaryContainer = md_theme_light_onPrimaryContainer,
31 | secondary = md_theme_light_secondary,
32 | onSecondary = md_theme_light_onSecondary,
33 | secondaryContainer = md_theme_light_secondaryContainer,
34 | onSecondaryContainer = md_theme_light_onSecondaryContainer,
35 | tertiary = md_theme_light_tertiary,
36 | onTertiary = md_theme_light_onTertiary,
37 | tertiaryContainer = md_theme_light_tertiaryContainer,
38 | onTertiaryContainer = md_theme_light_onTertiaryContainer,
39 | error = md_theme_light_error,
40 | errorContainer = md_theme_light_errorContainer,
41 | onError = md_theme_light_onError,
42 | onErrorContainer = md_theme_light_onErrorContainer,
43 | background = md_theme_light_background,
44 | onBackground = md_theme_light_onBackground,
45 | surface = md_theme_light_surface,
46 | onSurface = md_theme_light_onSurface,
47 | surfaceVariant = md_theme_light_surfaceVariant,
48 | onSurfaceVariant = md_theme_light_onSurfaceVariant,
49 | outline = md_theme_light_outline
50 | )
51 |
52 |
53 | private val DarkColors = darkColorScheme(
54 | primary = md_theme_dark_primary,
55 | onPrimary = md_theme_dark_onPrimary,
56 | primaryContainer = md_theme_dark_primaryContainer,
57 | onPrimaryContainer = md_theme_dark_onPrimaryContainer,
58 | secondary = md_theme_dark_secondary,
59 | onSecondary = md_theme_dark_onSecondary,
60 | secondaryContainer = md_theme_dark_secondaryContainer,
61 | onSecondaryContainer = md_theme_dark_onSecondaryContainer,
62 | tertiary = md_theme_dark_tertiary,
63 | onTertiary = md_theme_dark_onTertiary,
64 | tertiaryContainer = md_theme_dark_tertiaryContainer,
65 | onTertiaryContainer = md_theme_dark_onTertiaryContainer,
66 | error = md_theme_dark_error,
67 | errorContainer = md_theme_dark_errorContainer,
68 | onError = md_theme_dark_onError,
69 | onErrorContainer = md_theme_dark_onErrorContainer,
70 | background = md_theme_dark_background,
71 | onBackground = md_theme_dark_onBackground,
72 | surface = md_theme_dark_surface,
73 | onSurface = md_theme_dark_onSurface,
74 | surfaceVariant = md_theme_dark_surfaceVariant,
75 | onSurfaceVariant = md_theme_dark_onSurfaceVariant,
76 | outline = md_theme_dark_outline
77 | )
78 |
79 | @Composable
80 | fun MySootheTheme(
81 | darkTheme: Boolean = isSystemInDarkTheme(),
82 | content: @Composable() () -> Unit
83 | ) {
84 | val colors = if (darkTheme) {
85 | DarkColors
86 | } else {
87 | LightColors
88 | }
89 |
90 | MaterialTheme(
91 | colorScheme = colors,
92 | typography = typography,
93 | shapes = shapes,
94 | content = content
95 | )
96 | }
97 |
--------------------------------------------------------------------------------
/ASSETS_LICENSE:
--------------------------------------------------------------------------------
1 | All font files are licensed under the SIL OPEN FONT LICENSE license. All other files are licensed under the Apache 2 license.
2 |
3 |
4 | SIL OPEN FONT LICENSE
5 | Version 1.1 - 26 February 2007
6 |
7 | PREAMBLE
8 | The goals of the Open Font License (OFL) are to stimulate worldwide
9 | development of collaborative font projects, to support the font creation
10 | efforts of academic and linguistic communities, and to provide a free and
11 | open framework in which fonts may be shared and improved in partnership
12 | with others.
13 |
14 | The OFL allows the licensed fonts to be used, studied, modified and
15 | redistributed freely as long as they are not sold by themselves. The
16 | fonts, including any derivative works, can be bundled, embedded,
17 | redistributed and/or sold with any software provided that any reserved
18 | names are not used by derivative works. The fonts and derivatives,
19 | however, cannot be released under any other type of license. The
20 | requirement for fonts to remain under this license does not apply
21 | to any document created using the fonts or their derivatives.
22 |
23 | DEFINITIONS
24 | "Font Software" refers to the set of files released by the Copyright
25 | Holder(s) under this license and clearly marked as such. This may
26 | include source files, build scripts and documentation.
27 |
28 | "Reserved Font Name" refers to any names specified as such after the
29 | copyright statement(s).
30 |
31 | "Original Version" refers to the collection of Font Software components as
32 | distributed by the Copyright Holder(s).
33 |
34 | "Modified Version" refers to any derivative made by adding to, deleting,
35 | or substituting — in part or in whole — any of the components of the
36 | Original Version, by changing formats or by porting the Font Software to a
37 | new environment.
38 |
39 | "Author" refers to any designer, engineer, programmer, technical
40 | writer or other person who contributed to the Font Software.
41 |
42 | PERMISSION & CONDITIONS
43 | Permission is hereby granted, free of charge, to any person obtaining
44 | a copy of the Font Software, to use, study, copy, merge, embed, modify,
45 | redistribute, and sell modified and unmodified copies of the Font
46 | Software, subject to the following conditions:
47 |
48 | 1) Neither the Font Software nor any of its individual components,
49 | in Original or Modified Versions, may be sold by itself.
50 |
51 | 2) Original or Modified Versions of the Font Software may be bundled,
52 | redistributed and/or sold with any software, provided that each copy
53 | contains the above copyright notice and this license. These can be
54 | included either as stand-alone text files, human-readable headers or
55 | in the appropriate machine-readable metadata fields within text or
56 | binary files as long as those fields can be easily viewed by the user.
57 |
58 | 3) No Modified Version of the Font Software may use the Reserved Font
59 | Name(s) unless explicit written permission is granted by the corresponding
60 | Copyright Holder. This restriction only applies to the primary font name as
61 | presented to the users.
62 |
63 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
64 | Software shall not be used to promote, endorse or advertise any
65 | Modified Version, except to acknowledge the contribution(s) of the
66 | Copyright Holder(s) and the Author(s) or with their explicit written
67 | permission.
68 |
69 | 5) The Font Software, modified or unmodified, in part or in whole,
70 | must be distributed entirely under this license, and must not be
71 | distributed under any other license. The requirement for fonts to
72 | remain under this license does not apply to any document created
73 | using the Font Software.
74 |
75 | TERMINATION
76 | This license becomes null and void if any of the above conditions are
77 | not met.
78 |
79 | DISCLAIMER
80 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
81 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
82 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
83 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
84 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
85 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
86 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
87 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
88 | OTHER DEALINGS IN THE FONT SOFTWARE.
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
20 |
23 |
28 |
33 |
38 |
43 |
48 |
53 |
58 |
63 |
68 |
73 |
78 |
83 |
88 |
93 |
98 |
103 |
108 |
113 |
118 |
123 |
128 |
133 |
138 |
143 |
148 |
153 |
158 |
163 |
168 |
173 |
178 |
183 |
184 |
--------------------------------------------------------------------------------
/app/src/main/java/com/codelab/basiclayouts/MainActivity.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 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 |
17 | package com.codelab.basiclayouts
18 |
19 | import android.os.Bundle
20 | import androidx.activity.ComponentActivity
21 | import androidx.activity.compose.setContent
22 | import androidx.annotation.DrawableRes
23 | import androidx.annotation.StringRes
24 | import androidx.compose.foundation.Image
25 | import androidx.compose.foundation.layout.*
26 | import androidx.compose.foundation.shape.CircleShape
27 | import androidx.compose.material3.Icon
28 | import androidx.compose.material3.MaterialTheme
29 | import androidx.compose.material3.Text
30 | import androidx.compose.material3.TextField
31 | import androidx.compose.material3.TextFieldDefaults
32 | import androidx.compose.material.icons.Icons
33 | import androidx.compose.material.icons.filled.Search
34 | import androidx.compose.runtime.Composable
35 | import androidx.compose.ui.Alignment
36 | import androidx.compose.ui.Modifier
37 | import androidx.compose.ui.draw.clip
38 | import androidx.compose.ui.layout.ContentScale
39 | import androidx.compose.ui.res.painterResource
40 | import androidx.compose.ui.res.stringResource
41 | import androidx.compose.ui.tooling.preview.Preview
42 | import androidx.compose.ui.unit.dp
43 | import com.codelab.basiclayouts.ui.theme.MySootheTheme
44 |
45 | class MainActivity : ComponentActivity() {
46 | override fun onCreate(savedInstanceState: Bundle?) {
47 | super.onCreate(savedInstanceState)
48 | setContent { MySootheApp() }
49 | }
50 | }
51 |
52 | // Step: Search bar - Modifiers
53 | @Composable
54 | fun SearchBar(
55 | modifier: Modifier = Modifier
56 | ) {
57 | TextField(
58 | value = "",
59 | onValueChange = {},
60 | leadingIcon = {
61 | Icon(Icons.Default.Search, contentDescription = null)
62 | },
63 | placeholder = {
64 | Text(stringResource(id = R.string.placeholder_search))
65 | },
66 | colors = TextFieldDefaults.colors(),
67 | modifier = modifier
68 | .heightIn(min = 56.dp)
69 | .fillMaxWidth()
70 | )
71 | }
72 |
73 | // Step: Align your body - Alignment
74 | @Composable
75 | fun AlignYourBodyElement(
76 | @DrawableRes drawable: Int,
77 | @StringRes text: Int,
78 | modifier: Modifier = Modifier
79 | ) {
80 | Column(
81 | modifier = modifier,
82 | horizontalAlignment = Alignment.CenterHorizontally
83 | ) {
84 | Image(
85 | painter = painterResource(id = drawable),
86 | contentDescription = null,
87 | contentScale = ContentScale.Crop,
88 | modifier = Modifier
89 | .size(88.dp)
90 | .clip(CircleShape)
91 | )
92 | Text(
93 | text = stringResource(text),
94 | modifier = Modifier.paddingFromBaseline(top = 24.dp, bottom = 8.dp),
95 | style = MaterialTheme.typography.bodyMedium
96 | )
97 | }
98 | }
99 |
100 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE)
101 | @Composable
102 | fun AlignYourBodyElementPreview() {
103 | MySootheTheme {
104 | AlignYourBodyElement(
105 | text = R.string.ab1_inversions,
106 | drawable = R.drawable.ab1_inversions,
107 | modifier = Modifier.padding(8.dp)
108 | )
109 | }
110 | }
111 | // Step: Favorite collection card - Material Surface
112 | @Composable
113 | fun FavoriteCollectionCard(
114 | modifier: Modifier = Modifier
115 | ) {
116 | // Implement composable here
117 | }
118 |
119 | // Step: Align your body row - Arrangements
120 | @Composable
121 | fun AlignYourBodyRow(
122 | modifier: Modifier = Modifier
123 | ) {
124 | // Implement composable here
125 | }
126 |
127 | // Step: Favorite collections grid - LazyGrid
128 | @Composable
129 | fun FavoriteCollectionsGrid(
130 | modifier: Modifier = Modifier
131 | ) {
132 | // Implement composable here
133 | }
134 |
135 | // Step: Home section - Slot APIs
136 | @Composable
137 | fun HomeSection(
138 | modifier: Modifier = Modifier
139 | ) {
140 | // Implement composable here
141 | }
142 |
143 | // Step: Home screen - Scrolling
144 | @Composable
145 | fun HomeScreen(modifier: Modifier = Modifier) {
146 | // Implement composable here
147 | }
148 |
149 | // Step: Bottom navigation - Material
150 | @Composable
151 | private fun SootheBottomNavigation(modifier: Modifier = Modifier) {
152 | // Implement composable here
153 | }
154 |
155 | // Step: MySoothe App - Scaffold
156 | @Composable
157 | fun MySootheAppPortrait() {
158 | // Implement composable here
159 | }
160 |
161 | // Step: Bottom navigation - Material
162 | @Composable
163 | private fun SootheNavigationRail(modifier: Modifier = Modifier) {
164 | // Implement composable here
165 | }
166 |
167 | // Step: Landscape Mode
168 | @Composable
169 | fun MySootheAppLandscape(){
170 | // Implement composable here
171 | }
172 |
173 | // Step: MySoothe App
174 | @Composable
175 | fun MySootheApp() {
176 | // Implement composable here
177 | }
178 |
179 | private val alignYourBodyData = listOf(
180 | R.drawable.ab1_inversions to R.string.ab1_inversions,
181 | R.drawable.ab2_quick_yoga to R.string.ab2_quick_yoga,
182 | R.drawable.ab3_stretching to R.string.ab3_stretching,
183 | R.drawable.ab4_tabata to R.string.ab4_tabata,
184 | R.drawable.ab5_hiit to R.string.ab5_hiit,
185 | R.drawable.ab6_pre_natal_yoga to R.string.ab6_pre_natal_yoga
186 | ).map { DrawableStringPair(it.first, it.second) }
187 |
188 | private val favoriteCollectionsData = listOf(
189 | R.drawable.fc1_short_mantras to R.string.fc1_short_mantras,
190 | R.drawable.fc2_nature_meditations to R.string.fc2_nature_meditations,
191 | R.drawable.fc3_stress_and_anxiety to R.string.fc3_stress_and_anxiety,
192 | R.drawable.fc4_self_massage to R.string.fc4_self_massage,
193 | R.drawable.fc5_overwhelmed to R.string.fc5_overwhelmed,
194 | R.drawable.fc6_nightly_wind_down to R.string.fc6_nightly_wind_down
195 | ).map { DrawableStringPair(it.first, it.second) }
196 |
197 | private data class DrawableStringPair(
198 | @param:DrawableRes val drawable: Int,
199 | @param:StringRes val text: Int
200 | )
201 |
202 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE)
203 | @Composable
204 | fun SearchBarPreview() {
205 | MySootheTheme { SearchBar(Modifier.padding(8.dp)) }
206 | }
207 |
208 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE, name = "AlignYourBodyElement Preview 1")
209 | @Composable
210 | fun AlignYourBodyElementPreview1() {
211 | MySootheTheme {
212 | AlignYourBodyElement(
213 | text = R.string.ab1_inversions,
214 | drawable = R.drawable.ab1_inversions,
215 | modifier = Modifier.padding(8.dp)
216 | )
217 | }
218 | }
219 |
220 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE, name = "AlignYourBodyElement Preview 2")
221 | @Composable
222 | fun AlignYourBodyElementPreview2() {
223 | MySootheTheme {
224 | AlignYourBodyElement(
225 | text = R.string.ab2_quick_yoga,
226 | drawable = R.drawable.ab2_quick_yoga,
227 | modifier = Modifier.padding(8.dp)
228 | )
229 | }
230 | }
231 |
232 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE)
233 | @Composable
234 | fun FavoriteCollectionCardPreview() {
235 | MySootheTheme {
236 | FavoriteCollectionCard(
237 | modifier = Modifier.padding(8.dp)
238 | )
239 | }
240 | }
241 |
242 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE)
243 | @Composable
244 | fun FavoriteCollectionsGridPreview() {
245 | MySootheTheme { FavoriteCollectionsGrid() }
246 | }
247 |
248 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE)
249 | @Composable
250 | fun AlignYourBodyRowPreview() {
251 | MySootheTheme { AlignYourBodyRow() }
252 | }
253 |
254 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE)
255 | @Composable
256 | fun HomeSectionPreview() {
257 | MySootheTheme { HomeSection() }
258 | }
259 |
260 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE)
261 | @Composable
262 | fun ScreenContentPreview() {
263 | MySootheTheme { HomeScreen() }
264 | }
265 |
266 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE)
267 | @Composable
268 | fun BottomNavigationPreview() {
269 | MySootheTheme { SootheBottomNavigation(Modifier.padding(top = 24.dp)) }
270 | }
271 |
272 | @Preview(showBackground = true, backgroundColor = 0xFFF5F0EE)
273 | @Composable
274 | fun NavigationRailPreview() {
275 | MySootheTheme { SootheNavigationRail() }
276 | }
277 |
278 | @Preview(widthDp = 360, heightDp = 640)
279 | @Composable
280 | fun MySoothePortraitPreview() {
281 | MySootheAppPortrait()
282 | }
283 |
284 | @Preview(widthDp = 640, heightDp = 360)
285 | @Composable
286 | fun MySootheLandscapePreview() {
287 | MySootheAppLandscape()
288 | }
289 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Copyright © 2015-2021 the original authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | # SPDX-License-Identifier: Apache-2.0
19 | #
20 |
21 | ##############################################################################
22 | #
23 | # Gradle start up script for POSIX generated by Gradle.
24 | #
25 | # Important for running:
26 | #
27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
28 | # noncompliant, but you have some other compliant shell such as ksh or
29 | # bash, then to run this script, type that shell name before the whole
30 | # command line, like:
31 | #
32 | # ksh Gradle
33 | #
34 | # Busybox and similar reduced shells will NOT work, because this script
35 | # requires all of these POSIX shell features:
36 | # * functions;
37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
39 | # * compound commands having a testable exit status, especially «case»;
40 | # * various built-in commands including «command», «set», and «ulimit».
41 | #
42 | # Important for patching:
43 | #
44 | # (2) This script targets any POSIX shell, so it avoids extensions provided
45 | # by Bash, Ksh, etc; in particular arrays are avoided.
46 | #
47 | # The "traditional" practice of packing multiple parameters into a
48 | # space-separated string is a well documented source of bugs and security
49 | # problems, so this is (mostly) avoided, by progressively accumulating
50 | # options in "$@", and eventually passing that to Java.
51 | #
52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
54 | # see the in-line comments for details.
55 | #
56 | # There are tweaks for specific operating systems such as AIX, CygWin,
57 | # Darwin, MinGW, and NonStop.
58 | #
59 | # (3) This script is generated from the Groovy template
60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
61 | # within the Gradle project.
62 | #
63 | # You can find Gradle at https://github.com/gradle/gradle/.
64 | #
65 | ##############################################################################
66 |
67 | # Attempt to set APP_HOME
68 |
69 | # Resolve links: $0 may be a link
70 | app_path=$0
71 |
72 | # Need this for daisy-chained symlinks.
73 | while
74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
75 | [ -h "$app_path" ]
76 | do
77 | ls=$( ls -ld "$app_path" )
78 | link=${ls#*' -> '}
79 | case $link in #(
80 | /*) app_path=$link ;; #(
81 | *) app_path=$APP_HOME$link ;;
82 | esac
83 | done
84 |
85 | # This is normally unused
86 | # shellcheck disable=SC2034
87 | APP_BASE_NAME=${0##*/}
88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
90 |
91 | # Use the maximum available, or set MAX_FD != -1 to use that value.
92 | MAX_FD=maximum
93 |
94 | warn () {
95 | echo "$*"
96 | } >&2
97 |
98 | die () {
99 | echo
100 | echo "$*"
101 | echo
102 | exit 1
103 | } >&2
104 |
105 | # OS specific support (must be 'true' or 'false').
106 | cygwin=false
107 | msys=false
108 | darwin=false
109 | nonstop=false
110 | case "$( uname )" in #(
111 | CYGWIN* ) cygwin=true ;; #(
112 | Darwin* ) darwin=true ;; #(
113 | MSYS* | MINGW* ) msys=true ;; #(
114 | NONSTOP* ) nonstop=true ;;
115 | esac
116 |
117 | CLASSPATH="\\\"\\\""
118 |
119 |
120 | # Determine the Java command to use to start the JVM.
121 | if [ -n "$JAVA_HOME" ] ; then
122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
123 | # IBM's JDK on AIX uses strange locations for the executables
124 | JAVACMD=$JAVA_HOME/jre/sh/java
125 | else
126 | JAVACMD=$JAVA_HOME/bin/java
127 | fi
128 | if [ ! -x "$JAVACMD" ] ; then
129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
130 |
131 | Please set the JAVA_HOME variable in your environment to match the
132 | location of your Java installation."
133 | fi
134 | else
135 | JAVACMD=java
136 | if ! command -v java >/dev/null 2>&1
137 | then
138 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
139 |
140 | Please set the JAVA_HOME variable in your environment to match the
141 | location of your Java installation."
142 | fi
143 | fi
144 |
145 | # Increase the maximum file descriptors if we can.
146 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
147 | case $MAX_FD in #(
148 | max*)
149 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
150 | # shellcheck disable=SC2039,SC3045
151 | MAX_FD=$( ulimit -H -n ) ||
152 | warn "Could not query maximum file descriptor limit"
153 | esac
154 | case $MAX_FD in #(
155 | '' | soft) :;; #(
156 | *)
157 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
158 | # shellcheck disable=SC2039,SC3045
159 | ulimit -n "$MAX_FD" ||
160 | warn "Could not set maximum file descriptor limit to $MAX_FD"
161 | esac
162 | fi
163 |
164 | # Collect all arguments for the java command, stacking in reverse order:
165 | # * args from the command line
166 | # * the main class name
167 | # * -classpath
168 | # * -D...appname settings
169 | # * --module-path (only if needed)
170 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
171 |
172 | # For Cygwin or MSYS, switch paths to Windows format before running java
173 | if "$cygwin" || "$msys" ; then
174 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
176 |
177 | JAVACMD=$( cygpath --unix "$JAVACMD" )
178 |
179 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
180 | for arg do
181 | if
182 | case $arg in #(
183 | -*) false ;; # don't mess with options #(
184 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
185 | [ -e "$t" ] ;; #(
186 | *) false ;;
187 | esac
188 | then
189 | arg=$( cygpath --path --ignore --mixed "$arg" )
190 | fi
191 | # Roll the args list around exactly as many times as the number of
192 | # args, so each arg winds up back in the position where it started, but
193 | # possibly modified.
194 | #
195 | # NB: a `for` loop captures its iteration list before it begins, so
196 | # changing the positional parameters here affects neither the number of
197 | # iterations, nor the values presented in `arg`.
198 | shift # remove old arg
199 | set -- "$@" "$arg" # push replacement arg
200 | done
201 | fi
202 |
203 |
204 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
205 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206 |
207 | # Collect all arguments for the java command:
208 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209 | # and any embedded shellness will be escaped.
210 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211 | # treated as '${Hostname}' itself on the command line.
212 |
213 | set -- \
214 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
215 | -classpath "$CLASSPATH" \
216 | -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217 | "$@"
218 |
219 | # Stop when "xargs" is not available.
220 | if ! command -v xargs >/dev/null 2>&1
221 | then
222 | die "xargs is not available"
223 | fi
224 |
225 | # Use "xargs" to parse quoted args.
226 | #
227 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
228 | #
229 | # In Bash we could simply go:
230 | #
231 | # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
232 | # set -- "${ARGS[@]}" "$@"
233 | #
234 | # but POSIX shell has neither arrays nor command substitution, so instead we
235 | # post-process each arg (as a line of input to sed) to backslash-escape any
236 | # character that might be a shell metacharacter, then use eval to reverse
237 | # that process (while maintaining the separation between arguments), and wrap
238 | # the whole thing up as a single "set" statement.
239 | #
240 | # This will of course break if any of these variables contains a newline or
241 | # an unmatched quote.
242 | #
243 |
244 | eval "set -- $(
245 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
246 | xargs -n1 |
247 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
248 | tr '\n' ' '
249 | )" '"$@"'
250 |
251 | exec "$JAVACMD" "$@"
252 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
--------------------------------------------------------------------------------