Coder Social home page Coder Social logo

android / compose-samples Goto Github PK

View Code? Open in Web Editor NEW
19.3K 398.0 4.6K 183.54 MB

Official Jetpack Compose samples.

Home Page: https://developer.android.com/jetpack/compose

License: Apache License 2.0

Kotlin 99.43% Shell 0.57%
android jetpack-compose

compose-samples's Introduction

Jetpack Compose Samples

Jetpack Compose Samples

This repository contains a set of individual Android Studio projects to help you learn about Compose in Android. Each sample demonstrates different use cases, complexity levels and APIs.

For more information, please read the documentation.

💻 Requirements

To try out these sample apps, you need to use Android Studio. You can clone this repository or import the project from Android Studio following the steps here.

🧬 Samples

Project

JetNews

A sample blog post viewer that demonstrates the use of Compose with a typical Material app and real-world architecture.

• Medium complexity
• Varied UI
• Light & dark themes
• Resource loading
• UI Testing

> Browse

Jetnews sample demo

Jetchat

A sample chat app that focuses on UI state patterns and text input.

• Low complexity
• Material Design 3 theme and Material You dynamic color
• Resource loading
• Back button handling
• Integration with Architecture Components: Navigation, Fragments, LiveData, ViewModel
• Animation
• UI Testing

> Browse

Jetchat sample demo

Jetsurvey

A sample survey app that showcases text input, validation and UI state management in Compose.

• Low complexity
TextField and form validation
• Snackbar implementation
• Element reusability and styling
• Various form elements

> Browse

Jetsurvey sample demo

Jetsnack

Jetsnack is a sample snack ordering app built with Compose.

• Medium complexity
• Custom design system
• Custom layouts
• Animation

> Browse

Jetsnack sample demo

Jetcaster

A sample podcast app that features a full-featured, Redux-style architecture and showcases dynamic themes.

• Advanced sample
• Dynamic theming using podcast artwork
• Image fetching
WindowInsets support
• Coroutines
• Local storage with Room

> Browse

Jetcaster sample demo

Rally

A Compose implementation of the Rally Material study, a financial app that focuses on data, charts, reusability and animations.

• Low complexity
• Material theming with a dark-only theme
• Custom layouts and reusable elements
• Charts and tables
• Animations
• Screenshot tests

> Browse

Rally sample demo

Crane

A Compose implementation of the Crane Material study, a travel app that uses Material Design components and Material Theming to create a personalized, on-brand experience.

• Medium complexity
• Draggable UI elements
• UI state handling
• UI Tests

> Browse

Crane sample demo

Owl

A Compose implementation of the Owl Material study. The Owl brand uses bold color, shape, and typography to express its brand attributes: energy, daring, and fun.

• Medium complexity
• Material theming & light/dark themes
• Custom layout
• Animation

> Browse

Owl sample demo

Reply

A compose implementation of the Reply material study, an email client app that focuses on adaptive design for mobile, tablets and foldables. It also showcases brand new Material design 3 theming, dynamic colors and navigation components.

• Medium complexity
• Adaptive UI for phones, tablet and desktops
• Foldable support
• Material 3 theming & Components
• Dynamic colors and Light/Dark theme support

> Browse

Reply sample demo

JetLagged

A sample sleep tracker app, showcasing how to create custom layouts and graphics in Compose

• Custom Layouts
• Graphs with Paths

> Browse

JetLagged sample demo

🧬 Additional samples

Project

Now in Android

An app for keeping up to date with the latest news and developments in Android.

Jetpack Compose first app.
• Implements the recommended Android Architecture Guidelines
• Integrates Jetpack Libraries holistically in the context of a real world app


> Browse

Now In Android Github Repository

Material Catalog

A catalog of Material Design components and features available in Jetpack Compose. See how to implement them and how they look and behave on real devices.

• Lives in AOSP—always up to date
• Uses the same samples as API reference docs
• Theme picker to change Material Theming values at runtime
• Links to guidelines, docs, source code, and issue tracker


> Browse on AOSP

Material Catalog sample demo

Sunflower

A gardening app illustrating Android development best practices with Android Jetpack. The compose branch is partially built with Jetpack Compose.

• Compose working in an existing app: including integration with strings, resources, and themes and styles
• Integration with an existing architecture based on Jetpack libraries
CollapsingToolbarLayout behavior implemented manually with Compose
• Showing Snackbars with Compose

> Browse

Sunflower sample demo

High level features

Looking for a sample that has the following features?

Custom Layouts

Theming

Animations

Text

Large Screens

TV

Wear

Formatting

To automatically format all samples: Run ./scripts/format.sh To check one sample for errors: Navigate to the sample folder and run ./gradlew --init-script buildscripts/init.gradle.kts spotlessCheck To format one sample: Navigate to the sample folder and run ./gradlew --init-script buildscripts/init.gradle.kts spotlessApply

