Senior software engineer at Google. Progenitor of Jetpack Compose (May 2017). Now: Compose on every platform, and AI architectures for Program Synthesis.
More than four years after I first proposed it and wrote the first line of code, we've finally released
#JetpackCompose
(stable) version 1.0.0! 🎉 Incredibly grateful to everyone who helped me make it happen. Exciting to have built the future of
#Android
together!
Compose for iOS is officially in Alpha! 🎉
Now you can write your UI in Compose for both iOS and Android, share widgets across platforms, and it compiles to a native app on both platforms! Amazing!
#JetpackCompose
#android
#kotlin
We will be releasing the Compose 1.0 (stable) in July! So excited that
#JetpackCompose
graduating to stable, and thankful we're releasing when we think it's ready rather than hitting arbitrary conference dates.
Compose for iOS is officially in Beta! 🎉
Now you can write your UI in Compose for both iOS and Android, share widgets across platforms, and it compiles to a native app on both platforms! Amazing!
#JetpackCompose
#androiddev
#kotlin
@deniskiuras
Kotlin (and therefore also Compose) is different-in-kind from other multiplatform solutions. It compiles to truly native binaries (can seamlessly share code, call to/from platform APIs).
Android Studio Arctic Fox ❄️🦊 is stable and now!
And it supports
#JetpackCompose
! 🎉
For those of you who were waiting for Compose to go stable before adopting it, now is the time!
We just released Compose Compiler stable version 1.2.0 has support for Kotlin 1.7.0! You can use the new Compose Compiler even if you are using older versions of other Compose libraries.
Beautiful Compose for Desktop sample built by
@sinasamaki
- absolutely love it, keep up the fantastic work, can't wait to see what you build next!
Source code is here:
Have you ever wondered how computers generate QR Codes? 🤣
Also, do we have a Compose-Desktop version of Tetris yet? If not, I gotta say, this is the way to do it 😉
Pro tip: `BoxWithConstraints` is probably one of the most useful (and under-appreciated) widgets ever created. Many people don't even know it exists, but it would solve so many of their problems. Someone should write a blog post about it.
#JetpackCompose
People consistently underestimate the critical importance of early design decisions. Code builds upon code. Early decisions (good and bad) are reenforced (exponential/compound growth) superlinear to project size and become impossible to change.
🤯 Wow, somebody is ahead of the curve 😉. I'm a little surprised at how far they've gotten, given that we haven't even released a technical preview yet and everything is still in a very experimental state. Yay for open source.
The Kotlin Multiplatform
@droidconNYC
app will be using Compose UI on iOS. Fine work by the
@TouchlabHQ
team. Source code just pushed. App deploy soon (ish). Wish us luck on approval!
"Context Receivers" in Jetpack Compose 🤯, if you're brave enough to try the 1.7.0-RC2 build of the Compose Compiler available at
#JetpackCompose
#Android
Screenshot testing is very important! Jetbrains wants to hire a senior engineer with interest in building a UI test framework for Compose. This person would have huge impact to enable critical use cases. Please apply if you are interested.
Skia Shaders in Compose for Desktop. If you haven't already seen the article by
@kirillpixel
, it's pretty cool:
Things you can do with
#JetpackCompose
for Desktop.
Moonshot idea: Shared element transitions are hard to implement and engineers are lazy. Imagine if we had a phase between Layout and Draw, which could run a Generative Adversarial Network. Imagine if every transition had silky smooth animations with zero effort.
@ChannelAdam
Certainly Compose was inspired in part by work done by other frameworks (React, Litho, View.js, Flutter). Not surprising that React and Compose have similarities, as I helped build both. I was one of five core engineers on React core before joining Android and starting Compose.
Amazing! We can use a desktop app built with Compose to track which Android apps are using Jetpack Compose in production! --and it might surprise you to see who is ahead of the curve.
#Android
#JetpackCompose
#ComposeDesktop
Woah 😮 🧐🥰
So excited to see examples of Compose+React.js sharing widgets and playing together. This opens the door to sharing an entire ecosystem of existing declarative widgets! 🎉
#JetpackCompose
#ReactJS
@Engr_Wil
@p_chmielowski
@BreensR
For beginners, I'd suggest learning Compose first, for a couple reasons: (1) easier to learn (2) skate to where the puck is going, not where it has been (3) you'll never compete with devs with decade+ of XML/View experience, but can easily become your company's top Compose expert
One thing I love about Compose Multiplatform is that when people try porting their apps, they're regularly surprised to discover that their composable functions frontend "just works" on iOS.
#android
#ios
#kotlin
#JetpackCompose
Finished porting Compose UI of Click Track to iOS using
#ComposeMultiplatform
. Surprisingly took me little effort and time (around a week of late nights). Still some components are missing, bugs here and there but all happen to be known and have workarounds. Very impressed
@dbaroncellimob
AAC ViewModel is a kludge for Android, I see no reason to proliferate bad patterns. If you have a properly designed data layer, you'll realize you have no use for an AAC ViewModel.
@CatalinGhita4
But the best thing is probably for your app to have a real data layer (with a cache, network layer, etc). Your VM may reference your data layer, but the VM its self probably shouldn't be handling all interactions directly anyway, your platform agnostic data layer should do that.
Comparison of my app that uses Compose Animations with canvas on a M1 mac mini, when using JVM vs. GraalVM. CPU usage is reduced on Graal, but maybe less than expected, the memory footprint reduction is pretty big :).
#JetpackCompose
#graalvm
@jetbrains
Still needs work on macOS!
If anyone is looking for animation project inspiration, maybe try porting the "Three.js Birds" demo to Compose? I have no idea if
#JetpackCompose
is fast enough to drive such a thing, but scattering a flock of birds with your pointer is satisfying as hell.
@a_key_bako
Declarative programming (including Compose) usually takes 3-6 months of usage before people have the "💡⚡️ holly-shit this is good" moment. Until then, you will struggle with it, you will fight it, it will frustrate you, and then it will all click in your mind six months later.
Woah, looks amazing! There is something about the parallax effect that is just so satisfying. I can't wait for an entire design system (full of buttons, switches, and text nodes) to use this technology for all the widgets. Great work
@_SUR4J_
!
@_______Arash
It's true. If you look hard enough, you'll still find some ktdocs that were copy-pasted from flutter. That said, we also made many different design choices, like our usage of an optimizing compiler, and positional memoization, and widgets as functions.
🤩 Yes, you can also build chrome extensions using Compose. Here's a template if you want to start developing one.
➡️ Template:
If you don't want to use the template, you can use the `create-compose-app` CLI 😉
➡️CLI:
Let's dive into the world of Jetpack Compose, where we're embracing the power of 'BoxWithConstraints' to support a wide range of screen sizes! 📲
Follow me for more Android, and Kotlin-related information, and share it to help others.
😍 Creative color picking tool built using Compose for Desktop. I love how the wheel shows the locations of the matching colors, gives a much better understanding of how the algorithm chooses the colors :). Very well done!
I added a harmony mode color picker to the repo this week, it also works on desktop ✨
Let me know what you think and if you find any bugs🐛
#JetpackCompose
#AndroidDev
Just landed WebAssembly support to Haze 💠
Kotlin Multiplatform and Compose Multiplatform made it far too easy. This is the _exact_ same code that we use on iOS and JVM, working on the web too.
🔗:
@fanatico120
@InosukeDrummer
@marianorenteria
We moved the Compose Compiler into the Kotlin repository in order to allow it to be released along with the rest of Kotlin, so you don't need to always worry about which versions are compatible. Google will still be primary contributor on compose compiler and Compose is strong.
Compose (and NOT Compose UI) on iOS driving UIKit.
Same demo we ran a few months ago (thanks to
@kpgalligan
and
@shikasd_
) on a hacky fork of the compiler now runs on unmodified AOSP Compose compiler.
Yes it's ugly it's a technical demo. Give me a pretty UI I'll drive that too
The Compose Multiplatform Documentation Survey is a great place to share your insights on Compose Multiplatform docs to help us enhance your developer experience.
➡️ Take the survey:
@AndroidDev
The syntax was originally called KTX, back before the Android Kotlin Extensions (also called KTX) started competing for the same name. If you look back at some of the original commits to Compose, you'll see a flag to enable/disable the KTX syntax.
Compose for iOS is officially in Alpha! 🎉
Now you can write your UI in Compose for both iOS and Android, share widgets across platforms, and it compiles to a native app on both platforms! Amazing!
#JetpackCompose
#android
#kotlin
@SamuelKangau
Did you know: Compose Modifiers are effectively just wrapper widgets collapsed into a short expression? They wrap the widget they modify, and match the direction of the DSL (top-left being outermost, bottom right being innermost widget).
If you are eager to use the latest Kotlin, feel free to bump your Compose Compiler version to 1.2.0-beta02. Although the 1.2 version is technically a beta, we generally consider it stable enough to be used in production encourage people to upgrade.
@blendthink
The Compose Compiler version does not need to match the version number for the rest of the Compose libraries. Even if you are using older/stable versions of other Compose libraries, you should feel comfortable bumping your Compose Compiler. (eg: ComposeUI=1.1,ComposeCompiler=1.2)
This is still my favorites so far! Such a beautiful Desktop app built with
#JetpackCompose
! The video is well-done and the music is so catchy. If anyone knows of other sweet Desktop apps built with
#JetpackCompose
, please send them my way!
🎊 Here's my first compose desktop app 💻. A simple application to name colors and generate code for them 🖌️
It can also auto-capture colors from your clipboard 📋
➡️ GitHub:
#Kotlin
#ComposeDesktop
#Compose
@ndiritu_michael
@RealNeilC
@arkann1985
The only meaningful definition of "native" is: "can you directly pass objects to and from the system". Or put another way: do you share code, share the same memory space and call stack.
Trailer is epic:
Disclaimer: I haven't reviewed the course and thus can't officially endorse it, but the trailer is epic and the technology (KMM) is awesome.
@CatalinGhita4
AAC ViewModel shouldn't be necessary with Compose; just handle configuration changes. VM is a platform-dependency; we've seen ton of value (better code quality) by embracing MPP source structure and being explicit to avoid platform dependencies. Also:
@VasiliyZukanov
Yes, Google monorepo encourages Compose.
I can't comment on specific teams/projects except those already publicly mentioned in Google messaging, but can say that many flagship projects are using Compose and many others have plans to switch to Compose.
Hold on... That's a Google I/O talk that mentions Compose Multiplatform! Running on Wasm, no less. Didn't have that on my bingo card for this year.
6:51 into the video.
@programadorthi
Strongly disagree. It has nothing to do with being impressed by a particular framework, ultimately every framework just draws pixels.
It's about getting practice building a legendary looking widget and demonstrating your skill / what you are capable of building.
@Tech_Kazu
Considering I was on the React.js core engineering team before joining Google and proposing Compose, it's not surprising there are similarities. If you know React, you might be interested in some of the earliest Kotlin syntax extensions we had for Compose:
@__velu
@ThomasBurkhartB
@manuelmaly
@shakil807
@kyleve
@StanTwinB
I had lunch with the Flutter team on a regular basis when doing the initial designs for Compose, they were very helpful and we bounced lots of ideas around, so there was certainly influence. We also mentioned our inspirations at Google IO 2019 release:
@ndiritu_michael
@RealNeilC
@arkann1985
That is the super-power of Kotlin. The output of the Kotlin compiler is truly naive, indistinguishable from a library written in Java/ObjectiveC on their respective platforms, you can directly call Android/iOS APIs.
I managed to migrate one of my old android projects to a Kotlin Multiplatform project and created a desktop version of the app using Compose Multiplatform. Huge thanks to
@cm_kagiri
for helping out in migrating the android app to compose
#AndroidDev
#Kotlin
@254androiddevs
@csinco
No, as I understand it, most of the SwiftUI problems are downstream consequences of (1) being closed source (2) being bundled with OS releases (3) not utilizing KMP. That isn't to say I don't have regrets (eg. Effects, CompositionLocals, etc) but we avoided the biggest pitfalls.
@ilian_konchev
Yeah, but you've gotta be careful. We were asking ChatGPT about some Compose APIs and it started hallucinating some (admittedly very cool APIs) that don't actually exist. It spoke about them in amazing detail complete with hallucinated docs and hallucinated usage examples.
A huge THANK YOU to
@shikasd_
for doing an incredible job getting this huge CL over the finish line! A giant leap closer to Compose for Web being a thing! Prime example of an ideal community contributor. It's inspiring what community contributions can achieve!
#JetpackCompose
Kotlin/JS support for Compose compiler has been merged 🎉🎉🎉
After ~100 revisions and 6 months of work, we've done it!
*some of it is not that plain and simple though:
@blendthink
The Compose Compiler version does not need to match the version number for the rest of the Compose libraries. Even if you are using older/stable versions of other Compose libraries, you should feel comfortable bumping your Compose Compiler. (eg: ComposeUI=1.1,ComposeCompiler=1.2)
@X1nto
I think he is just saying that an understanding of other declarative frameworks will give you a better understanding of the Compose architecture, which is true. Correct me if I'm wrong, but I don't see anything objectionable about his original tweet.
Don't know how I missed this release last year, but lately I've been seeing a bunch of positive feedback on this library! If you're looking for a navigation library, it's worth checking out! Thanks
@adrielcafe
!
#Compose
#JetpackCompose
#AndroidDev
@miguelatwork
This is why it's so important to spread the news about things like `BoxWithConstraints` which allows you to easily write widgets that are responsive to the space available. Allows widgets to naturally occupy the space available, whether due to screen size or orientation or other.
Games of Snake seem to be a popular use of
#JetpackCompose
🐍
I think "Pacman" and "Breakout" are still unattempted if anyone is looking for other arcade games to add to the collection 😉
I just recreated the classic Snake game using Kotlin Compose for Desktop! I know it's not as amazing as Fruit Ninja or Asteroids (as what I have seen on twitter) but at least I got my hands a little dirty.
#JetpackCompose
#desktop
#Kotlin
#snake
I made all this to recreate a bounding box algorithm (brilliantly explained by
@FreyaHolmer
) for beziers! ~600LOC.
By the way I'm not opening an Android emulator ever again.
#ComposeDesktop
#JetpackCompose
If you're looking for a great way to start playing with Compose on iOS... and simultaneous build something useful... while contributing to the compose community...
Thanks to
@Ch8n2
for adding another game to the list of games built with Compose for Desktop!
✅ Snake
✅ Asteroids
✅ Alien Invasion
Compose for Desktop is rapidly becoming a game engine!
So excited to see what's next!
It's been a while...
Introducing HypnoticCanvas ✨, a background shader modifier for Compose (Jetpack & Multiplatform including WASM)
Featuring Haze by
@chrisbanes
to create a whole new immersive experience.
WASM:
GitHub:
@AndroidDev
There were some very real reasons the syntax existed, which maybe we'll go into in a blog post or something some day. Those early explorations had a major impact both on what Compose is today and what Kotlin can do today.
@bluemix2
CompositionLocal should be thought of like ThreadLocal or Globals - they create implicit data dependencies and implicit API contracts that break modularity and make your code much less maintainable. You should feel bad every time you use it, prefer passing parameters explicitly.
@fanatico120
@InosukeDrummer
@marianorenteria
The move was purely 100% a pragmatic way to improve the developer experience for Compose users by making it easier to get the correct version of Compose Compiler. The Android team is still 100% supportive of Compose and we are not backing away from framework development.
@imShreyasPatil
@joreilly
I know people have made Compose run on iOS 12. SwiftUI requires iOS 13, so Compose has better version support than SwiftUI! 🤣😂🤣😇
@CFDevelop
@ndiritu_michael
@RealNeilC
@arkann1985
Yes, targets the platform ABI. For example, on Android it compiles to Java class files. On iOS it uses LLVM (same compiler toolchain used by XCode/Swift). From that point, binary generation is identical to Apple's native toolchain (uses all the same tools). Web compiles to JS.
Took my Jetpack Compose desktop experiment a little further, it's now the primary WYSIWYG editor for my blog.
The floating action button adapting with animation as it changes based on the current screen is one of my favorite things.
@YazeedAlKhalaf
All tech builds upon the learnings of prior technologies. Especially in the early days when designing Compose, I'd frequently have lunch with the Flutter team and bounce design ideas off them. Hopefully we can learn from each other and grow better together.
@__velu
@ThomasBurkhartB
@manuelmaly
@shakil807
@kyleve
@StanTwinB
I had lunch with the Flutter team on a regular basis when doing the initial designs for Compose, they were very helpful and we bounced lots of ideas around, so there was certainly influence. We also mentioned our inspirations at Google IO 2019 release: