diff --git a/Jetpack-Compose-Playground/.gitignore b/Jetpack-Compose-Playground/.gitignore
new file mode 100644
index 000000000..8f51b42bb
--- /dev/null
+++ b/Jetpack-Compose-Playground/.gitignore
@@ -0,0 +1,17 @@
+*.iml
+.gradle
+/local.properties
+.idea
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+/.idea/misc.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+/.idea/vcs.xml
+/compose/build/
+/desktop/build/
diff --git a/Jetpack-Compose-Playground/LICENSE b/Jetpack-Compose-Playground/LICENSE
new file mode 100644
index 000000000..89228658a
--- /dev/null
+++ b/Jetpack-Compose-Playground/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 Jens Klingenberg
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Jetpack-Compose-Playground/README.md b/Jetpack-Compose-Playground/README.md
new file mode 100644
index 000000000..477786444
--- /dev/null
+++ b/Jetpack-Compose-Playground/README.md
@@ -0,0 +1,183 @@
+
Jetpack Compose Playground
+
+## Introduction 🙋‍♂️
+This is a Jetpack Compose example project. I'm collecting a bunch of sample codes for Jetpack Compose. I also collect information/tutorials on the GitHub page https://foso.github.io/compose.
+
+[]() []()
+
+[](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/LICENSE)
+[](http://makeapullrequest.com)
+
+[](#contributors)
+
+### Show some :heart: and star the repo to support the project
+
+[](https://github.com/Foso/Jetpack-Compose-Playground) [](https://github.com/Foso/Jetpack-Compose-Playground/fork) [](https://github.com/Foso/Jetpack-Compose-Playground) [](https://twitter.com/jklingenberg_)
+## Composable of the week!! 🎉
+The [SubComposeLayout](https://foso.github.io/Jetpack-Compose-Playground/ui/layout/subcomposelayout/)
+
+## New to Compose?
+Check [Compose for Android Developers](https://foso.github.io/Jetpack-Compose-Playground/compose_for/android_devs/) or [Hello World Compose](https://foso.github.io/Jetpack-Compose-Playground/general/helloworld/)
+
+## đź“™ Jetpack Compose examples/tutorials and demos
+Look in the [repo](https://github.com/Foso/Jetpack-Compose-Playground/tree/master/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github) or take a look at the GitHub page: https://foso.github.io/compose
+
+### Animation
+* [Crossfade](https://foso.github.io/Jetpack-Compose-Playground/animation/crossfade)
+
+### Layouts
+* [ConstraintLayout](https://foso.github.io/Jetpack-Compose-Playground/layout/constraintlayout)
+* [Scaffold](https://foso.github.io/Jetpack-Compose-Playground/material/scaffold)
+* [Column](https://foso.github.io/Jetpack-Compose-Playground/layout/column)
+* [Row](https://foso.github.io/Jetpack-Compose-Playground/layout/row)
+* [Stack](https://foso.github.io/Jetpack-Compose-Playground/layout/stack)
+
+### Foundation
+* [Canvas](https://foso.github.io/Jetpack-Compose-Playground/foundation/canvas)
+* [Image](https://foso.github.io/Jetpack-Compose-Playground/foundation/image)
+* [LazyColumn](https://foso.github.io/Jetpack-Compose-Playground/foundation/lazycolumn)
+* [LazyRow](https://foso.github.io/Jetpack-Compose-Playground/foundation/lazyrow)
+* [Shape](https://foso.github.io/Jetpack-Compose-Playground/foundation/shape)
+* [Text](https://foso.github.io/Jetpack-Compose-Playground/foundation/text)
+
+### Material
+* [AlertDialog](https://foso.github.io/Jetpack-Compose-Playground/material/alertdialog)
+* [BadgeBox](https://foso.github.io/Jetpack-Compose-Playground/material/badgedbox/)
+* Buttons: [Button](https://foso.github.io/Jetpack-Compose-Playground/material/button), [FloatingActionButton](https://foso.github.io/Jetpack-Compose-Playground/material/floatingactionbutton/), [OutlinedButton](https://foso.github.io/Jetpack-Compose-Playground/material/button/), [TextButton](https://foso.github.io/Jetpack-Compose-Playground/material/button/)
+* [Card](https://foso.github.io/Jetpack-Compose-Playground/material/card)
+* [Divider](https://foso.github.io/Jetpack-Compose-Playground/material/divider)
+* [DropdownMenu](https://foso.github.io/Jetpack-Compose-Playground/material/dropdownmenu/)
+* [ModalBottomSheetLayout](https://foso.github.io/Jetpack-Compose-Playground/material/modalbottomsheetlayout/)
+* [ModalDrawerLayout](https://foso.github.io/Jetpack-Compose-Playground/material/modaldrawer)
+* [NavigationRail](https://foso.github.io/Jetpack-Compose-Playground/material/navigationrail/)
+* Progress Indicators: [CircularProgressIndicator](https://foso.github.io/Jetpack-Compose-Playground/material/circularprogressindicator), [LinearProgressIndicator](https://foso.github.io/Jetpack-Compose-Playground/material/linearprogressindicator/)
+* [Scaffold](https://foso.github.io/Jetpack-Compose-Playground/material/scaffold)
+* Selection Controls: [Checkbox](https://foso.github.io/Jetpack-Compose-Playground/material/checkbox), [RadioButton](https://foso.github.io/Jetpack-Compose-Playground/material/radiobutton), [Switch](https://foso.github.io/Jetpack-Compose-Playground/material/switch)
+* [Slider](https://foso.github.io/Jetpack-Compose-Playground/material/slider/)
+* [Snackbar](https://foso.github.io/Jetpack-Compose-Playground/material/snackbar/)
+* [Surface](https://foso.github.io/Jetpack-Compose-Playground/material/surface/)
+* [Text](https://foso.github.io/Jetpack-Compose-Playground/foundation/text/)
+* [TextField](https://foso.github.io/Jetpack-Compose-Playground/material/textfield)
+* [TopAppBar](https://foso.github.io/Jetpack-Compose-Playground/material/topappbar/)
+
+### Cookbook
+
+* [Overview](https://foso.github.io/Jetpack-Compose-Playground/cookbook/overview/)
+* [Handle changes to a TextField](https://foso.github.io/Jetpack-Compose-Playground/cookbook/textfield_changes/)
+
+
+> Some of the code samples in this Repository:
+
+| Overview | DialogExample | CircularProgress |
+| ------------------ | --------------------------- | ------------------ |
+| | | |
+
+
+
+### Project Structure
+
+* [/app](https://github.com/Foso/Jetpack-Compose-Playground/tree/master/app) - Android project directory
+
+# Resources
+
+## Talks
+| Name | Description |
+| ----------------------------------------- | ------------------------------------ |
+| [Thinking in Compose](https://www.youtube.com/watch?v=SMOhl9RK0BA) | Jetpack Compose is the new next generation UI toolkit. It uses a declarative component based paradigm for building UIs easily and quickly. It’s written entirely in Kotlin and embraces the style and ergonomics of the Kotlin language. |
+| [Compose by example](https://www.youtube.com/watch?v=DDd6IOlH3io) | Jetpack Compose is a new declarative UI toolkit built for the demands of creating modern user interfaces. Get started with Compose and learn about the new APIs and Material components that make up the toolkit by examining concrete UIs we’ve created with it. We’ll walk through examples of theming, animation, layout and more, demonstrating how to customize and combine components to build real UIs. We’ll show how the new toolkit simplifies your development experience and enables new possibilities. |
+| [Compose for existing apps](https://www.youtube.com/watch?v=PjQdFmiDgwk) | Jetpack Compose is now in alpha and you might want to start adding it to your existing apps. In this talk, you'll learn how to do that! We'll cover topics such as: adding Compose to your existing Views and embedding Views in Compose, using your existing View theme and current app architecture in Compose, testing all of that code, and much more. |
+| [Jetpack Compose](https://www.youtube.com/watch?v=U5BwfqBpiWU) | Jetpack Compose is Android’s new modern UI toolkit. Learn how Compose simplifies & accelerates your UI development, allowing you to create richer, more robust and responsive UIs. We outline our roadmap, what is ready for use right now, share our direction in areas that are still evolving, and show how the tight integration with tooling makes the development experience even better. Get up to speed with Compose and how it can help you to build better apps! |
+| [droidcon Online 2020: Become A Composer By Brian Gardner ](https://www.droidcon.com/media-detail?video=412304809) | |
+| [KotlinConf 2019: The Compose Runtime, Demystified by Leland Richardson](https://www.youtube.com/watch?v=6BRlI5zfCCk) | Jetpack Compose is an ambitious multi-team effort to reimagine Android's UI Toolkit more than 10 years after the Android Platform launched with the original UI Toolkit. Compose follows a declarative programming model, and the runtime is coupled with a Kotlin compiler plugin to enable a novel new approach to declarative programming. In this talk, Leland will go over the mechanics of how the Compose runtime and compiler plugin work together, demystifying how it can be used to enable efficient and performant user interfaces. In addition, this talk will describe how Compose can operate completely independent of the Android Platform and Compose UI, allowing it to be used as a general language feature for Incremental Computing and the management of tree-like data structures. |
+| [KotlinConf 2019: Compose Yourself: Designing a Kotlin First UI Toolkit by Anna-Chiara & Clara](https://www.youtube.com/watch?v=WqnR_XhEiVI) | #Jetpack Compose is an unbundled UI Toolkit for #Android, designed to simplify UI development. It combines a reactive programming model with the conciseness and ease of use of Kotlin. Learn directly from engineers on the project about the decisions that went into making this toolkit and how a Kotlin-first approach has influenced API design from the project's inception. |
+| [What's New in Jetpack Compose (Android Dev Summit '19)](https://www.youtube.com/watch?v=dtm2h-_sNDQ&list=PLWz5rJ2EKKc_xXXubDti2eRnIKU0p7wHd&index=8&t=0s) | Jetpack Compose was announced at Google I/O and the team has been hard at work ever since. This talk introduces Compose to new audiences, including what the project is and how it is taking shape. The talk also updates people who already know about Jetpack Compose, including how the project has evolved. |
+| [Understanding Compose (Android Dev Summit '19)](https://www.youtube.com/watch?v=Q9MtlmmN4Q0) | This session covers the benefits of a declarative reactive UI system like Jetpack Compose and how it applies to real problems that Android developers have today. Additionally, this talk expands on the programming model of Jetpack Compose and some of its implementation details the can help you understand how Compose works. |
+| [#AskAndroid at Android Dev Summit 2019 - Jetpack Compose](https://www.youtube.com/watch?v=oEy6nJaMtLM) | Missed the #AskAndroid livestream segment of Android Dev Summit 2019? Don’t worry, we got you covered. Hosts Lyla Fujiwara and Dan Galpin are joined by Anna-Chiara Bellini and Adam Powell to discuss Jetpack Compose questions submitted by Android developers online. Anna-Chiara Bellini is a product manager, and Adam Powell is an engineering lead. |
+| [Google IO19 - Declarative UI patterns](https://youtu.be/VsStyq4Lzxo) | Explore how reactive and declarative paradigms can be applied to Android UI development, making it easier for developers to integrate these patterns into their Android apps with Kotlin. |
+| [DroidconBerlin - Jetpack Compose — Next Gen Kotlin UI Toolkit for Android](https://www.droidcon.com/media-detail?video=353079951) | |
+| [DroidconBerlin - Jumping into Jetpack Compose way too early to see what's inside](https://www.droidcon.com/media-detail?video=352686988) | |
+| [KotlinEverywhere - Jetpack Compose](https://www.youtube.com/watch?v=I5zRmCheVVg) | |
+| [DevFest Kolkata 2019 - Let's Talk Composing UI](https://www.youtube.com/watch?v=kfNC-MKAGzc) | |
+
+## Podcasts
+| Name | Episode | Description |
+| ----------------------------------------- | ------------------------------------ | -- |
+| Android Developers Backstage | [Episode 147](http://androidbackstage.blogspot.com/2020/08/episode-147-jetpack-compose-alpha.html) | Jetpack Compose Alpha |
+| Android Developers Backstage | [Episode 131](http://androidbackstage.blogspot.com/2020/01/episode-131-jetpack-compose-and.html) | Jetpack Compose and Declarative UIs |
+| Android Developers Backstage | [Episode 115](http://androidbackstage.blogspot.com/2019/06/episode-115-jetpack-compose.html) | Jetpack Compose |
+| Fragmented Podcast | [Episode 171](https://fragmentedpodcast.com/episodes/172/) | Jetpack Compose with Leland Richardson |
+| The Kodeco Podcast | [S09 E09](https://podcasts.google.com/?feed=aHR0cHM6Ly93d3cucmF5d2VuZGVybGljaC5jb20vY2F0ZWdvcnkvcG9kY2FzdC9mZWVk&episode=aHR0cHM6Ly93d3cucmF5d2VuZGVybGljaC5jb20vP3A9MjMxMjI0&hl=en-IN&ep=6&at=1567914736470) | Google’s Android Toolkit Lead Developer Romain Guy |
+
+## Other Links
+
+| Name | Description |
+| ----------------------------------------- | ------------------------------------ |
+| [Jetpack Compose](https://developer.android.com/jetpack/compose) | |
+| [Jetpack Compose UI Readme](https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-master-dev/ui/README.md) | |
+| [Compose Readme](https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-master-dev/compose/) | |
+| [Video - Kotlin and Jetpack Compose](https://www.youtube.com/watch?v=KjQU_QrlbEI) | |
+| `#compose` channel on [Kotlin Slack](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up) | |
+| [Compose from first Principles ](http://intelligiblebabble.com/compose-from-first-principles/) | |
+| [Jetpack Compose Tutorial ](https://developer.android.com/jetpack/compose) | |
+| [AndroidX Git Compose](https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-master-dev/compose/) | |
+| [Release Notes](https://developer.android.com/jetpack/androidx/releases/ui) | |
+| [Compose UI Docu](https://developer.android.com/reference/kotlin/androidx/ui/packages) | |
+| [Video - Jetpack compose - MVVM State management in a simple way](https://youtu.be/KTvP27FpXd0) | |
+| [Jetpack Compose Twitter Bot](https://twitter.com/ComposeBot) | |
+| [SSComposeCookBook](https://github.com/SimformSolutionsPvtLtd/SSComposeCookBook/) | |
+| [SSJetPackComposeProgressButton](https://github.com/SimformSolutionsPvtLtd/SSJetPackComposeProgressButton/) | |
+| [SSJetpackComposeSwipeableView](https://github.com/SimformSolutionsPvtLtd/SSJetpackComposeSwipeableView/) | |
+| [SSComposeOTPPinView](https://github.com/SimformSolutionsPvtLtd/SSComposeOTPPinView) | |
+
+Feel free to contribute!
+
+## ✍️ Feedback
+
+If you want to improve Compose, join the [Kotlin Slack](https://slack.kotlinlang.org) and the #compose channel or file a Compose bug on the [Google Issue Tracker](https://issuetracker.google.com/issues?q=componentid:612128)
+
+### Find this project useful? :heart:
+* Support it by clicking the :star: button on the upper right of this page. :v:
+
+##
+
+
+
This project is proudly supported by JetBrains OSS License
+
+
+
+[License](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/LICENSE)
+-------
+
+ ```
+MIT License
+
+Copyright (c) 2019-2023 Jens Klingenberg
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+```
+
+## Acknowledgments
+Projects that helped me understand how to setup the project:
+* [Mishkun/try-compose
+](https://github.com/Mishkun/try-compose)
+
+## Credits
+Jetpack-Compose-Playground is brought to you by these [contributors](https://github.com/Foso/Jetpack-Compose-Playground/graphs/contributors).
+
diff --git a/Jetpack-Compose-Playground/app/.gitignore b/Jetpack-Compose-Playground/app/.gitignore
new file mode 100644
index 000000000..796b96d1c
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/Jetpack-Compose-Playground/app/build.gradle.kts b/Jetpack-Compose-Playground/app/build.gradle.kts
new file mode 100644
index 000000000..d1ebb804c
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/build.gradle.kts
@@ -0,0 +1,104 @@
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+
+plugins {
+ id("com.android.application")
+ id("kotlin-android")
+ alias(libs.plugins.compose.compiler)
+}
+
+android {
+ compileSdk = 35
+
+ defaultConfig {
+ applicationId = "de.jensklingenberg.jetpackcomposeplayground"
+ minSdk = 21
+ targetSdk = 35
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ getByName("release") {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+
+ kotlinOptions {
+ jvmTarget = "1.8"
+ }
+
+ namespace = "de.jensklingenberg.jetpackcomposeplayground"
+
+}
+
+tasks.withType().configureEach {
+ kotlinOptions {
+ freeCompilerArgs += listOf(
+ "-P",
+ "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.buildDir.absolutePath}/compose_compiler"
+ )
+ freeCompilerArgs += listOf(
+ "-P",
+ "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.buildDir.absolutePath}/compose_compiler"
+ )
+ }
+}
+val compose_version = libs.versions.compose.version.get()
+
+dependencies {
+ implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
+ implementation("androidx.activity:activity-compose:1.10.0")
+ implementation("androidx.appcompat:appcompat:1.7.0")
+ implementation("androidx.compose.animation:animation-core:$compose_version")
+ implementation("androidx.compose.animation:animation:$compose_version")
+ implementation("androidx.compose.foundation:foundation-layout:$compose_version")
+ implementation("androidx.compose.foundation:foundation:$compose_version")
+ implementation("androidx.compose.material:material-icons-core:$compose_version")
+ implementation("androidx.compose.material:material-icons-extended:$compose_version")
+ implementation("androidx.compose.material:material:$compose_version")
+ implementation("androidx.compose.material:material:$compose_version")
+ implementation("androidx.compose.runtime:runtime-livedata:$compose_version")
+ implementation("androidx.compose.runtime:runtime-rxjava2:$compose_version")
+ implementation("androidx.compose.ui:ui-geometry:$compose_version")
+ implementation("androidx.compose.ui:ui-graphics:$compose_version")
+ implementation("androidx.compose.ui:ui-tooling:$compose_version")
+ implementation("androidx.compose.ui:ui-tooling:$compose_version")
+ implementation("androidx.compose.ui:ui:$compose_version")
+ implementation("androidx.core:core-ktx:1.15.0")
+ implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
+ implementation("com.google.android.material:material:1.12.0")
+ implementation("androidx.compose.ui:ui-viewbinding:$compose_version")
+ implementation("androidx.compose.ui:ui-text:$compose_version")
+ implementation("androidx.compose.ui:ui-util:$compose_version")
+ implementation("androidx.compose.ui:ui:$compose_version")
+ implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0")
+
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
+ androidTestImplementation("androidx.test:runner:1.6.2")
+ androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
+ androidTestImplementation("androidx.compose.ui:ui-test:$compose_version")
+ androidTestImplementation("androidx.test.espresso:espresso-intents:3.6.1")
+ androidTestImplementation("androidx.test.ext:junit:1.2.1")
+ androidTestImplementation("androidx.test:core:1.6.1")
+ androidTestImplementation("androidx.test:rules:1.6.1")
+ androidTestImplementation("androidx.test:runner:1.6.2")
+ androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.2")
+ androidTestImplementation("org.mockito:mockito-core:5.12.0")
+ debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")
+
+ androidTestImplementation("com.adevinta.android:barista:4.3.0") {
+ exclude(group = "org.jetbrains.kotlin")
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/proguard-rules.pro b/Jetpack-Compose-Playground/app/proguard-rules.pro
new file mode 100644
index 000000000..2fe953834
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradl.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/Jetpack-Compose-Playground/app/src/androidTest/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUiTestWithAndroidComposeRule.kt b/Jetpack-Compose-Playground/app/src/androidTest/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUiTestWithAndroidComposeRule.kt
new file mode 100644
index 000000000..3046527d2
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/androidTest/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUiTestWithAndroidComposeRule.kt
@@ -0,0 +1,41 @@
+package de.jensklingenberg.jetpackcomposeplayground
+
+import androidx.compose.material.Text
+import androidx.compose.ui.test.*
+import androidx.compose.ui.test.junit4.ComposeContentTestRule
+import androidx.compose.ui.test.junit4.createAndroidComposeRule
+import org.junit.Rule
+import org.junit.Test
+import java.util.concurrent.CountDownLatch
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUiTestWithAndroidComposeRule {
+
+ @Rule
+ @JvmField
+ var composeTestRule: ComposeContentTestRule = createAndroidComposeRule()
+
+ @Test
+ fun whenIClickOnButton_TheTextShouldChange() {
+ composeTestRule.onNodeWithText("Hello").assertTextEquals("Hello")
+ composeTestRule.onNodeWithText("Hello").performClick()
+ composeTestRule.onNodeWithText("Hello").assertDoesNotExist()
+ composeTestRule.onNodeWithText("Bye").assertExists()
+ }
+
+
+ @Test
+ fun whenIClickOnButton_TheTextShouldChange_WithTag() {
+ composeTestRule.onNodeWithTag("MyTestTag").printToLog("XXX")
+ composeTestRule.onNodeWithTag("MyTestTag").performClick()
+ composeTestRule.onNodeWithText("Hello").assertDoesNotExist()
+ composeTestRule.onNodeWithTag("MyTestTag").assertTextEquals("Bye")
+
+ }
+}
+
+
diff --git a/Jetpack-Compose-Playground/app/src/androidTest/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUiTestWithComposeRule.kt b/Jetpack-Compose-Playground/app/src/androidTest/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUiTestWithComposeRule.kt
new file mode 100644
index 000000000..7d53d2ee6
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/androidTest/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUiTestWithComposeRule.kt
@@ -0,0 +1,47 @@
+package de.jensklingenberg.jetpackcomposeplayground
+
+import androidx.compose.ui.test.*
+import androidx.compose.ui.test.junit4.ComposeContentTestRule
+import androidx.compose.ui.test.junit4.createComposeRule
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.testing.TestingExample
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUiTestWithComposeRule {
+
+ @Rule
+ @JvmField
+ var composeTestRule: ComposeContentTestRule = createComposeRule()
+
+ @Before
+ fun before(){
+ composeTestRule.setContent {
+ TestingExample()
+ }
+ }
+
+ @Test
+ fun whenIClickOnButton_TheTextShouldChange() {
+ composeTestRule.onNodeWithText("Hello").assertTextEquals("Hello")
+ composeTestRule.onNodeWithText("Hello").performClick()
+ composeTestRule.onNodeWithText("Hello").assertDoesNotExist()
+ composeTestRule.onNodeWithText("Bye").assertExists()
+ }
+
+
+ @Test
+ fun whenIClickOnButton_TheTextShouldChange_WithTag() {
+ composeTestRule.onNodeWithTag("MyTestTag").assertTextEquals("Hello")
+ composeTestRule.onNodeWithTag("MyTestTag").performClick()
+ composeTestRule.onNodeWithText("Hello").assertDoesNotExist()
+ composeTestRule.onNodeWithTag("MyTestTag").assertTextEquals("Bye")
+ }
+
+
+}
diff --git a/Jetpack-Compose-Playground/app/src/androidTest/java/de/jensklingenberg/jetpackcomposeplayground/test.text b/Jetpack-Compose-Playground/app/src/androidTest/java/de/jensklingenberg/jetpackcomposeplayground/test.text
new file mode 100644
index 000000000..e69de29bb
diff --git a/Jetpack-Compose-Playground/app/src/main/AndroidManifest.xml b/Jetpack-Compose-Playground/app/src/main/AndroidManifest.xml
new file mode 100644
index 000000000..3e2e596d7
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/AndroidManifest.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/MainActivity.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/MainActivity.kt
new file mode 100644
index 000000000..c2465fee8
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/MainActivity.kt
@@ -0,0 +1,18 @@
+package de.jensklingenberg.jetpackcomposeplayground
+
+import android.content.Intent
+import android.os.Bundle
+import androidx.appcompat.app.AppCompatActivity
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.DemoActivity
+
+
+class MainActivity : AppCompatActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ startActivity(Intent(this, DemoActivity::class.java))
+
+ }
+
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/UiTestingDemoActivity.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/UiTestingDemoActivity.kt
new file mode 100644
index 000000000..46abf1974
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/UiTestingDemoActivity.kt
@@ -0,0 +1,18 @@
+package de.jensklingenberg.jetpackcomposeplayground
+
+
+import android.os.Bundle
+import androidx.activity.compose.setContent
+import androidx.appcompat.app.AppCompatActivity
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.testing.TestingExample
+
+
+class UiTestingDemoActivity : AppCompatActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ setContent {
+ TestingExample()
+ }
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/MyTestActivity.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/MyTestActivity.kt
new file mode 100644
index 000000000..6613e501c
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/MyTestActivity.kt
@@ -0,0 +1,41 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples
+
+
+import android.os.Bundle
+import androidx.activity.compose.setContent
+import androidx.appcompat.app.AppCompatActivity
+import androidx.compose.foundation.layout.Column
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.runtime.compositionLocalOf
+
+data class User(val name: String, val age: Int)
+
+val LocalActiveUser = compositionLocalOf { error("No user found!") }
+
+class MyTestActivity : AppCompatActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ setContent {
+ MyUserScreen()
+ }
+ }
+}
+@Composable
+private fun MyUserScreen() {
+ val user = User("Jens", 31)
+ CompositionLocalProvider(LocalActiveUser provides user) {
+ UserInfo()
+ }
+}
+
+
+@Composable
+fun UserInfo() {
+ Column {
+ Text("Name: " + LocalActiveUser.current.name)
+ Text("Age: " + LocalActiveUser.current.age)
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/Demo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/Demo.kt
new file mode 100644
index 000000000..ecf54f60e
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/Demo.kt
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.demo
+
+import android.app.Activity
+import androidx.activity.ComponentActivity
+import androidx.compose.runtime.Composable
+import kotlin.reflect.KClass
+
+/**
+ * Generic demo with a [title] that will be displayed in the list of demos.
+ */
+sealed class Demo(val title: String) {
+ override fun toString() = title
+}
+
+/**
+ * Demo that launches an [Activity] when selected.
+ *
+ * This should only be used for demos that need to customize the activity, the large majority of
+ * demos should just use [ComposableDemo] instead.
+ *
+ * @property activityClass the KClass (Foo::class) of the activity that will be launched when
+ * this demo is selected.
+ */
+class ActivityDemo(title: String, val activityClass: KClass) : Demo(title)
+
+/**
+ * Demo that displays [Composable] [content] when selected.
+ */
+class ComposableDemo(title: String, val content: @Composable () -> Unit) : Demo(title)
+
+/**
+ * A category of [Demo]s, that will display a list of [demos] when selected.
+ */
+class DemoCategory(title: String, val demos: List) : Demo(title)
+
+/**
+ * Flattened recursive DFS [List] of every demo in [this].
+ */
+fun DemoCategory.allDemos(): List {
+ val allDemos = mutableListOf()
+ fun DemoCategory.addAllDemos() {
+ demos.forEach { demo ->
+ allDemos += demo
+ if (demo is DemoCategory) {
+ demo.addAllDemos()
+ }
+ }
+ }
+ addAllDemos()
+ return allDemos
+}
+
+/**
+ * Flattened recursive DFS [List] of every launchable demo in [this].
+ */
+fun DemoCategory.allLaunchableDemos(): List {
+ return allDemos().filter { it !is DemoCategory }
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoActivity.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoActivity.kt
new file mode 100644
index 000000000..013d868e9
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoActivity.kt
@@ -0,0 +1,312 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.demo
+
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+import android.content.SharedPreferences
+import android.os.Bundle
+import android.view.Window
+import androidx.activity.ComponentActivity
+import androidx.activity.OnBackPressedCallback
+import androidx.activity.OnBackPressedDispatcher
+import androidx.compose.material.Colors
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.darkColors
+import androidx.compose.material.lightColors
+import androidx.compose.runtime.*
+import androidx.compose.runtime.saveable.Saver
+import androidx.compose.runtime.saveable.listSaver
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.toArgb
+import androidx.compose.ui.platform.ComposeView
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.LifecycleEventObserver
+
+/**
+ * Main [Activity] containing all Compose related demos.
+ */
+class DemoActivity : ComponentActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ ComposeView(this).also {
+ setContentView(it)
+ }.setContent {
+ val activityStarter = fun(demo: ActivityDemo<*>) {
+ startActivity(Intent(this, demo.activityClass.java))
+ }
+ val navigator = rememberSaveable(
+ saver = Navigator.Saver(AllDemosCategory, onBackPressedDispatcher, activityStarter)
+ ) {
+ Navigator(AllDemosCategory, onBackPressedDispatcher, activityStarter)
+ }
+ val demoColors = remember {
+ DemoColors().also {
+ lifecycle.addObserver(
+ LifecycleEventObserver { _, event ->
+ if (event == Lifecycle.Event.ON_RESUME) {
+ it.loadColorsFromSharedPreferences(this)
+ }
+ }
+ )
+ }
+ }
+ DemoTheme(demoColors, window) {
+ val filteringMode = rememberSaveable(
+ saver = FilterMode.Saver(onBackPressedDispatcher)
+ ) {
+ FilterMode(onBackPressedDispatcher)
+ }
+ val onStartFiltering = { filteringMode.isFiltering = true }
+ val onEndFiltering = { filteringMode.isFiltering = false }
+ DemoApp(
+ currentDemo = navigator.currentDemo,
+ backStackTitle = navigator.backStackTitle,
+ isFiltering = filteringMode.isFiltering,
+ onStartFiltering = onStartFiltering,
+ onEndFiltering = onEndFiltering,
+ onNavigateToDemo = { demo ->
+ if (filteringMode.isFiltering) {
+ onEndFiltering()
+ navigator.popAll()
+ }
+ navigator.navigateTo(demo)
+ },
+ canNavigateUp = !navigator.isRoot,
+ onNavigateUp = {
+ onBackPressed()
+ },
+ launchSettings = {
+ // startActivity(Intent(this, DemoSettingsActivity::class.java))
+ }
+ )
+ }
+ }
+ }
+}
+
+@Composable
+private fun DemoTheme(
+ demoColors: DemoColors,
+ window: Window,
+ content: @Composable () -> Unit
+) {
+ MaterialTheme() {
+ val statusBarColor = with(MaterialTheme.colors) {
+ (if (isLight) primaryVariant else Color.Black).toArgb()
+ }
+ SideEffect {
+ window.statusBarColor = statusBarColor
+ }
+ content()
+ }
+}
+
+private class Navigator private constructor(
+ private val backDispatcher: OnBackPressedDispatcher,
+ private val launchActivityDemo: (ActivityDemo<*>) -> Unit,
+ private val rootDemo: Demo,
+ initialDemo: Demo,
+ private val backStack: MutableList
+) {
+ constructor(
+ rootDemo: Demo,
+ backDispatcher: OnBackPressedDispatcher,
+ launchActivityDemo: (ActivityDemo<*>) -> Unit
+ ) : this(backDispatcher, launchActivityDemo, rootDemo, rootDemo, mutableListOf())
+
+ private val onBackPressed = object : OnBackPressedCallback(false) {
+ override fun handleOnBackPressed() {
+ popBackStack()
+ }
+ }.apply {
+ isEnabled = !isRoot
+ backDispatcher.addCallback(this)
+ }
+
+ private var _currentDemo by mutableStateOf(initialDemo)
+ var currentDemo: Demo
+ get() = _currentDemo
+ private set(value) {
+ _currentDemo = value
+ onBackPressed.isEnabled = !isRoot
+ }
+
+ val isRoot: Boolean get() = backStack.isEmpty()
+
+ val backStackTitle: String
+ get() =
+ (backStack.drop(1) + currentDemo).joinToString(separator = " > ") { it.title }
+
+ fun navigateTo(demo: Demo) {
+ if (demo is ActivityDemo<*>) {
+ launchActivityDemo(demo)
+ } else {
+ backStack.add(currentDemo)
+ currentDemo = demo
+ }
+ }
+
+ fun popAll() {
+ if (!isRoot) {
+ backStack.clear()
+ currentDemo = rootDemo
+ }
+ }
+
+ private fun popBackStack() {
+ currentDemo = backStack.removeAt(backStack.lastIndex)
+ }
+
+ companion object {
+ fun Saver(
+ rootDemo: DemoCategory,
+ backDispatcher: OnBackPressedDispatcher,
+ launchActivityDemo: (ActivityDemo<*>) -> Unit
+ ): Saver = listSaver(
+ save = { navigator ->
+ (navigator.backStack + navigator.currentDemo).map { it.title }
+ },
+ restore = { restored ->
+ require(restored.isNotEmpty())
+ val backStack = restored.mapTo(mutableListOf()) {
+ requireNotNull(findDemo(rootDemo, it))
+ }
+ val initial = backStack.removeAt(backStack.lastIndex)
+ Navigator(backDispatcher, launchActivityDemo, rootDemo, initial, backStack)
+ }
+ )
+
+ private fun findDemo(demo: Demo, title: String): Demo? {
+ if (demo.title == title) {
+ return demo
+ }
+ if (demo is DemoCategory) {
+ demo.demos.forEach { child ->
+ findDemo(child, title)
+ ?.let { return it }
+ }
+ }
+ return null
+ }
+ }
+}
+
+private class FilterMode(backDispatcher: OnBackPressedDispatcher, initialValue: Boolean = false) {
+
+ private var _isFiltering by mutableStateOf(initialValue)
+
+ private val onBackPressed = object : OnBackPressedCallback(false) {
+ override fun handleOnBackPressed() {
+ isFiltering = false
+ }
+ }.apply {
+ isEnabled = initialValue
+ backDispatcher.addCallback(this)
+ }
+
+ var isFiltering
+ get() = _isFiltering
+ set(value) {
+ _isFiltering = value
+ onBackPressed.isEnabled = value
+ }
+
+ companion object {
+ fun Saver(backDispatcher: OnBackPressedDispatcher) = Saver(
+ save = { it.isFiltering },
+ restore = { FilterMode(backDispatcher, it) }
+ )
+ }
+}
+
+/**
+ * Returns a [DemoColors] from the values saved to [SharedPreferences]. If a given color is
+ * not present in the [SharedPreferences], its default value as defined in [Colors]
+ * will be returned.
+ */
+fun DemoColors.loadColorsFromSharedPreferences(context: Context) {
+
+}
+
+/**
+ * TODO: remove after b/154329050 is fixed
+ * Inline classes don't play well with reflection, so we want boxed classes for our
+ * call to [lightColors].
+ */
+internal fun reflectLightColors(
+ primary: Long = 0xFF6200EE,
+ primaryVariant: Long = 0xFF3700B3,
+ secondary: Long = 0xFF03DAC6,
+ secondaryVariant: Long = 0xFF018786,
+ background: Long = 0xFFFFFFFF,
+ surface: Long = 0xFFFFFFFF,
+ error: Long = 0xFFB00020,
+ onPrimary: Long = 0xFFFFFFFF,
+ onSecondary: Long = 0xFF000000,
+ onBackground: Long = 0xFF000000,
+ onSurface: Long = 0xFF000000,
+ onError: Long = 0xFFFFFFFF
+) = lightColors(
+ primary = Color(primary),
+ primaryVariant = Color(primaryVariant),
+ secondary = Color(secondary),
+ secondaryVariant = Color(secondaryVariant),
+ background = Color(background),
+ surface = Color(surface),
+ error = Color(error),
+ onPrimary = Color(onPrimary),
+ onSecondary = Color(onSecondary),
+ onBackground = Color(onBackground),
+ onSurface = Color(onSurface),
+ onError = Color(onError)
+)
+
+/**
+ * TODO: remove after b/154329050 is fixed
+ * Inline classes don't play well with reflection, so we want boxed classes for our
+ * call to [darkColors].
+ */
+internal fun reflectDarkColors(
+ primary: Long = 0xFFBB86FC,
+ primaryVariant: Long = 0xFF3700B3,
+ secondary: Long = 0xFF03DAC6,
+ background: Long = 0xFF121212,
+ surface: Long = 0xFF121212,
+ error: Long = 0xFFCF6679,
+ onPrimary: Long = 0xFF000000,
+ onSecondary: Long = 0xFF000000,
+ onBackground: Long = 0xFFFFFFFF,
+ onSurface: Long = 0xFFFFFFFF,
+ onError: Long = 0xFF000000
+) = darkColors(
+ primary = Color(primary),
+ primaryVariant = Color(primaryVariant),
+ secondary = Color(secondary),
+ background = Color(background),
+ surface = Color(surface),
+ error = Color(error),
+ onPrimary = Color(onPrimary),
+ onSecondary = Color(onSecondary),
+ onBackground = Color(onBackground),
+ onSurface = Color(onSurface),
+ onError = Color(onError)
+)
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoApp.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoApp.kt
new file mode 100644
index 000000000..42727c2f0
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoApp.kt
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.demo
+
+import androidx.compose.animation.Crossfade
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.wrapContentSize
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.integration.demos.DemoFilter
+import androidx.compose.integration.demos.FilterAppBar
+import androidx.compose.material.ExperimentalMaterialApi
+import androidx.compose.material.Icon
+import androidx.compose.material.IconButton
+import androidx.compose.material.ListItem
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.Scaffold
+import androidx.compose.material.Surface
+import androidx.compose.material.Text
+import androidx.compose.material.TopAppBar
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.ArrowBack
+import androidx.compose.material.icons.filled.ArrowForward
+import androidx.compose.material.icons.filled.Search
+import androidx.compose.material.icons.filled.Settings
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.LocalLayoutDirection
+import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.unit.LayoutDirection
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun DemoApp(
+ currentDemo: Demo,
+ backStackTitle: String,
+ isFiltering: Boolean,
+ onStartFiltering: () -> Unit,
+ onEndFiltering: () -> Unit,
+ onNavigateToDemo: (Demo) -> Unit,
+ canNavigateUp: Boolean,
+ onNavigateUp: () -> Unit,
+ launchSettings: () -> Unit
+) {
+ val navigationIcon = (@Composable { AppBarIcons.Back(onNavigateUp) }).takeIf { canNavigateUp }
+
+ var filterText by rememberSaveable { mutableStateOf("") }
+
+ Scaffold(
+ topBar = {
+ DemoAppBar(
+ title = backStackTitle,
+ navigationIcon = navigationIcon,
+ launchSettings = launchSettings,
+ isFiltering = isFiltering,
+ filterText = filterText,
+ onFilter = { filterText = it },
+ onStartFiltering = onStartFiltering,
+ onEndFiltering = onEndFiltering
+ )
+ }
+ ) { innerPadding ->
+ val modifier = Modifier.padding(innerPadding)
+ DemoContent(modifier, currentDemo, isFiltering, filterText, onNavigateToDemo)
+ }
+}
+
+@Composable
+private fun DemoContent(
+ modifier: Modifier,
+ currentDemo: Demo,
+ isFiltering: Boolean,
+ filterText: String,
+ onNavigate: (Demo) -> Unit
+) {
+ Crossfade(isFiltering to currentDemo) { (filtering, demo) ->
+ Surface(modifier.fillMaxSize(), color = MaterialTheme.colors.background) {
+ if (filtering) {
+ DemoFilter(
+ launchableDemos = AllDemosCategory.allLaunchableDemos(),
+ filterText = filterText,
+ onNavigate = onNavigate
+ )
+ } else {
+ DisplayDemo(demo, onNavigate)
+ }
+ }
+ }
+}
+
+@Composable
+private fun DisplayDemo(demo: Demo, onNavigate: (Demo) -> Unit) {
+ when (demo) {
+ is ActivityDemo<*> -> {
+ /* should never get here as activity demos are not added to the backstack*/
+ }
+ is ComposableDemo -> demo.content()
+ is DemoCategory -> DisplayDemoCategory(demo, onNavigate)
+ }
+}
+
+@Composable
+@OptIn(ExperimentalMaterialApi::class)
+private fun DisplayDemoCategory(category: DemoCategory, onNavigate: (Demo) -> Unit) {
+ // TODO: migrate to LazyColumn after b/175671850
+ Column(Modifier.verticalScroll(rememberScrollState())) {
+ category.demos.forEach { demo ->
+ ListItem(
+ text = {
+ Text(
+ modifier = Modifier.height(56.dp)
+ .wrapContentSize(Alignment.Center),
+ text = demo.title
+ )
+ },
+ modifier = Modifier.clickable { onNavigate(demo) }
+ )
+ }
+ }
+}
+
+@Suppress("ComposableLambdaParameterNaming", "ComposableLambdaParameterPosition")
+@Composable
+private fun DemoAppBar(
+ title: String,
+ navigationIcon: @Composable (() -> Unit)?,
+ isFiltering: Boolean,
+ filterText: String,
+ onFilter: (String) -> Unit,
+ onStartFiltering: () -> Unit,
+ onEndFiltering: () -> Unit,
+ launchSettings: () -> Unit
+) {
+ if (isFiltering) {
+ FilterAppBar(
+ filterText = filterText,
+ onFilter = onFilter,
+ onClose = onEndFiltering
+ )
+ } else {
+ TopAppBar(
+ title = {
+ Text(title, Modifier.testTag(Tags.AppBarTitle))
+ },
+ navigationIcon = navigationIcon,
+ actions = {
+ AppBarIcons.Filter(onClick = onStartFiltering)
+ }
+ )
+ }
+}
+
+private object AppBarIcons {
+ @Composable
+ fun Back(onClick: () -> Unit) {
+ val icon = when (LocalLayoutDirection.current) {
+ LayoutDirection.Ltr -> Icons.Filled.ArrowBack
+ LayoutDirection.Rtl -> Icons.Filled.ArrowForward
+ }
+ IconButton(onClick = onClick) {
+ Icon(icon, null)
+ }
+ }
+
+ @Composable
+ fun Filter(onClick: () -> Unit) {
+ IconButton(modifier = Modifier.testTag(Tags.FilterButton), onClick = onClick) {
+ Icon(Icons.Filled.Search, null)
+ }
+ }
+
+ @Composable
+ fun Settings(onClick: () -> Unit) {
+ IconButton(onClick = onClick) {
+ Icon(Icons.Filled.Settings, null)
+ }
+ }
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoColors.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoColors.kt
new file mode 100644
index 000000000..9543e39d4
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoColors.kt
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.demo
+
+import android.content.SharedPreferences
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.Stable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import androidx.compose.foundation.isSystemInDarkTheme
+import androidx.compose.material.Colors
+import androidx.compose.material.darkColors
+import androidx.compose.material.lightColors
+
+/**
+ * Wrapper class that contains a light and dark [Colors], to allow saving and
+ * restoring the entire light / dark theme to and from [SharedPreferences].
+ */
+@Stable
+class DemoColors {
+ var light: Colors by mutableStateOf(lightColors())
+ var dark: Colors by mutableStateOf(darkColors())
+
+
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoFilter.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoFilter.kt
new file mode 100644
index 000000000..bffa0aa5a
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/DemoFilter.kt
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.compose.integration.demos
+
+import androidx.compose.foundation.ExperimentalFoundationApi
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.wrapContentSize
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.text.BasicTextField
+import androidx.compose.foundation.verticalScroll
+
+import androidx.compose.material.ExperimentalMaterialApi
+import androidx.compose.material.Icon
+import androidx.compose.material.IconButton
+import androidx.compose.material.ListItem
+import androidx.compose.material.LocalContentColor
+import androidx.compose.material.LocalTextStyle
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.Text
+import androidx.compose.material.TopAppBar
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Close
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.DisposableEffect
+import androidx.compose.runtime.key
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.focus.FocusRequester
+import androidx.compose.ui.focus.focusRequester
+import androidx.compose.ui.graphics.SolidColor
+import androidx.compose.ui.graphics.compositeOver
+import androidx.compose.ui.text.SpanStyle
+import androidx.compose.ui.text.buildAnnotatedString
+import androidx.compose.ui.text.withStyle
+import androidx.compose.ui.unit.dp
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.Demo
+
+/**
+ * A scrollable list of [launchableDemos], filtered by [filterText].
+ */
+@Composable
+fun DemoFilter(launchableDemos: List, filterText: String, onNavigate: (Demo) -> Unit) {
+ val filteredDemos = launchableDemos
+ .filter { it.title.contains(filterText, ignoreCase = true) }
+ .sortedBy { it.title }
+ // TODO: migrate to LazyColumn after b/175671850
+ Column(Modifier.verticalScroll(rememberScrollState())) {
+ filteredDemos.forEach { demo ->
+ FilteredDemoListItem(
+ demo,
+ filterText = filterText,
+ onNavigate = onNavigate
+ )
+ }
+ }
+}
+
+/**
+ * [TopAppBar] with a text field allowing filtering all the demos.
+ */
+@Composable
+fun FilterAppBar(
+ filterText: String,
+ onFilter: (String) -> Unit,
+ onClose: () -> Unit
+) {
+ with(MaterialTheme.colors) {
+ val appBarColor = if (isLight) {
+ surface
+ } else {
+ // Blending primary over surface according to Material design guidance for brand
+ // surfaces in dark theme
+ primary.copy(alpha = 0.08f).compositeOver(surface)
+ }
+ TopAppBar(backgroundColor = appBarColor, contentColor = onSurface) {
+ IconButton(modifier = Modifier.align(Alignment.CenterVertically), onClick = onClose) {
+ Icon(Icons.Filled.Close, null)
+ }
+ FilterField(
+ filterText,
+ onFilter,
+ Modifier.fillMaxWidth().align(Alignment.CenterVertically)
+ )
+ }
+ }
+}
+
+/**
+ * [BasicTextField] that edits the current [filterText], providing [onFilter] when edited.
+ */
+@Composable
+@OptIn(ExperimentalFoundationApi::class)
+private fun FilterField(
+ filterText: String,
+ onFilter: (String) -> Unit,
+ modifier: Modifier = Modifier
+) {
+
+}
+
+/**
+ * [ListItem] that displays a [demo] and highlights any matches for [filterText] inside [Demo.title]
+ */
+@Composable
+@OptIn(ExperimentalMaterialApi::class)
+private fun FilteredDemoListItem(
+ demo: Demo,
+ filterText: String,
+ onNavigate: (Demo) -> Unit
+) {
+ val primary = MaterialTheme.colors.primary
+ val annotatedString = buildAnnotatedString {
+ val title = demo.title
+ var currentIndex = 0
+ val pattern = filterText.toRegex(option = RegexOption.IGNORE_CASE)
+ pattern.findAll(title).forEach { result ->
+ val index = result.range.first
+ if (index > currentIndex) {
+ append(title.substring(currentIndex, index))
+ currentIndex = index
+ }
+ withStyle(SpanStyle(color = primary)) {
+ append(result.value)
+ }
+ currentIndex = result.range.last + 1
+ }
+ if (currentIndex <= title.lastIndex) {
+ append(title.substring(currentIndex, title.length))
+ }
+ }
+ key(demo.title) {
+ ListItem(
+ text = {
+ Text(
+ modifier = Modifier.height(56.dp).wrapContentSize(Alignment.Center),
+ text = annotatedString
+ )
+ },
+ modifier = Modifier.clickable { onNavigate(demo) }
+ )
+ }
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/Demos.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/Demos.kt
new file mode 100644
index 000000000..1fae7da65
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/Demos.kt
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.demo
+
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.activity.ActivityDemos
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.animation.AnimationDemos
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation.FoundationDemos
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.general.GeneralDemos
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.layout.LayoutDemos
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.MaterialDemos
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.other.OtherDemos
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.ui.UIDemos
+
+
+/**
+ * [DemoCategory] containing all the top level demo categories.
+ */
+val AllDemosCategory = DemoCategory(
+ "Jetpack Compose Playground Demos",
+ listOf(
+ AnimationDemos,
+ FoundationDemos,
+ LayoutDemos,
+ MaterialDemos,
+ GeneralDemos,
+ OtherDemos,
+ ActivityDemos,
+ UIDemos
+ )
+)
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/Tags.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/Tags.kt
new file mode 100644
index 000000000..216db989c
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/demo/Tags.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.demo
+
+/**
+ * Tags used for testing
+ */
+object Tags {
+ const val AppBarTitle = "AppBarTitle"
+ const val FilterButton = "FilterButton"
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/activity/ActivityDemos.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/activity/ActivityDemos.kt
new file mode 100644
index 000000000..354038584
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/activity/ActivityDemos.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.activity
+
+
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.ComposableDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.DemoCategory
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.activity.backhandler.BackHandlerExample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.animation.crossfade.CrossfadeDemo
+
+
+val ActivityDemos = DemoCategory(
+ "Activity",
+ listOf(
+ ComposableDemo("BackHandler") { BackHandlerExample() }
+ )
+)
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/activity/backhandler/BackHandlerExample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/activity/backhandler/BackHandlerExample.kt
new file mode 100644
index 000000000..710274bc5
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/activity/backhandler/BackHandlerExample.kt
@@ -0,0 +1,16 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.activity.backhandler
+
+import androidx.activity.compose.BackHandler
+import androidx.compose.material.Text
+import androidx.compose.runtime.*
+
+//# --8<-- [start:func]
+@Composable
+fun BackHandlerExample() {
+ var backPressedCount by remember { mutableStateOf(0) }
+ BackHandler(enabled = true, onBack = {
+ backPressedCount += 1
+ })
+ Text(text="Backbutton was pressed : $backPressedCount times")
+}
+//# --8<-- [end:func]
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/androidview/embeddedAndroidViewDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/androidview/embeddedAndroidViewDemo.kt
new file mode 100644
index 000000000..7737201a2
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/androidview/embeddedAndroidViewDemo.kt
@@ -0,0 +1,63 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.androidview
+
+import android.view.ViewGroup.LayoutParams.MATCH_PARENT
+import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
+import android.widget.ImageView
+import android.widget.LinearLayout
+import android.widget.TextView
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.viewinterop.AndroidView
+import androidx.core.content.ContextCompat
+import de.jensklingenberg.jetpackcomposeplayground.R
+
+
+@Preview(showBackground = true)
+@Composable
+fun EmbeddedAndroidViewDemo() {
+ Column {
+ val state = remember { mutableStateOf(0) }
+
+ //widget.ImageView
+ AndroidView(factory = { ctx ->
+ ImageView(ctx).apply {
+ val drawable = ContextCompat.getDrawable(ctx, R.drawable.composelogo)
+ setImageDrawable(drawable)
+ }
+ })
+
+ //Compose Button
+ androidx.compose.material.Button(onClick = { state.value++ }) {
+ Text("MyComposeButton")
+ }
+
+ //widget.Button
+ AndroidView(factory = { ctx ->
+ //Here you can construct your View
+ android.widget.Button(ctx).apply {
+ text = "MyAndroidButton"
+ layoutParams = LinearLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT)
+ setOnClickListener {
+ state.value++
+ }
+ }
+ }, modifier = Modifier.padding(8.dp))
+
+ //widget.TextView
+ AndroidView(factory = { ctx ->
+ //Here you can construct your View
+ TextView(ctx).apply {
+ layoutParams = LinearLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT)
+ }
+ }, update = {
+ it.text = "You have clicked the buttons: " + state.value.toString() + " times"
+ })
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/animation/AnimationDemos.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/animation/AnimationDemos.kt
new file mode 100644
index 000000000..01e06a66b
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/animation/AnimationDemos.kt
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.animation
+
+
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.ComposableDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.DemoCategory
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.animation.crossfade.CrossfadeDemo
+
+
+val AnimationDemos = DemoCategory(
+ "Animation",
+ listOf(
+ ComposableDemo("CrossfadeDemo") { CrossfadeDemo() }
+ )
+)
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/animation/crossfade/CrossfadeDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/animation/crossfade/CrossfadeDemo.kt
new file mode 100644
index 000000000..50ec0ec47
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/animation/crossfade/CrossfadeDemo.kt
@@ -0,0 +1,42 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.animation.crossfade
+
+import androidx.compose.animation.Crossfade
+import androidx.compose.animation.core.tween
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.*
+import androidx.compose.material.Button
+import androidx.compose.material.ButtonDefaults
+import androidx.compose.material.Text
+import androidx.compose.runtime.*
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+
+
+enum class MyColors(val color: Color) {
+ Red(Color.Red), Green(Color.Green), Blue(Color.Blue)
+}
+
+@Preview(showBackground = true)
+@Composable
+fun CrossfadeDemo() {
+ var currentColor by remember { mutableStateOf(MyColors.Red) }
+ Column {
+ Row {
+ MyColors.values().forEach { myColors ->
+ Button(
+ onClick = { currentColor = myColors },
+ Modifier.weight(1f, true)
+ .height(48.dp).background(myColors.color),colors = ButtonDefaults.buttonColors(backgroundColor = myColors.color)
+ ) {
+ Text(myColors.name)
+ }
+ }
+ }
+ Crossfade(targetState = currentColor, animationSpec = tween(3000)) { selectedColor ->
+ Box(modifier = Modifier.fillMaxSize().background(selectedColor.color))
+ }
+ }
+}
+
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/cookbook/textfieldchange/HandleTextFieldChanges.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/cookbook/textfieldchange/HandleTextFieldChanges.kt
new file mode 100644
index 000000000..b2368e010
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/cookbook/textfieldchange/HandleTextFieldChanges.kt
@@ -0,0 +1,20 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.cookbook.textfieldchange
+
+
+import androidx.compose.foundation.ExperimentalFoundationApi
+import androidx.compose.material.TextField
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.text.input.TextFieldValue
+import androidx.compose.runtime.*
+
+@OptIn(ExperimentalFoundationApi::class)
+@Composable
+fun HandleTextFieldChanges() {
+ var textState by remember { mutableStateOf(TextFieldValue()) }
+
+ TextField(value = textState, onValueChange = {
+ textState = it
+ })
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/CanvasDrawExample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/CanvasDrawExample.kt
new file mode 100644
index 000000000..47f917287
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/CanvasDrawExample.kt
@@ -0,0 +1,32 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation
+
+import androidx.compose.foundation.Canvas
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.geometry.Size
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.tooling.preview.Preview
+
+@Preview(showBackground = true)
+@Composable
+fun CanvasDrawExample() {
+ Canvas(modifier = Modifier.fillMaxSize()) {
+ drawRect(Color.Blue, topLeft = Offset(0f, 0f), size = Size(this.size.width, 55f))
+ drawCircle(Color.Red, center = Offset(50f, 200f), radius = 40f)
+ drawLine(
+ Color.Green, Offset(20f, 0f),
+ Offset(200f, 200f), strokeWidth = 5f
+ )
+
+ drawArc(
+ Color.Black,
+ 0f,
+ 60f,
+ useCenter = true,
+ size = Size(300f, 300f),
+ topLeft = Offset(60f, 60f)
+ )
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/FoundationDemos.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/FoundationDemos.kt
new file mode 100644
index 000000000..888e5dd3c
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/FoundationDemos.kt
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation
+
+
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.ComposableDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.DemoCategory
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation.basictextfield.BasicTextFieldDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation.layout.BoxWithConstraintsDemo
+
+
+val FoundationDemos = DemoCategory(
+ "Foundation",
+ listOf(
+ ComposableDemo("BaseTextFieldDemo") { BasicTextFieldDemo() },
+ ComposableDemo("BoxWithConstraints") { BoxWithConstraintsDemo() },
+ ComposableDemo("Canvas") { CanvasDrawExample() },
+ ComposableDemo("LazyRowDemo") { LazyRowDemo() },
+ ComposableDemo("LazyColumnDemo") { LazyColumnDemo() },
+ ComposableDemo("LazyVerticalGridDemo") { LazyVerticalGridDemo() },
+ ComposableDemo("TextDemo") { TextExample() },
+ ComposableDemo("CircleShapeDemo") { ShapeDemo() },
+ ComposableDemo("ImageResourceDemo") { ImageResourceDemo() },
+
+ )
+)
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/ImageResourceDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/ImageResourceDemo.kt
new file mode 100644
index 000000000..ba43c97ec
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/ImageResourceDemo.kt
@@ -0,0 +1,15 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation
+
+import androidx.compose.foundation.Image
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.graphics.painter.Painter
+import androidx.compose.ui.res.painterResource
+import de.jensklingenberg.jetpackcomposeplayground.R
+
+
+@Composable
+fun ImageResourceDemo() {
+ val image: Painter = painterResource(id = R.drawable.composelogo)
+ Image(painter = image,contentDescription = "")
+}
+
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/LazyColumnDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/LazyColumnDemo.kt
new file mode 100644
index 000000000..f7806ba4d
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/LazyColumnDemo.kt
@@ -0,0 +1,48 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation
+
+import android.util.Log
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxHeight
+import androidx.compose.foundation.lazy.*
+import androidx.compose.foundation.shape.RoundedCornerShape
+
+import androidx.compose.material.Button
+import androidx.compose.material.Card
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.sp
+
+@Composable
+fun LazyColumnDemo() {
+ val list = listOf(
+ "A", "B", "C", "D"
+ ) + ((0..100).map { it.toString() })
+ LazyColumn(modifier = Modifier.fillMaxHeight()) {
+ items(items = list, itemContent = { item ->
+ Log.d("COMPOSE", "This get rendered $item")
+ when (item) {
+ "A" -> {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ "B" -> {
+ Button(onClick = {}) {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ }
+ "C" -> {
+ //Do Nothing
+ }
+ "D" -> {
+ Text(text = item)
+ }
+ else -> {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ }
+ })
+ }
+}
+
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/LazyRowDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/LazyRowDemo.kt
new file mode 100644
index 000000000..5cf72114c
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/LazyRowDemo.kt
@@ -0,0 +1,48 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation
+
+import android.util.Log
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxHeight
+import androidx.compose.foundation.lazy.*
+import androidx.compose.foundation.shape.RoundedCornerShape
+
+import androidx.compose.material.Button
+import androidx.compose.material.Card
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.sp
+
+@Composable
+fun LazyRowDemo() {
+ val list = listOf(
+ "A", "B", "C", "D"
+ ) + ((0..100).map { it.toString() })
+ LazyRow(modifier = Modifier.fillMaxHeight()) {
+ items(items = list, itemContent = { item ->
+ Log.d("COMPOSE", "This get rendered $item")
+ when (item) {
+ "A" -> {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ "B" -> {
+ Button(onClick = {}) {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ }
+ "C" -> {
+ //Do Nothing
+ }
+ "D" -> {
+ Text(text = item)
+ }
+ else -> {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ }
+ })
+ }
+}
+
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/LazyVerticalGridDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/LazyVerticalGridDemo.kt
new file mode 100644
index 000000000..7cde3bd29
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/LazyVerticalGridDemo.kt
@@ -0,0 +1,53 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation
+
+import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.lazy.grid.GridCells
+import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
+import androidx.compose.material.Card
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+
+@Composable
+fun LazyVerticalGridDemo(){
+ val list = (1..10).map { it.toString() }
+
+ LazyVerticalGrid(
+ columns = GridCells.Adaptive(128.dp),
+
+ // content padding
+ contentPadding = PaddingValues(
+ start = 12.dp,
+ top = 16.dp,
+ end = 12.dp,
+ bottom = 16.dp
+ ),
+ content = {
+ items(list.size) { index ->
+ Card(
+ backgroundColor = Color.Red,
+ modifier = Modifier
+ .padding(4.dp)
+ .fillMaxWidth(),
+ elevation = 8.dp,
+ ) {
+ Text(
+ text = list[index],
+ fontWeight = FontWeight.Bold,
+ fontSize = 30.sp,
+ color = Color(0xFFFFFFFF),
+ textAlign = TextAlign.Center,
+ modifier = Modifier.padding(16.dp)
+ )
+ }
+ }
+ }
+ )
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/ShapeDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/ShapeDemo.kt
new file mode 100644
index 000000000..1d71a1e7d
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/ShapeDemo.kt
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation
+
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.wrapContentSize
+import androidx.compose.foundation.shape.CircleShape
+import androidx.compose.foundation.shape.CutCornerShape
+import androidx.compose.foundation.shape.GenericShape
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Size
+import androidx.compose.ui.graphics.*
+import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.dp
+import androidx.compose.foundation.layout.*
+import androidx.compose.material.Text
+import androidx.compose.ui.draw.clip
+import androidx.compose.ui.unit.LayoutDirection
+
+@Composable
+fun CircleShapeDemo() {
+ BoxDemo(CircleShape)
+}
+
+@Composable
+fun ShapeDemo() {
+ Column {
+ Text("CircleShapeDemo:")
+ CircleShapeDemo()
+ Text("RoundedCornerShapeDemo:")
+ RoundedCornerShapeDemo()
+ Text("CutCornerShapeDemo:")
+ CutCornerShapeDemo()
+ Text("RectangleShapeDemo:")
+ RectangleShapeDemo()
+ Text("TriangleShapeDemo:")
+ TriangleShapeDemo()
+ }
+
+
+}
+
+@Composable
+fun BoxDemo(shape: Shape) {
+ Column(modifier = Modifier.fillMaxWidth().wrapContentSize(Alignment.Center).clip(shape)) {
+ Box(
+ modifier = Modifier.size(100.dp).background(Color.Red)
+ ) {
+
+ }
+ }
+}
+
+@Composable
+fun RoundedCornerShapeDemo() {
+ BoxDemo(shape = RoundedCornerShape(10.dp))
+}
+
+@Composable
+fun CutCornerShapeDemo() {
+ BoxDemo(shape = CutCornerShape(10.dp))
+}
+
+
+@Composable
+fun RectangleShapeDemo() {
+ BoxDemo(shape = RectangleShape)
+}
+
+@Composable
+fun TriangleShapeDemo() {
+ BoxDemo(shape = CustomShape())
+}
+
+
+/**
+ * You can draw custom shapes.
+ * Use a GenericShape.
+ */
+
+
+private val TriangleShape = GenericShape { size, direction ->
+ /**
+ *
+ Inside the GenericShape you can draw your custom shape.
+ You have access to the **size**-object. This is size of the composable that the shape is applied to.
+ You can get the height with **size.height.value** and the width with **size.width.value**
+
+
+ 1) Initially the painter will start at the top left of the parent composable(0x,0y).
+ With **moveTo()** you can set the coordinates of the painter. Here the coordinates will be set to the half width of the parent layout
+ and a 0y coordinate.
+
+ 2) This will draw a line from the painter coordinates, which were set in **1)**, to the bottom right corner of the parent layout.
+ The painter coordinates are then automatically set to this corner.
+
+ 3) This will draw a line to the bottom left corner. GenericShape will implicit execute the **close()**-function. **close()** will draw a line from the last painter coordinates to the first definied.
+ */
+
+ /**
+ * 1)
+ */
+ /**
+ *
+ Inside the GenericShape you can draw your custom shape.
+ You have access to the **size**-object. This is size of the composable that the shape is applied to.
+ You can get the height with **size.height.value** and the width with **size.width.value**
+
+
+ 1) Initially the painter will start at the top left of the parent composable(0x,0y).
+ With **moveTo()** you can set the coordinates of the painter. Here the coordinates will be set to the half width of the parent layout
+ and a 0y coordinate.
+
+ 2) This will draw a line from the painter coordinates, which were set in **1)**, to the bottom right corner of the parent layout.
+ The painter coordinates are then automatically set to this corner.
+
+ 3) This will draw a line to the bottom left corner. GenericShape will implicit execute the **close()**-function. **close()** will draw a line from the last painter coordinates to the first definied.
+ */
+
+
+ /**
+ * 1)
+ */
+ moveTo(size.width / 2f, 0f)
+ //This will draw a line from the cursor to the x/y coordinates
+
+ /**
+ * 2)
+ */
+
+ /**
+ * 2)
+ */
+ lineTo(size.width, size.height)
+
+ /**
+ * 3)
+ */
+
+ /**
+ * 3)
+ */
+ lineTo(0f, size.height)
+}
+
+
+class CustomShape : Shape {
+
+
+ override fun createOutline(
+ size: Size,
+ layoutDirection: LayoutDirection,
+ density: Density
+ ): Outline {
+ val path = Path().apply {
+ moveTo(size.width / 2f, 0f)
+ lineTo(size.width, size.height)
+ lineTo(0f, size.height)
+ close()
+ }
+ return Outline.Generic(path)
+
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/TextExample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/TextExample.kt
new file mode 100644
index 000000000..cc3b0ab15
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/TextExample.kt
@@ -0,0 +1,80 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation
+
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.text.font.FontFamily
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.text.style.TextDecoration
+
+@Composable
+fun TextExample(){
+ Column {
+ Text("Just Text")
+ Text("Text with cursive font", style = TextStyle(fontFamily = FontFamily.Cursive))
+ Text(
+ text = "Text with LineThrough",
+ style = TextStyle(textDecoration = TextDecoration.LineThrough)
+ )
+ Text(
+ text = "Text with underline",
+ style = TextStyle(textDecoration = TextDecoration.Underline)
+ )
+ Text(
+ text = "Text with underline, linethrough and bold",
+ style = TextStyle(
+ textDecoration = TextDecoration.combine(
+ listOf(
+ TextDecoration.Underline,
+ TextDecoration.LineThrough
+ )
+ ), fontWeight = FontWeight.Bold
+ )
+ )
+ }
+}
+
+
+@Composable
+fun NormalTextExample(){
+ Text("Just Text")
+}
+
+@Composable
+fun CursiveTextExample(){
+ Text("Text with cursive font", style = TextStyle(fontFamily = FontFamily.Cursive))
+}
+
+@Composable
+fun TextWithLineThroughExample(){
+ Text(
+ text = "Text with LineThrough",
+ style = TextStyle(textDecoration = TextDecoration.LineThrough)
+ )
+}
+
+@Composable
+fun TextWithUnderline(){
+ Text(
+ text = "Text with underline",
+ style = TextStyle(textDecoration = TextDecoration.Underline)
+ )
+}
+
+
+@Composable
+fun TextWithUnderlineStrikeThroughAndBold(){
+ Text(
+ text = "Text with underline, linethrough and bold",
+ style = TextStyle(
+ textDecoration = TextDecoration.combine(
+ listOf(
+ TextDecoration.Underline,
+ TextDecoration.LineThrough
+ )
+ ), fontWeight = FontWeight.Bold
+ )
+ )
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/basictextfield/BasicTextFieldDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/basictextfield/BasicTextFieldDemo.kt
new file mode 100644
index 000000000..410a42632
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/basictextfield/BasicTextFieldDemo.kt
@@ -0,0 +1,21 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation.basictextfield
+
+import androidx.activity.compose.BackHandler
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.text.BasicTextField
+import androidx.compose.material.Text
+import androidx.compose.runtime.*
+import androidx.compose.ui.text.input.TextFieldValue
+
+//# --8<-- [start:func]
+@Composable
+fun BasicTextFieldDemo() {
+ var textState by remember { mutableStateOf(TextFieldValue("Hello World")) }
+ Column {
+ BasicTextField(value = textState, onValueChange = {
+ textState = it
+ })
+ Text("The textfield has this text: " + textState.text)
+ }
+}
+//# --8<-- [end:func]
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/layout/BoxWithConstraintsExample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/layout/BoxWithConstraintsExample.kt
new file mode 100644
index 000000000..d5198c4bb
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/layout/BoxWithConstraintsExample.kt
@@ -0,0 +1,41 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation.layout
+
+import androidx.compose.foundation.layout.*
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+
+@Composable
+fun BoxWithConstraintsDemo() {
+ Column {
+ Column {
+ MyBoxWithConstraintsDemo()
+ }
+
+ Text("Here we set the size to 150.dp", modifier = Modifier.padding(top = 20.dp))
+ Column(modifier = Modifier.size(150.dp)) {
+ MyBoxWithConstraintsDemo()
+ }
+ }
+}
+
+@Composable
+private fun MyBoxWithConstraintsDemo() {
+ BoxWithConstraints {
+ val boxWithConstraintsScope = this
+ //You can use this scope to get the minWidth, maxWidth, minHeight, maxHeight in dp and constraints
+
+ Column {
+ if (boxWithConstraintsScope.maxHeight >= 200.dp) {
+ Text(
+ "This is only visible when the maxHeight is >= 200.dp",
+ style = TextStyle(fontSize = 20.sp)
+ )
+ }
+ Text("minHeight: ${boxWithConstraintsScope.minHeight}, maxHeight: ${boxWithConstraintsScope.maxHeight}, minWidth: ${boxWithConstraintsScope.minWidth} maxWidth: ${boxWithConstraintsScope.maxWidth}")
+ }
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/layout/SpacerDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/layout/SpacerDemo.kt
new file mode 100644
index 000000000..49ee5cfaf
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/foundation/layout/SpacerDemo.kt
@@ -0,0 +1,21 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation.layout
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.size
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun SpacerDemo() {
+ Column {
+ Text("Hello")
+ Spacer(
+ modifier = Modifier
+ .size(30.dp)
+ )
+ Text("World")
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/CompositionLocalExample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/CompositionLocalExample.kt
new file mode 100644
index 000000000..73e5a4b03
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/CompositionLocalExample.kt
@@ -0,0 +1,43 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.general
+
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import androidx.compose.foundation.layout.Column
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.runtime.compositionLocalOf
+
+
+data class User(val name: String, val age: Int)
+
+val LocalActiveUser = compositionLocalOf { error("No user found!") }
+
+class MainActivity : ComponentActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ setContent {
+ MyUserScreen()
+ }
+ }
+}
+
+@Composable
+private fun MyUserScreen() {
+ val user = User("Jens", 31)
+ CompositionLocalProvider(LocalActiveUser provides user) {
+ UserInfo()
+ }
+}
+
+
+@Composable
+fun UserInfo() {
+ Column {
+ Text("Name: " + LocalActiveUser.current.name)
+ Text("Age: " + LocalActiveUser.current.age)
+ }
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/GeneralDemos.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/GeneralDemos.kt
new file mode 100644
index 000000000..6c045d448
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/GeneralDemos.kt
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.general
+
+
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.ComposableDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.DemoCategory
+
+
+val GeneralDemos = DemoCategory(
+ "General",
+ listOf(
+ ComposableDemo("LifecycleDemo") { LifecycleDemo() },
+ ComposableDemo("PaddingDemo") { PaddingDemo() },
+ )
+)
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/LifecycleDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/LifecycleDemo.kt
new file mode 100644
index 000000000..44feaefd5
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/LifecycleDemo.kt
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.general
+
+
+import android.util.Log
+import androidx.compose.foundation.layout.Column
+import androidx.compose.material.Button
+import androidx.compose.material.Text
+import androidx.compose.runtime.*
+
+
+@Composable
+fun LifecycleDemo() {
+
+ val count = remember { mutableStateOf(0) }
+
+ Column {
+ Button(onClick = {
+ count.value++
+ }) {
+ Text("Click me")
+ }
+
+ if (count.value < 3) {
+ SideEffect {
+ Log.d("Compose", "onactive with value: " + count.value)
+ }
+ DisposableEffect(Unit) {
+ onDispose {
+ Log.d("Compose", "onDispose because value=" + count.value)
+ }
+ }
+
+ Text(text = "You have clicked the button: " + count.value.toString())
+ }
+ }
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/PaddingDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/PaddingDemo.kt
new file mode 100644
index 000000000..50c50e1ef
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/general/PaddingDemo.kt
@@ -0,0 +1,29 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.general
+
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+
+
+@Composable
+fun PaddingDemo() {
+
+ Column {
+ Text("TextWithoutPadding")
+ Column(modifier = Modifier.padding(start = 80.dp)){
+ Text("TextWith80dpOnlyLeftPadding")
+
+ }
+
+
+ Column(Modifier.padding(all = 80.dp)){
+ Text("TextWith80dpPadding")
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/BoxExample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/BoxExample.kt
new file mode 100644
index 000000000..5f5e1f1b8
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/BoxExample.kt
@@ -0,0 +1,35 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.layout
+
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.*
+import androidx.compose.material.FloatingActionButton
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+
+
+@Preview(showBackground = true)
+//# --8<-- [start:func]
+@Composable
+fun BoxExample() {
+ Box(Modifier.fillMaxSize()) {
+ Text("This text is drawn first", modifier = Modifier.align(Alignment.TopCenter))
+ Box(
+ Modifier.align(Alignment.TopCenter).fillMaxHeight().width(
+ 50.dp
+ ).background( Color.Blue)
+ )
+ Text("This text is drawn last", modifier = Modifier.align(Alignment.Center))
+ FloatingActionButton(
+ modifier = Modifier.align(Alignment.BottomEnd).padding(12.dp),
+ onClick = {}
+ ) {
+ Text("+")
+ }
+ }
+}
+//# --8<-- [end:func]
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/ColumnExample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/ColumnExample.kt
new file mode 100644
index 000000000..8cc09f636
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/ColumnExample.kt
@@ -0,0 +1,30 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.layout
+
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+
+
+
+
+@Composable
+fun ColumnDemo() {
+
+ MaterialTheme {
+ ColumnExample()
+ }
+
+}
+
+@Composable
+fun ColumnExample() {
+
+ Column {
+ Text(text = " Hello World!")
+ Text(text = " Hello World!2")
+ }
+
+
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/ConstraintLayoutDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/ConstraintLayoutDemo.kt
new file mode 100644
index 000000000..96652122e
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/ConstraintLayoutDemo.kt
@@ -0,0 +1,47 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.layout
+
+
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.unit.dp
+import androidx.constraintlayout.compose.ConstraintLayout
+
+
+@Composable
+fun ConstraintLayoutDemo() {
+ ConstraintLayout(modifier = Modifier.size(200.dp)) {
+ val (redBox, blueBox, yellowBox, text) = createRefs()
+
+ Box(modifier = Modifier
+ .size(50.dp)
+ .background(Color.Red)
+ .constrainAs(redBox) {})
+
+ Box(modifier = Modifier
+ .size(50.dp)
+ .background(Color.Blue)
+ .constrainAs(blueBox) {
+ top.linkTo(redBox.bottom)
+ start.linkTo(redBox.end)
+ })
+
+ Box(modifier = Modifier
+ .size(50.dp)
+ .background(Color.Yellow)
+ .constrainAs(yellowBox) {
+ bottom.linkTo(blueBox.bottom)
+ start.linkTo(blueBox.end, 20.dp)
+ })
+
+ Text("Hello World", modifier = Modifier.constrainAs(text) {
+ top.linkTo(parent.top)
+ start.linkTo(yellowBox.start)
+ })
+
+ }
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/LayoutDemos.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/LayoutDemos.kt
new file mode 100644
index 000000000..ef9fc46af
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/LayoutDemos.kt
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.layout
+
+
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.ComposableDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.DemoCategory
+
+
+val LayoutDemos = DemoCategory(
+ "LayoutDemos",
+ listOf(
+ ComposableDemo("BoxExample") { BoxExample() },
+ ComposableDemo("ConstraintLayoutDemo") { ConstraintLayoutDemo() },
+
+ ComposableDemo("ColumnExample") { ColumnExample() },
+ ComposableDemo("RowExample") { RowExample() },
+ )
+)
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/RowExample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/RowExample.kt
new file mode 100644
index 000000000..73bd0ad9f
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/RowExample.kt
@@ -0,0 +1,23 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.layout
+
+import androidx.compose.foundation.layout.Row
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+
+
+@Composable
+fun RowDemo() {
+ MaterialTheme {
+ RowExample()
+ }
+
+}
+
+@Composable
+fun RowExample() {
+ Row {
+ Text(text = " Hello World!", style = (MaterialTheme.typography).body1)
+ Text(text = " Hello World!2", style = (MaterialTheme.typography).body1)
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/MaterialDemos.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/MaterialDemos.kt
new file mode 100644
index 000000000..de936d1a7
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/MaterialDemos.kt
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material
+
+
+import SnackbarDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.ComposableDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.DemoCategory
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.button.ButtonExample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.card.CardDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.checkbox.CheckBoxDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.circularprogress.CircularProgressIndicatorSample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.dropdown.DropdownDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.floatingactionbutton.FloatingActionButtonDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.linearprogress.LinearProgressIndicatorSample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.modaldrawer.ModalDrawerSample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.radiobutton.RadioButtonSample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.alertdialog.AlertDialogSample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.appbar.topappbar.TopAppBarSample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.button.ProgressButtonExample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.divider.DividerExample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.modalbottomsheetlayout.ModalBottomSheetSample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.navigationrail.NavigationRailSample
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.scaffold.ScaffoldDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.surface.SurfaceDemo
+
+
+val MaterialDemos = DemoCategory(
+ "MaterialDemos",
+ listOf(
+ ComposableDemo("AlertDialogSample") { AlertDialogSample() },
+ ComposableDemo("ButtonExample") { ButtonExample() },
+ ComposableDemo("ProgressButtonExample") { ProgressButtonExample() },
+ ComposableDemo("CardDemo") { CardDemo() },
+ ComposableDemo("CheckBoxDemo") { CheckBoxDemo() },
+ ComposableDemo("CircularProgressIndicatorSample") { CircularProgressIndicatorSample() },
+ ComposableDemo("Divider") { DividerExample() },
+ ComposableDemo("DropdownDemo") { DropdownDemo() },
+ ComposableDemo("FloatingActionButtonDemo") { FloatingActionButtonDemo() },
+ ComposableDemo("LinearProgressIndicatorSample") { LinearProgressIndicatorSample() },
+ ComposableDemo("ModalBottomSheetSample") { ModalBottomSheetSample() },
+ ComposableDemo("ModalDrawerLayoutSample") { ModalDrawerSample() },
+ ComposableDemo("NavigationRailSample") { NavigationRailSample() },
+ ComposableDemo("RadioButtonSample") { RadioButtonSample() },
+ ComposableDemo("ScaffoldDemo") { ScaffoldDemo() },
+ ComposableDemo("SnackbarDemo") { SnackbarDemo() },
+ ComposableDemo("SurfaceDemo") { SurfaceDemo() },
+ ComposableDemo("TopAppBarSample") { TopAppBarSample() },
+
+ )
+)
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/alertdialog/AlertDialogSample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/alertdialog/AlertDialogSample.kt
new file mode 100644
index 000000000..cd207555d
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/alertdialog/AlertDialogSample.kt
@@ -0,0 +1,61 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.alertdialog
+
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.material.*
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+
+
+@Composable
+fun AlertDialogSample() {
+ MaterialTheme {
+ Column {
+ val openDialog = remember { mutableStateOf(false) }
+
+ Button(onClick = {
+ openDialog.value = true
+ }) {
+ Text("Click me")
+ }
+
+ if (openDialog.value) {
+
+ AlertDialog(
+ onDismissRequest = {
+ // Dismiss the dialog when the user clicks outside the dialog or on the back
+ // button. If you want to disable that functionality, simply use an empty
+ // onCloseRequest.
+ openDialog.value = false
+ },
+ title = {
+ Text(text = "Dialog Title")
+ },
+ text = {
+ Text("Here is a text ")
+ },
+ confirmButton = {
+ Button(
+
+ onClick = {
+ openDialog.value = false
+ }) {
+ Text("This is the Confirm Button")
+ }
+ },
+ dismissButton = {
+ Button(
+
+ onClick = {
+ openDialog.value = false
+ }) {
+ Text("This is the dismiss Button")
+ }
+ }
+ )
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/appbar/topappbar/TopAppBarSample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/appbar/topappbar/TopAppBarSample.kt
new file mode 100644
index 000000000..ebe4e233f
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/appbar/topappbar/TopAppBarSample.kt
@@ -0,0 +1,37 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.appbar.topappbar
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.material.*
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.ArrowBack
+import androidx.compose.material.icons.filled.Settings
+import androidx.compose.material.icons.filled.Share
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun TopAppBarSample(){
+ Column {
+ TopAppBar(
+ elevation = 4.dp,
+ title = {
+ Text("I'm a TopAppBar")
+ },
+ backgroundColor = MaterialTheme.colors.primarySurface,
+ navigationIcon = {
+ IconButton(onClick = {/* Do Something*/ }) {
+ Icon(Icons.Filled.ArrowBack, null)
+ }
+ }, actions = {
+ IconButton(onClick = {/* Do Something*/ }) {
+ Icon(Icons.Filled.Share, null)
+ }
+ IconButton(onClick = {/* Do Something*/ }) {
+ Icon(Icons.Filled.Settings, null)
+ }
+ })
+
+ Text("Hello World")
+
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/badgebox/BadgeBoxDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/badgebox/BadgeBoxDemo.kt
new file mode 100644
index 000000000..0a2e321ea
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/badgebox/BadgeBoxDemo.kt
@@ -0,0 +1,27 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.badgebox
+
+import androidx.compose.material.*
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Favorite
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.tooling.preview.Preview
+
+@OptIn(ExperimentalMaterialApi::class)
+@Preview
+@Composable
+fun BadgeBoxDemo() {
+ BottomNavigation {
+ BottomNavigationItem(
+ icon = {
+ BadgedBox(badge = { Badge { Text("8") } }) {
+ Icon(
+ Icons.Filled.Favorite,
+ contentDescription = "Favorite"
+ )
+ }
+
+ },
+ selected = false,
+ onClick = {})
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/button/ButtonExample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/button/ButtonExample.kt
new file mode 100644
index 000000000..030034e06
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/button/ButtonExample.kt
@@ -0,0 +1,102 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.button
+
+import androidx.compose.animation.core.animateFloatAsState
+import androidx.compose.foundation.layout.*
+import androidx.compose.material.*
+import androidx.compose.material.OutlinedButton
+import androidx.compose.material.R
+import androidx.compose.runtime.*
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.graphicsLayer
+import androidx.compose.ui.res.colorResource
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun ButtonExample() {
+ Button(
+ onClick = { /* Do something! */ }, colors = ButtonDefaults.textButtonColors(
+ backgroundColor = Color.Red
+ )
+ ) {
+ Text("Button")
+ }
+}
+
+@Composable
+fun OutlinedButtonExample() {
+ OutlinedButton(onClick = { /* Do something! */ }) {
+ Text("I'm an Outlined Button")
+ }
+}
+
+@Composable
+fun TextButtonExample() {
+ TextButton(onClick = { /* Do something! */ }) {
+ Text("I'm a Text Button")
+ }
+}
+
+
+@Composable
+fun ProgressButtonExample() {
+ var loading by remember {
+ mutableStateOf(false)
+ }
+ Box() {
+ ProgressButton(
+ onClick = { loading = !loading },
+ modifier = Modifier
+ .padding(16.dp)
+ .height(46.dp)
+ .align(Alignment.Center),
+ loading = loading,
+ color = Color.Black,
+ progressColor = Color.White
+ ) {
+ Text(
+ color = Color.White,
+ text = "Refresh"
+ )
+ }
+ }
+}
+
+@Composable
+fun ProgressButton(
+ onClick: () -> Unit,
+ modifier: Modifier = Modifier,
+ loading: Boolean = false,
+ color: Color,
+ progressColor: Color,
+ content: @Composable () -> Unit,
+) {
+ val contentAlpha by animateFloatAsState(targetValue = if (loading) 0f else 1f)
+ val loadingAlpha by animateFloatAsState(targetValue = if (loading) 1f else 0f)
+ Button(
+ onClick = onClick,
+ modifier = modifier,
+ colors = ButtonDefaults.buttonColors(backgroundColor = color),
+ ) {
+ Box(
+ modifier = Modifier
+ .fillMaxWidth()
+ .wrapContentHeight(),
+ contentAlignment = Alignment.Center,
+ ) {
+ CircularProgressIndicator(
+ modifier = Modifier
+ .size(size = 16.dp)
+ .graphicsLayer { alpha = loadingAlpha },
+ color = progressColor,
+ strokeWidth = 2.dp,
+ )
+ Box(
+ modifier = Modifier.graphicsLayer { alpha = contentAlpha }
+ ) {
+ content()
+ }
+ }
+ }
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/card/CardDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/card/CardDemo.kt
new file mode 100644
index 000000000..023a86c92
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/card/CardDemo.kt
@@ -0,0 +1,50 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.card
+
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.Card
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.SpanStyle
+import androidx.compose.ui.text.buildAnnotatedString
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.text.withStyle
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun CardDemo() {
+ Card(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(15.dp)
+ .clickable{ },
+ elevation = 10.dp
+ ) {
+ Column(
+ modifier = Modifier.padding(15.dp)
+ ) {
+ Text(
+ buildAnnotatedString {
+ append("welcome to ")
+ withStyle(style = SpanStyle(fontWeight = FontWeight.W900, color = Color(0xFF4552B8))
+ ) {
+ append("Jetpack Compose Playground")
+ }
+ }
+ )
+ Text(
+ buildAnnotatedString {
+ append("Now you are in the ")
+ withStyle(style = SpanStyle(fontWeight = FontWeight.W900)) {
+ append("Card")
+ }
+ append(" section")
+ }
+ )
+ }
+ }
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/checkbox/CheckBoxDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/checkbox/CheckBoxDemo.kt
new file mode 100644
index 000000000..7334bae06
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/checkbox/CheckBoxDemo.kt
@@ -0,0 +1,16 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.checkbox
+
+import androidx.compose.material.Checkbox
+import androidx.compose.material.MaterialTheme
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+
+@Composable
+fun CheckBoxDemo() {
+ val checkedState = remember { mutableStateOf(true) }
+ Checkbox(
+ checked = checkedState.value,
+ onCheckedChange = { checkedState.value = it }
+ )
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/circularprogress/CircularProgressIndicatorSample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/circularprogress/CircularProgressIndicatorSample.kt
new file mode 100644
index 000000000..90d295ca9
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/circularprogress/CircularProgressIndicatorSample.kt
@@ -0,0 +1,49 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.circularprogress
+
+
+import androidx.compose.animation.core.animateFloatAsState
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.height
+import androidx.compose.material.CircularProgressIndicator
+import androidx.compose.material.OutlinedButton
+import androidx.compose.material.ProgressIndicatorDefaults
+import androidx.compose.material.Text
+import androidx.compose.runtime.*
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun CircularProgressIndicatorSample() {
+ var progress by remember { mutableStateOf(0.1f) }
+ val animatedProgress = animateFloatAsState(
+ targetValue = progress,
+ animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec
+ ).value
+
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Spacer(Modifier.height(30.dp))
+ Text("CircularProgressIndicator with undefined progress")
+ CircularProgressIndicator()
+ Spacer(Modifier.height(30.dp))
+ Text("CircularProgressIndicator with progress set by buttons")
+ CircularProgressIndicator(progress = animatedProgress)
+ Spacer(Modifier.height(30.dp))
+ OutlinedButton(
+ onClick = {
+ if (progress < 1f) progress += 0.1f
+ }
+ ) {
+ Text("Increase")
+ }
+
+ OutlinedButton(
+ onClick = {
+ if (progress > 0f) progress -= 0.1f
+ }
+ ) {
+ Text("Decrease")
+ }
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/divider/DividerDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/divider/DividerDemo.kt
new file mode 100644
index 000000000..36b9985b1
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/divider/DividerDemo.kt
@@ -0,0 +1,19 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.divider
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.material.Divider
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+
+@Preview
+@Composable
+fun DividerExample(){
+ Column {
+ Text("Foo")
+ Divider(startIndent = 8.dp, thickness = 1.dp, color = Color.Black)
+ Text("Bar")
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/dropdown/DropdownDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/dropdown/DropdownDemo.kt
new file mode 100644
index 000000000..fe4178e77
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/dropdown/DropdownDemo.kt
@@ -0,0 +1,49 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.dropdown
+
+import androidx.compose.foundation.background
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.wrapContentSize
+import androidx.compose.material.*
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.MoreVert
+import androidx.compose.runtime.*
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.tooling.preview.Preview
+
+@Preview
+@Composable
+fun DropdownDemo() {
+ var expanded by remember { mutableStateOf(false) }
+ val items = listOf("A", "B", "C", "D", "E", "F")
+ val disabledValue = "B"
+ var selectedIndex by remember { mutableStateOf(0) }
+ Box(modifier = Modifier.fillMaxSize().wrapContentSize(Alignment.TopStart)) {
+ Text(items[selectedIndex],modifier = Modifier.fillMaxWidth().clickable(onClick = { expanded = true }).background(
+ Color.Gray))
+ DropdownMenu(
+ expanded = expanded,
+ onDismissRequest = { expanded = false },
+ modifier = Modifier.fillMaxWidth().background(
+ Color.Red)
+ ) {
+ items.forEachIndexed { index, s ->
+ DropdownMenuItem(onClick = {
+ selectedIndex = index
+ expanded = false
+ }) {
+ val disabledText = if (s == disabledValue) {
+ " (Disabled)"
+ } else {
+ ""
+ }
+ Text(text = s + disabledText)
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/floatingactionbutton/FabDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/floatingactionbutton/FabDemo.kt
new file mode 100644
index 000000000..fe9fa3e54
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/floatingactionbutton/FabDemo.kt
@@ -0,0 +1,25 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.floatingactionbutton
+
+import androidx.compose.material.*
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Favorite
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun FloatingActionButtonDemo() {
+ FloatingActionButton(onClick = { /*do something*/}) {
+ Text("FloatingActionButton")
+ }
+}
+
+@Composable
+fun ExtendedFloatingActionButtonDemo() {
+ ExtendedFloatingActionButton(
+ icon = { Icon(Icons.Filled.Favorite,"") },
+ text = { Text("FloatingActionButton") },
+ onClick = { /*do something*/ },
+ elevation = FloatingActionButtonDefaults.elevation(8.dp)
+ )
+}
+
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/linearprogress/LinearProgressIndicatorSample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/linearprogress/LinearProgressIndicatorSample.kt
new file mode 100644
index 000000000..c59a6c42e
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/linearprogress/LinearProgressIndicatorSample.kt
@@ -0,0 +1,47 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.linearprogress
+
+import androidx.compose.animation.core.animateFloatAsState
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.height
+import androidx.compose.material.*
+import androidx.compose.runtime.*
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun LinearProgressIndicatorSample() {
+ var progress by remember { mutableStateOf(0.1f) }
+ val animatedProgress = animateFloatAsState(
+ targetValue = progress,
+ animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec
+ ).value
+
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+
+ Spacer(Modifier.height(30.dp))
+ Text("LinearProgressIndicator with undefined progress")
+ LinearProgressIndicator()
+ Spacer(Modifier.height(30.dp))
+ Text("LinearProgressIndicator with progress set by buttons")
+ LinearProgressIndicator(progress = animatedProgress)
+ Spacer(Modifier.height(30.dp))
+ OutlinedButton(
+ onClick = {
+ if (progress < 1f) progress += 0.1f
+ }
+ ) {
+ Text("Increase")
+ }
+
+ OutlinedButton(
+ onClick = {
+ if (progress > 0f) progress -= 0.1f
+ }
+ ) {
+ Text("Decrease")
+ }
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/modalbottomsheetlayout/ModalBottomSheetLayout.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/modalbottomsheetlayout/ModalBottomSheetLayout.kt
new file mode 100644
index 000000000..487fcd20b
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/modalbottomsheetlayout/ModalBottomSheetLayout.kt
@@ -0,0 +1,50 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.modalbottomsheetlayout
+
+import androidx.compose.foundation.layout.*
+import androidx.compose.foundation.lazy.LazyColumn
+import androidx.compose.material.*
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Favorite
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import kotlinx.coroutines.launch
+
+
+@Composable
+@OptIn(ExperimentalMaterialApi::class)
+fun ModalBottomSheetSample() {
+ val state = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden)
+ val scope = rememberCoroutineScope()
+ ModalBottomSheetLayout(
+ sheetState = state,
+ sheetContent = {
+ LazyColumn {
+ items(50) {
+ ListItem(
+ text = { Text("Item $it") },
+ icon = {
+ Icon(
+ Icons.Default.Favorite,
+ contentDescription = "Localized description"
+ )
+ }
+ )
+ }
+ }
+ }
+ ) {
+ Column(
+ modifier = Modifier.fillMaxSize().padding(16.dp),
+ horizontalAlignment = Alignment.CenterHorizontally
+ ) {
+ Text("Rest of the UI")
+ Spacer(Modifier.height(20.dp))
+ Button(onClick = { scope.launch { state.show() } }) {
+ Text("Click to show sheet")
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/modaldrawer/ModalDrawerSample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/modaldrawer/ModalDrawerSample.kt
new file mode 100644
index 000000000..d96525e6a
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/modaldrawer/ModalDrawerSample.kt
@@ -0,0 +1,43 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.modaldrawer
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.material.*
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.rememberCoroutineScope
+import kotlinx.coroutines.launch
+
+@Composable
+fun ModalDrawerSample() {
+ val drawerState = rememberDrawerState(DrawerValue.Closed)
+ val scope = rememberCoroutineScope()
+
+ ModalDrawer(
+ drawerState = drawerState,
+ drawerContent = {
+ Column {
+ Text("Text in Drawer")
+ Button(onClick = {
+ scope.launch {
+ drawerState.close()
+ }
+ }) {
+ Text("Close Drawer")
+ }
+ }
+ },
+ content = {
+ Column {
+ Text("Text in Bodycontext")
+ Button(onClick = {
+
+ scope.launch {
+ drawerState.open()
+ }
+
+ }) {
+ Text("Click to open")
+ }
+ }
+ }
+ )
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/navigationrail/NavigationRailSample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/navigationrail/NavigationRailSample.kt
new file mode 100644
index 000000000..648fd1c5a
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/navigationrail/NavigationRailSample.kt
@@ -0,0 +1,63 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.navigationrail
+
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.Icon
+import androidx.compose.material.NavigationRail
+import androidx.compose.material.NavigationRailItem
+import androidx.compose.material.Text
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Home
+import androidx.compose.material.icons.filled.Search
+import androidx.compose.material.icons.filled.Settings
+import androidx.compose.runtime.*
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.vector.ImageVector
+import androidx.compose.ui.unit.dp
+
+enum class Page(val title:String, val content: String){
+ HOME("home","Show only icon"),
+ SEARCH("Search","Show icon with label"),
+ SETTINGS("Settings","Show icon /Show the label only when selected")
+}
+
+@Composable
+fun NavigationRailSample() {
+ var selectedItem by remember { mutableStateOf(0) }
+ val pages = Page.values()
+ val icons = listOf(Icons.Filled.Home, Icons.Filled.Search, Icons.Filled.Settings)
+ Row {
+ NavigationRail {
+ pages.forEachIndexed { index, item ->
+ when(item){
+ Page.HOME -> {
+ NavigationRailItem(
+ icon = { Icon(icons[index], contentDescription = "") },
+ selected = selectedItem == index,
+ onClick = { selectedItem = index }
+ )
+ }
+ Page.SEARCH -> {
+ NavigationRailItem(
+ label = { Text(item.title) },
+ icon = { Icon(icons[index], contentDescription = "") },
+ selected = selectedItem == index,
+ onClick = { selectedItem = index }
+ )
+ }
+ Page.SETTINGS -> {
+ NavigationRailItem(
+ label = { Text(item.title) },
+ icon = { Icon(icons[index], contentDescription = "") },
+ selected = selectedItem == index,
+ onClick = { selectedItem = index },
+ alwaysShowLabel = false
+ )
+ }
+ }
+ }
+ }
+
+ Text(pages[selectedItem].content, Modifier.padding(start = 8.dp))
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/radiobutton/RadioButtonSample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/radiobutton/RadioButtonSample.kt
new file mode 100644
index 000000000..1352548be
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/radiobutton/RadioButtonSample.kt
@@ -0,0 +1,49 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.radiobutton
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.selection.selectable
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.RadioButton
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+
+
+@Composable
+fun RadioButtonSample() {
+ val radioOptions = listOf("A", "B", "C")
+ val (selectedOption, onOptionSelected) = remember { mutableStateOf(radioOptions[1] ) }
+ Column {
+ radioOptions.forEach { text ->
+ Row(
+ Modifier
+ .fillMaxWidth()
+ .selectable(
+ selected = (text == selectedOption),
+ onClick = {
+ onOptionSelected
+ (text)
+ }
+ )
+ .padding(horizontal = 16.dp)
+ ) {
+ RadioButton(
+ selected = (text == selectedOption),
+ onClick = { onOptionSelected(text) }
+ )
+ Text(
+ text = text,
+ style = MaterialTheme.typography.body1.merge(),
+ modifier = Modifier.padding(start = 16.dp)
+ )
+ }
+ }
+ }
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/scaffold/ScaffoldDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/scaffold/ScaffoldDemo.kt
new file mode 100644
index 000000000..79f708416
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/scaffold/ScaffoldDemo.kt
@@ -0,0 +1,26 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.scaffold
+
+import androidx.compose.material.*
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.graphics.Color
+
+
+@Composable
+fun ScaffoldDemo() {
+ val materialBlue700= Color(0xFF1976D2)
+ val scaffoldState = rememberScaffoldState(rememberDrawerState(DrawerValue.Open))
+ Scaffold(
+ scaffoldState = scaffoldState,
+ topBar = { TopAppBar(title = {Text("TopAppBar")},backgroundColor = materialBlue700) },
+ floatingActionButtonPosition = FabPosition.End,
+ floatingActionButton = { FloatingActionButton(onClick = {}){
+ Text("X")
+ } },
+ drawerContent = { Text(text = "drawerContent") },
+ content = {
+
+ Text("BodyContent") },
+ bottomBar = { BottomAppBar(backgroundColor = materialBlue700) { Text("BottomAppBar") } }
+ )
+}
+
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/slider/MySliderDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/slider/MySliderDemo.kt
new file mode 100644
index 000000000..b615f2300
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/slider/MySliderDemo.kt
@@ -0,0 +1,11 @@
+
+import androidx.compose.material.Slider
+import androidx.compose.material.Text
+import androidx.compose.runtime.*
+
+@Composable
+fun MySliderDemo() {
+ var sliderPosition by remember { mutableStateOf(0f) }
+ Text(text = sliderPosition.toString())
+ Slider(value = sliderPosition, onValueChange = { sliderPosition = it })
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/snackbar/SnackbarDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/snackbar/SnackbarDemo.kt
new file mode 100644
index 000000000..0b1bedbbd
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/snackbar/SnackbarDemo.kt
@@ -0,0 +1,37 @@
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.Button
+import androidx.compose.material.Snackbar
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun SnackbarDemo() {
+ Column {
+ val (snackbarVisibleState, setSnackBarState) = remember { mutableStateOf(false) }
+
+ Button(onClick = { setSnackBarState(!snackbarVisibleState) }) {
+ if (snackbarVisibleState) {
+ Text("Hide Snackbar")
+ } else {
+ Text("Show Snackbar")
+ }
+ }
+ if (snackbarVisibleState) {
+ Snackbar(
+
+ action = {
+ Button(onClick = {}) {
+ Text("MyAction")
+ }
+ },
+ modifier = Modifier.padding(8.dp)
+ ) { Text(text = "This is a snackbar!") }
+ }
+ }
+}
+
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/surface/SurfaceDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/surface/SurfaceDemo.kt
new file mode 100644
index 000000000..14235b9bc
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/surface/SurfaceDemo.kt
@@ -0,0 +1,24 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.surface
+
+import androidx.compose.foundation.BorderStroke
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.shape.CircleShape
+import androidx.compose.material.Surface
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.unit.dp
+
+@Composable
+fun SurfaceDemo() {
+ Surface(
+ modifier = Modifier.padding(8.dp),
+ border = BorderStroke(2.dp, Color.Red),
+ contentColor = Color.Blue,
+ elevation = 8.dp,
+ shape = CircleShape
+ ) {
+ Text("Hello World", modifier = Modifier.padding(8.dp))
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/switch/SwitchDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/switch/SwitchDemo.kt
new file mode 100644
index 000000000..25713ecc1
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/switch/SwitchDemo.kt
@@ -0,0 +1,21 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.switch
+
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.Switch
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+
+
+
+@Composable
+fun SwitchDemo() {
+ MaterialTheme {
+ val checkedState = remember { mutableStateOf(true) }
+ Switch(
+ checked = checkedState.value,
+ onCheckedChange = { checkedState.value = it }
+ )
+ }
+}
+
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/textfield/TextFieldDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/textfield/TextFieldDemo.kt
new file mode 100644
index 000000000..4a79dc5c4
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/material/textfield/TextFieldDemo.kt
@@ -0,0 +1,25 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.material.textfield
+
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.Text
+import androidx.compose.material.TextField
+import androidx.compose.runtime.*
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.input.TextFieldValue
+
+@Composable
+fun TextFieldDemo() {
+ Column(Modifier.padding(16.dp)) {
+ val textState = remember { mutableStateOf(TextFieldValue()) }
+ TextField(
+ value = textState.value,
+ onValueChange = { textState.value = it }
+ )
+ Text("The textfield has this text: " + textState.value.text)
+ }
+}
+
+
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/other/AndroidContextComposeDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/other/AndroidContextComposeDemo.kt
new file mode 100644
index 000000000..1837b1b48
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/other/AndroidContextComposeDemo.kt
@@ -0,0 +1,16 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.other
+
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.platform.LocalContext
+import de.jensklingenberg.jetpackcomposeplayground.R
+
+
+@Composable
+fun AndroidContextComposeDemo() {
+ MaterialTheme {
+ val context = LocalContext.current
+ Text(text = "Read this string from Context: "+context.getString(R.string.app_name))
+ }
+}
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/other/GeneralDemos.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/other/GeneralDemos.kt
new file mode 100644
index 000000000..ff5bd4417
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/other/GeneralDemos.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.other
+
+
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.ComposableDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.DemoCategory
+
+
+val OtherDemos = DemoCategory(
+ "Other",
+ listOf(
+ ComposableDemo("TextFieldDemo") { TextFieldDemo() },
+ )
+)
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/other/TextFieldDemo.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/other/TextFieldDemo.kt
new file mode 100644
index 000000000..1bdbe1cf2
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/other/TextFieldDemo.kt
@@ -0,0 +1,20 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.other
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.text.BasicTextField
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.text.input.TextFieldValue
+
+
+@Composable
+fun TextFieldDemo() {
+ Column {
+ var state = TextFieldValue("")
+ BasicTextField(
+ value = state,
+ onValueChange = {value-> state= value }
+ )
+ Text("The textfield has this text: "+state)
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/testing/TestLayout.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/testing/TestLayout.kt
new file mode 100644
index 000000000..d99926ce8
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/testing/TestLayout.kt
@@ -0,0 +1,17 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.testing
+
+import androidx.compose.material.Button
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.testTag
+
+@Composable
+fun TestingExample() {
+ val state = remember { mutableStateOf("Hello") }
+ Button(onClick = { state.value = "Bye" }, modifier = Modifier.testTag("MyTestTag")) {
+ Text(state.value)
+ }
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/ui/UiDemos.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/ui/UiDemos.kt
new file mode 100644
index 000000000..c606c70e7
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/ui/UiDemos.kt
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.ui
+
+
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.ComposableDemo
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.demo.DemoCategory
+import de.jensklingenberg.jetpackcomposeplayground.mysamples.github.ui.layout.SubComposeLayoutDemo
+
+
+val UIDemos = DemoCategory(
+ "UIDemos",
+ listOf(
+ ComposableDemo("SubComposeLayoutDemo") { SubComposeLayoutDemo() },
+ )
+)
diff --git a/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/ui/layout/SubComposeLayoutExample.kt b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/ui/layout/SubComposeLayoutExample.kt
new file mode 100644
index 000000000..1418a8827
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/ui/layout/SubComposeLayoutExample.kt
@@ -0,0 +1,91 @@
+package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.ui.layout
+
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.layout.Placeable
+import androidx.compose.ui.layout.SubcomposeLayout
+import androidx.compose.ui.unit.Constraints
+import androidx.compose.ui.unit.IntSize
+import androidx.compose.ui.unit.dp
+
+
+@Composable
+fun SubComposeLayoutDemo() {
+ ResizeWidthColumn(Modifier.fillMaxWidth(), true) {
+
+ Box(
+ modifier = Modifier
+ .background(Color.Red)
+ ) {
+ Text("Hello")
+ }
+
+ Box(
+ modifier = Modifier
+ .padding(top = 8.dp)
+ .background(Color.Red)
+ ) {
+ Text("This is a long messsage \n and its longer")
+ }
+ }
+}
+
+@Composable
+fun ResizeWidthColumn(modifier: Modifier, resize: Boolean, mainContent: @Composable () -> Unit) {
+ SubcomposeLayout(modifier) { constraints ->
+ val mainPlaceables = subcompose(SlotsEnum.Main, mainContent).map {
+ // Here we measure the width/height of the child Composables
+ it.measure(Constraints())
+ }
+
+ //Here we find the max width/height of the child Composables
+ val maxSize = mainPlaceables.fold(IntSize.Zero) { currentMax, placeable ->
+ IntSize(
+ width = maxOf(currentMax.width, placeable.width),
+ height = maxOf(currentMax.height, placeable.height)
+ )
+ }
+
+ val resizedPlaceables: List =
+ subcompose(SlotsEnum.Dependent, mainContent).map {
+ if (resize) {
+ /** Here we rewrite the child Composables to have the width of
+ * widest Composable
+ */
+ it.measure(
+ Constraints(
+ minWidth = maxSize.width
+ )
+ )
+ } else {
+ // Ask the child for its preferred size.
+ it.measure(Constraints())
+ }
+ }
+
+ /**
+ * We can place the Composables on the screen
+ * with layout() and the place() functions
+ */
+
+ layout(constraints.maxWidth, constraints.maxHeight) {
+ resizedPlaceables.forEachIndexed { index, placeable ->
+ val widthStart = resizedPlaceables.take(index).sumOf { it.measuredHeight }
+ placeable.place(0, widthStart)
+ }
+ }
+ }
+}
+
+
+enum class SlotsEnum {
+ Main,
+ Dependent
+
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable-v21/ic_account_circle_black_24dp.xml b/Jetpack-Compose-Playground/app/src/main/res/drawable-v21/ic_account_circle_black_24dp.xml
new file mode 100644
index 000000000..ab8be5907
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/drawable-v21/ic_account_circle_black_24dp.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Jetpack-Compose-Playground/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 000000000..6348baae3
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/composelogo.png b/Jetpack-Compose-Playground/app/src/main/res/drawable/composelogo.png
new file mode 100644
index 000000000..ff971a110
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/drawable/composelogo.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/favorite.xml b/Jetpack-Compose-Playground/app/src/main/res/drawable/favorite.xml
new file mode 100644
index 000000000..52d4d9bb7
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/drawable/favorite.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_account_box.png b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_account_box.png
new file mode 100644
index 000000000..cdd05ccda
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_account_box.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_account_circle_black_24dp.xml b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_account_circle_black_24dp.xml
new file mode 100644
index 000000000..ab8be5907
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_account_circle_black_24dp.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_android.png b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_android.png
new file mode 100644
index 000000000..4696f99e3
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_android.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_bluetooth.png b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_bluetooth.png
new file mode 100644
index 000000000..7bc240299
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_bluetooth.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_crane.xml b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_crane.xml
new file mode 100644
index 000000000..3d0a138c6
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_crane.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_favorite.png b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_favorite.png
new file mode 100644
index 000000000..5a76a28f7
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_favorite.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_hourglass.xml b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_hourglass.xml
new file mode 100644
index 000000000..1666c76e9
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_hourglass.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_launcher_background.xml b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 000000000..a0ad202f9
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_sample_vector.xml b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_sample_vector.xml
new file mode 100644
index 000000000..d49a476d7
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/drawable/ic_sample_vector.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/placeholder_1_1.png b/Jetpack-Compose-Playground/app/src/main/res/drawable/placeholder_1_1.png
new file mode 100644
index 000000000..55fb3c2ac
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/drawable/placeholder_1_1.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ripple.xml b/Jetpack-Compose-Playground/app/src/main/res/drawable/ripple.xml
new file mode 100644
index 000000000..c235e6361
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/drawable/ripple.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/res/drawable/ripple_shape.xml b/Jetpack-Compose-Playground/app/src/main/res/drawable/ripple_shape.xml
new file mode 100644
index 000000000..def926180
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/drawable/ripple_shape.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/res/font/domine_bold.ttf b/Jetpack-Compose-Playground/app/src/main/res/font/domine_bold.ttf
new file mode 100644
index 000000000..329288c6b
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/font/domine_bold.ttf differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/font/domine_regular.ttf b/Jetpack-Compose-Playground/app/src/main/res/font/domine_regular.ttf
new file mode 100644
index 000000000..c387575c2
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/font/domine_regular.ttf differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/font/montserrat_medium.ttf b/Jetpack-Compose-Playground/app/src/main/res/font/montserrat_medium.ttf
new file mode 100644
index 000000000..6e079f698
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/font/montserrat_medium.ttf differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/font/montserrat_regular.ttf b/Jetpack-Compose-Playground/app/src/main/res/font/montserrat_regular.ttf
new file mode 100644
index 000000000..8d443d5d5
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/font/montserrat_regular.ttf differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/font/montserrat_semibold.ttf b/Jetpack-Compose-Playground/app/src/main/res/font/montserrat_semibold.ttf
new file mode 100644
index 000000000..f8a43f2b2
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/font/montserrat_semibold.ttf differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/font/my_font_400_italic.ttf b/Jetpack-Compose-Playground/app/src/main/res/font/my_font_400_italic.ttf
new file mode 100644
index 000000000..52c37a488
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/font/my_font_400_italic.ttf
@@ -0,0 +1 @@
+This is a dummy font file used for sample code.
diff --git a/Jetpack-Compose-Playground/app/src/main/res/font/my_font_400_regular.ttf b/Jetpack-Compose-Playground/app/src/main/res/font/my_font_400_regular.ttf
new file mode 100644
index 000000000..52c37a488
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/font/my_font_400_regular.ttf
@@ -0,0 +1 @@
+This is a dummy font file used for sample code.
diff --git a/Jetpack-Compose-Playground/app/src/main/res/font/myfont.ttf b/Jetpack-Compose-Playground/app/src/main/res/font/myfont.ttf
new file mode 100644
index 000000000..52c37a488
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/font/myfont.ttf
@@ -0,0 +1 @@
+This is a dummy font file used for sample code.
diff --git a/Jetpack-Compose-Playground/app/src/main/res/layout/activity.xml b/Jetpack-Compose-Playground/app/src/main/res/layout/activity.xml
new file mode 100644
index 000000000..48038f967
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/layout/activity.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Jetpack-Compose-Playground/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 000000000..bbd3e0212
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Jetpack-Compose-Playground/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 000000000..bbd3e0212
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-hdpi/ic_launcher.png b/Jetpack-Compose-Playground/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 000000000..898f3ed59
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/Jetpack-Compose-Playground/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 000000000..dffca3601
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-mdpi/ic_launcher.png b/Jetpack-Compose-Playground/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 000000000..64ba76f75
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/Jetpack-Compose-Playground/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 000000000..dae5e0823
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 000000000..e5ed46597
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 000000000..14ed0af35
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 000000000..b0907cac3
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 000000000..d8ae03154
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 000000000..2c18de9e6
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 000000000..beed3cdd2
Binary files /dev/null and b/Jetpack-Compose-Playground/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/Jetpack-Compose-Playground/app/src/main/res/values/activity_main.xml b/Jetpack-Compose-Playground/app/src/main/res/values/activity_main.xml
new file mode 100644
index 000000000..55344e519
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/values/activity_main.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/app/src/main/res/values/colors.xml b/Jetpack-Compose-Playground/app/src/main/res/values/colors.xml
new file mode 100644
index 000000000..aba64c866
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #DD0D3E
+ #C20029
+ #DD0D3E
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/values/strings.xml b/Jetpack-Compose-Playground/app/src/main/res/values/strings.xml
new file mode 100644
index 000000000..a2235f9fb
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ Jetpack Compose Playground
+
diff --git a/Jetpack-Compose-Playground/app/src/main/res/values/styles.xml b/Jetpack-Compose-Playground/app/src/main/res/values/styles.xml
new file mode 100644
index 000000000..0b53dcf2a
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/main/res/values/styles.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
diff --git a/Jetpack-Compose-Playground/app/src/test/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUnitTest.kt b/Jetpack-Compose-Playground/app/src/test/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUnitTest.kt
new file mode 100644
index 000000000..d4201833a
--- /dev/null
+++ b/Jetpack-Compose-Playground/app/src/test/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUnitTest.kt
@@ -0,0 +1,17 @@
+package de.jensklingenberg.jetpackcomposeplayground
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+ @Test
+ fun addition_isCorrect() {
+ assertEquals(4, 2 + 2)
+ }
+}
diff --git a/Jetpack-Compose-Playground/build.gradle.kts b/Jetpack-Compose-Playground/build.gradle.kts
new file mode 100644
index 000000000..4e2968290
--- /dev/null
+++ b/Jetpack-Compose-Playground/build.gradle.kts
@@ -0,0 +1,17 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ mavenCentral()
+ }
+ dependencies {
+ classpath("com.android.tools.build:gradle:8.6.1")
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}")
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
diff --git a/Jetpack-Compose-Playground/docs/activity/backhandler.md b/Jetpack-Compose-Playground/docs/activity/backhandler.md
new file mode 100644
index 000000000..22891b2bc
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/activity/backhandler.md
@@ -0,0 +1,20 @@
+
+
+# BackHandler
+
+You can use BackHandler to detect the presses on the device back button inside of Compose
+
+## Example
+```kotlin
+--8<-- "activity/backhandler/BackHandlerExample.kt:func"
+```
+
+
+
+
+
+## See also:
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/activity/compose/package-summary#backhandler)
+* [Full Example Code]({{ site.samplefolder }}/activity/backhandler/BackHandlerExample.kt)
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/animation/crossfade.md b/Jetpack-Compose-Playground/docs/animation/crossfade.md
new file mode 100644
index 000000000..9463ede0b
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/animation/crossfade.md
@@ -0,0 +1,63 @@
+
+# Crossfade
+
+Crossfade can be used to switch between Composables with an crossfade animation.
+
+
+
+
+Example video of the code below. On every button click, the content of the screen will change with an animation duration of 3 seconds.
+
+```kotlin
+enum class MyColors(val color: Color) {
+ Red(Color.Red), Green(Color.Green), Blue(Color.Blue)
+}
+
+@Composable
+fun CrossfadeDemo() {
+ var currentColor by remember { mutableStateOf(MyColors.Red) }
+ Column {
+ Row {
+ MyColors.values().forEach { myColors ->
+ Button(
+ onClick = { currentColor = myColors },
+ Modifier.weight(1f, true)
+ .height(48.dp)
+ .background(myColors.color),
+ colors = ButtonDefaults.buttonColors(backgroundColor = myColors.color)
+ ) {
+ Text(myColors.name)
+ }
+ }
+ }
+ Crossfade(targetState = currentColor, animationSpec = tween(3000)) { selectedColor ->
+ Box(modifier = Modifier.fillMaxSize().background(selectedColor.color))
+ }
+ }
+}
+```
+
+## How does it work?
+As you can see in the video above, this demo consists of a screen with 3 buttons at the top. On a button click, the screen below will change to the selected color.
+
+```kotlin
+Crossfade(targetState = currentColor, animationSpec = tween(3000)) { selectedColor ->
+ Box(modifier = Modifier.fillMaxSize().background(selectedColor.color))
+}
+```
+
+Crossfade expects some kind of state to detect when it should recompose. In this example, this is **currentColor**, which is a state with the selected color enum. This state will be set to the **current** parameter.
+
+With the **animationSpec** parameter, you can set which animation should be used to switch between the Composables. The default parameter here is the **tween** animation. You can choose between any class that implements **AnimationSpec**.
+The **3000** in this example is the duration that the tween animation will have.
+
+The last parameter is the body of the Crossfade Composable. Here you have to create the UI that you want to display. **selectedColor** is the current value of **currentColor**. In this example i'm using a Box to display the colors.
+Everytime one of the 3 buttons is clicked, the value of currentColor will change and the Crossfade will recompose with an animation between the old and new UI.
+
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/animation/crossfade/CrossfadeDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/animation/transistion.md b/Jetpack-Compose-Playground/docs/animation/transistion.md
new file mode 100644
index 000000000..96f468531
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/animation/transistion.md
@@ -0,0 +1,70 @@
+# Transistion
+
+WORK IN PROGRESS
+
+# Working with Transistion
+
+
+
+## What will we build?
+This is might not be a spectacutlar use case for Transistion, but it should give an idea, how to use Transistion.
+This is example consist of a **Text** which will print the active value of the Transition state and a padding which will change depending on this state.
+The value of the Transistion state will change from 0 to 200 over and over again.
+
+## Create a transistion definition
+Transistion requires a TransitionDefinition, so let's build that first.
+
+```kotlin
+private val paddingTransitionDefinition = transitionDefinition {
+...
+}
+```
+
+Inside the TransitionDefinition, we have to define all possible transition states and which transition should be used between two transition states.
+In this example we want to create transition between 0 and 200, so let's create two states for that.
+
+```kotlin
+private val paddingPropKey = FloatPropKey()
+
+private val paddingTransitionDefinition = transitionDefinition {
+ state("A"){ this[paddingPropKey] = 0f }
+ state("B") { this[paddingPropKey] = 200f }
+...
+}
+```
+
+Inside **transitionDefinition** you have to use the **state()** to define a transition state. It requires a name and a function to initialize a state.
+**paddingPropKey** is a **FloatPropKey**, it's like a state with a float value. It will be constantly updated with the latest value inside the transition.
+
+Now we have two states. One with the Name **A** and a paddingPropKey value of **0f** and one with the Name **B** and a paddingPropKey value of **200f**. Next we have to define a transistion between **A** and **B**.
+
+```kotlin
+private val paddingPropKey = FloatPropKey()
+
+private val paddingTransitionDefinition = transitionDefinition {
+ state("A"){ this[paddingPropKey] = 0f }
+ state("B") { this[paddingPropKey] = 200f }
+
+ transition("A" to "B") {
+ paddingPropKey using repeatable {
+ animation = tween {
+ duration = 1000
+ easing = FastOutLinearInEasing
+ }
+ iterations = Infinite
+ }
+ }
+}
+
+```
+
+With
+```kotlin
+ transition("A" to "B")
+```
+a transistion between state **A** and state **B** is definied. Inside the transition you have to define **how**, **how long** and **how often** the transition should happen.
+
+paddingPropKey using repeatable
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/community.md b/Jetpack-Compose-Playground/docs/community.md
new file mode 100644
index 000000000..f118bb0a7
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/community.md
@@ -0,0 +1,8 @@
+# Community
+
+Slack: join the Kotlin Slack and the #compose channel
+
+Bugtracker
+https://issuetracker.google.com/issues/new?component=612128
+
+Stackoverflow
diff --git a/Jetpack-Compose-Playground/docs/compose_for/android_devs.md b/Jetpack-Compose-Playground/docs/compose_for/android_devs.md
new file mode 100644
index 000000000..3b2d74a94
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/compose_for/android_devs.md
@@ -0,0 +1,97 @@
+# Compose for Android Developers
+This page is inspired by https://flutter.dev/docs/get-started/flutter-for/android-devs.
+The goal is to show how common use cases with the classic Android View system, can be done with Compose.
+
+| Android View | Compose |
+| ----------------------------------------- | ------------------------------------ |
+| Button | [Button](../material/button.md) |
+| TextView | [Text](../foundation/text.md) |
+| EditText | [TextField](../material/textfield.md) |
+| ImageView | [Image](../foundation/image.md) |
+| LinearLayout(horizontally) | [Row](../layout/row.md) |
+| LinearLayout(vertically) | [Column](../layout/column.md) |
+| FrameLayout | [Box](../layout/box.md) |
+| RecyclerView | [LazyColumn](../foundation/lazycolumn.md) |
+| RecyclerView(horizontally) | [LazyRow](../foundation/lazyrow.md) |
+| Snackbar | [Snackbar](../material/snackbar.md) |
+
+
+## Layouts
+### What is the equivalent of a LinearLayout?
+
+In Android, a LinearLayout is used to lay your widgets out linearly—either horizontally or vertically. With Compose, use the [Row](https://foso.github.io/Jetpack-Compose-Playground/layout/row/) or [Column](https://foso.github.io/Jetpack-Compose-Playground/layout/column/) composable to achieve the same result.
+
+If you notice the two code samples are identical with the exception of the “Row” and “Column” composable. The children are the same and this feature can be exploited to develop rich layouts that can change overtime with the same children.
+
+```kotlin
+@Composable
+fun Example() {
+ Row {
+ Text("Hello World!")
+ Text("Hello World!2")
+ }
+}
+```
+
+```kotlin
+@Composable
+fun Example() {
+ Column {
+ Text("Hello World!")
+ Text("Hello World!2")
+ }
+}
+
+```
+
+
+### What is the equivalent of a RelativeLayout?
+A RelativeLayout lays your widgets out relative to each other. In Compose, there are a few ways to achieve the same result.
+
+You can achieve the result of a RelativeLayout by using a combination of Column, Row, and Stack widgets
+
+### What is the equivalent of a ScrollView?
+
+In Android, use a ScrollView to lay out your widgets—if the user’s device has a smaller screen than your content, it scrolls.
+
+In Compose, you can use a **[LazyColumn](../foundation/lazycolumn.md)**
+
+### What is the equivalent of a RecyclerView?
+In Compose, you can use a **[LazyColumn](../foundation/lazycolumn/)** or **[LazyRow](../foundation/lazyrow/)**.
+
+
+### What is the equivalent of wrap_content?
+
+In the classic Android View system you use **wrap_content** to set the height/width of a View to the minimun needed value.
+
+In Compose, you can set a Modifier:
+
+#### Modifier.wrapContentWidth()
+Android View equivalent -> android:layout_width="wrap_content"
+
+#### Modifier.wrapContentHeight()
+Android View equivalent ->android:layout_height="wrap_content"
+
+#### Modifier.wrapContentSize()
+Android View equivalent ->android:layout_height="wrap_content"
+
+Android View equivalent -> android:layout_width="wrap_content"
+
+```kotlin
+@Composable
+fun Example() {
+ Row {
+ Text("Text1",modifier = Modifier.wrapContentWidth())
+ Text("Text2",modifier = Modifier.wrapContentHeight())
+ }
+}
+```
+
+## Working with Text
+
+### What is the equivalent of a TextView?
+In Compose you can use a **[Text](https://foso.github.io/Jetpack-Compose-Playground/foundation/text/)** to display text
+
+### What is the equivalent of a EditText?
+The EditText is the standard text entry view in the Android View system. If the user needs to enter text into an app, this is the primary way for them to do that.
+In Compose you can use **[TextField](https://foso.github.io/Jetpack-Compose-Playground/material/textfield/)**
diff --git a/Jetpack-Compose-Playground/docs/compose_for/swiftui_devs.md b/Jetpack-Compose-Playground/docs/compose_for/swiftui_devs.md
new file mode 100644
index 000000000..3362bbe84
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/compose_for/swiftui_devs.md
@@ -0,0 +1,66 @@
+# Compose for SwiftUI Developers
+
+
+| SwiftUI | Compose |
+| ----------------------------------------- | ------------------------------------ |
+| Button | [Button](../material/button.md) |
+| Text | [Text](../foundation/text.md) |
+| TextEditor | [TextField](../material/textfield.md) |
+| Image | [Image](../foundation/image.md) |
+| HStack | [Row](../layout/row.md) |
+| VStack | [Column](../layout/column.md) |
+| ZStack | [Box](../layout/box.md) |
+| LazyVStack | [LazyColumn](../foundation/lazycolumn.md) |
+| LazyHStack | [LazyRow](../foundation/lazyrow.md) |
+| ScrollView | [LazyColumn](../foundation/lazycolumn.md) |
+
+## What is the equivalent of a View?
+In "Jetpack Compose" Views are called **Composable**. They are Kotlin functions that are annotated with @Composable.
+```kotlin
+@Composable fun ComposableDemo(){
+ Text("Hello, World")
+}
+```
+
+## How to define a state?
+In SwiftUI you can use the **@State** property wrapper to create a state.
+
+```swift
+//SwiftUI
+@State var isActiveState = false
+```
+
+In Compose you use **mutableStateOf()**
+```kotlin
+//Compose
+var isActiveState = mutableStateOf(false)
+```
+
+But this will only create the state. When you want to remember the value of your state in every recomposition, you have to put your state inside **remember**
+```kotlin
+//Compose
+ val isActiveState = remember { mutableStateOf(false) }
+```
+
+
+
+## What is the equivalent of a ViewModifier?
+
+```swift
+//SwiftUI
+struct ContentView: View {
+ var body : some View {
+ Text("Hello, World!").background(Color.Red).padding(100)
+ }
+}
+```
+
+In Compose a ViewModifier is called [Modifier](../general/modifier/). You can't directly append it to a View, you need to apply your modifier as a parameter to a Composable that expects a modifier.
+
+```kotlin
+//Compose
+Text("Hello, World", modifier = Modifier.background(Color.Red).padding(100.dp))
+```
+
+## What is the equivalent of EnvironmentObject?
+For data that should be shared with all views in your entire app, in SwiftUI you can use EnvironmentObject. In Compose this can be done with [CompositionLocal](/general/compositionlocal/)
diff --git a/Jetpack-Compose-Playground/docs/compose_projects.md b/Jetpack-Compose-Playground/docs/compose_projects.md
new file mode 100644
index 000000000..59c0db118
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/compose_projects.md
@@ -0,0 +1,56 @@
+# Compose Projects
+A list of projects that are related to Jetpack Compose. If you want to add an entry, please edit the table and send PR.
+
+# Example Apps
+
+| Name | Description |
+| ----------------------------------------- | ------------------------------------ |
+| [Jetpack Compose Playground](https://github.com/Foso/Jetpack-Compose-Playground) | Collection of Jetpack Compose example code :rocket: . |
+| [Compose Pokedex](https://github.com/zsoltk/compose-pokedex) | Pokedex on Jetpack Compose. |
+| [Compose Samples Repository](https://github.com/android/compose-samples) | This repository contains a set of individual Android Studio projects to help you learn about Compose in Android. |
+| [PeopleInSpace](https://github.com/joreilly/PeopleInSpace) | Minimal Kotlin Multiplatform project using Jetpack Compose and SwiftUI|
+| [ComposeClock](https://github.com/adibfara/composeclock) | Particle clock created with Jetpack Compose framework |
+| [JetDelivery](https://github.com/vipulasri/JetDelivery) | JetDelivery is a sample food delivery app, built with Jetpack Compose.|
+| [Learn Jetpack Compose By Example](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example) | This project contains various examples that show how you would do things the "Jetpack Compose" way|
+| [Full Compose Cookbook with Demo UIs](https://github.com/Gurupreet/ComposeCookBook) | This project showcase all UI, Widgets, Animations and Demo UI samples.
+| [JetInstagram](https://github.com/vipulasri/JetInstagram) | An Instagram UI clone app built with "Jetpack Compose" with Like Button Animation and instagram reels feature with exoplayer.
+| [DisneyCompose](https://github.com/skydoves/DisneyCompose) | A demo Disney app using compose and Hilt based on modern Android tech-stacks and MVVM architecture. Fetching data from the network and integrating persisted data in the database via repository pattern. Declarative UI version of the DisneyMotions using compose.
+| [Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform) | Compose Kotlin UI framework port for desktop platforms (macOS, Linux, Windows), components outside of the core.
+| [Compose Slack Desktop](https://github.com/vipulasri/ComposeSlackDesktop) | A Slack demo app for desktop using Jetpack Compose UI toolkit
+| [FlappyBird](https://github.com/Nthily/FlappyBird) | FlappyBird made with Jetpack Compose.
+| [JetSpotify](https://github.com/sunny52525/JetSpotify) | This is a Spotify App made in Jetpack Compose having Spotify Android UI and functionality using Spotify SDK and web API.
+| [JetPic Express](https://github.com/la-colinares/JetPicExpress) | A simple photo editing app that allows you to apply stunning filters and share it to the world. This app was built using the latest Jetpack Compose UI for Modern Native Android UI development.
+| [CoolWheatherApp](https://github.com/markoeltiger/CoolWheatherApp) | A cool modern weather application build with (JetpackCompose UI , coroutine,retrofit , MVVM Architecture , LiveData)
+
+# Libraries
+
+| Name | Description |
+| ----------------------------------------- | ------------------------------------ |
+| [accompanist](https://github.com/chrisbanes/accompanist/) | A collection of extension libraries for Jetpack Compose |
+| [Showkase](https://github.com/airbnb/Showkase) | Showkase is an annotation-processor based Android library that helps you organize, discover, search and visualize Jetpack Compose UI elements |
+| [Decompose](https://github.com/arkivanov/Decompose) | Lifecycle-aware components for Jetpack Compose with routing functionality |
+| [Compose Router](https://github.com/zsoltk/compose-router) | Routing functionality for Jetpack Compose with back stack |
+| [Compose Glide Image](https://github.com/mvarnagiris/compose-glide-image) | Simple Glide library adaptation for Jetpack Compose. |
+| [Compose Navigation](https://github.com/mvarnagiris/compose-navigation) | |
+| [Compose Backstack](https://github.com/zach-klippenstein/compose-backstack) | Simple composable for rendering transitions between backstacks.|
+| [SwipeReveal-Compose](https://github.com/kacmacuna/SwipeReveal-Compose) | A layout that you can swipe to show action buttons.|
+| [Exploding Composable](https://github.com/omkar-tenkale/ExplodingComposable) | Explosive dust effect animation for your composables!|
+| [Landscapist](https://github.com/skydoves/landscapist) | 🍂 Jetpack Compose image loading library which can fetch and display network images using Glide, Coil, and Fresco.|
+
+
+# Websites
+
+| Name | Description |
+| ----------------------------------------- | ------------------------------------ |
+| [Compose.Academy](https://compose.academy/) | |
+| [Jetpackcompose.app](https://Jetpackcompose.app) | |
+| [Jetpack Compose ä¸ć–‡ć–‡ćˇŁ](https://docs.compose.net.cn/) |
+| [JetpackComposeVersion.com](https://www.jetpackcomposeversion.com/) | A page to quickly check what the latest version of Jetpack Compose is and its dependencies. |
+| [Composables.co](https://www.composables.co) | Articles & resources for Jetpack Compose |
+
+# Compose for Web
+
+| Name | Description |
+| ----------------------------------------- | ------------------------------------ |
+| [HtmlToComposeWebConverter](https://github.com/Foso/HtmlToComposeWebConverter) | Intellij Idea Plugin that can convert HTML to Compose for Web code. https://plugins.jetbrains.com/plugin/18261-html-to-compose-web-converter
+| [Compose-Snake-Web](https://github.com/Foso/compose-snake-web) | This is a Compose for Web port of CompoSnake.
diff --git a/Jetpack-Compose-Playground/docs/contributing.md b/Jetpack-Compose-Playground/docs/contributing.md
new file mode 100644
index 000000000..37537e3b5
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/contributing.md
@@ -0,0 +1,36 @@
+# Contributing
+
+## to Jetpack Compose
+If you want to improve Compose, join the Kotlin Slack and the **#compose** channel or file a bug at https://issuetracker.google.com/issues?q=componentid:612128
+
+## to this project
+This project is using [MkDocs](https://www.mkdocs.org/) and the [MkDocs-Material Theme](https://squidfunk.github.io/mkdocs-material/) to generate the pages for Github.
+The markdown files are located in [/docs](https://github.com/Foso/Jetpack-Compose-Playground/tree/master/docs).
+The generated files for the GitHub page are in [/site](https://github.com/Foso/Jetpack-Compose-Playground/tree/master/.github/workflows/gh-pages.yml#L32). Do not make changes in this folder, they will be overridden.
+
+* Install plugins
+
+ ```
+ pip3 install mkdocs-minify-plugin
+ pip3 install mkdocs-git-revision-date-localized-plugin
+ pip3 install mkdocs-minify-plugin
+ pip3 install mkdocs-macros-plugin
+ ```
+
+* Run docs locally
+
+ To start the mkdocs server locally, run **mkdocs serve** in a terminal in the project folder.
+
+
+* Add/Change docs
+
+ The docs are written in markdown files which are all in [/docs](https://github.com/Foso/Jetpack-Compose-Playground/tree/master/docs). To change the navigation sidebar, you need to edit the **mkdocs.yml**.
+
+* Build the docs
+
+ When you run **mkdocs build** in a terminal in the project folder, the html files be generated to [/site](https://github.com/Foso/Jetpack-Compose-Playground/tree/master/docs).
+
+ When deployed, these files are built for GitHub Pages using a [workflow](https://github.com/Foso/Jetpack-Compose-Playground/actions).
+
+
+Feel free to change/add files and send a pull request.
diff --git a/Jetpack-Compose-Playground/docs/cookbook/detect_darkmode.md b/Jetpack-Compose-Playground/docs/cookbook/detect_darkmode.md
new file mode 100644
index 000000000..5828df406
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/detect_darkmode.md
@@ -0,0 +1,14 @@
+# How to detect dark mode
+
+
+Inside your Composable you can use **isSystemInDarkTheme** to detect if the device is running in dark mode.
+
+```kotlin
+ val dark = isSystemInDarkTheme()
+```
+
+-------------
+
+## See also:
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/foundation/package-summary#issystemindarktheme)
+* [Learn-Jetpack-Compose-By-Example/DarkModeActivity](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/theme/DarkModeActivity.kt)
diff --git a/Jetpack-Compose-Playground/docs/cookbook/get_android_context.md b/Jetpack-Compose-Playground/docs/cookbook/get_android_context.md
new file mode 100644
index 000000000..9816b4e52
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/get_android_context.md
@@ -0,0 +1,16 @@
+
+
+You can use LocalContext.current to receive the context of your Android App inside a Compose Function
+
+```kotlin
+@Composable
+fun AndroidContextComposeDemo() {
+ val context = LocalContext.current
+ Text(text = "Read this string from Context: "+context.getString(R.string.app_name))
+}
+```
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/other/AndroidContextComposeDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/cookbook/hint_edit_text.md b/Jetpack-Compose-Playground/docs/cookbook/hint_edit_text.md
new file mode 100644
index 000000000..bc2acd3ae
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/hint_edit_text.md
@@ -0,0 +1,84 @@
+# How to show hint with underline in a TextField
+
+!!! info
+ This is the API of version dev08. Newer versions may have a different one
+
+We have all used EditText in classic Android development. It has lots of features like hint showing or default underline background. In Jetpack compose it's name is TextField
+and we set up it like that.
+
+## Create TextField
+```kotlin
+val state = state { "" }
+TextField(
+ value = state.value,
+ modifier = modifier,
+ onValueChange = { state.value = it },
+ textStyle = yourTextStyle
+)
+```
+
+With textStyle parameter you can change your TextField's font, font size, color and many other things, but there are something that its missing, you cant quite set its PlaceHolder
+text(Hint). So how can we do that? If you think about that hint's only purpose is to be shown when TextField is empty and be hidden when we are starting to type something in TextField.
+So we need two views one Text for hint showing and one TextField. They must have same location on the screen so it will look like same component. So without further ado let's start
+implementing it.
+
+## Create HintTextField
+```kotlin
+@Composable
+fun HintEditText(
+ hintText: String = "",
+ modifier: Modifier = Modifier.None,
+ textStyle: TextStyle = currentTextStyle()
+) {
+ val state = state { "" }
+ val inputField = @Composable {
+ TextField(
+ value = state.value,
+ modifier = modifier,
+ onValueChange = { state.value = it },
+ textStyle = textStyle.merge(TextStyle(textDecoration = TextDecoration.None))
+ )
+ }
+
+ Layout(
+ children = @Composable {
+ inputField()
+ Text(
+ text = hintText,
+ modifier = modifier,
+ style = textStyle.merge(TextStyle(color = Color.Gray))
+ )
+ Divider(color = Color.Black, height = 2.dp)
+ },
+ measureBlock = { measurables: List, constraints: Constraints, _ ->
+ val inputFieldPlace = measurables[0].measure(constraints)
+ val hintEditPlace = measurables[1].measure(constraints)
+ val dividerEditPlace = measurables[2].measure(
+ Constraints(constraints.minWidth, constraints.maxWidth, 2.ipx, 2.ipx)
+ )
+ layout(
+ inputFieldPlace.width,
+ inputFieldPlace.height + dividerEditPlace.height
+ ) {
+ inputFieldPlace.place(0.ipx, 0.ipx)
+ if (state.value.isEmpty())
+ hintEditPlace.place(0.ipx, 0.ipx)
+ dividerEditPlace.place(0.ipx, inputFieldPlace.height)
+ }
+ })
+}
+```
+
+
+Seems like lots of code for simple functional, doesn’t it? Let’s describe whats happening from the function declaration. It has three function parameters and they are pretty
+self-explanatory. As second part we are creating TextField lambda and passing it in Layout Composable function, with our HintText and Divider, which as you might have guessed
+will create underline background. Now it's time to decide where we are going to put our HintTextField.
+
+First of all we need to measure our views and **measureBlock** will help us do that.
+Measurables list will contain three items(Our TextField, HintText and Divider) as Measurable type, we need to call measure on all of list items and pass constraints in it. Constraints
+is a class which only has four properties(minWidth, maxWidth, minHeight, maxHeight). We can pass constraints which is given to us by measuring @Composable children lambda, which works
+with our TextField and HintText because we want them to have same size as it's parent, but when it comes to underline background we need it to stay as thin as possible.
+Now we are measuring our HintTextField one more time and placing it's children on some (x, y).
+
+One last thing to realize is that if our state value is not empty we don’t place
+our HintText at all!
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/cookbook/how_to_create_custom_shape.md b/Jetpack-Compose-Playground/docs/cookbook/how_to_create_custom_shape.md
new file mode 100644
index 000000000..7cfe891e5
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/how_to_create_custom_shape.md
@@ -0,0 +1,83 @@
+## How to draw a custom shape?
+
+!!! info
+ This is the API of version 1.2.0. Newer versions may have a different one
+
+
+
+
+
+### GenericShape
+
+You can create custom shapes. One way to do it, is to use **GenericShape**. Let's see how the triangle is drawn.
+
+
+```kotlin
+private val TriangleShape = GenericShape { size, _ ->
+ // 1)
+ moveTo(size.width / 2f, 0f)
+
+ // 2)
+ lineTo(size.width, size.height)
+
+ // 3)
+ lineTo(0f, size.height)
+}
+```
+
+Inside the GenericShape you can draw your custom shape.
+You have access to the **size**-object. This is size of the Composable that the shape is applied to.
+You can get the height with **size.height** and the width with **size.width**
+
+
+1) Initially the painter will start at the top left of the parent composable(0x,0y).
+With **moveTo()** you can set the coordinates of the painter. Here the coordinates will be set to the half width of the parent layout
+and a 0y coordinate.
+
+2) This will draw a line from the painter coordinates, which were set in **1)**, to the bottom right corner of the parent layout.
+The painter coordinates are then automatically set to this corner.
+
+3) This will draw a line to the bottom left corner. GenericShape will implicitly execute the **close()**-function. **close()** will draw a line from the last painter coordinates to the first definied.
+
+### Extend the Shape interface
+
+```kotlin
+/**
+ * Defines a generic shape.
+ */
+interface Shape {
+ /**
+ /**
+ * Creates [Outline] of this shape for the given [size].
+ *
+ * @param size the size of the shape boundary.
+ * @param density the current density of the screen.
+ *
+ * @return [Outline] of this shape for the given [size].
+ */
+ fun createOutline(size: Size, density: Density): Outline
+}
+```
+You can extend the Shape interface to create your own implementation of Shape. Inside **createOutline** you get the size of the Composable, which the shape is applied to and the density of the screen.
+You have to return an instance of **Outline**. Outline is a sealed class with the following subclasses:
+
+* Rectangle(val rect: Rect)
+* Rounded(val rrect: RRect)
+* Generic(val path: Path)
+
+Take a look at the GenericShape example when you want to understand, how the drawing of a custom shape works.
+
+```kotlin
+class CustomShape : Shape {
+ override fun createOutline(size: Size, density: Density): Outline {
+ val path = Path().apply {
+ moveTo(size.width / 2f, 0f)
+ lineTo(size.width, size.height)
+ lineTo(0f, size.height)
+ close()
+ }
+ return Outline.Generic(path)
+ }
+}
+
+```
diff --git a/Jetpack-Compose-Playground/docs/cookbook/how_to_create_your_own_modifier b/Jetpack-Compose-Playground/docs/cookbook/how_to_create_your_own_modifier
new file mode 100644
index 000000000..f360ac8aa
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/how_to_create_your_own_modifier
@@ -0,0 +1,54 @@
+# How to create your own Modifier
+
+!!! info
+ This is the API of version alpha01. Newer versions may have a different one
+
+Compose is using Modifiers to set certain aspects of a Composable like backgrounds, size or click events.
+Compose already comes with
+
+In this example i want to explain how you can create your own Modifier.
+We will create a Modifier that scales the size of the Composable where it's applied to.
+
+To create a Modifier you need to create a class that implements Modifier.Element.
+
+
+
+```kotlin
+ /**
+ * A [Modifier.Element] that changes how its wrapped content is measured and laid out.
+ * It has the same measurement and layout functionality as the [androidx.compose.ui.Layout]
+ * component, while wrapping exactly one layout due to it being a modifier. In contrast,
+ * the [androidx.compose.ui.Layout] component is used to define the layout behavior of
+ * multiple children.
+ *
+ * @see androidx.compose.ui.Layout
+ */
+ interface LayoutModifier : Modifier.Element {
+```
+
+
+```kotlin
+ class ScaleSizeModifier(val scale: Int) : LayoutModifier {
+
+ //1
+ override fun MeasureScope.measure(
+ measurable: Measurable,
+ constraints: Constraints
+ ): MeasureScope.MeasureResult {
+
+ val pl = measurable.measure(constraints)
+
+ measurable.measure(
+ Constraints(
+ pl.width * scale,
+ pl.width * scale,
+ pl.height * scale,
+ pl.height * scale
+ )
+ )
+ return layout(pl.width, pl.height) {
+ pl.place(0, 0)
+ }
+ }
+ }
+```
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/cookbook/how_to_make_composable_invisible.md b/Jetpack-Compose-Playground/docs/cookbook/how_to_make_composable_invisible.md
new file mode 100644
index 000000000..06e9cb2b7
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/how_to_make_composable_invisible.md
@@ -0,0 +1,3 @@
+# How to make a Composable invisible?
+
+When you want to set a Composable to invisible, you can use the **alpha** modifier. **alpha(0f)** will make it invisible.
diff --git a/Jetpack-Compose-Playground/docs/cookbook/how_to_use_an_android_view_in_compose.md b/Jetpack-Compose-Playground/docs/cookbook/how_to_use_an_android_view_in_compose.md
new file mode 100644
index 000000000..187498beb
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/how_to_use_an_android_view_in_compose.md
@@ -0,0 +1,3 @@
+# How to use an Android View in Compose
+
+See [AndroidView](../viewinterop/androidview.md)
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/cookbook/how_to_use_compose_in_viewgroup.md b/Jetpack-Compose-Playground/docs/cookbook/how_to_use_compose_in_viewgroup.md
new file mode 100644
index 000000000..d8c38ccac
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/how_to_use_compose_in_viewgroup.md
@@ -0,0 +1,3 @@
+# How to use Compose in a ViewGroup
+
+See [ComposeView](../platform/composeview.md)
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/cookbook/loadimage.md b/Jetpack-Compose-Playground/docs/cookbook/loadimage.md
new file mode 100644
index 000000000..e73e67b4d
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/loadimage.md
@@ -0,0 +1,36 @@
+
+# How to load an image
+
+## Load Image
+You can use **painterResource** to load an image from the resources
+
+```kotlin
+@Composable
+fun ImageResourceDemo() {
+ val image: Painter = painterResource(id = R.drawable.composelogo)
+ Image(painter = image,contentDescription = "")
+}
+```
+Or load an Icon from Material Icons
+
+```kotlin
+@Composable
+fun ImageResourceDemo() {
+ Icon(Icons.Rounded.Home,contentDescription = "")
+}
+```
+
+Remember to add dependencies to build.gradle
+
+```
+ implementation "androidx.compose.material:material-icons-extended:$compose_version"
+```
+
+
+
+
+## See also:
+
+* [Full Example Code]({{ site.samplefolder }}/foundation/ImageResourceDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/cookbook/overview.md b/Jetpack-Compose-Playground/docs/cookbook/overview.md
new file mode 100644
index 000000000..6b43d4ea0
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/overview.md
@@ -0,0 +1,10 @@
+# Cookbook
+
+* [Handle changes to a text field](./textfield_changes.md)
+* [How to use Compose in a ViewGroup](./how_to_use_compose_in_viewgroup.md)
+* [How to create HintTextField](./hint_edit_text.md)
+* [How to load an Image](./loadimage.md)
+* [How to use an Android View in Compose](./how_to_use_an_android_view_in_compose.md)
+* [How to get Android Context](./get_android_context.md)
+* [How to detect dark mode](./detect_darkmode.md)
+* [How to make a Composable invisible?](./how_to_make_composable_invisible.md)
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/cookbook/textfield_changes.md b/Jetpack-Compose-Playground/docs/cookbook/textfield_changes.md
new file mode 100644
index 000000000..238e6089a
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/cookbook/textfield_changes.md
@@ -0,0 +1,35 @@
+
+# Handle changes to a TextField
+
+In some cases, it’s useful to get the value of a textfield every time the text in a text field changes. For example, you might want to build a search screen with autocomplete functionality where you want to update the results as the user types.
+
+Here is an example how you can do it with Compose:
+
+
+
+
+
+
+
+```kotlin
+@Composable
+fun TextFieldDemo() {
+ Column(Modifier.padding(16.dp)) {
+ val textState = remember { mutableStateOf(TextFieldValue()) }
+ TextField(
+ value = textState.value,
+ onValueChange = { textState.value = it }
+ )
+ Text("The textfield has this text: " + textState.value.text)
+ }
+}
+```
+
+The simplest approach is to supply an onValueChange() callback to a TextField. Whenever the text changes, the callback is invoked.
+
+In this example, every time the TextField changes, the new text value will be saved in a state and set to the TextField and the Text.
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/material/textfield/TextFieldDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/desktop/general/Image.md b/Jetpack-Compose-Playground/docs/desktop/general/Image.md
new file mode 100644
index 000000000..648de9a82
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/desktop/general/Image.md
@@ -0,0 +1,5 @@
+# Image
+
+WIP
+
+You can find the official docs here: https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials/Image_And_Icons_Manipulations
diff --git a/Jetpack-Compose-Playground/docs/desktop/general/gettingstarted.md b/Jetpack-Compose-Playground/docs/desktop/general/gettingstarted.md
new file mode 100644
index 000000000..3ad86bfbb
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/desktop/general/gettingstarted.md
@@ -0,0 +1,5 @@
+# Getting Started
+
+WIP
+
+You can find the official docs here: https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials/Getting_Started
diff --git a/Jetpack-Compose-Playground/docs/desktop/general/keyboard.md b/Jetpack-Compose-Playground/docs/desktop/general/keyboard.md
new file mode 100644
index 000000000..f617b6125
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/desktop/general/keyboard.md
@@ -0,0 +1,5 @@
+# Keyboard
+
+WIP
+
+You can find the official docs here: https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials/Keyboard
diff --git a/Jetpack-Compose-Playground/docs/desktop/general/mouse.md b/Jetpack-Compose-Playground/docs/desktop/general/mouse.md
new file mode 100644
index 000000000..3afa86bde
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/desktop/general/mouse.md
@@ -0,0 +1,5 @@
+# Mouse
+
+WIP
+
+You can find the official docs here: https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials/Mouse_Events
diff --git a/Jetpack-Compose-Playground/docs/desktop/general/scrollbar.md b/Jetpack-Compose-Playground/docs/desktop/general/scrollbar.md
new file mode 100644
index 000000000..c875daa3d
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/desktop/general/scrollbar.md
@@ -0,0 +1,5 @@
+# Scrollbar
+
+WIP
+
+You can find the official docs here: https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials/Desktop_Components#scrollbars
diff --git a/Jetpack-Compose-Playground/docs/desktop/general/window.md b/Jetpack-Compose-Playground/docs/desktop/general/window.md
new file mode 100644
index 000000000..582693618
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/desktop/general/window.md
@@ -0,0 +1,5 @@
+# Window
+
+WIP
+
+You can find the official docs here: https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials/Window_API_new
diff --git a/Jetpack-Compose-Playground/docs/desktop/overview.md b/Jetpack-Compose-Playground/docs/desktop/overview.md
new file mode 100644
index 000000000..f71c83b53
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/desktop/overview.md
@@ -0,0 +1,8 @@
+# Compose on Desktop
+JetBrains released a Compose port for the desktop.
+
+"Compose for Desktop targets the JVM, and supports high-performance, hardware-accelerated UI rendering on all major desktop platforms (macOS, Windows, and Linux/x64) by leveraging the powerful native Skia graphics library."
+
+You can find more information here https://www.jetbrains.com/lp/compose/ or on their Github Repo https://github.com/JetBrains/compose-multiplatform or in the Kotlin Slack [#compose-desktop](https://kotlinlang.slack.com/archives/C01D6HTPATV)
+
+
diff --git a/Jetpack-Compose-Playground/docs/foundation/basictextfield.md b/Jetpack-Compose-Playground/docs/foundation/basictextfield.md
new file mode 100644
index 000000000..b1ed3a11d
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/foundation/basictextfield.md
@@ -0,0 +1,19 @@
+
+
+# BasicTextField
+
+BasicTextField can be used to insert text. See [TextField](../material/textfield.md) for a material version.
+
+
+
+
+
+```kotlin
+--8<-- "foundation/basictextfield/BasicTextFieldDemo.kt:func"
+```
+
+-------------
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/foundation/basictextfield/BasicTextFieldDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/foundation/canvas.md b/Jetpack-Compose-Playground/docs/foundation/canvas.md
new file mode 100644
index 000000000..593820a9e
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/foundation/canvas.md
@@ -0,0 +1,39 @@
+
+
+# Canvas
+A Canvas is a Composable that allows you to draw inside of it.
+
+## How to draw on Canvas
+
+
+
+
+
+```kotlin
+@Preview(showBackground = true)
+@Composable
+fun CanvasDrawExample() {
+ Canvas(modifier = Modifier.fillMaxSize()) {
+ drawRect(Color.Blue, topLeft = Offset(0f, 0f), size = Size(this.size.width, 55f))
+ drawCircle(Color.Red, center = Offset(50f, 200f), radius = 40f)
+ drawLine(
+ Color.Green, Offset(20f, 0f),
+ Offset(200f, 200f), strokeWidth = 5f
+ )
+
+ drawArc(
+ Color.Black,
+ 0f,
+ 60f,
+ useCenter = true,
+ size = Size(300f, 300f),
+ topLeft = Offset(60f, 60f)
+ )
+ }
+}
+```
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/foundation/CanvasDrawExample.kt)
diff --git a/Jetpack-Compose-Playground/docs/foundation/image.md b/Jetpack-Compose-Playground/docs/foundation/image.md
new file mode 100644
index 000000000..817b617ae
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/foundation/image.md
@@ -0,0 +1,33 @@
+
+# Image
+
+Image is used to display Images. It's similar to an ImageView in the classic Android View system.
+
+
+
+
+
+
+
+## Load Image
+You can use **painterResource** to load an image from the resources
+
+```kotlin
+@Composable
+fun ImageResourceDemo() {
+ val image: Painter = painterResource(id = R.drawable.composelogo)
+ Image(painter = image,contentDescription = "")
+}
+```
+
+
+
+
+## See also:
+
+* [Full Example Code]({{ site.samplefolder }}/foundation/ImageResourceDemo.kt)
+
+
+
diff --git a/Jetpack-Compose-Playground/docs/foundation/layout/boxwithconstraints.md b/Jetpack-Compose-Playground/docs/foundation/layout/boxwithconstraints.md
new file mode 100644
index 000000000..5dbdef72e
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/foundation/layout/boxwithconstraints.md
@@ -0,0 +1,53 @@
+
+# BoxWithConstraints
+
+BoxWithConstraints is a layout similar to the [Box](../../../layout/box) layout, but it has the advantage that you can get the minimum/maximum available width and height for the Composable on the screen.
+You can use it to show a different content depending on the available space.
+
+Inside the scope of BoxWithConstraints you have access to the BoxWithConstraintsScope. With it you can get the **minWidth**, **maxWidth**, **minHeight**, **maxHeight** in dp and **constraints** in pixels.
+
+## Example:
+
+
+
+
+```kotlin
+@Composable
+fun BoxWithConstraintsDemo() {
+ Column {
+ Column {
+ MyBoxWithConstraintsDemo()
+ }
+
+ Text("Here we set the size to 150.dp", modifier = Modifier.padding(top = 20.dp))
+ Column(modifier = Modifier.size(150.dp)) {
+ MyBoxWithConstraintsDemo()
+ }
+ }
+}
+
+@Composable
+private fun MyBoxWithConstraintsDemo() {
+ BoxWithConstraints {
+ val boxWithConstraintsScope = this
+ //You can use this scope to get the minWidth, maxWidth, minHeight, maxHeight in dp and constraints
+
+ Column {
+ if (boxWithConstraintsScope.maxHeight >= 200.dp) {
+ Text(
+ "This is only visible when the maxHeight is >= 200.dp",
+ style = TextStyle(fontSize = 20.sp)
+ )
+ }
+ Text("minHeight: ${boxWithConstraintsScope.minHeight}, maxHeight: ${boxWithConstraintsScope.maxHeight}, minWidth: ${boxWithConstraintsScope.minWidth} maxWidth: ${boxWithConstraintsScope.maxWidth}")
+ }
+ }
+}
+```
+
+
+## See also:
+* [Official Docs]({{ site.composedoc }}/foundation/layout/package-summary#BoxWithConstraints(androidx.compose.ui.Modifier,androidx.compose.ui.Alignment,kotlin.Boolean,kotlin.Function1))
+* [Full Example Code]({{ site.samplefolder }}/foundation/layout/BoxWithConstraintsExample.kt)
diff --git a/Jetpack-Compose-Playground/docs/foundation/layout/spacer.md b/Jetpack-Compose-Playground/docs/foundation/layout/spacer.md
new file mode 100644
index 000000000..32797a65d
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/foundation/layout/spacer.md
@@ -0,0 +1,28 @@
+
+
+# Spacer
+
+Spacer is a Composable that can be used when you want to add an additional space between Composables
+
+
+
+
+
+## Example
+
+```kotlin
+@Composable
+fun SpacerDemo() {
+ Column {
+ Text("Hello")
+ Spacer(modifier = Modifier.size(30.dp))
+ Text("World")
+ }
+}
+```
+
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/foundation/layout/SpacerDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/foundation/lazycolumn.md b/Jetpack-Compose-Playground/docs/foundation/lazycolumn.md
new file mode 100644
index 000000000..919b1393c
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/foundation/lazycolumn.md
@@ -0,0 +1,50 @@
+
+
+# LazyColumn
+
+A [LazyColumn](https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/package-summary#lazycolumn) is a vertically scrolling list that only composes and lays out the currently visible items.
+It's similar to a Recyclerview in the classic Android View system.
+
+
+
+
+
+```kotlin
+@Composable
+fun LazyColumnDemo() {
+ val list = listOf(
+ "A", "B", "C", "D"
+ ) + ((0..100).map { it.toString() })
+ LazyColumn(modifier = Modifier.fillMaxHeight()) {
+ items(items = list, itemContent = { item ->
+ Log.d("COMPOSE", "This get rendered $item")
+ when (item) {
+ "A" -> {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ "B" -> {
+ Button(onClick = {}) {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ }
+ "C" -> {
+ //Do Nothing
+ }
+ "D" -> {
+ Text(text = item)
+ }
+ else -> {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ }
+ })
+ }
+}
+```
+
+## See also:
+* [Official Docs]({{ site.composedoc }}/foundation/lazy/package-summary#lazycolumn)
+* [Full Example Code]({{ site.samplefolder }}/foundation/LazyColumnDemo.kt)
+
diff --git a/Jetpack-Compose-Playground/docs/foundation/lazyrow.md b/Jetpack-Compose-Playground/docs/foundation/lazyrow.md
new file mode 100644
index 000000000..3adf6ed88
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/foundation/lazyrow.md
@@ -0,0 +1,54 @@
+
+
+# LazyRow
+
+A [LazyRow]({{ site.composedoc }}/foundation/lazy/package-summary#lazyrow) is a horizontal scrolling list that only composes and lays out the currently visible items.
+It's similar to a horizontal Recyclerview in the classic Android View system.
+
+
+
+
+
+
+```kotlin
+@Composable
+fun LazyRowDemo() {
+ val list = listOf(
+ "A", "B", "C", "D"
+ ) + ((0..100).map { it.toString() })
+ LazyRow(modifier = Modifier.fillMaxHeight()) {
+ items(items = list, itemContent = { item ->
+ Log.d("COMPOSE", "This get rendered $item")
+ when (item) {
+ "A" -> {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ "B" -> {
+ Button(onClick = {}) {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ }
+ "C" -> {
+ //Do Nothing
+ }
+ "D" -> {
+ Text(text = item)
+ }
+ else -> {
+ Text(text = item, style = TextStyle(fontSize = 80.sp))
+ }
+ }
+ })
+ }
+}
+```
+
+## See also:
+* [Official Docs]({{ site.composedoc }}/foundation/lazy/package-summary#lazyrow)
+* [Full Example Code]({{ site.samplefolder }}/foundation/LazyRowDemo.kt)
+
+
+
+[Lazy and amazy – Lazy layouts in Compose](https://www.droidcon.com/2022/08/01/lazy-and-amazy-lazy-layouts-in-compose/)
diff --git a/Jetpack-Compose-Playground/docs/foundation/lazyverticalgrid.md b/Jetpack-Compose-Playground/docs/foundation/lazyverticalgrid.md
new file mode 100644
index 000000000..c606630ac
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/foundation/lazyverticalgrid.md
@@ -0,0 +1,69 @@
+
+
+# LazyVerticalGrid
+
+Jetpack Compose provides an API for displaying grid or grid elements.
+
+# Example
+
+To arrange list items in a grid, ``LazyVerticalGrid`` provides a cells parameter that controls how cells are formed into columns.
+The following example displays the items in a grid, using ``GridCells.Adaptive`` to set the width of each column at least 128.dp:
+
+
+
+
+
+
+
+```kotlin
+@Composable
+fun LazyVerticalGridDemo(){
+ val list = (1..10).map { it.toString() }
+
+ LazyVerticalGrid(
+ columns = GridCells.Adaptive(128.dp),
+
+ // content padding
+ contentPadding = PaddingValues(
+ start = 12.dp,
+ top = 16.dp,
+ end = 12.dp,
+ bottom = 16.dp
+ ),
+ content = {
+ items(list.size) { index ->
+ Card(
+ backgroundColor = Color.Red,
+ modifier = Modifier
+ .padding(4.dp)
+ .fillMaxWidth(),
+ elevation = 8.dp,
+ ) {
+ Text(
+ text = list[index],
+ fontWeight = FontWeight.Bold,
+ fontSize = 30.sp,
+ color = Color(0xFFFFFFFF),
+ textAlign = TextAlign.Center,
+ modifier = Modifier.padding(16.dp)
+ )
+ }
+ }
+ }
+ )
+}
+```
+
+Apart from ``GridCells.Adaptive`` there are other types of cells that provide the number of columns per row. As follows
+```
+colums = GridCells.Fixed(2)
+```
+The above code will display 2 columns in 1 row.
+
+
+
+## See also:
+* [Official Docs]({{ site.composedoc }}/foundation/lazy/package-summary#LazyVerticalGrid)
+* [Full Example Code]({{ site.samplefolder }}/foundation/LazyVerticalGridDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/foundation/shape.md b/Jetpack-Compose-Playground/docs/foundation/shape.md
new file mode 100644
index 000000000..0ec42d4b6
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/foundation/shape.md
@@ -0,0 +1,103 @@
+
+# Shape
+A Shape can be used to draw a Composable in specific shape.
+
+## RectangleShape
+
+
+
+A shape describing the rectangle with cut corners.
+
+```kotlin
+@Composable
+fun CutCornerShapeDemo(){
+ ExampleBox(shape = CutCornerShape(10.dp))
+}
+
+@Composable
+fun ExampleBox(shape: Shape){
+ Column(modifier = Modifier.fillMaxWidth().wrapContentSize(Alignment.Center)) {
+ Box(
+ modifier = Modifier.size(100.dp).clip(shape).background(Color.Red)
+ )
+ }
+}
+```
+
+## How to draw a custom shape?
+[How to create a custom shape](../cookbook/how_to_create_custom_shape.md)
diff --git a/Jetpack-Compose-Playground/docs/foundation/text.md b/Jetpack-Compose-Playground/docs/foundation/text.md
new file mode 100644
index 000000000..c51459487
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/foundation/text.md
@@ -0,0 +1,125 @@
+
+# Text
+
+You can use **Text** to display text. You can use the **style** argument to define things like textdecoration or fontfamily.
+
+
+
+
+
+
+```kotlin
+@Composable
+fun TextExample(){
+ Column {
+ Text("Just Text")
+ Text("Text with cursive font", style = TextStyle(fontFamily = FontFamily.Cursive))
+ Text(
+ text = "Text with LineThrough",
+ style = TextStyle(textDecoration = TextDecoration.LineThrough)
+ )
+ Text(
+ text = "Text with underline",
+ style = TextStyle(textDecoration = TextDecoration.Underline)
+ )
+ Text(
+ text = "Text with underline, linethrough and bold",
+ style = TextStyle(
+ textDecoration = TextDecoration.combine(
+ listOf(
+ TextDecoration.Underline,
+ TextDecoration.LineThrough
+ )
+ ), fontWeight = FontWeight.Bold
+ )
+ )
+ }
+}
+```
+
+# Working with Text
+
+## Normal text
+
+
+```kotlin
+@Composable
+fun CursiveTextExample(){
+ Text("Text with cursive font", style = TextStyle(fontFamily = Cursive))
+}
+```
+
+## Text with LineThrough
+
+
+
+
+```kotlin
+@Composable
+fun TextWithLineThroughExample(){
+ Text(
+ text = "Text with LineThrough",
+ style = TextStyle(textDecoration = TextDecoration.LineThrough)
+ )
+}
+```
+
+## Text with underline
+
+
+
+
+```kotlin
+@Composable
+fun TextWithUnderline(){
+ Text(
+ text = "Text with underline",
+ style = TextStyle(textDecoration = TextDecoration.Underline)
+ )
+}
+```
+
+## Text with underline, bold and linethrough
+
+
+
+
+```kotlin
+@Composable
+fun TextWithUnderlineStrikeThroughAndBold(){
+ Text(
+ text = "Text with underline, linethrough and bold",
+ style = TextStyle(
+ textDecoration = TextDecoration.combine(
+ listOf(
+ TextDecoration.Underline,
+ TextDecoration.LineThrough
+ )
+ ), fontWeight = FontWeight.Bold
+ )
+ )
+}
+```
+
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/foundation/TextExample.kt)
+* [Write it down: Using text in Jetpack Compose](https://www.droidcon.com/2022/08/01/write-it-down-using-text-in-jetpack-compose/))
+
+
diff --git a/Jetpack-Compose-Playground/docs/general/codelabs.md b/Jetpack-Compose-Playground/docs/general/codelabs.md
new file mode 100644
index 000000000..46af980da
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/codelabs.md
@@ -0,0 +1,7 @@
+# Codelabs
+* [Jetpack Compose basics](https://codelabs.developers.google.com/codelabs/jetpack-compose-basics/index.html?index=..%2F..index#0)
+* [Migrating to Jetpack Compose](https://codelabs.developers.google.com/codelabs/jetpack-compose-migration)
+* [Jetpack Compose Theming](https://codelabs.developers.google.com/codelabs/jetpack-compose-theming/index.html?index=..%2F..index#0)
+* [Layouts in Jetpack Compose](https://codelabs.developers.google.com/codelabs/jetpack-compose-layouts/index.html?index=..%2F..index#0)
+* [Using State in Jetpack Compose](https://codelabs.developers.google.com/codelabs/jetpack-compose-state/index.html?index=..%2F..index#0)
+* [Advanced State Side Effects](https://developer.android.com/codelabs/jetpack-compose-advanced-state-side-effects#0)
diff --git a/Jetpack-Compose-Playground/docs/general/compiler_plugin.md b/Jetpack-Compose-Playground/docs/general/compiler_plugin.md
new file mode 100644
index 000000000..c4a865525
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/compiler_plugin.md
@@ -0,0 +1,66 @@
+# Compiler Plugin
+
+Compose works by transforming all Kotlin functions that are annotated with **@Composable** and adding code for the Compose Runtime.
+To do that it uses a Kotlin Compiler Plugin.
+
+
+For instance, this Composable:
+```kotlin
+@Composable
+fun Hello(name: String) {
+ Text(name)
+}
+```
+
+
+will be transformed and compiled to Jvm ByteCode. Below you can see the decompiled code as Java code
+
+```java
+@Metadata(
+ mv = {1, 5, 1},
+ k = 2,
+ xi = 48,
+ d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\u001a\u0015\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\u0007¢\u0006\u0002\u0010\u0004¨\u0006\u0005"},
+ d2 = {"Hello", "", "name", "", "(Ljava/lang/String;Landroidx/compose/runtime/Composer;I)V", "app_debug"}
+)
+public final class GreetingKt {
+ @Composable
+ public static final void Hello(@NotNull final String name, @Nullable Composer $composer, final int $changed) {
+ Intrinsics.checkNotNullParameter(name, "name");
+ $composer = $composer.startRestartGroup(274849561);
+ ComposerKt.sourceInformation($composer, "C(Hello)7@166L10:Greeting.kt#tlkiwl");
+ int $dirty = $changed;
+ if (($changed & 14) == 0) {
+ $dirty = $changed | ($composer.changed(name) ? 4 : 2);
+ }
+
+ if (($dirty & 11 ^ 2) == 0 && $composer.getSkipping()) {
+ $composer.skipToGroupEnd();
+ } else {
+ TextKt.Text-fLXpl1I(name, (Modifier)null, 0L, 0L, (FontStyle)null, (FontWeight)null, (FontFamily)null, 0L, (TextDecoration)null, (TextAlign)null, 0L, 0, false, 0, (Function1)null, (TextStyle)null, $composer, 14 & $dirty, 0, 65534);
+ }
+
+ ScopeUpdateScope var4 = $composer.endRestartGroup();
+ if (var4 != null) {
+ var4.updateScope((Function2)(new Function2() {
+ public final void invoke(@Nullable Composer $composer, int $force) {
+ GreetingKt.Hello(name, $composer, $changed | 1);
+ }
+ }));
+ }
+
+ }
+}
+```
+
+
+## Where can i find the source code
+https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-master-dev/compose/compiler/compiler-hosted/
+
+
+## See also:
+* Leland Richardson(@intelligibabble) started a series about the Compose Compiler https://www.youtube.com/watch?v=bg0R9-AUXQM
+* [Under the hood of Jetpack Compose — part 2 of 2](https://medium.com/androiddevelopers/under-the-hood-of-jetpack-compose-part-2-of-2-37b2c20c6cdd)
+* [A Hitchhiker's Guide to Compose Compiler: Composers, Compiler Plugins, and Snapshots](https://www.droidcon.com/2022/06/28/ha-hitchhikers-guide-to-compose-compiler-composers-compiler-plugins-and-snapshots/)
+* [Explained: Compose Compiler and Runtime](https://www.droidcon.com/2022/08/02/explained-compose-compiler-and-runtime/)
+* [Using Compose Runtime to create a client library](https://www.droidcon.com/2022/08/02/using-compose-runtime-to-create-a-client-library/)
diff --git a/Jetpack-Compose-Playground/docs/general/compose_lifecycle.md b/Jetpack-Compose-Playground/docs/general/compose_lifecycle.md
new file mode 100644
index 000000000..06a8b452a
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/compose_lifecycle.md
@@ -0,0 +1,53 @@
+
+# Lifecycle
+
+
+Compose has some "effects"-functions that can be used in Composables to track the lifecycle of a function.
+
+* LaunchedEffect {}
+will be called the first time a compose function is applied.
+
+* DisposableEffect { }
+Has a onDispose() which will be called when the compose function isn't part of the composition anymore.
+
+The example below has a Button that will count up everytime it gets clicked.
+When the count value gets 3, the Text() function will not be added anymore.
+
+The first time the LifecycleDemo will be executed, the SideEffect in the if-clause will be executed.
+When the count value gets 3 +onDispose{} inside the if-clause will be called.
+
+
+```kotlin
+@Composable
+fun LifecycleDemo() {
+ val count = remember { mutableStateOf(0) }
+
+ Column {
+ Button(onClick = {
+ count.value++
+ }) {
+ Text("Click me")
+ }
+
+ if (count.value < 3) {
+ LaunchedEffect(Unit)
+ Log.d("Compose", "onactive with value: " + count.value)
+ }
+ DisposableEffect(Unit) {
+ onDispose {
+ Log.d("Compose", "onDispose because value=" + count.value)
+ }
+ }
+
+ Text(text = "You have clicked the button: " + count.value.toString())
+ }
+ }
+}
+```
+
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/general/LifecycleDemo.kt)
+
diff --git a/Jetpack-Compose-Playground/docs/general/composeconfusion.md b/Jetpack-Compose-Playground/docs/general/composeconfusion.md
new file mode 100644
index 000000000..0b2811419
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/composeconfusion.md
@@ -0,0 +1,36 @@
+# Compose Confusion
+Because of similar naming of the Compose libraries, there is a some confusion between the different "variants" of Compose. Here is a quick overview that tries to give clarification:
+
+## Compose Runtime
+
+The [Compose Runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) is a library for manipulating and managing trees of data.
+This library can be used to manage UI tree nodes, but it's a general purpose library, so it can be used with any kind of data.
+
+It is developed as a Kotlin Multiplatform Library, which means that it could be ported to every target that Kotlin Multiplatform supports.
+Openly developed targets are Android, JVM and Web.
+[Square](https://www.reddit.com/r/androiddev/comments/r77o7d/comment/hmyqbta/?utm_source=share&utm_medium=web2x&context=3
+) is running an internal version of it on iOS.
+
+This library contains basic things like @Composable, remember, mutableState, effects.
+
+## Compose Compiler Plugin
+The Compose Compiler Plugin is a Kotlin Compiler Plugin that transforms all the **@Composable** functions and adds the needed calls to the **Compose Runtime**
+
+## Compose UI
+[Compose UI](https://developer.android.com/jetpack/androidx/releases/compose-ui) is a set of UI libraries for Android using **Compose Runtime/Compose Compiler Plugin**
+
+
+# Jetpack Compose
+Jetpack Compose is a UI Toolkit for Android developed by Google.
+It is using **Compose Runtime/Compose Compiler Plugin** and **Compose UI**
+
+# Compose HTML
+Compose HTML is a UI Toolkit for Web developed by JetBrains written in Kotlin/JS.
+It is using the **Compose Runtime** and the **Compose Compiler Plugin**. It does not use Compose UI, because it uses Compose Wrappers for the HTML DOM UI Elements.
+
+# Compose for Desktop
+**Compose for Desktop** is a UI Toolkit developed by JetBrains. It runs on the JVM and it is using **Compose Runtime**, **Compose Compiler Plugin** and a Compose UI version for desktop which is using Skia to target Windows, macOS, Linux. Additional it provides components for desktop specific apps like scrollbars or mouse support and Swing interop.
+
+# Compose Multiplatform
+[Compose Multiplatform](https://www.jetbrains.com/lp/compose-mpp/) is a Kotlin multiplatform project which is developed by JetBrains.
+It uses Jetpack Compose, Compose for Web and Compose for Desktop
diff --git a/Jetpack-Compose-Playground/docs/general/compositionlocal.md b/Jetpack-Compose-Playground/docs/general/compositionlocal.md
new file mode 100644
index 000000000..764754ed0
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/compositionlocal.md
@@ -0,0 +1,85 @@
+
+# CompositionLocal
+
+
+CompositionLocal is useful when you want to create a dependency in a higher node of the layout tree and use it on lower node without having to
+pass it down the tree through every child Composable.
+
+## How to create an CompositionLocal?
+```kotlin
+data class User(val name: String, val age: Int)
+val LocalActiveUser = compositionLocalOf { error("No user found!") }
+```
+Let's say you want to create an CompositionLocal with an User. You can use **compositionLocalOf**. Inside the function you can return an initial user object
+ or you can throw an exception when the user is missing.
+
+## How to provide a value for an CompositionLocal?
+
+```kotlin
+@Composable
+private fun MyUserScreen() {
+ val user = User("Jens", 31)
+ CompositionLocalProvider(LocalActiveUser provides user) {
+ UserInfo()
+ }
+}
+```
+Somewhere above in your hierarchy you have to use CompositionLocalProvider to provide a value for your CompositionLocal.
+The syntax is: "**CompositionLocal``** provides **T**".
+All child @Composable of CompositionLocalProvider will implicitly be able to get the value of the CompositionLocals.
+
+## How to use a value of an CompositionLocal?
+
+```kotlin
+@Preview
+@Composable
+fun UserInfo() {
+ Column {
+ Text("Name: " + LocalActiveUser.current.name)
+ Text("Age: " + LocalActiveUser.current.age)
+ }
+}
+```
+
+Now you can use your CompositionLocal in your @Composable. Every CompositionLocal has a **current** property that contains the current value.
+
+## Predefined CompositionLocals
+The Compose libraries already contain some useful CompositionLocals. You can directly use them without needing add a Providers.
+
+### LocalContext
+Provides a [Context] that can be used by Android applications.
+
+### LocalConfiguration
+The [Configuration] is useful for determining how to organize the UI.
+
+#### Device orientation
+One of the things you can get from the LocalConfiguration is the orientation of your device. This can be used to give the user a different ui when the device is rotated.
+
+```kotlin
+val configuration = LocalConfiguration.current
+when (configuration.orientation) {
+ Configuration.ORIENTATION_LANDSCAPE -> {
+ Text("Landscape")
+ }
+ else -> {
+ Text("Portrait")
+ }
+}
+```
+
+### LocalLifecycleOwner
+The CompositionLocal containing the current [LifecycleOwner].
+
+### LocalView
+ The CompositionLocal containing the current Compose [View].
+
+### LocalViewModelStoreOwner
+The CompositionLocal containing the current [ViewModelStoreOwner].
+
+
+## See also:
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocal)
+* [Full Example Code]({{ site.samplefolder }}/general/CompositionLocalExample.kt)
+
diff --git a/Jetpack-Compose-Playground/docs/general/compositionlocalprovider.md b/Jetpack-Compose-Playground/docs/general/compositionlocalprovider.md
new file mode 100644
index 000000000..cf80344f2
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/compositionlocalprovider.md
@@ -0,0 +1,17 @@
+# CompositionLocalProvider
+CompositionLocalProvider are used to provide a value for an [CompositionLocal](../compositionlocal)
+
+## How to provide a value for an CompositionLocal?
+
+```kotlin
+@Composable
+private fun MyUserScreen() {
+ val user = User("Jens", 31)
+ CompositionLocalProvider(LocalActiveUser provides user) {
+ UserInfo()
+ }
+}
+```
+Somewhere above in your hierarchy you have to use CompositionLocalProviders to provide a value for your CompositionLocal. You can provide the values of multiple CompositionLocals inside Providers.
+The syntax is: "**CompositionLocal``** provides **T**".
+All child @Composable of CompositionLocalProvider will implicitly be able to get the value of the CompositionLocals.
diff --git a/Jetpack-Compose-Playground/docs/general/getting_started.md b/Jetpack-Compose-Playground/docs/general/getting_started.md
new file mode 100644
index 000000000..7e8e0a999
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/getting_started.md
@@ -0,0 +1,49 @@
+# Project Setup
+
+## Gradle Dependencies
+
+Add this inside in the **android{}** block your build.gradle
+```groovy
+android{
+//YOUR OTHER CODE
+
+ buildFeatures {
+ compose = true
+ }
+ composeOptions {
+ kotlinCompilerExtensionVersion = "{{compose.release}}"
+ }
+
+}
+```
+
+Below are some Compose dependencies that are online available, can find the others [here](https://maven.google.com/web/index.html?q=compose#androidx.compose.ui)
+
+```kotlin
+
+dependencies {
+ val compose_version = "{{compose.release}}"
+
+ implementation("androidx.compose.animation:animation-core:$compose_version")
+ implementation("androidx.compose.animation:animation:$compose_version")
+ implementation("androidx.compose.ui:ui:$compose_version")
+ implementation("androidx.compose.foundation:foundation:$compose_version")
+ implementation("androidx.compose.ui:ui-geometry:$compose_version")
+ implementation("androidx.compose.ui:ui-graphics:$compose_version")
+ implementation("androidx.compose.foundation:foundation-layout:$compose_version")
+ implementation("androidx.compose.runtime:runtime-livedata:$compose_version")
+ implementation("androidx.compose.material:material:$compose_version")
+ implementation("androidx.compose.material:material-icons-core:$compose_version")
+ implementation("androidx.compose.material:material-icons-extended:$compose_version")
+ implementation("androidx.compose.runtime:runtime-rxjava2:$compose_version")
+ implementation("androidx.compose.ui:ui-text:$compose_version")
+ implementation("androidx.compose.ui:ui-util:$compose_version")
+ implementation("androidx.compose.ui:ui-viewbinding:$compose_version")
+ implementation("androidx.compose.ui:ui-tooling:$compose_version")
+ implementation("androidx.activity:activity-compose:1.3.1")
+
+ //Compose Constraintlayout
+ implementation("androidx.constraintlayout:constraintlayout-compose:1.0.0")
+}
+
+```
diff --git a/Jetpack-Compose-Playground/docs/general/helloworld.md b/Jetpack-Compose-Playground/docs/general/helloworld.md
new file mode 100644
index 000000000..cf0a8c69f
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/helloworld.md
@@ -0,0 +1,36 @@
+# Hello World Compose
+
+### Setup the project
+First setup your [Project Setup](getting_started.md)
+
+
+### Write a simple Compose function
+
+A basic Compose View is using a normal Kotlin function which is annotated with @Composable
+
+
+```kotlin
+@Composable
+fun HelloWorld() {
+ Text("Hello World!")
+}
+```
+
+### Use a Compose function as a view in your android app
+
+ To use the HelloWorld() function in your App you have to use the setContent() extension function inside a onCreate() in an Activity.
+
+
+```kotlin
+
+class MainActivity : AppCompatActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ setContent {
+ HelloWorld()
+ }
+ }
+}
+```
diff --git a/Jetpack-Compose-Playground/docs/general/modifier.md b/Jetpack-Compose-Playground/docs/general/modifier.md
new file mode 100644
index 000000000..8438b2a9d
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/modifier.md
@@ -0,0 +1,93 @@
+
+# Modifier
+
+Modifiers can be used modify certain aspects of a Composable.
+To set them, a Composable needs to accept a modifier as a parameter.
+
+## Combine modifiers
+```kotlin
+Column(modifier = Modifier.height(500.dp).padding(100.dp)) {
+ Text("Hello")
+}
+```
+You can chain multiple modifiers.
+The order is important modifier elements to the left are applied before modifier elements to the right.
+
+## Some Modifiers
+The Compose libraries already contain some useful modifiers.
+
+### LayoutModifier
+
+#### Modifier.width()
+You can use this to set the width of a Composable.
+
+#### Modifier.height()
+You can use this to set the height of a Composable.
+
+#### Modifier.size()
+You can use this to set the width and height of a Composable.
+
+#### Modifier.fillMaxHeight()
+This will set the height of the Composable to the maximum available height. This is similar to **MATCH_PARENT** from the classic View system.
+
+#### Modifier.fillMaxWidth()
+This will set the width of the Composable to the maximum available width. This is similar to **MATCH_PARENT** from the classic View system.
+
+#### Modifier.fillMaxSize()
+This will set the height/width of the Composable to the maximum available height/width
+
+#### Modifier.padding()
+You can use **Modifier.padding** to set padding to Composables that take a modifier as an argument.
+
+
+
+
+
+```kotlin
+@Composable
+fun PaddingDemo() {
+
+ Column {
+ Text("TextWithoutPadding")
+ Column(modifier = Modifier.padding(start = 80.dp)){
+ Text("TextWith80dpOnlyLeftPadding")
+ }
+
+ Column(Modifier.padding(all = 80.dp)){
+ Text("TextWith80dpPadding")
+ }
+ }
+}
+```
+
+### DrawModifier
+
+#### Modifier.background()
+With this modifier you can set a background color/shape for the Composable
+
+#### Modifier.clip()
+This modifier can clip the Composable to rectangle, rounded, or circle
+
+### GestureModifier
+
+#### Modifier.clickable
+Configure component to receive clicks via input or accessibility "click" event.
+
+
+#### Modifier.scrollable
+You can use this to make a Composable scrollable
+
+#### Modifier.draggable
+You can use this to make a Composable draggable
+
+#### Modifier.swipeable
+You drag elements which, when released, animate towards typically two or more anchor points defined in an orientation
+
+#### Multitouch: Panning, zooming, rotating
+To detect multitouch gestures used for panning, zooming and rotating, you can use the ``transformable`` modifier. This modifier does not transform elements by itself, it only detects the gestures.
+
+
+## See also:
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier)
diff --git a/Jetpack-Compose-Playground/docs/general/navigation.md b/Jetpack-Compose-Playground/docs/general/navigation.md
new file mode 100644
index 000000000..ec0f2113a
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/navigation.md
@@ -0,0 +1,12 @@
+# Navigation
+
+## On Android
+In Android Projects you can use the [Jetpack Compose Navigation](https://developer.android.com/jetpack/compose/navigation)
+
+[Codelab Jetpack Compose Navigation](https://developer.android.com/codelabs/jetpack-compose-navigation#0)
+
+
+## Multiplatform
+When you need a multiplaform solution for Routing, you can use [Decompose](https://github.com/arkivanov/Decompose)
+
+[Decompose Navigation Overview](https://arkivanov.github.io/Decompose/navigation/overview/)
diff --git a/Jetpack-Compose-Playground/docs/general/preview/preview.md b/Jetpack-Compose-Playground/docs/general/preview/preview.md
new file mode 100644
index 000000000..f153d0961
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/preview/preview.md
@@ -0,0 +1,48 @@
+# Preview
+## Preview
+You can use the **@Preview** annotation to preview compose functions inside Android Studio.
+Preview can not be used on Composables that have parameters without a default parameter.
+
+```kotlin
+@Preview
+@Composable
+fun TextDemo(){
+ Text("Hello")
+}
+
+@Preview(name = "MyPreviewName")
+@Composable
+fun TextDemo2(){
+ Text("Hello")
+}
+
+```
+Android Studio Preview
+
+
+
+
+
+## Group Previews
+
+```kotlin
+ @Preview(group = "TestGroup1")
+```
+The Preview annotation has a group parameter. You can use it to set a group name to your previews.
+
+
+
+
+The layout preview will now have an option to filter all the previews by the group name.
+
+## Interactive Previews
+
+
+
+
+Above a generated preview in Android Studio you will find an "Interactive" Button. It will open your Composable in an interactive preview mode where can try your Composable directly inside
+Android Studio.
+
+
+## See also:
+* [Official Docs](https://developer.android.com/jetpack/compose/tooling#preview-features)
diff --git a/Jetpack-Compose-Playground/docs/general/preview/previewparameter.md b/Jetpack-Compose-Playground/docs/general/preview/previewparameter.md
new file mode 100644
index 000000000..d5d823050
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/preview/previewparameter.md
@@ -0,0 +1,71 @@
+# PreviewParameter
+
+You can use **@PreviewParameter** to provide sample data for your Composables.
+Let's say you have the following Composable and you want to generate a preview.
+
+```kotlin
+data class User(val name :String,val age:Int)
+
+@Composable
+fun UserInfo(user:User) {
+ Text(user.name+ " "+user.age)
+}
+```
+
+Because UserInfo needs a User you can't directly use @Preview.
+One way is to wrap your Composable in a Composable that provides a User
+
+```kotlin
+@Preview
+@Composable
+fun UserPreview() {
+ UserInfo(user = User("Jens", 31))
+}
+```
+
+An other way is to use @PreviewParameter on the parameter. With PreviewParameter you can set a class
+which will provide values for the needed User
+
+```kotlin
+@Preview
+@Composable
+fun UserInfo(@PreviewParameter(SampleUserProvider::class) user:User) {
+ Text(user.name+ " "+user.age)
+}
+```
+### Create PreviewParameterProvider
+
+**SampleUserProvider::class** will be the class which provides a User.
+To create a PreviewParameterProvider you need to implement the interface PreviewParameterProvider.
+The interface has two properties.
+
+**values** is a sequence of your sample data.
+
+```kotlin
+class SampleUserProvider: PreviewParameterProvider {
+ override val values = sequenceOf(User("Jens",31),User("Jim",44))
+}
+```
+
+### Use PreviewParameterProvider
+You can annotate your parameter with @PreviewParameter and the class which provides the sample data.
+
+```kotlin
+@Preview
+@Composable
+fun UserInfo(@PreviewParameter(SampleUserProvider::class) user:User) {
+ Text(user.name+ " "+user.age)
+}
+```
+
+Now Android Studio will generate a preview of the Composable for every value that your provider provides.
+
+
+
+
+
+You can limit the amount of previews by settings a limit to PreviewParameter.
+
+```kotlin
+@PreviewParameter(SampleUserProvider::class,1)
+```
diff --git a/Jetpack-Compose-Playground/docs/general/roadmap.md b/Jetpack-Compose-Playground/docs/general/roadmap.md
new file mode 100644
index 000000000..f1a6ec963
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/roadmap.md
@@ -0,0 +1,3 @@
+# Roadmap
+
+You can find the road map here: https://developer.android.com/jetpack/androidx/compose-roadmap
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/general/state.md b/Jetpack-Compose-Playground/docs/general/state.md
new file mode 100644
index 000000000..b4f6c1de6
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/state.md
@@ -0,0 +1,62 @@
+
+# State
+
+## Define a state
+```kotlin
+val textState = mutableStateOf("Hello")
+```
+
+You can use the mutableStateOf function to create a mutable state.
+
+
+## Example
+In this example we will create a composable with a Text and a Button. On a click on the button, the count state will go up and the text of Text will be updated.
+
+
+Initial state:
+
+
+
+
+After Button click:
+
+
+
+
+
+```kotlin
+@Composable
+fun StateDemo(){
+ val countState = remember { mutableStateOf(0) }
+ Column {
+ Button(colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.secondary), onClick = { countState.value++ }) {
+ Text("count up")
+ }
+ Text("You have clicked the Button " + countState.value.toString() + " times")
+ }
+}
+
+```
+
+```kotlin
+val countState = remember { mutableStateOf(0) }
+```
+
+Here we define the state for the click counter with **mutableStateOf(0)**. 0 will be the initial value. Because 0 is an Int, the counterState will only allow values which are Int.
+
+**remember** is used to remember the countstate. Without remember, every time the value of countstate would change, the StateDemo Composable will be recomposed and your state will also
+get recreated with the initial value. When you use remember it will remember the last value and not be recreated.
+
+```kotlin
+countState.value
+```
+With the value property you can get/set the value of the counterstate. In the onClick() function of the Button, the value will be incremented. The Text shows the value of the counterstate. When counterstate is changed,
+"Text" will also change.
+
+
+## See also:
+* [Codelab: Using state in Jetpack Compose](https://developer.android.com/codelabs/jetpack-compose-state#0)
+
+* [Invest in Real State: A workshop for State in Compose](https://www.droidcon.com/2022/08/02/invest-in-real-state-a-workshop-for-state-in-compose/)
diff --git a/Jetpack-Compose-Playground/docs/general/testing.md b/Jetpack-Compose-Playground/docs/general/testing.md
new file mode 100644
index 000000000..ea4a38fc6
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/general/testing.md
@@ -0,0 +1,134 @@
+# UI Testing
+
+## Setup
+Add the Compose testing library to your dependencies in build.gradle
+
+```kotlin
+androidTestImplementation("androidx.compose.ui:ui-test:$compose_version")
+debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")
+```
+
+## Example
+Let's say you have the following example code, it's a button with a text that says **Hello** and when you click on it, it turns to **Bye**
+
+```kotlin
+@Composable
+fun TestingExample() {
+ val state = remember { mutableStateOf("Hello") }
+ Button(onClick = { state.value = "Bye" }) {
+ Text(state.value)
+ }
+}
+```
+
+
+## TestRule
+To run this Composable in your test Code you have 2 options:
+
+### 1) createComposeRule()
+```kotlin
+@Rule
+@JvmField
+var composeTestRule: ComposeContentTestRule = createComposeRule()
+```
+
+You can use this when you want to run your Composable without a specific Activity. You can then use the **setContent()** from the TestRule to host your Composable.
+
+```kotlin
+composeTestRule.setContent {
+ TestingExample()
+}
+```
+
+
+### 2) createAndroidComposeRule()
+```kotlin
+@Rule
+@JvmField
+var composeTestRule: ComposeContentTestRule = createAndroidComposeRule()
+```
+
+You can use this when you want to start your test with a specific Activity.
+
+## Interaction with Composables
+
+Now we want to test how the Composable reacts when we interact with it.
+Usually in Tests we would use Espresso for that, but you can use that only for classic Android Views and not for Composables.
+
+The ComposeTestRule will offer a similar API
+
+```kotlin
+class ExampleUiTestWithAndroidComposeRule {
+
+ @Rule
+ @JvmField
+ var composeTestRule: ComposeContentTestRule = createAndroidComposeRule()
+
+ @Test
+ fun whenIClickOnButton_TheTextShouldChange() {
+ composeTestRule.onNodeWithText("Hello").assertExists()
+ composeTestRule.onNodeWithText("Hello").performClick()
+ composeTestRule.onNodeWithText("Hello").assertDoesNotExist()
+ composeTestRule.onNodeWithText("Bye").assertExists()
+ }
+
+}
+```
+
+As you can see above we used the TestRule methods to click on the node with the text **Hello** and asserted that the text changed to **Bye**
+
+The TestRule offers a lot of different methods. You can find a cheatSheet [here](https://developer.android.com/jetpack/compose/testing-cheatsheet)
+
+### TestTags
+The test above is only half correct, because it looks for the text inside the button and not the button itself.
+Composables have no resource ids so we cant just use **onView(withId(R.id.my_view))** to find a Composable in a test, also we can't find Composables of a specific "type"
+like a button, because everything is just a Composable function.
+
+When you can't find a Composable by a text and you want to make it detectable in your test. Jetpack Compose offers the concept of a **TestTag**.
+testTag is a modifier that needs to be set to a Composable. It expects a string which will be used as a reference in your test.
+
+```kotlin
+@Composable
+fun TestingExample() {
+ val state = remember { mutableStateOf("Hello") }
+ Button(onClick = { state.value = "Bye" }, modifier = Modifier.testTag("MyTestTag")) {
+ Text(state.value)
+ }
+}
+```
+
+Now you can use **onNodeWithTag("MyTestTag")** to find the button Composable.
+
+```kotlin
+@Test
+fun whenIClickOnButton_TheTextShouldChange() {
+ composeTestRule.onNodeWithTag("MyTestTag").assertTextEquals("Hello")
+ composeTestRule.onNodeWithTag("MyTestTag").performClick()
+ composeTestRule.onNodeWithText("Hello").assertDoesNotExist()
+ composeTestRule.onNodeWithTag("MyTestTag").assertTextEquals("Bye")
+}
+```
+
+### PrintToLog
+When you want to get more information about how the node tree of a Composable looks like,
+you can use **printToLog()** on a node.
+
+```kotlin
+composeTestRule.onNodeWithTag("MyTestTag").printToLog("XXX")
+```
+
+will print to logcat:
+
+```kotlin
+2022-01-07 22:58:55.048 9567-9587/de.jensklingenberg.jetpackcomposeplayground D/XXX: printToLog:
+Printing with useUnmergedTree = 'false'
+Node #2 at (l=0.0, t=325.0, r=195.0, b=424.0)px, Tag: 'MyTestTag'
+Role = 'Button'
+Text = '[Hello]'
+Actions = [OnClick, GetTextLayoutResult]
+MergeDescendants = 'true'
+```
+
+## See also:
+* [Full Example Code](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/app/src/androidTest/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUiTestWithAndroidComposeRule.kt)
+* [Full Example Code](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/app/src/androidTest/java/de/jensklingenberg/jetpackcomposeplayground/ExampleUiTestWithComposeRule.kt)
diff --git a/Jetpack-Compose-Playground/docs/images/DialogExample.png b/Jetpack-Compose-Playground/docs/images/DialogExample.png
new file mode 100644
index 000000000..74e93048c
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/DialogExample.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/Elevation.png b/Jetpack-Compose-Playground/docs/images/Elevation.png
new file mode 100644
index 000000000..49e1e8b34
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/Elevation.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/LayoutActivity.png b/Jetpack-Compose-Playground/docs/images/LayoutActivity.png
new file mode 100644
index 000000000..15a566c0e
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/LayoutActivity.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/SelectionControlsActivity.png b/Jetpack-Compose-Playground/docs/images/SelectionControlsActivity.png
new file mode 100644
index 000000000..4213cb7d9
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/SelectionControlsActivity.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/TableLayout.png b/Jetpack-Compose-Playground/docs/images/TableLayout.png
new file mode 100644
index 000000000..d75598142
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/TableLayout.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/TextDemo.png b/Jetpack-Compose-Playground/docs/images/TextDemo.png
new file mode 100644
index 000000000..fcb5a3395
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/TextDemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/TextFieldDemo.png b/Jetpack-Compose-Playground/docs/images/TextFieldDemo.png
new file mode 100644
index 000000000..1076719b6
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/TextFieldDemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/activity/backhandler/backhandler.png b/Jetpack-Compose-Playground/docs/images/activity/backhandler/backhandler.png
new file mode 100644
index 000000000..e2538cab9
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/activity/backhandler/backhandler.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/animation/crossfade/crossfadedemo.webm b/Jetpack-Compose-Playground/docs/images/animation/crossfade/crossfadedemo.webm
new file mode 100644
index 000000000..7960dbf2a
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/animation/crossfade/crossfadedemo.webm differ
diff --git a/Jetpack-Compose-Playground/docs/images/animation/transistion/rotation.mp4 b/Jetpack-Compose-Playground/docs/images/animation/transistion/rotation.mp4
new file mode 100644
index 000000000..dce85dbaf
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/animation/transistion/rotation.mp4 differ
diff --git a/Jetpack-Compose-Playground/docs/images/counterdemo.png b/Jetpack-Compose-Playground/docs/images/counterdemo.png
new file mode 100644
index 000000000..ec28965f8
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/counterdemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/basictextfield/basictextfield.png b/Jetpack-Compose-Playground/docs/images/foundation/basictextfield/basictextfield.png
new file mode 100644
index 000000000..22926dd53
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/basictextfield/basictextfield.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/box/box.png b/Jetpack-Compose-Playground/docs/images/foundation/box/box.png
new file mode 100644
index 000000000..f4414d41d
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/box/box.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/box/boxdemo.png b/Jetpack-Compose-Playground/docs/images/foundation/box/boxdemo.png
new file mode 100644
index 000000000..f7191a435
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/box/boxdemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/canvas/CanvasDrawExample.png b/Jetpack-Compose-Playground/docs/images/foundation/canvas/CanvasDrawExample.png
new file mode 100644
index 000000000..aa43884eb
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/canvas/CanvasDrawExample.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/image/imagedemo.png b/Jetpack-Compose-Playground/docs/images/foundation/image/imagedemo.png
new file mode 100644
index 000000000..282faba3d
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/image/imagedemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/layout/boxwithconstraints/boxwithconstraints.png b/Jetpack-Compose-Playground/docs/images/foundation/layout/boxwithconstraints/boxwithconstraints.png
new file mode 100644
index 000000000..31452326b
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/layout/boxwithconstraints/boxwithconstraints.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/layout/spacer/spacer.png b/Jetpack-Compose-Playground/docs/images/foundation/layout/spacer/spacer.png
new file mode 100644
index 000000000..aa64428af
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/layout/spacer/spacer.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/lazycolumnitems.png b/Jetpack-Compose-Playground/docs/images/foundation/lazycolumnitems.png
new file mode 100644
index 000000000..e85ac2962
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/lazycolumnitems.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/lazyrow/lazyrow.png b/Jetpack-Compose-Playground/docs/images/foundation/lazyrow/lazyrow.png
new file mode 100644
index 000000000..bc9d732e2
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/lazyrow/lazyrow.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/lazyverticalgrid/lazyverticalgrid.png b/Jetpack-Compose-Playground/docs/images/foundation/lazyverticalgrid/lazyverticalgrid.png
new file mode 100644
index 000000000..97f6aca56
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/lazyverticalgrid/lazyverticalgrid.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/scrollablecolumn/VerticalScroller.webm b/Jetpack-Compose-Playground/docs/images/foundation/scrollablecolumn/VerticalScroller.webm
new file mode 100644
index 000000000..d84071dfb
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/scrollablecolumn/VerticalScroller.webm differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/shape/circleshape.png b/Jetpack-Compose-Playground/docs/images/foundation/shape/circleshape.png
new file mode 100644
index 000000000..6f00a14b6
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/shape/circleshape.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/shape/cutcornershape.png b/Jetpack-Compose-Playground/docs/images/foundation/shape/cutcornershape.png
new file mode 100644
index 000000000..a27a0a4cc
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/shape/cutcornershape.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/shape/rectangleshape.png b/Jetpack-Compose-Playground/docs/images/foundation/shape/rectangleshape.png
new file mode 100644
index 000000000..f4414d41d
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/shape/rectangleshape.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/shape/roundedcornershape.png b/Jetpack-Compose-Playground/docs/images/foundation/shape/roundedcornershape.png
new file mode 100644
index 000000000..4b0468a9e
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/shape/roundedcornershape.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/shape/triangleshape.png b/Jetpack-Compose-Playground/docs/images/foundation/shape/triangleshape.png
new file mode 100644
index 000000000..98104c846
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/shape/triangleshape.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/text/TextExample.png b/Jetpack-Compose-Playground/docs/images/foundation/text/TextExample.png
new file mode 100644
index 000000000..ece0a99b9
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/text/TextExample.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/text/cursive_text.png b/Jetpack-Compose-Playground/docs/images/foundation/text/cursive_text.png
new file mode 100644
index 000000000..3c26eb498
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/text/cursive_text.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/text/linethrough_text.png b/Jetpack-Compose-Playground/docs/images/foundation/text/linethrough_text.png
new file mode 100644
index 000000000..227fa6a32
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/text/linethrough_text.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/text/normal_text.png b/Jetpack-Compose-Playground/docs/images/foundation/text/normal_text.png
new file mode 100644
index 000000000..d0fa97f6a
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/text/normal_text.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/text/underline_bold_linethrough_text.png b/Jetpack-Compose-Playground/docs/images/foundation/text/underline_bold_linethrough_text.png
new file mode 100644
index 000000000..54973e0b9
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/text/underline_bold_linethrough_text.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/foundation/text/underline_text.png b/Jetpack-Compose-Playground/docs/images/foundation/text/underline_text.png
new file mode 100644
index 000000000..a4242370e
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/foundation/text/underline_text.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/general/Roadmap.png b/Jetpack-Compose-Playground/docs/images/general/Roadmap.png
new file mode 100644
index 000000000..68bd70b77
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/general/Roadmap.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/general/modifier/PaddingExample.png b/Jetpack-Compose-Playground/docs/images/general/modifier/PaddingExample.png
new file mode 100644
index 000000000..e9e0bb7cf
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/general/modifier/PaddingExample.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/general/preview/ComposePreview.png b/Jetpack-Compose-Playground/docs/images/general/preview/ComposePreview.png
new file mode 100644
index 000000000..045d0fc6e
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/general/preview/ComposePreview.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/general/preview/grouppreviews.png b/Jetpack-Compose-Playground/docs/images/general/preview/grouppreviews.png
new file mode 100644
index 000000000..705affebe
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/general/preview/grouppreviews.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/general/preview/interactivepreview.png b/Jetpack-Compose-Playground/docs/images/general/preview/interactivepreview.png
new file mode 100644
index 000000000..7ad6e41f8
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/general/preview/interactivepreview.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/general/preview/previewParam1.png b/Jetpack-Compose-Playground/docs/images/general/preview/previewParam1.png
new file mode 100644
index 000000000..275d8dd8c
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/general/preview/previewParam1.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/general/state/state1.png b/Jetpack-Compose-Playground/docs/images/general/state/state1.png
new file mode 100644
index 000000000..a7b4e4422
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/general/state/state1.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/general/state/state2.png b/Jetpack-Compose-Playground/docs/images/general/state/state2.png
new file mode 100644
index 000000000..af8280fa9
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/general/state/state2.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/box/boxdemo.png b/Jetpack-Compose-Playground/docs/images/layout/box/boxdemo.png
new file mode 100644
index 000000000..de1c5a117
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/box/boxdemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/column/ColumnExample.png b/Jetpack-Compose-Playground/docs/images/layout/column/ColumnExample.png
new file mode 100644
index 000000000..db743e5a9
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/column/ColumnExample.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/column/centerhorizontal.png b/Jetpack-Compose-Playground/docs/images/layout/column/centerhorizontal.png
new file mode 100644
index 000000000..667118493
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/column/centerhorizontal.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/column/end.png b/Jetpack-Compose-Playground/docs/images/layout/column/end.png
new file mode 100644
index 000000000..fe556fca6
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/column/end.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/column/modifierCenterH.png b/Jetpack-Compose-Playground/docs/images/layout/column/modifierCenterH.png
new file mode 100644
index 000000000..2abfcb551
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/column/modifierCenterH.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/column/modifierEnd.png b/Jetpack-Compose-Playground/docs/images/layout/column/modifierEnd.png
new file mode 100644
index 000000000..57042bcde
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/column/modifierEnd.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/column/modifierStart.png b/Jetpack-Compose-Playground/docs/images/layout/column/modifierStart.png
new file mode 100644
index 000000000..39cbe1e7b
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/column/modifierStart.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/column/start.png b/Jetpack-Compose-Playground/docs/images/layout/column/start.png
new file mode 100644
index 000000000..39cbe1e7b
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/column/start.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/column/top.png b/Jetpack-Compose-Playground/docs/images/layout/column/top.png
new file mode 100644
index 000000000..92cba1933
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/column/top.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/column/vbottom.png b/Jetpack-Compose-Playground/docs/images/layout/column/vbottom.png
new file mode 100644
index 000000000..d9880050a
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/column/vbottom.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/column/vcenter.png b/Jetpack-Compose-Playground/docs/images/layout/column/vcenter.png
new file mode 100644
index 000000000..12f0b1910
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/column/vcenter.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/constraintlayout/constraintlayout.png b/Jetpack-Compose-Playground/docs/images/layout/constraintlayout/constraintlayout.png
new file mode 100644
index 000000000..e8cb07228
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/constraintlayout/constraintlayout.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/row/RowExample.png b/Jetpack-Compose-Playground/docs/images/layout/row/RowExample.png
new file mode 100644
index 000000000..ea48e2c0a
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/row/RowExample.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/row/arrange_center.png b/Jetpack-Compose-Playground/docs/images/layout/row/arrange_center.png
new file mode 100644
index 000000000..408e7a202
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/row/arrange_center.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/row/arrangement_end.png b/Jetpack-Compose-Playground/docs/images/layout/row/arrangement_end.png
new file mode 100644
index 000000000..7a65e2901
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/row/arrangement_end.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/layout/row/row_arrangement_space_evenly.png b/Jetpack-Compose-Playground/docs/images/layout/row/row_arrangement_space_evenly.png
new file mode 100644
index 000000000..d5f846704
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/layout/row/row_arrangement_space_evenly.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/alertdialog/AlertDialogSample.png b/Jetpack-Compose-Playground/docs/images/material/alertdialog/AlertDialogSample.png
new file mode 100644
index 000000000..1583459a7
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/alertdialog/AlertDialogSample.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/badgebox/img.png b/Jetpack-Compose-Playground/docs/images/material/badgebox/img.png
new file mode 100644
index 000000000..c036f2680
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/badgebox/img.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/button/buttonExample.png b/Jetpack-Compose-Playground/docs/images/material/button/buttonExample.png
new file mode 100644
index 000000000..4c3f54096
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/button/buttonExample.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/card/card.png b/Jetpack-Compose-Playground/docs/images/material/card/card.png
new file mode 100644
index 000000000..d2377f57f
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/card/card.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/card/carddemo.png b/Jetpack-Compose-Playground/docs/images/material/card/carddemo.png
new file mode 100644
index 000000000..9fae44125
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/card/carddemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/checkbox/CheckboxDemo.png b/Jetpack-Compose-Playground/docs/images/material/checkbox/CheckboxDemo.png
new file mode 100644
index 000000000..21fe9401f
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/checkbox/CheckboxDemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/circularprogressindicator/circularprogress.mp4 b/Jetpack-Compose-Playground/docs/images/material/circularprogressindicator/circularprogress.mp4
new file mode 100644
index 000000000..02cd1f9e6
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/circularprogressindicator/circularprogress.mp4 differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/circularprogressindicator/progresshalf.png b/Jetpack-Compose-Playground/docs/images/material/circularprogressindicator/progresshalf.png
new file mode 100644
index 000000000..3e307bc07
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/circularprogressindicator/progresshalf.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/divider/divider.png b/Jetpack-Compose-Playground/docs/images/material/divider/divider.png
new file mode 100644
index 000000000..a7f39ad76
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/divider/divider.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/dropdownmenu/dropdown.png b/Jetpack-Compose-Playground/docs/images/material/dropdownmenu/dropdown.png
new file mode 100644
index 000000000..de1b59a02
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/dropdownmenu/dropdown.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/floatingactionbutton/exfab.png b/Jetpack-Compose-Playground/docs/images/material/floatingactionbutton/exfab.png
new file mode 100644
index 000000000..8757929d8
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/floatingactionbutton/exfab.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/floatingactionbutton/fab.png b/Jetpack-Compose-Playground/docs/images/material/floatingactionbutton/fab.png
new file mode 100644
index 000000000..d50397e29
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/floatingactionbutton/fab.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/linearprogressindicator/linearprogress.mp4 b/Jetpack-Compose-Playground/docs/images/material/linearprogressindicator/linearprogress.mp4
new file mode 100644
index 000000000..c7efb48a4
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/linearprogressindicator/linearprogress.mp4 differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/linearprogressindicator/progresshalf.png b/Jetpack-Compose-Playground/docs/images/material/linearprogressindicator/progresshalf.png
new file mode 100644
index 000000000..07f5bf075
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/linearprogressindicator/progresshalf.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/modalbottomsheetlayout/modalbottomsheetlayout.png b/Jetpack-Compose-Playground/docs/images/material/modalbottomsheetlayout/modalbottomsheetlayout.png
new file mode 100644
index 000000000..e80e1f941
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/modalbottomsheetlayout/modalbottomsheetlayout.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/modaldrawer/ModaldrawerOpened.png b/Jetpack-Compose-Playground/docs/images/material/modaldrawer/ModaldrawerOpened.png
new file mode 100644
index 000000000..2daaadab4
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/modaldrawer/ModaldrawerOpened.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/modaldrawer/modaldrawerClosed.png b/Jetpack-Compose-Playground/docs/images/material/modaldrawer/modaldrawerClosed.png
new file mode 100644
index 000000000..b3a2a838b
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/modaldrawer/modaldrawerClosed.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/navigationrail/navigationRail.webm b/Jetpack-Compose-Playground/docs/images/material/navigationrail/navigationRail.webm
new file mode 100644
index 000000000..f87089edb
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/navigationrail/navigationRail.webm differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/outlinedbutton/outlinedbutton.png b/Jetpack-Compose-Playground/docs/images/material/outlinedbutton/outlinedbutton.png
new file mode 100644
index 000000000..c30626c9c
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/outlinedbutton/outlinedbutton.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/radiobutton/radiobutton.png b/Jetpack-Compose-Playground/docs/images/material/radiobutton/radiobutton.png
new file mode 100644
index 000000000..d62ce943f
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/radiobutton/radiobutton.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/scaffold/bottomappbar.png b/Jetpack-Compose-Playground/docs/images/material/scaffold/bottomappbar.png
new file mode 100644
index 000000000..29404a2ab
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/scaffold/bottomappbar.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/scaffold/floatingactionbutton.png b/Jetpack-Compose-Playground/docs/images/material/scaffold/floatingactionbutton.png
new file mode 100644
index 000000000..d498f49dc
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/scaffold/floatingactionbutton.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/scaffold/scaffold.png b/Jetpack-Compose-Playground/docs/images/material/scaffold/scaffold.png
new file mode 100644
index 000000000..57edcae5b
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/scaffold/scaffold.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/scaffold/scaffoldwithdrawer.png b/Jetpack-Compose-Playground/docs/images/material/scaffold/scaffoldwithdrawer.png
new file mode 100644
index 000000000..7d94ee21a
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/scaffold/scaffoldwithdrawer.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/scaffold/topappbar.png b/Jetpack-Compose-Playground/docs/images/material/scaffold/topappbar.png
new file mode 100644
index 000000000..1775449b2
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/scaffold/topappbar.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/slider/sliderdemo.png b/Jetpack-Compose-Playground/docs/images/material/slider/sliderdemo.png
new file mode 100644
index 000000000..1e082a2bb
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/slider/sliderdemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/snackbar/snackbarDemo.png b/Jetpack-Compose-Playground/docs/images/material/snackbar/snackbarDemo.png
new file mode 100644
index 000000000..66743ecf7
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/snackbar/snackbarDemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/surface/surfacedemo.png b/Jetpack-Compose-Playground/docs/images/material/surface/surfacedemo.png
new file mode 100644
index 000000000..94748a403
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/surface/surfacedemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/switch/SwitchDemo.png b/Jetpack-Compose-Playground/docs/images/material/switch/SwitchDemo.png
new file mode 100644
index 000000000..0f2083e73
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/switch/SwitchDemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/textbutton/textbutton.png b/Jetpack-Compose-Playground/docs/images/material/textbutton/textbutton.png
new file mode 100644
index 000000000..fc4f7b078
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/textbutton/textbutton.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/textfield/textfield.png b/Jetpack-Compose-Playground/docs/images/material/textfield/textfield.png
new file mode 100644
index 000000000..cc7562f2a
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/textfield/textfield.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/material/topappbar/topappbar.png b/Jetpack-Compose-Playground/docs/images/material/topappbar/topappbar.png
new file mode 100644
index 000000000..b6eec6a75
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/material/topappbar/topappbar.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/platform/composeview/viewgroupExample.png b/Jetpack-Compose-Playground/docs/images/platform/composeview/viewgroupExample.png
new file mode 100644
index 000000000..b336a35ee
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/platform/composeview/viewgroupExample.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/readme/ButtonActivity.png b/Jetpack-Compose-Playground/docs/images/readme/ButtonActivity.png
new file mode 100644
index 000000000..dcff43862
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/readme/ButtonActivity.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/readme/ControlledScrollDemo.png b/Jetpack-Compose-Playground/docs/images/readme/ControlledScrollDemo.png
new file mode 100644
index 000000000..9447be2b4
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/readme/ControlledScrollDemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/readme/DemoActivity.png b/Jetpack-Compose-Playground/docs/images/readme/DemoActivity.png
new file mode 100644
index 000000000..b40c5dde7
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/readme/DemoActivity.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/readme/ListItemActivity.png b/Jetpack-Compose-Playground/docs/images/readme/ListItemActivity.png
new file mode 100644
index 000000000..7956a9945
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/readme/ListItemActivity.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/readme/RallyActivity.png b/Jetpack-Compose-Playground/docs/images/readme/RallyActivity.png
new file mode 100644
index 000000000..c6f9915e6
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/readme/RallyActivity.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/readme/circprog.png b/Jetpack-Compose-Playground/docs/images/readme/circprog.png
new file mode 100644
index 000000000..5a1310b8d
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/readme/circprog.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/selectiondemo.png b/Jetpack-Compose-Playground/docs/images/selectiondemo.png
new file mode 100644
index 000000000..7ae72d5c9
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/selectiondemo.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/ui/layout/chatafter.png b/Jetpack-Compose-Playground/docs/images/ui/layout/chatafter.png
new file mode 100644
index 000000000..49284903d
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/ui/layout/chatafter.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/ui/layout/chatbefore.png b/Jetpack-Compose-Playground/docs/images/ui/layout/chatbefore.png
new file mode 100644
index 000000000..d769db9f6
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/ui/layout/chatbefore.png differ
diff --git a/Jetpack-Compose-Playground/docs/images/viewinterop/androidview/androidview.png b/Jetpack-Compose-Playground/docs/images/viewinterop/androidview/androidview.png
new file mode 100644
index 000000000..5d7b1de5f
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/images/viewinterop/androidview/androidview.png differ
diff --git a/Jetpack-Compose-Playground/docs/index.md b/Jetpack-Compose-Playground/docs/index.md
new file mode 100644
index 000000000..0b3fbfedc
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/index.md
@@ -0,0 +1,80 @@
+# Jetpack Compose Playground
+
+
+## Introduction
+This is a community-driven collection of Jetpack Compose documentation/examples/tutorials and demos.
+
+## Show some :heart: and star the repo to support the project
+
+[](https://github.com/Foso/Jetpack-Compose-Playground) [](https://github.com/Foso/Jetpack-Compose-Playground/fork) [](https://github.com/Foso/Jetpack-Compose-Playground) [](https://twitter.com/jklingenberg_)
+
+[](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/LICENSE)
+[](http://makeapullrequest.com)
+[](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/LICENSE)
+
+[](#contributors)
+
+
+## What is Jetpack Compose?
+"Jetpack Compose is a modern toolkit for building native Android UI. Jetpack Compose simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs. "
+
+
+
+
+## Composable of the week!! 🎉
+The [LazyVerticalGrid](foundation/lazyverticalgrid.md)
+
+
+## New to Compose?
+Check [Project Setup](general/getting_started.md) or [Hello World Compose](general/helloworld/)
+
+### Animation
+* [Crossfade](animation/crossfade)
+
+### Layouts
+---
+* [ConstraintLayout](layout/constraintlayout)
+* [Scaffold](material/scaffold)
+* [Column](layout/column)
+* [Row](layout/row)
+* [Box](layout/box)
+
+### Foundation
+---
+* [Canvas](foundation/canvas.md)
+* [Image](foundation/image.md)
+* [LazyColumn](foundation/lazycolumn.md)
+* [LazyRow](foundation/lazyrow.md)
+* [LazyVerticalGrid](foundation/lazyverticalgrid.md)
+* [Shape](foundation/shape.md)
+* [Text](foundation/text.md)
+
+### Material
+---
+* [AlertDialog](material/alertdialog.md)
+* [Button](material/button.md)
+* [Card](material/card.md)
+* [Checkbox](material/checkbox.md)
+* [CircularProgressIndicator](material/circularprogressindicator.md)
+* [DropdownMenu](material/dropdownmenu.md)
+* [FloatingActionButton](material/floatingactionbutton.md)
+* [ModalDrawerLayout](material/modaldrawer.md)
+* [RadioButton](material/radiobutton.md)
+* [Scaffold](material/scaffold.md)
+* [Slider](material/slider.md)
+* [Snackbar](material/snackbar.md)
+* [Switch](material/switch.md)
+* [TextField](material/textfield.md)
+
+## Looking for tutorials/sample code
+Take a look at the sidebar under "Guides & Samples" or check [Compose projects](compose_projects)
+
+
+## Contributing
+Interested in adding samples/tutorials? Check [Contributing](contributing.md)
+
+## 📜 License
+
+This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/LICENSE) file for details
diff --git a/Jetpack-Compose-Playground/docs/ios/overview.md b/Jetpack-Compose-Playground/docs/ios/overview.md
new file mode 100644
index 000000000..1c3909865
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/ios/overview.md
@@ -0,0 +1,8 @@
+# Compose on iOS
+
+JetBrains released a Compose port for iOS. It's currently in beta.
+(https://blog.jetbrains.com/kotlin/2024/05/compose-multiplatform-1-6-10-ios-beta/#compose-multiplatform-for-i-os-in-beta)
+
+https://github.com/JetBrains/compose-multiplatform#ios
+
+You can find more information on the Kotlin Slack in channel "#compose-ios"
diff --git a/Jetpack-Compose-Playground/docs/layout/box.md b/Jetpack-Compose-Playground/docs/layout/box.md
new file mode 100644
index 000000000..c93bf6a11
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/layout/box.md
@@ -0,0 +1,23 @@
+
+# Box
+
+The children of the Box layout will be stacked over each other. You can use the align modifier to specify where the composable should be drawn.
+
+
+
+
+
+
+```kotlin
+--8<-- "layout/BoxExample.kt:func"
+```
+
+## Content Alignment
+You can use the **align** modifier to set the position of a Composable inside the Box
+
+## See also:
+* [Official Docs]({{ site.composedoc }}/foundation/layout/package-summary#Box)
+* [Full Example Code]({{ site.samplefolder }}/layout/BoxExample.kt)
+
diff --git a/Jetpack-Compose-Playground/docs/layout/column.md b/Jetpack-Compose-Playground/docs/layout/column.md
new file mode 100644
index 000000000..c6bb078c3
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/layout/column.md
@@ -0,0 +1,183 @@
+
+# Column
+
+A Column will show each child below the previous children. It's similar to a LinearLayout with vertical orientation.
+
+
+
+
+
+```kotlin
+@Composable
+fun ColumnExample() {
+ Column {
+ Text("Hello World!")
+ Text("Hello World!2")
+ }
+}
+
+```
+
+## Content Alignment
+### Horizontal
+You can use **horizontalAlignment** to set the horizontal alignment of the content in the Column
+
+=== "Alignment.Start"
+
+
+ ```kotlin
+
+ @Composable
+ fun ColumnVerticalBottom() {
+ Column(verticalArrangement = Arrangement.Bottom, modifier = Modifier.height(100.dp).background(Color.LightGray)) {
+ Text("Hello World!")
+ Text("Hello World!2")
+ }
+ }
+ ```
+
+
+## See also:
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary#column)
+* [Full Example Code]({{ site.samplefolder }}/layout/ColumnExample.kt)
diff --git a/Jetpack-Compose-Playground/docs/layout/constraintlayout.md b/Jetpack-Compose-Playground/docs/layout/constraintlayout.md
new file mode 100644
index 000000000..76f9d3c48
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/layout/constraintlayout.md
@@ -0,0 +1,92 @@
+
+# ConstraintLayout
+!!! tip
+ Remember to add dependencies to build.gradle:
+
+ implementation 'androidx.constraintlayout:constraintlayout-compose:1.0.1'
+
+A ConstraintLayout in Compose is similar to a ConstraintLayout from the classic Android View System
+
+## Example:
+
+
+
+
+```kotlin
+@Composable
+fun ConstraintLayoutDemo() {
+ ConstraintLayout(modifier = Modifier.size(200.dp)) {
+ val (redBox, blueBox, yellowBox, text) = createRefs()
+
+ Box(modifier = Modifier
+ .size(50.dp)
+ .background(Color.Red)
+ .constrainAs(redBox) {})
+
+ Box(modifier = Modifier
+ .size(50.dp)
+ .background(Color.Blue)
+ .constrainAs(blueBox) {
+ top.linkTo(redBox.bottom)
+ start.linkTo(redBox.end)
+ })
+
+ Box(modifier = Modifier
+ .size(50.dp)
+ .background(Color.Yellow)
+ .constrainAs(yellowBox) {
+ bottom.linkTo(blueBox.bottom)
+ start.linkTo(blueBox.end, 20.dp)
+ })
+
+ Text("Hello World", modifier = Modifier.constrainAs(text) {
+ top.linkTo(parent.top)
+ start.linkTo(yellowBox.start)
+ })
+
+ }
+}
+
+```
+
+
+## How to use it?
+
+First add the Constraintlayout dependency to your project (see start of this page)
+
+I will use the example code above, to explain how the boxes are constraint to each other.
+Inside the scope of ConstraintLayout you can use createRefs() to create reference objects.
+These will be used by ConstraintLayout to know which Composables should be linked to each other.
+
+```kotlin
+val (redBox, blueBox, yellowBox, text) = createRefs()
+```
+
+Kotlin's destructuring declaration feature is used here to generate reference objects.
+
+Now we need to let ConstraintLayout know which reference objects belongs to which Composable.
+To do that you need to use the constrainAs Modifier on your Composable.
+
+```kotlin
+.constrainAs(redBox) {})
+```
+
+Now ConstraintLayout knows that redBox belongs to the first Box Composable.
+
+We do the same for the blue box, but now we want to link it to the red box.
+
+```kotlin
+.constrainAs(blueBox) {
+ top.linkTo(redBox.bottom)
+ start.linkTo(redBox.end)
+})
+```
+
+Inside the scope of **constrainAs** we have access to the ConstrainScope.
+We can now link start/end/top/bottom of the Composable to Composables through the reference object.
+You can also link to the parent ConstraintLayout with the **parent** object. It's used at the Text Composable.
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/layout/ConstraintLayoutDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/layout/row.md b/Jetpack-Compose-Playground/docs/layout/row.md
new file mode 100644
index 000000000..ede245ff2
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/layout/row.md
@@ -0,0 +1,84 @@
+
+# Row
+
+A Row will show each child next to the previous children. It's similar to a LinearLayout with a horizontal orientation.
+
+
+
+
+
+
+```kotlin
+@Composable
+fun RowExample() {
+ Row {
+ Text("Hello World!")
+ Text("Hello World!2")
+ }
+}
+```
+
+
+## Content Arrangement
+### Horizontal
+
+You can use **horizontalArrangement** to set the horizontal arrangement of the content in the Row
+
+=== "Arrangement.SpaceEvenly"
+
+
+
+ ```kotlin
+
+ @Composable
+ fun RowExample() {
+ Row(horizontalArrangement = Arrangement.End) {
+ Text("Hello World!")
+ Text("Hello World!2")
+ }
+ }
+ ```
+
+
+## See also:
+* [Official Docs]({{ site.composedoc }}/foundation/layout/package-summary#row)
+* [Full Example Code]({{ site.samplefolder }}/layout/RowExample.kt)
diff --git a/Jetpack-Compose-Playground/docs/manifest.webmanifest b/Jetpack-Compose-Playground/docs/manifest.webmanifest
new file mode 100644
index 000000000..871cd168f
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/manifest.webmanifest
@@ -0,0 +1,5 @@
+{
+ "name": "Jetpack Compose Examples Tutorials and demos",
+ "short_name": "Jetpack Compose Examples Tutorials and demos",
+ "description": "This is a community-driven collection of Jetpack Compose documentation/examples/tutorials and demos."
+}
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/material/alertdialog.md b/Jetpack-Compose-Playground/docs/material/alertdialog.md
new file mode 100644
index 000000000..b44c03624
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/alertdialog.md
@@ -0,0 +1,68 @@
+
+
+# AlertDialog
+
+Alert dialog is a Dialog which interrupts the user with urgent information, details or actions.
+
+
+
+
+
+```kotlin
+@Composable
+fun AlertDialogSample() {
+ MaterialTheme {
+ Column {
+ val openDialog = remember { mutableStateOf(false) }
+
+ Button(onClick = {
+ openDialog.value = true
+ }) {
+ Text("Click me")
+ }
+
+ if (openDialog.value) {
+
+ AlertDialog(
+ onDismissRequest = {
+ // Dismiss the dialog when the user clicks outside the dialog or on the back
+ // button. If you want to disable that functionality, simply use an empty
+ // onCloseRequest.
+ openDialog.value = false
+ },
+ title = {
+ Text(text = "Dialog Title")
+ },
+ text = {
+ Text("Here is a text ")
+ },
+ confirmButton = {
+ Button(
+
+ onClick = {
+ openDialog.value = false
+ }) {
+ Text("This is the Confirm Button")
+ }
+ },
+ dismissButton = {
+ Button(
+
+ onClick = {
+ openDialog.value = false
+ }) {
+ Text("This is the dismiss Button")
+ }
+ }
+ )
+ }
+ }
+
+ }
+}
+```
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/material/alertdialog/AlertDialogSample.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/badgedbox.md b/Jetpack-Compose-Playground/docs/material/badgedbox.md
new file mode 100644
index 000000000..ec95e4924
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/badgedbox.md
@@ -0,0 +1,36 @@
+# BadgeBox
+A `BadgeBox` is used to decorate content with a badge that can contain dynamic information, such as the presence of a new notification or a number of pending requests. Badges can be icon only or contain short text.
+
+A common use case is to display a badge with bottom navigation items. For more information, see Bottom Navigation
+
+A simple icon with badge example looks like:
+
+
+
+
+
+```kotlin
+@OptIn(ExperimentalMaterialApi::class)
+@Preview
+@Composable
+fun BadgeBoxDemo() {
+ BottomNavigation {
+ BottomNavigationItem(
+ icon = {
+ BadgedBox(badge = { Badge { Text("8") } }) {
+ Icon(
+ Icons.Filled.Favorite,
+ contentDescription = "Favorite"
+ )
+ }
+
+ },
+ selected = false,
+ onClick = {})
+ }
+}
+```
+
+
+### See also:
+* [Full Example Code]({{ site.samplefolder }}/material/badgebox/BadgeBoxDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/button.md b/Jetpack-Compose-Playground/docs/material/button.md
new file mode 100644
index 000000000..1298b3aea
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/button.md
@@ -0,0 +1,58 @@
+
+# Button
+
+A [Button](https://developer.android.com/reference/kotlin/androidx/ui/material/package-summary#button) has a onClick-Function. You can add a Text-Composable or any other Composables as child elements of the Button.
+
+
+
+```kotlin
+@Composable
+fun CheckBoxDemo() {
+ val checkedState = remember { mutableStateOf(true) }
+ Checkbox(
+ checked = checkedState.value,
+ onCheckedChange = { checkedState.value = it }
+ )
+}
+```
+
+
+## See also:
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#checkbox)
+* [Full Example Code]({{ site.samplefolder }}/material/checkbox/CheckBoxDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/circularprogressindicator.md b/Jetpack-Compose-Playground/docs/material/circularprogressindicator.md
new file mode 100644
index 000000000..fa8ab5199
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/circularprogressindicator.md
@@ -0,0 +1,76 @@
+
+# CircularProgressIndicator
+
+A CircularProgressIndicator can be used to display a progress in circular shape.
+There are two kinds:
+
+**Indeterminate**
+
+```kotlin
+CircularProgressIndicator()
+```
+
+When you use the CircularProgressIndicator without the **progress** parameter, it will run forever.
+
+
+**Determinate**
+
+```kotlin
+CircularProgressIndicator(progress = 0.5f)
+```
+
+
+
+
+When you set a value to the **progress** parameter, the indicator will be shown with that progress.
+E.g. a progress of 0.5f will fill it to the half.
+
+# Example
+
+
+
+
+```kotlin
+@Composable
+fun CircularProgressIndicatorSample() {
+ var progress by remember { mutableStateOf(0.1f) }
+ val animatedProgress = animateFloatAsState(
+ targetValue = progress,
+ animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec
+ ).value
+
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Spacer(Modifier.height(30.dp))
+ Text("CircularProgressIndicator with undefined progress")
+ CircularProgressIndicator()
+ Spacer(Modifier.height(30.dp))
+ Text("CircularProgressIndicator with progress set by buttons")
+ CircularProgressIndicator(progress = animatedProgress)
+ Spacer(Modifier.height(30.dp))
+ OutlinedButton(
+ onClick = {
+ if (progress < 1f) progress += 0.1f
+ }
+ ) {
+ Text("Increase")
+ }
+
+ OutlinedButton(
+ onClick = {
+ if (progress > 0f) progress -= 0.1f
+ }
+ ) {
+ Text("Decrease")
+ }
+ }
+}
+```
+
+## See also:
+* [Material.io](https://material.io/components/progress-indicators#circular-progress-indicators)
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#circularprogressindicator)
+* [Full Example Code]({{ site.samplefolder }}/material/circularprogress/CircularProgressIndicatorSample.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/divider.md b/Jetpack-Compose-Playground/docs/material/divider.md
new file mode 100644
index 000000000..f48bf8a51
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/divider.md
@@ -0,0 +1,25 @@
+
+# Divider
+
+A divider is a thin line that groups content in lists and layouts.
+
+
+
+
+
+``` kotlin
+@Composable
+fun DividerExample(){
+ Column {
+ Text("Foo")
+ Divider(startIndent = 8.dp, thickness = 1.dp, color = Color.Black)
+ Text("Bar")
+ }
+}
+```
+
+## See also:
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#divider)
+* [Full Example Code]({{ site.samplefolder }}/material/divider/DividerDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/dropdownmenu.md b/Jetpack-Compose-Playground/docs/material/dropdownmenu.md
new file mode 100644
index 000000000..a19736b43
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/dropdownmenu.md
@@ -0,0 +1,67 @@
+
+# DropdownMenu
+
+The DropdownMenu Composable can be used to create DropdownMenu.
+
+
+
+
+
+```kotlin
+fun DropdownMenu(
+ expanded: Boolean,
+ onDismissRequest: () -> Unit,
+ modifier: Modifier = Modifier,
+ offset: DpOffset = DpOffset(0.dp, 0.dp),
+ properties: PopupProperties = PopupProperties(focusable = true),
+ content: @Composable ColumnScope.() -> Unit
+)
+```
+
+**expanded**
+If true, the popupmenu with the dropdownContent will be shown
+
+**onDismissRequest**
+Called when the menu should be dismiss
+
+```kotlin
+@Composable
+fun DropdownDemo() {
+ var expanded by remember { mutableStateOf(false) }
+ val items = listOf("A", "B", "C", "D", "E", "F")
+ val disabledValue = "B"
+ var selectedIndex by remember { mutableStateOf(0) }
+ Box(modifier = Modifier.fillMaxSize().wrapContentSize(Alignment.TopStart)) {
+ Text(items[selectedIndex],modifier = Modifier.fillMaxWidth().clickable(onClick = { expanded = true }).background(
+ Color.Gray))
+ DropdownMenu(
+ expanded = expanded,
+ onDismissRequest = { expanded = false },
+ modifier = Modifier.fillMaxWidth().background(
+ Color.Red)
+ ) {
+ items.forEachIndexed { index, s ->
+ DropdownMenuItem(onClick = {
+ selectedIndex = index
+ expanded = false
+ }) {
+ val disabledText = if (s == disabledValue) {
+ " (Disabled)"
+ } else {
+ ""
+ }
+ Text(text = s + disabledText)
+ }
+ }
+ }
+ }
+}
+```
+
+
+## See also:
+* [Material.io](https://material.io/components/menus#dropdown-menu)
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#dropdownmenu)
+* [Full Example Code]({{ site.samplefolder }}/material/dropdown/DropdownDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/floatingactionbutton.md b/Jetpack-Compose-Playground/docs/material/floatingactionbutton.md
new file mode 100644
index 000000000..5465154f2
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/floatingactionbutton.md
@@ -0,0 +1,39 @@
+
+# FloatingActionButton
+
+
+```kotlin
+fun FloatingActionButtonDemo() {
+ FloatingActionButton(onClick = { /*do something*/}) {
+ Text("FloatingActionButton")
+ }
+}
+```
+
+
+
+## See also:
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#floatingactionbutton)
+* [Full Example Code]({{ site.samplefolder }}/material/floatingactionbutton/FabDemo.kt)
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/material/linearprogressindicator.md b/Jetpack-Compose-Playground/docs/material/linearprogressindicator.md
new file mode 100644
index 000000000..bf1760369
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/linearprogressindicator.md
@@ -0,0 +1,77 @@
+
+# LinearProgressIndicator
+
+A LinearProgressIndicator can be used to display a progress in linear line, also known as a progress bar.
+There are two kinds:
+
+**Indeterminate**
+
+```kotlin
+LinearProgressIndicator()
+```
+
+When you use the LinearProgressIndicator without the **progress** parameter, it will run forever.
+
+
+**Determinate**
+
+```kotlin
+LinearProgressIndicator(progress = 0.5f)
+```
+
+
+
+
+When you set a value to the **progress** parameter, the indicator will be shown with that progress.
+E.g. a progress of 0.5f will fill it to the half.
+
+# Example
+
+
+## Example
+
+```kotlin
+@Composable
+fun RadioButtonSample() {
+ val radioOptions = listOf("A", "B", "C")
+ val (selectedOption, onOptionSelected) = remember { mutableStateOf(radioOptions[1] ) }
+ Column {
+ radioOptions.forEach { text ->
+ Row(
+ Modifier
+ .fillMaxWidth()
+ .selectable(
+ selected = (text == selectedOption),
+ onClick = {
+ onOptionSelected(text)
+ }
+ )
+ .padding(horizontal = 16.dp)
+ ) {
+ RadioButton(
+ selected = (text == selectedOption),
+ onClick = { onOptionSelected(text) }
+ )
+ Text(
+ text = text,
+ style = MaterialTheme.typography.body1.merge(),
+ modifier = Modifier.padding(start = 16.dp)
+ )
+ }
+ }
+ }
+}
+```
+
+
+## See also:
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#radiobutton)
+* [Full Example Code]({{ site.samplefolder }}/material/radiobutton/RadioButtonSample.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/scaffold.md b/Jetpack-Compose-Playground/docs/material/scaffold.md
new file mode 100644
index 000000000..93213d113
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/scaffold.md
@@ -0,0 +1,81 @@
+
+# Scaffold
+
+A Scaffold is a layout which implements the basic material design layout structure. You can add things like a TopBar, BottomBar, FAB or a Drawer.
+
+```kotlin
+@Composable
+fun ScaffoldDemo() {
+ val materialBlue700= Color(0xFF1976D2)
+ val scaffoldState = rememberScaffoldState(rememberDrawerState(DrawerValue.Open))
+ Scaffold(
+ scaffoldState = scaffoldState,
+ topBar = { TopAppBar(title = {Text("TopAppBar")},backgroundColor = materialBlue700) },
+ floatingActionButtonPosition = FabPosition.End,
+ floatingActionButton = { FloatingActionButton(onClick = {}){
+ Text("X")
+ } },
+ drawerContent = { Text(text = "drawerContent") },
+ content = { Text("BodyContent") },
+ bottomBar = { BottomAppBar(backgroundColor = materialBlue700) { Text("BottomAppBar") } }
+ )
+}
+```
+
+=== "Default"
+
+
+
+
+=== "With Drawer open"
+
+
+
+
+
+## scaffoldState
+With the scaffoldState you can set the opening state of the drawer(DrawerState.Opened or DrawerState.Closed)
+
+
+## topBar
+
+
+
+
+
+Here you can set the part of your layout that should be displayed on top of the screen. You can use it for things like a toolbar. You can set any Composable, but **TopAppBar** is already made for this usecase.
+
+## floatingActionButton
+
+
+
+Here you can add FloatingActionButton. You can set any Composable, but **FloatingActionButton** is already made for this usecase
+
+## floatingActionButtonPosition
+When you have added a FAB, you can use this specify the position of it. The default position is at the end of your layout.
+
+## drawerContent
+Here you can set the content of your drawer.
+
+## Content
+This is the primary content of the scaffold. You can add any Composable here.
+
+## bottomBar
+
+
+
+
+
+Here you can set the part of your layout is on bottom of the screen. You can set any Composable, but **BottomAppBar** is already made for this usecase.
+
+
+## Tips
+
+* The bottombar is overlapping the content
+
+Inside the content lambda you have access to the PaddingValues. You can use **calculateBottomPadding()** to get the height of the bottombar and then set an extra padding to your content
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/material/scaffold/ScaffoldDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/slider.md b/Jetpack-Compose-Playground/docs/material/slider.md
new file mode 100644
index 000000000..adbb2871a
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/slider.md
@@ -0,0 +1,26 @@
+
+# Slider
+
+"Sliders allow users to make selections from a range of values."
+
+
+
+
+
+
+```kotlin
+@Composable
+fun MySliderDemo() {
+ var sliderPosition by remember { mutableStateOf(0f) }
+ Text(text = sliderPosition.toString())
+ Slider(value = sliderPosition, onValueChange = { sliderPosition = it })
+}
+```
+
+
+## See also:
+* [Material.io](https://material.io/components/sliders)
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#slider)
+* [Full Example Code]({{ site.samplefolder }}/material/slider/MySliderDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/snackbar.md b/Jetpack-Compose-Playground/docs/material/snackbar.md
new file mode 100644
index 000000000..274a23973
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/snackbar.md
@@ -0,0 +1,44 @@
+
+# Snackbar
+
+"Snackbars provide brief messages about app processes at the bottom of the screen."
+
+
+
+
+```kotlin
+@Composable
+fun SwitchDemo() {
+ val checkedState = remember { mutableStateOf(true) }
+ Switch(
+ checked = checkedState.value,
+ onCheckedChange = { checkedState.value = it }
+ )
+}
+```
+
+## See also:
+* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#switch)
+* [Full Example Code]({{ site.samplefolder }}/material/switch/SwitchDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/textfield.md b/Jetpack-Compose-Playground/docs/material/textfield.md
new file mode 100644
index 000000000..d7e7365d5
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/textfield.md
@@ -0,0 +1,29 @@
+
+# TextField
+
+TextField can be used to insert text. This is the equivalent to **EditText** from the Android View system.
+
+
+
+
+
+```kotlin
+@Composable
+fun TextFieldDemo() {
+ Column(Modifier.padding(16.dp)) {
+ val textState = remember { mutableStateOf(TextFieldValue()) }
+ TextField(
+ value = textState.value,
+ onValueChange = { textState.value = it }
+ )
+ Text("The textfield has this text: " + textState.value.text)
+ }
+}
+```
+
+-------------
+## See also:
+* [Handle changes in a TextField](https://foso.github.io/Jetpack-Compose-Playground/cookbook/textfield_changes/)
+* [Full Example Code]({{ site.samplefolder }}/other/TextFieldDemo.kt)
diff --git a/Jetpack-Compose-Playground/docs/material/topappbar.md b/Jetpack-Compose-Playground/docs/material/topappbar.md
new file mode 100644
index 000000000..0b8f77ab9
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/material/topappbar.md
@@ -0,0 +1,42 @@
+
+# TopAppBar
+
+A TopAppBar displays information and actions relating to the current screen and is placed at the top of the screen.
+
+
+
+
+
+```kotlin
+@Composable
+fun TopAppBarSample(){
+ Column {
+ TopAppBar(
+ elevation = 4.dp,
+ title = {
+ Text("I'm a TopAppBar")
+ },
+ backgroundColor = MaterialTheme.colors.primarySurface,
+ navigationIcon = {
+ IconButton(onClick = {/* Do Something*/ }) {
+ Icon(Icons.Filled.ArrowBack, null)
+ }
+ }, actions = {
+ IconButton(onClick = {/* Do Something*/ }) {
+ Icon(Icons.Filled.Share, null)
+ }
+ IconButton(onClick = {/* Do Something*/ }) {
+ Icon(Icons.Filled.Settings, null)
+ }
+ })
+
+ Text("Hello World")
+
+ }
+}
+```
+
+## See also:
+* [Full Example Code]({{ site.samplefolder }}/material/appbar/topappbar/TopAppBarSample.kt)
diff --git a/Jetpack-Compose-Playground/docs/platform/composeview.md b/Jetpack-Compose-Playground/docs/platform/composeview.md
new file mode 100644
index 000000000..2da03a7a6
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/platform/composeview.md
@@ -0,0 +1,58 @@
+# ComposeView
+
+You can use ComposeView to use Compose inside a ViewGroup.
+This example will show you, how you can use ComposeView inside a FrameLayout. It should also work in other layouts like LinearLayout
+
+
+## Create a custom FrameLayout
+Create a custom FrameLayout, then you can use the **ComposeView** and **setContent()** for example inside **init()**.
+Inside **setContent()** you can then add your Compose code.
+```kotlin
+class ComposeFrameLayout @JvmOverloads constructor(
+ context: Context, attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0
+) : FrameLayout(context, attrs, defStyleAttr) {
+
+ init {
+ addView(
+ ComposeView(context).apply {
+ setContent {
+ Button(onClick = {}) {
+ Text("ComposeButton")
+ }
+ }
+ }
+ )
+ }
+}
+```
+
+## Add it to your layout file
+Just add your FrameLayout like any other layout.
+```xml
+
+
+
+
+
+
+
+```
+
+
+
+
diff --git a/Jetpack-Compose-Playground/docs/resources.md b/Jetpack-Compose-Playground/docs/resources.md
new file mode 100644
index 000000000..e2b96bcfe
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/resources.md
@@ -0,0 +1,49 @@
+# Resources
+
+## Talks
+| Name | Description |
+| ----------------------------------------- | ------------------------------------ |
+| [Thinking in Compose](https://www.youtube.com/watch?v=SMOhl9RK0BA) | Jetpack Compose is the new next generation UI toolkit. It uses a declarative component based paradigm for building UIs easily and quickly. It’s written entirely in Kotlin and embraces the style and ergonomics of the Kotlin language. |
+| [Compose by example](https://www.youtube.com/watch?v=DDd6IOlH3io) | Jetpack Compose is a new declarative UI toolkit built for the demands of creating modern user interfaces. Get started with Compose and learn about the new APIs and Material components that make up the toolkit by examining concrete UIs we’ve created with it. We’ll walk through examples of theming, animation, layout and more, demonstrating how to customize and combine components to build real UIs. We’ll show how the new toolkit simplifies your development experience and enables new possibilities. |
+| [Compose for existing apps](https://www.youtube.com/watch?v=PjQdFmiDgwk) | Jetpack Compose is now in alpha and you might want to start adding it to your existing apps. In this talk, you'll learn how to do that! We'll cover topics such as: adding Compose to your existing Views and embedding Views in Compose, using your existing View theme and current app architecture in Compose, testing all of that code, and much more. |
+| [Jetpack Compose](https://www.youtube.com/watch?v=U5BwfqBpiWU) | Jetpack Compose is Android’s new modern UI toolkit. Learn how Compose simplifies & accelerates your UI development, allowing you to create richer, more robust and responsive UIs. We outline our roadmap, what is ready for use right now, share our direction in areas that are still evolving, and show how the tight integration with tooling makes the development experience even better. Get up to speed with Compose and how it can help you to build better apps! |
+| [droidcon Online 2020: Become A Composer By Brian Gardner ](https://www.droidcon.com/media-detail?video=412304809) | |
+| [KotlinConf 2019: The Compose Runtime, Demystified by Leland Richardson](https://www.youtube.com/watch?v=6BRlI5zfCCk) | Jetpack Compose is an ambitious multi-team effort to reimagine Android's UI Toolkit more than 10 years after the Android Platform launched with the original UI Toolkit. Compose follows a declarative programming model, and the runtime is coupled with a Kotlin compiler plugin to enable a novel new approach to declarative programming. In this talk, Leland will go over the mechanics of how the Compose runtime and compiler plugin work together, demystifying how it can be used to enable efficient and performant user interfaces. In addition, this talk will describe how Compose can operate completely independent of the Android Platform and Compose UI, allowing it to be used as a general language feature for Incremental Computing and the management of tree-like data structures. |
+| [KotlinConf 2019: Compose Yourself: Designing a Kotlin First UI Toolkit by Anna-Chiara & Clara](https://www.youtube.com/watch?v=WqnR_XhEiVI) | #Jetpack Compose is an unbundled UI Toolkit for #Android, designed to simplify UI development. It combines a reactive programming model with the conciseness and ease of use of Kotlin. Learn directly from engineers on the project about the decisions that went into making this toolkit and how a Kotlin-first approach has influenced API design from the project's inception. |
+| [What's New in Jetpack Compose (Android Dev Summit '19)](https://www.youtube.com/watch?v=dtm2h-_sNDQ&list=PLWz5rJ2EKKc_xXXubDti2eRnIKU0p7wHd&index=8&t=0s) | Jetpack Compose was announced at Google I/O and the team has been hard at work ever since. This talk introduces Compose to new audiences, including what the project is and how it is taking shape. The talk also updates people who already know about Jetpack Compose, including how the project has evolved. |
+| [Understanding Compose (Android Dev Summit '19)](https://www.youtube.com/watch?v=Q9MtlmmN4Q0) | This session covers the benefits of a declarative reactive UI system like Jetpack Compose and how it applies to real problems that Android developers have today. Additionally, this talk expands on the programming model of Jetpack Compose and some of its implementation details the can help you understand how Compose works. |
+| [#AskAndroid at Android Dev Summit 2019 - Jetpack Compose](https://www.youtube.com/watch?v=oEy6nJaMtLM) | Missed the #AskAndroid livestream segment of Android Dev Summit 2019? Don’t worry, we got you covered. Hosts Lyla Fujiwara and Dan Galpin are joined by Anna-Chiara Bellini and Adam Powell to discuss Jetpack Compose questions submitted by Android developers online. Anna-Chiara Bellini is a product manager, and Adam Powell is an engineering lead. |
+| [Google IO19 - Declarative UI patterns](https://youtu.be/VsStyq4Lzxo) | Explore how reactive and declarative paradigms can be applied to Android UI development, making it easier for developers to integrate these patterns into their Android apps with Kotlin. |
+| [DroidconBerlin - Jetpack Compose — Next Gen Kotlin UI Toolkit for Android](https://www.droidcon.com/media-detail?video=353079951) | |
+| [DroidconBerlin - Jumping into Jetpack Compose way too early to see what's inside](https://www.droidcon.com/media-detail?video=352686988) | |
+| [KotlinEverywhere - Jetpack Compose](https://www.youtube.com/watch?v=I5zRmCheVVg) | |
+| [DevFest Kolkata 2019 - Let's Talk Composing UI](https://www.youtube.com/watch?v=kfNC-MKAGzc) | |
+
+## Podcasts
+| Name | Description |
+| ----------------------------------------- | ------------------------------------ |
+| [**Android Developer backstage** - Episode 147: Jetpack Compose Alpha](http://androidbackstage.blogspot.com/2020/08/episode-147-jetpack-compose-alpha.html) | |
+| [**Android Developers Backstage** : Episode 131: Jetpack Compose and Declarative UIs](http://androidbackstage.blogspot.com/2020/01/episode-131-jetpack-compose-and.html) | |
+| [**Android Developer backstage** - Episode 115: Jetpack Compose](http://androidbackstage.blogspot.com/2019/06/episode-115-jetpack-compose.html) | |
+| [**Fragmented Podcast** - Episode 171: Jetpack Compose with Leland Richardson](https://fragmentedpodcast.com/episodes/172/) | |
+| [**Google podcast** - Romain Guy – Podcast S09 E09](https://podcasts.google.com/?feed=aHR0cHM6Ly93d3cucmF5d2VuZGVybGljaC5jb20vY2F0ZWdvcnkvcG9kY2FzdC9mZWVk&episode=aHR0cHM6Ly93d3cucmF5d2VuZGVybGljaC5jb20vP3A9MjMxMjI0&hl=en-IN&ep=6&at=1567914736470) | |
+
+## Other Links
+
+| Name | Description |
+| ----------------------------------------- | ------------------------------------ |
+| [Jetpack Compose](https://developer.android.com/jetpack/compose) | |
+| [Jetpack Compose UI Readme](https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-master-dev/ui/README.md) | |
+| [Compose Readme](https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-master-dev/compose/) | |
+| [Video - Kotlin and Jetpack Compose](https://www.youtube.com/watch?v=KjQU_QrlbEI) | |
+| `#compose` channel on [Kotlin Slack](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up) | |
+| [Compose from first Principles ](http://intelligiblebabble.com/compose-from-first-principles/) | |
+| [Jetpack Compose Tutorial ](https://developer.android.com/jetpack/compose) | |
+| [AndroidX Git Compose](https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-master-dev/compose/) | |
+| [Release Notes](https://developer.android.com/jetpack/androidx/releases/ui) | |
+| [Compse UI Docu](https://developer.android.com/reference/kotlin/androidx/ui/packages) | |
+| [Jetpack Compose Twitter Bot](https://twitter.com/ComposeBot) | |
+| [Jetpack Compose ä¸ć–‡ć–‡ćˇŁ](https://docs.compose.net.cn/) | |
+| [Jetpack Compose Components](https://www.composables.com/components) | |
+
+Feel free to contribute!
diff --git a/Jetpack-Compose-Playground/docs/sitemap.xml b/Jetpack-Compose-Playground/docs/sitemap.xml
new file mode 100644
index 000000000..de9c136ac
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/sitemap.xml
@@ -0,0 +1,88 @@
+
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/general/helloworld/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/general/compose_lifecycle/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/get_android_context/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/general/draw_on_canvas/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/foundation/clickable/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/foundation/vertical_scroller/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/foundation/horizontal_scroller/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/foundation/draggable/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/core/pressgesturedetector/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/Layout/Column/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/Layout/row/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/material/switch/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/material/checkbox/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/material/radiogroup/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/material/alertdialog/
+ 2020-03-06
+ daily
+
+
+ https://foso.github.io/Jetpack-Compose-Playground/resources/
+ 2020-03-06
+ daily
+
+
\ No newline at end of file
diff --git a/Jetpack-Compose-Playground/docs/sitemap.xml.gz b/Jetpack-Compose-Playground/docs/sitemap.xml.gz
new file mode 100644
index 000000000..c3a16977f
Binary files /dev/null and b/Jetpack-Compose-Playground/docs/sitemap.xml.gz differ
diff --git a/Jetpack-Compose-Playground/docs/theme/404.html b/Jetpack-Compose-Playground/docs/theme/404.html
new file mode 100644
index 000000000..1eb657383
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/theme/404.html
@@ -0,0 +1,31 @@
+
+
+{% extends "base.html" %}
+
+
+{% block content %}
+
404 - Not found
+
+Can't find this file go to: Overview
+
+{% endblock %}
diff --git a/Jetpack-Compose-Playground/docs/theme/main.html b/Jetpack-Compose-Playground/docs/theme/main.html
new file mode 100644
index 000000000..8fae2885e
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/theme/main.html
@@ -0,0 +1,34 @@
+{% extends "base.html" %}
+
+{% block content %}
+{% if page.edit_url %}
+{% if "/api/" in page.edit_url %}
+🤔 Documentation issue? Report it
+{% else %}
+🤔 Documentation issue? Report or edit
+{% endif %}
+{% endif %}
+{% if not "\x3ch1" in page.content %}
+
{{ page.title | default(config.site_name, true)}}
+{% endif %}
+{{ page.content }}
+
+{% if page.meta.git_revision_date_localized %}
+Last update: {{ page.meta.git_revision_date_localized }}
+{% endif %}
+{% block source %}
+{% if page and page.meta and page.meta.source %}
+
{{ lang.t("meta.source") }}
+{% set repo = config.repo_url %}
+{% if repo | last == "/" %}
+{% set repo = repo[:-1] %}
+{% endif %}
+{% set path = page.meta.path | default([""]) %}
+{% set file = page.meta.source %}
+
+ {{ file }}
+
+{% endif %}
+{% endblock %}
+{% endblock %}
+
diff --git a/Jetpack-Compose-Playground/docs/ui/layout/subcomposelayout.md b/Jetpack-Compose-Playground/docs/ui/layout/subcomposelayout.md
new file mode 100644
index 000000000..f460c0511
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/ui/layout/subcomposelayout.md
@@ -0,0 +1,103 @@
+# SubComposeLayout
+
+You can use SubComposeLayout to measure and resize Composables.
+
+# Example
+Let`s say you have a chat log this:
+
+
+
+
+
+And now you want to set the width of every composable to the width of the widest Composable
+
+
+
+
+
+You can use the SubComposeLayout to get the height/width of every child composable and then you can resize
+the values to the one that you want.
+
+```kotlin
+@Composable
+fun SubComposeLayoutDemo() {
+ ResizeWidthColumn(Modifier.fillMaxWidth(), true) {
+
+ Box(
+ modifier = Modifier
+ .background(Color.Red)
+ ) {
+ Text("Hello")
+ }
+
+ Box(
+ modifier = Modifier
+ .padding(top = 8.dp)
+ .background(Color.Red)
+ ) {
+ Text("This is a long messsage \n and its longer")
+ }
+ }
+}
+
+@Composable
+fun ResizeWidthColumn(modifier: Modifier, resize: Boolean, mainContent: @Composable () -> Unit) {
+ SubcomposeLayout(modifier) { constraints ->
+ val mainPlaceables = subcompose(SlotsEnum.Main, mainContent).map {
+ // Here we measure the width/height of the child Composables
+ it.measure(Constraints())
+ }
+
+ //Here we find the max width/height of the child Composables
+ val maxSize = mainPlaceables.fold(IntSize.Zero) { currentMax, placeable ->
+ IntSize(
+ width = maxOf(currentMax.width, placeable.width),
+ height = maxOf(currentMax.height, placeable.height)
+ )
+ }
+
+ val resizedPlaceables: List =
+ subcompose(SlotsEnum.Dependent, mainContent).map {
+ if (resize) {
+ /** Here we rewrite the child Composables to have the width of
+ * widest Composable
+ */
+ it.measure(
+ Constraints(
+ minWidth = maxSize.width
+ )
+ )
+ } else {
+ // Ask the child for its preferred size.
+ it.measure(Constraints())
+ }
+ }
+
+ /**
+ * We can place the Composables on the screen
+ * with layout() and the place() functions
+ */
+
+ layout(constraints.maxWidth, constraints.maxHeight) {
+ resizedPlaceables.forEachIndexed { index, placeable ->
+ val widthStart = resizedPlaceables.take(index).sumOf { it.measuredHeight }
+ placeable.place(0, widthStart)
+ }
+ }
+ }
+}
+
+
+enum class SlotsEnum {
+ Main,
+ Dependent
+
+}
+```
+
+
+## See also:
+* [Official Docs]({{ site.composedoc }}/ui/layout/package-summary#SubcomposeLayout(androidx.compose.ui.Modifier,kotlin.Function2))
+* [Full Example Code]({{ site.samplefolder }}/ui/layout/SubComposeLayoutExample.kt)
+
+
diff --git a/Jetpack-Compose-Playground/docs/viewinterop/androidview.md b/Jetpack-Compose-Playground/docs/viewinterop/androidview.md
new file mode 100644
index 000000000..a2aeaed4a
--- /dev/null
+++ b/Jetpack-Compose-Playground/docs/viewinterop/androidview.md
@@ -0,0 +1,93 @@
+
+# AndroidView
+
+Altough Compose itself is independent from the classic Android View system, in Android Apps it is possible to use Views(classes that extend android.view.View).
+In this example you will see how you can use **android.widget.Button**, **android.widget.TextView** and **android.widget.ImageView** alongside a Compose Button.
+
+
+