Updates

To update dependencies to their new stable versions, run:

./scripts/updateDeps.sh

To make any other manual updates to dependencies (ie add a new dependency or set an alpha version), update the /scripts/libs.versions.toml file with changes, and then run duplicate_version_config.sh to propogate the changes to all other samples. You can also update the toml-updater-config.gradle file with changes that need to propogate to each sample.

License

Copyright 2022 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

    https://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.

compose-samples's People

Contributors

acbellini avatar alexvanyo avatar angeles-bilbao6 avatar arriolac avatar astamato avatar bentrengrove avatar chikoski avatar chrisbanes avatar codingjeremy avatar compose-devrel-github-bot avatar florina-muntenescu avatar gurupreet avatar iangclifton avatar jdkoren avatar jolandaverhoef avatar josealcerreca avatar jwill avatar kul3r4 avatar manuelvicnt avatar mlykotom avatar nickbutcher avatar objcode avatar pedrosax avatar renovate[bot] avatar riggaroo avatar rool78 avatar simona-anomis avatar tunjid avatar yongsuk44 avatar yrezgui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compose-samples's Issues

AppDrawer content is hardly clickable

The content(Home, Intererts) in navigation drawer is hardly clickable and also background color is only covering the small area. In pervious version background color is taking the full width of navigation bar.

navigationContent

Android Studio 4.0 or newer.

This version of Android Studio cannot open this project, please retry with Android Studio 4.0 or newer.

Why? :|
Can it be run on the current version?

Favorites Feature

Hello 👋,

I open this issue because I want to implement the Favorite Feature in Article Screen, I will open PR asap.
Hope you guys have a good day and stay safe and healthy 🙏

Thanks

rsz_screenshot_1585967111

Code coverage support (Jacoco)

I have added support for generating a Jacoco code coverage report to the dev15 Jetnews sample code.

This contribution has been generated at the suggestion of Romain Guy, whom I wrongly credited for the astute addition of actual instrumentation tests in Jetnews. If this code, or a variant of it, is accepted, I will gladly add more tests to both increase the test coverage and, more importantly, reveal possible new problems with Jacoco as a result of Compose code generation.

The base support changes are essentially limited to .../JetNews/build.gradle and .../JetNews/app/build.gradle such that a code coverage report for Jetnews can be obtained by using index.html in the (Gradle default) directory .../JetNews/app/build/reports/jacocoTestReport/html/.

Question about dependecies

Could you please explain why do we need all of these:

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
    kotlinOptions {
        jvmTarget = "1.8"
        freeCompilerArgs += ["-Xallow-jvm-ir-dependencies", "-Xskip-prerelease-check"]
    }
}

How about just:

android {
    buildFeatures {
        compose true
    }
}

or nothing at all and be done with it? That's too much boilerplate!

@Model is deprecated

I know that the compose version in the project is dev11, but it would be awesome to see an alternative for the navigation with the currentScreen

@Model
object JetnewsStatus {
    var currentScreen: Screen = Screen.Home
    val favorites = ModelList<String>()
    val selectedTopics = ModelList<String>()
}

crash on Android 5.0 emulator

I couldn't run this sample app on Android 5.0 emulator because of RuntimeException.

10-23 17:47:09.119 4923-4923/com.example.jetnews E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.jetnews, PID: 4923
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.jetnews/com.example.jetnews.ui.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable-xxhdpi-v4/ic_jetnews_wordmark.png from xml type xml resource ID #0x7f060068
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
        at android.app.ActivityThread.access$800(ActivityThread.java:144)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5221)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
     Caused by: android.content.res.Resources$NotFoundException: File res/drawable-xxhdpi-v4/ic_jetnews_wordmark.png from xml type xml resource ID #0x7f060068
        at android.content.res.Resources.loadXmlResourceParser(Resources.java:2645)
        at android.content.res.Resources.loadXmlResourceParser(Resources.java:2600)
        at android.content.res.Resources.getXml(Resources.java:1098)
        at androidx.ui.res.VectorResourcesKt.loadVectorResource(VectorResources.kt:63)
        at androidx.ui.res.VectorResourcesKt$vectorResource$1$1.invoke(VectorResources.kt:52)
        at androidx.ui.res.VectorResourcesKt$vectorResource$1$1.invoke(VectorResources.kt)
        at androidx.compose.ComposerKt.remember(Composer.kt:1867)
        at androidx.compose.EffectsKt$memo$2.invoke(Effects.kt:287)
        at androidx.compose.EffectsKt$memo$2.invoke(Effects.kt)
        at androidx.compose.Effect.resolve(Effects.kt:106)
        at androidx.compose.Effect.resolve$default(Effects.kt:843)
        at androidx.compose.Effect.unaryPlus(Effects.kt:115)
        at androidx.ui.res.VectorResourcesKt$vectorResource$1.invoke(VectorResources.kt:51)
        at androidx.ui.res.VectorResourcesKt$vectorResource$1.invoke(VectorResources.kt)
        at androidx.compose.Effect.resolve(Effects.kt:106)
        at androidx.compose.Effect.resolve$default(Effects.kt:843)
        at androidx.compose.EffectsKt.unaryPlus(Effects.kt:841)
        at com.example.jetnews.ui.VectorsKt$VectorImage$1.invoke(Vectors.kt:41)
        at com.example.jetnews.ui.VectorsKt$VectorImage$1.invoke(Vectors.kt)
        at androidx.compose.ObserveKt.Observe(Observe.kt:39)
        at com.example.jetnews.ui.VectorsKt.VectorImage(Vectors.kt)
        at com.example.jetnews.ui.VectorsKt.VectorImage$default(Vectors.kt:40)
        at com.example.jetnews.ui.JetnewsAppKt$AppDrawer$1$1$1$1$1$1$1.invoke(JetnewsApp.kt:103)
        at com.example.jetnews.ui.JetnewsAppKt$AppDrawer$1$1$1$1$1$1$1.invoke(JetnewsApp.kt)
        at androidx.compose.ObserveKt.Observe(Observe.kt:39)
        at com.example.jetnews.ui.JetnewsAppKt$AppDrawer$1$1$1$1$1$1.invoke(JetnewsApp.kt)
        at com.example.jetnews.ui.JetnewsAppKt$AppDrawer$1$1$1$1$1$1.invoke(JetnewsApp.kt)
        at androidx.ui.layout.FlexKt$ModifiedFlexLayout$1$1$1.invoke(Flex.kt:548)
        at androidx.ui.layout.FlexKt$ModifiedFlexLayout$1$1$1.invoke(Flex.kt)
        at androidx.compose.ObserveKt.Observe(Observe.kt:39)
        at androidx.ui.layout.FlexKt$ModifiedFlexLayout$1$1.invoke(Flex.kt)
        at androidx.ui.layout.FlexKt$ModifiedFlexLayout$1$1.invoke(Flex.kt)
        at androidx.ui.core.LayoutKt$Layout$3.invoke(Layout.kt:147)
        at androidx.ui.core.LayoutKt$Layout$3.invoke(Layout.kt)
        at androidx.compose.ObserveKt.Observe(Observe.kt:39)
        at androidx.ui.core.LayoutKt.Layout(Layout.kt)
        at androidx.ui.core.LayoutKt$Layout$1.invoke(Layout.kt:551)
        at androidx.ui.core.LayoutKt$Layout$1.invoke(Layout.kt)
        at androidx.compose.ObserveKt.Observe(Observe.kt:39)
        at androidx.ui.core.LayoutKt.Layout(Layout.kt)
        at androidx.ui.layout.FlexKt$FlexLayout$1.invoke(Flex.kt:990)
        at androidx.ui.layout.FlexKt$FlexLayout$1.invoke(Flex.kt)
        at androidx.compose.ObserveKt.Observe(Observe.kt:39)
    	at androidx.ui.layout.FlexKt.Flex

Toolbar - navigation button hardly clickable

The button in top Toolbar is very hardly clickable. It uses size of drawable for click area, which is 24x24 dp for ic_back.xml. 48dp is probably recommended minimum for buttons.

Ideally the button uses entire toolbar height, and has predefined width, starting from leftmost pixels. The drawable icon may be whatever size it wishes, but clickable area should be large enough.

See visualization of current clickable area:
image

Poor performance

this demo is too laggy to attract new comer :(
profile on pixel 3xl
image

Will espresso support jetpack compose?

Will espresso support jetpack compose UI once it became production ready?

Problems facing in compose and espresso integration now:

We are using view id and content description in espresso testing. unable to set id and content description in Jetpack compose
And the view hierarchy itself changed, unable to see child views of AndroidComposeView in layout inspector

Crossfade animation is dropping frames

  • Device: Samsung Galaxy S9+
  • Sample: Jetnews

When navigating from Home to Article screen (and from the Article back to the Home screen by clicking the back arrow button) the Crossfade transitions are dropping frames.

@Composable
private fun AppContent(openDrawer: () -> Unit) {
    Crossfade(JetnewsStatus.currentScreen) { screen ->
        Surface(color = +themeColor { background }) {
            when (screen) {
                is Screen.Home -> HomeScreen { openDrawer() }
                is Screen.Interests -> InterestsScreen { openDrawer() }
                is Screen.Article -> ArticleScreen(postId = screen.postId)
            }
        }
    }
}

Typo in README.md

What

Under Rally on the front page readme, it says:
"Custom layouts and reusable elementss"

Fix

Should probably be "elements"

Jetsnack sample project. Preview is crashing because of NPE.

Android Studio 4.2 Canary 8
Build #AI-202.6397.94.42.6787931, built on August 25, 2020
Runtime version: 11.0.7+10-b765.53 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 12
Non-Bundled Plugins: monokai-pro

Jetsnack sample project. Preview is crashing because of NPE.

java.lang.NullPointerException
at com.example.jetsnack.ui.utils.InsetsKt$navigationBarsPadding$1.invoke(Insets.kt:229)
at com.example.jetsnack.ui.utils.InsetsKt$navigationBarsPadding$1.invoke(Insets.kt)
at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:62)
at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt)
at androidx.compose.ui.Modifier$Element$DefaultImpls.foldIn(Modifier.kt:117)
at androidx.compose.ui.ComposedModifier.foldIn(ComposedModifier.kt)
at androidx.compose.ui.ComposedModifierKt.materialize(ComposedModifier.kt:57)
at androidx.compose.ui.LayoutKt$materializerOf$1.invoke(Layout.kt:251)
at androidx.compose.ui.LayoutKt$materializerOf$1.invoke(Layout.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:152)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.ui.LayoutKt.Layout(Layout.kt:667)
at androidx.compose.foundation.layout.StackKt.Stack(Stack.kt:51)
at com.example.jetsnack.ui.home.FeedKt$Feed$1.invoke(Feed.kt:61)
at com.example.jetsnack.ui.home.FeedKt$Feed$1.invoke(Feed.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:175)
at com.example.jetsnack.ui.components.SurfaceKt$JetsnackSurface$1.invoke(Surface.kt:62)
at com.example.jetsnack.ui.components.SurfaceKt$JetsnackSurface$1.invoke(Surface.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.foundation.BoxKt.Box-Mta43Ik(Box.kt:109)
at com.example.jetsnack.ui.components.SurfaceKt.JetsnackSurface-B4Zf7do(Surface.kt:52)
at com.example.jetsnack.ui.home.FeedKt.Feed(Feed.kt:60)
at com.example.jetsnack.ui.home.FeedKt$HomeDarkPreview$1.invoke(Feed.kt:147)
at com.example.jetsnack.ui.home.FeedKt$HomeDarkPreview$1.invoke(Feed.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:175)
at androidx.compose.foundation.TextKt.ProvideTextStyle(Text.kt:241)
at androidx.compose.material.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:71)
at androidx.compose.material.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:175)
at androidx.compose.material.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:65)
at com.example.jetsnack.ui.theme.ThemeKt$JetsnackTheme$2.invoke(Theme.kt:95)
at com.example.jetsnack.ui.theme.ThemeKt$JetsnackTheme$2.invoke(Theme.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:175)
at com.example.jetsnack.ui.theme.ThemeKt.ProvideJetsnackColors(Theme.kt:228)
at com.example.jetsnack.ui.theme.ThemeKt.JetsnackTheme(Theme.kt:94)
at com.example.jetsnack.ui.home.FeedKt.HomeDarkPreview(Feed.kt:146)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at androidx.ui.tooling.preview.PreviewUtilsKt.invokeComposableMethod(PreviewUtils.kt:145)
at androidx.ui.tooling.preview.PreviewUtilsKt.invokeComposableViaReflection(PreviewUtils.kt:184)
at androidx.ui.tooling.preview.ComposeViewAdapter$init$1$1$composable$1.invoke(ComposeViewAdapter.kt:370)
at androidx.ui.tooling.preview.ComposeViewAdapter$init$1$1$composable$1.invoke(ComposeViewAdapter.kt)
at androidx.ui.tooling.preview.ComposeViewAdapter$init$1$1.invoke(ComposeViewAdapter.kt:397)
at androidx.ui.tooling.preview.ComposeViewAdapter$init$1$1.invoke(ComposeViewAdapter.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:175)
at androidx.ui.tooling.InspectableKt.Inspectable(Inspectable.kt:62)
at androidx.ui.tooling.preview.ComposeViewAdapter$WrapPreview$1.invoke(ComposeViewAdapter.kt:327)
at androidx.ui.tooling.preview.ComposeViewAdapter$WrapPreview$1.invoke(ComposeViewAdapter.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:175)
at androidx.ui.tooling.preview.ComposeViewAdapter.WrapPreview(ComposeViewAdapter.kt:326)
at androidx.ui.tooling.preview.ComposeViewAdapter.access$WrapPreview(ComposeViewAdapter.kt)
at androidx.ui.tooling.preview.ComposeViewAdapter$init$1.invoke(ComposeViewAdapter.kt:363)
at androidx.ui.tooling.preview.ComposeViewAdapter$init$1.invoke(ComposeViewAdapter.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.ui.selection.SelectionContainerKt$SelectionContainer$3$1.invoke(SelectionContainer.kt:88)
at androidx.compose.ui.selection.SelectionContainerKt$SelectionContainer$3$1.invoke(SelectionContainer.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.ui.LayoutKt.Layout(Layout.kt:669)
at androidx.compose.ui.selection.SelectionLayoutKt.SelectionLayout(SelectionLayout.kt:80)
at androidx.compose.ui.selection.SelectionContainerKt$SelectionContainer$3.invoke(SelectionContainer.kt:85)
at androidx.compose.ui.selection.SelectionContainerKt$SelectionContainer$3.invoke(SelectionContainer.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:175)
at androidx.compose.ui.selection.SelectionContainerKt.SelectionContainer(SelectionContainer.kt:82)
at androidx.compose.ui.selection.SelectionContainerKt.SelectionContainer(SelectionContainer.kt:39)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$2.invoke(Wrapper.kt:273)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$2.invoke(Wrapper.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:175)
at androidx.compose.ui.platform.AmbientsKt.ProvideCommonAmbients(Ambients.kt:109)
at androidx.compose.ui.platform.AndroidAmbientsKt$ProvideAndroidAmbients$3.invoke(AndroidAmbients.kt:101)
at androidx.compose.ui.platform.AndroidAmbientsKt$ProvideAndroidAmbients$3.invoke(AndroidAmbients.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:175)
at androidx.compose.ui.platform.AndroidAmbientsKt.ProvideAndroidAmbients(AndroidAmbients.kt:93)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.kt:272)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.kt)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:143)
at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt)
at androidx.compose.runtime.ComposerKt.invokeComposable(Composer.kt:2684)
at androidx.compose.runtime.Composer.composeInitial(Composer.kt:1851)
at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:243)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:110)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.kt:262)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.kt)
at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.kt:545)
at android.view.View.dispatchAttachedToWindow(View.java:20479)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3489)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:44)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:354)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:435)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:141)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:704)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$6(RenderTask.java:859)
at com.android.tools.idea.rendering.RenderExecutor$runAsyncActionWithTimeout$2.run(RenderExecutor.kt:174)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

InsetsAmbient.current is null inside of Preview.
Steps to reproduce: Open Feed.kt file.

The project is not going to be built

No project is being built, the android studio 4.2 version of canary 3 has also been tested on previous versions and with different versions of packages

e: java.lang.IllegalStateException: java.lang.NoSuchFieldException: modifiers
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreApplicationEnvironment.updateInterfaceField(KotlinCoreApplicationEnvironment.java:194)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreApplicationEnvironment.registerExtensions(KotlinCoreApplicationEnvironment.java:120)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreApplicationEnvironment.<init>(KotlinCoreApplicationEnvironment.java:74)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreApplicationEnvironment.create(KotlinCoreApplicationEnvironment.java:66)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createApplicationEnvironment(KotlinCoreEnvironment.kt:508)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.getOrCreateApplicationEnvironmentForProduction(KotlinCoreEnvironment.kt:470)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:424)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:219)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:150)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:51)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:86)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:104)
	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:346)
	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:102)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:240)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.access$compileIncrementally(IncrementalCompilerRunner.kt:39)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner$compile$2.invoke(IncrementalCompilerRunner.kt:81)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:93)
	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:606)
	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:99)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1645)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.NoSuchFieldException: modifiers
	at java.base/java.lang.Class.getDeclaredField(Class.java:2489)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreApplicationEnvironment.updateInterfaceField(KotlinCoreApplicationEnvironment.java:172)
	... 38 more


e: java.lang.IllegalStateException: java.lang.NoSuchFieldException: modifiers

Execution failed for task ':app:compileDebugKotlin'.
> Internal compiler error. See log for more details

Demo App link

Great initiative over there,could we have a demo apk link in this repo as well?

Using of dependencies.kt

I don't understand why you are using dependencies.kt in the examples.
It maybe makes sense in the large multi-module project (I think that use Gradle Platform would be better here).
but why in examples?

  • it makes hard to copy&paste dependencies if you want to use the sample as source for your own project
  • especially with a groovy build script, there is no way to crl+click to the definition location
  • it prevents AS to automatically highlight outdated dependencies and automatically update them

Cannot import project in Android Studio

Hi!

I am following the import instructions here: https://developer.android.com/jetpack/compose/setup#sample but get the following error in Android Studio (posted in the Kotlin-slack): https://kotlinlang.slack.com/archives/CJLTWPH7S/p1572702912308100

When pressing finish I get a dialog saying "Failed to find any projects in Git repository". Copying and opening the URL leads to the correct repo, and cloning and opening the repo in AS works fine. Others are also getting this error.

No TextField samples

Can you please provide TextField samples here? There are no much references about how to control TextField and focus. Please add sample.

Can't import

I use canary 4.1 8, and I can't import and run this sample:

image

Low-performance in debug mode

Nice demo for compose!

I've install this demo in debug mode, seems loses much frames, especially when open new page. So I open GPU render analysis in Developer mode, and the result not good like the below picture

Jetsnack: crash when using navigation bar (going from home to search and going back to home)

I just tested Jetsnack application and I have a crash when using the navigation bar.
(going from home to search and going back to home)

Java.lang.IllegalArgumentException: LayoutNode@4d37297 children: 0 measureBlocks: androidx.compose.ui.LayoutKt$measureBlocksOf$1@393e433 is not ready. layoutState is NeedsRelayout

Android Studio 4.2 Preview 7
Android 9

My stack trace :

--------- beginning of system

2020-08-28 17:48:37.353 3288-3517/? E/ActivityManager: TouchDown intent received, starting ActiveLaunch
2020-08-28 17:48:37.371 18751-18751/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2020-08-28 17:48:37.373 18751-18751/? E/Zygote: accessInfo : 1
2020-08-28 17:48:37.499 4624-27784/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/input_booster/touchkey/time (Permission denied)
2020-08-28 17:48:37.499 4624-27784/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/input_booster/touchkey/time (Permission denied)
2020-08-28 17:48:37.501 4624-27784/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/input_booster/touchkey/time (Permission denied)
2020-08-28 17:48:37.666 3288-3308/? E/libprocessgroup: Failed to kill process cgroup uid 10430 pid 17199 in 219ms, 1 processes remain
2020-08-28 17:48:37.813 2883-5531/? E/BufferQueueProducer: [com.sec.android.app.launcher/com.sec.android.app.launcher.activities.LauncherActivity[4846]#0] disconnect: not connected (req=1)
2020-08-28 17:48:37.818 3288-4775/? E/WindowManager: win=Window{6ffbc1b u0 com.sec.android.app.launcher/com.sec.android.app.launcher.activities.LauncherActivity} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=false win.mRemoveOnExit=false win.mViewVisibility=8 caller=com.android.server.wm.WindowManagerService.tryStartExitingAnimation:2755 com.android.server.wm.WindowManagerService.relayoutWindow:2453 com.android.server.wm.Session.relayoutForTranslate:302 android.view.IWindowSession$Stub.onTransact:518 com.android.server.wm.Session.onTransact:186 android.os.Binder.execTransact:739
2020-08-28 17:48:39.154 3288-3665/? E/Watchdog: !@sync 53787 [2020-08-28 17:48:39.154] FD count : 2605
2020-08-28 17:48:39.505 4624-4984/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/camera/rear/ssrm_camera_info (No such file or directory)
2020-08-28 17:48:45.735 3288-3361/? E/WindowManager: win=Window{7f6a357 u0 Splash Screen com.example.jetsnack EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.AppWindowToken.destroySurfaces:870 com.android.server.wm.AppWindowToken.destroySurfaces:851 com.android.server.wm.WindowState.onExitAnimationDone:5436 com.android.server.wm.WindowStateAnimator.onAnimationFinished:319 com.android.server.wm.WindowState.onAnimationFinished:5858 com.android.server.wm.-$$Lambda$yVRF8YoeNdTa8GR1wDStVsHu8xM.run:2 com.android.server.wm.SurfaceAnimator.lambda$getFinishedCallback$0:100
2020-08-28 17:48:46.685 9002-10934/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: ELLIDED:1181522219, App: com.android.vending, Service: oauth2:https://www.googleapis.com/auth/googleplay
rod: Long live credential not available.
at gbz.a(:com.google.android.gms@[email protected] (100306-313409149):19)
at gai.a(:com.google.android.gms@[email protected] (100306-313409149):123)
at crk.a(:com.google.android.gms@[email protected] (100306-313409149):231)
at crk.a(:com.google.android.gms@[email protected] (100306-313409149):111)
at fyt.getAuthToken(:com.google.android.gms@[email protected] (100306-313409149):21)
at android.accounts.AbstractAccountAuthenticator$Transport.getAuthToken(AbstractAccountAuthenticator.java:247)
at android.accounts.IAccountAuthenticator$Stub.onTransact(IAccountAuthenticator.java:114)
at android.os.Binder.transact(Binder.java:675)
at cte.onTransact(:com.google.android.gms@[email protected] (100306-313409149):2)
at android.os.Binder.transact(Binder.java:675)
at aaah.onTransact(:com.google.android.gms@[email protected] (100306-313409149):17)
at android.os.Binder.execTransact(Binder.java:739)
2020-08-28 17:48:49.547 4624-4984/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/camera/rear/ssrm_camera_info (No such file or directory)
2020-08-28 17:48:59.591 4624-4984/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/camera/rear/ssrm_camera_info (No such file or directory)
2020-08-28 17:49:01.388 18751-18751/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.jetsnack, PID: 18751
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:504)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964) 
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at androidx.compose.ui.platform.ViewLayer$Companion.updateDisplayList(ViewLayer.kt:259)
at androidx.compose.ui.platform.ViewLayer.updateDisplayList(ViewLayer.kt:207)
at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.kt:474)
at android.view.View.draw(View.java:21871)
at android.view.View.updateDisplayListIfDirty(View.java:20741)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4542)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4514)
at android.view.View.updateDisplayListIfDirty(View.java:20696)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4542)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4514)
at android.view.View.updateDisplayListIfDirty(View.java:20696)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4542)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4514)
at android.view.View.updateDisplayListIfDirty(View.java:20696)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4542)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4514)
at android.view.View.updateDisplayListIfDirty(View.java:20696)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4542)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4514)
at android.view.View.updateDisplayListIfDirty(View.java:20696)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:725)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:731)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:840)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3963)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3737)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3048)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1911)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8526)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7077)
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964) 
Caused by: java.lang.IllegalArgumentException: LayoutNode@4d37297 children: 0 measureBlocks: androidx.compose.ui.LayoutKt$measureBlocksOf$1@393e433 is not ready. layoutState is NeedsRelayout
at androidx.compose.ui.node.InnerPlaceable.draw(InnerPlaceable.kt:132)
at androidx.compose.ui.node.ModifiedLayoutNode.draw(ModifiedLayoutNode.kt:81)
at androidx.compose.ui.node.LayerWrapper$layer$1.invoke(Unknown Source:10)
at androidx.compose.ui.node.LayerWrapper$layer$1.invoke(Unknown Source:3)
at androidx.compose.ui.platform.ViewLayer$dispatchDraw$1$1.invoke(ViewLayer.kt:179)
at androidx.compose.ui.platform.ViewLayer$dispatchDraw$1$1.invoke(Unknown Source:0)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:1668)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:127)
2020-08-28 17:49:01.389 18751-18751/? E/AndroidRuntime: at androidx.compose.ui.platform.AndroidComposeView.observeLayerModelReads(AndroidComposeView.kt:429)
at androidx.compose.ui.platform.ViewLayer.dispatchDraw(ViewLayer.kt:178)
at android.view.View.draw(View.java:21871)
at android.view.View.updateDisplayListIfDirty(View.java:20741)
... 40 more
2020-08-28 17:49:01.530 3288-3316/? E/WindowManager: RemoteException occurs on reporting focusChanged, w=Window{c82aa0c u0 com.example.jetsnack/com.example.jetsnack.ui.MainActivity EXITING}
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:1145)
at android.view.IWindow$Stub$Proxy.windowFocusChanged(IWindow.java:500)
at com.android.server.wm.WindowState.reportFocusChangedSerialized(WindowState.java:3950)
at com.android.server.wm.WindowManagerService$H.handleMessage(WindowManagerService.java:5472)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.os.HandlerThread.run(HandlerThread.java:65)
at com.android.server.ServiceThread.run(ServiceThread.java:44)
2020-08-28 17:49:01.532 3288-4118/? E/WindowManager: win=Window{c82aa0c u0 com.example.jetsnack/com.example.jetsnack.ui.MainActivity EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.AppWindowToken.destroySurfaces:870 com.android.server.wm.AppWindowToken.destroySurfaces:851 com.android.server.wm.WindowState.onExitAnimationDone:5436 com.android.server.wm.-$$Lambda$01bPtngJg5AqEoOWfW3rWfV7MH4.accept:2 java.util.ArrayList.forEach:1262 com.android.server.wm.AppWindowToken.onAnimationFinished:2398 com.android.server.wm.AppWindowToken.setVisibility:551
2020-08-28 17:49:01.571 4624-27784/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/input_booster/touchkey/time (Permission denied)
2020-08-28 17:49:01.571 4624-27784/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/input_booster/touchkey/time (Permission denied)
2020-08-28 17:49:01.573 4624-27784/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/input_booster/touchkey/time (Permission denied)
2020-08-28 17:49:01.610 16939-17032/? E/PBSessionCacheImpl: sessionId[74500108481002451] not persisted.
2020-08-28 17:49:01.627 18892-18892/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2020-08-28 17:49:01.629 18892-18892/? E/Zygote: accessInfo : 1
2020-08-28 17:49:01.641 18892-18892/? E/.devicesecurit: Not starting debugger since process cannot load the jdwp agent.
2020-08-28 17:49:01.746 4846-4846/? E/LiveIconManager: createLiveIconBitmap : com.sec.android.app.clockpackage apps size 1
2020-08-28 17:49:08.015 3000-3047/? E/storaged: getDiskStats failed with result NOT_SUPPORTED and size 0
2020-08-28 17:49:09.192 3288-3665/? E/Watchdog: !@sync 53788 [2020-08-28 17:49:09.192] FD count : 2601
2020-08-28 17:49:09.643 4624-4984/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/camera/rear/ssrm_camera_info (No such file or directory)
2020-08-28 17:49:19.680 4624-4984/? E/SDHMS:SDHMS_UTIL_IO: e = /sys/class/camera/rear/ssrm_camera_info (No such file or directory)
2020-08-28 17:49:23.623 18914-18914/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2020-08-28 17:49:23.626 18914-18914/? E/Zygote: accessInfo : 1
2020-08-28 17:49:23.643 18914-18914/? E/ng.storyservic: Not starting debugger since process cannot load the jdwp agent.
2020-08-28 17:49:24.851 18936-18936/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2020-08-28 17:49:24.854 18936-18936/? E/Zygote: accessInfo : 1
2020-08-28 17:49:24.870 18936-18936/? E/ung.faceservic: Not starting debugger since process cannot load the jdwp agent.

Hope this will help you fix this problem :)

Android Studio 4.1 or newer.

Im getting this error while syncing first time.

This version of Android Studio cannot open this project, please retry with Android Studio 4.1 or newer. Im already in android studio 4.0 beta 1. is there a 4.1 version?

Kapt not working with the sample

If we add the kotlin kapt plugin

apply plugin: 'kotlin-kapt'

Android studio throws an error

e: java.lang.IllegalStateException: Backend Internal error: Exception during code generation

This might be an issue with the new android gradle plugin. I have tried it outside the project and same error persists.

Understanding

Where is this issue located on the web or email presentation

Keyboard covering input

Hello,

Is there a simple example of how to prevent the keyboard from covering the input fields, similar to React Native's KeyboardAvoidingView?

Thanks,
Vladimir

Pressing backspace doesn't delete last character in the "Email" field

Steps to reproduce:

  1. Build and launch the "Jetsurvey" sample app
  2. Start typing symbols in the "Email" field
  3. Start deleting them using the "backspace" button on the keyboard
  4. Once all characters expect the first one are deleted, verify that pressing the "backspace" button doesn't delete the last character. Instead, the cursor just shifts in front of that character without actually deleting it.

Recorded video: jetpack-email-bug.tar.gz

Preview isn't Working after Kotlin 1.4 bump.

Preview isn't working. It was working with Kotlin 1.3.72 and compose 14, but the bumps (while the code works & launches), then Android Studio previews now fail.

Commit with changes: 90e3fb0

Android Studio 4.2 Canary 7

Screen Shot 2020-08-02 at 9 37 32 PM

Screen Shot 2020-08-02 at 9 39 40 PM

very slow run

hi
the my phone this project (JetNews) very slow run

Background sticky concurrent mark sweep GC freed 43281(2MB) AllocSpace objects, 24(432KB) LOS objects, 3% free, 48MB/50MB, paused 5.623ms total 69.124ms

my phone huawei ascend p7
api 21

[JetSurvey] OutlinedTextField for Email & Password currently supports multiple lines

When you press enter on the email/ password text field it becomes multiple lines. I don't think that's supposed to happen, so i remove \n before assigning it to email/ password state. But when the text is too long it will still become more that 1 line. is there an easy fix to this like singleLine = true or maxLine = 1 on the view system ?

Very slow perfomance

I installed JetNews app, it works very very slowly. The worst UX, I have to wait for 7-10 seconds before it navigates to another screen. Please check it.

Jetchat. Huge performance drop.

Huge performance tanking when selecting the text.

Steps to reproduce:

  1. Enable Profile HWUI rendering to see performance bars.
  2. Open the app
  3. Select the text and start scrolling.

Text not selected:

Text is selected:

Set `develop` branch as default branch for repo

Currently, JetNews is more or less the source of truth on using jetpack compose. When you first get to this repository you land on master, which is currently very out of date (in the compose world). It would be far more useful to folks for develop to be the default branch for viewing to reduce confusion.

Text Gravity

Can you please provide a sample of Text with gravity? There's no such reference on how to provide gravity to text.

P.S:
library version: dev-04

how to dynamic create/delete or hide/show composable component in Jetpack Compose

hi, android teem

thanks for your great demo, I've learned a lot.
Something I'd like to ask you a question, just like title :
how to dynamic open/close a list(some component create/delete or hide/show in the list item) in Jetpack Compose?

I think this is a challenge using the Jetpack Compose, it feels like:
sample

excuse me for bothering you,
I appreciate your response

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.