https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
compose
  • g

    Giorgos Neokleous

    06/13/2019, 9:00 AM
    Not sure why it wasn't posted here yet http://androidbackstage.blogspot.com/2019/06/episode-115-jetpack-compose.html
    👍 22
    s
    • 2
    • 1
  • r

    romainguy

    06/13/2019, 4:14 PM
    I forgot to announce it on Twitter 🤔
    g
    s
    • 3
    • 4
  • k

    kioba

    06/14/2019, 11:18 AM
    is there a way to diverge a layout with specific receivers? An example is like Scaffold in Flutter

    https://cdn-images-1.medium.com/max/1600/1*jZdYRvtKllXu0h0FiGG9Vw.png▾

    . where the AppBar, Body, and BottomNavBar are specified receivers for a Widget and Scaffold provides behaviour for them.
    m
    a
    +3
    • 6
    • 16
  • r

    romainguy

    06/14/2019, 6:51 PM
    @miha-x64 Why do you think that? I'm curious to hear what we could improve
    m
    k
    g
    • 4
    • 5
  • t

    Tristan Caron

    06/14/2019, 7:07 PM
    Compose doesn’t seem to be really tight to Android. I might be wrong, but we could probably “just” change a rendering function to make it able to draw on a different canvas. I perfectly understand it’s certainly not the priority but it’s cool to think that in the future it might be possible.
    🍏 4
    ❤️ 2
    👍 1
    f
    s
    +2
    • 5
    • 10
  • r

    romainguy

    06/17/2019, 9:14 PM
    We have ideas and prototypes for ConstraintLayout in Compose
    🙌 29
    t
    s
    • 3
    • 2
  • m

    Matej Drobnič

    06/18/2019, 5:32 AM
    I was just messing around with creating a slidable drawer with
    ViewDragHelper
    and noticed that this code has a lot of state and calbacks interacting with each other (for example see all the touch callbacks in
    androidx.drawerlayout.widget.DrawerLayout
    from androidx). I cannot fanthem how could such monstrosity be implemented with just composable functions. Will there be a way to create classes for views or some other way to properly manage complex views like this?
    👆 1
    k
    l
    • 3
    • 10
  • v

    Vladimir Ivanov

    06/19/2019, 10:21 AM
    Does Jetpack Compose has a SeekBar or Slider component? Can't find one =(
    a
    • 2
    • 1
  • v

    Vladimir Ivanov

    06/19/2019, 12:20 PM
    Another question: Any plans on returning a component instead of Unit for the sake of unit tests? Like described here: https://blog.karumi.com/android-jetpack-compose-review/
    l
    g
    • 3
    • 5
  • l

    Loránd

    06/20/2019, 8:28 AM
    Maybe i missed this but will there be any live preview window for compose in studio? similar to apples canvas in xcode for swift ui.
    v
    t
    • 3
    • 2
  • t

    Tristan Caron

    06/20/2019, 8:19 PM
    Interesting initiative https://worthdoingbadly.com/swiftui-html/ It’s only an educational toy, but still.
    f
    e
    +2
    • 5
    • 5
  • s

    Suraj Shah

    06/22/2019, 1:08 PM
    Do we have to write
    inline
    to inline lambdas in a function marked with
    @Composable
    or does the annotation processor optimize it for you?
    c
    l
    +3
    • 6
    • 19
  • g

    Gil Goldzweig

    06/22/2019, 2:46 PM
    Is there a URL that people can join this channel?
    b
    • 2
    • 4
  • m

    Matej Drobnič

    06/22/2019, 5:09 PM
    Follow up question to:
    Compose has no specific notion of View IDs.
    Without that information, how can compose distinguish between "old item removed, new item inserted" and "old item updated" events to display proper animations (e.g in recycler-view like setting)?
    l
    l
    +3
    • 6
    • 9
  • k

    Karen Ng

    06/26/2019, 8:15 PM
    Hey all! PSA: Interested in helping us shape Jetpack Compose and getting paid for it? We’re looking for some people interested in an upcoming Jetpack Compose research study. Announcement: Seeking Android Developers to provide feedback on Jetpack Compose Location: Either Mountain View (Googleplex), San Francisco Google Office Dates: July 1 - July 12 Time commitment: 1.5 hour in-person session Incentive: $200 More info: If you’re interested, please fill out the questionnaire below to confirm your availability and see if this study is a good fit for you https://forms.gle/ckFqCkLGGufTuv8U8
    f
    f
    +4
    • 7
    • 9
  • s

    Siyamed

    06/27/2019, 11:56 PM
    I was just fixing it. currently it is in a temporary stage.
    😍 4
    k
    • 2
    • 1
  • l

    Leland Richardson [G]

    06/29/2019, 5:49 PM
    though there are still a few advantages of class components that we are trying to work out
    s
    • 2
    • 3
  • l

    Leland Richardson [G]

    07/01/2019, 12:24 AM
    you can do patterns like that with both component classes and composable functions, if that was what you were asking
    s
    • 2
    • 2
  • r

    romainguy

    07/01/2019, 2:41 PM
    (first the new IR backend of the Kotlin compiler needs to be stable :)
    g
    • 2
    • 1
  • p

    pavi2410

    07/04/2019, 2:39 PM
    SwiftUI uses
    @State var count = 0
    while in Compose,
    val count = +state { 0 }
    . Why such a hacky thing (
    +state
    ) is chosen?
    m
    l
    +4
    • 7
    • 22
  • a

    Arman Chatikayn

    07/04/2019, 7:32 PM
    What is the approach do you use to update the corresponding UI part ? As I understand you did not use Virtual Dom approach to solve this problem
    g
    • 2
    • 1
  • a

    Arman Chatikayn

    07/07/2019, 1:15 PM
    Why_not_move___Compose_to_language_level__as_you_already_do_some_byte_code_changes_with_compiler_plugin__I_mean_maybe_something_like_this_will_be_better_.kt
    f
    s
    +8
    • 11
    • 17
  • d

    dead.fish

    07/08/2019, 10:54 AM
    Dear Android Compose Team, please do not re-use the existing style system Android provides, its a PITA to use right, memorize, extend and embrace. Please come up with something better, that doesn't force you to read and distribute base style information across dozens of files. Thank you! - A plagued user.
    👍 16
    ➕ 17
    ☝️ 6
    j
    a
    +4
    • 7
    • 19
  • t

    Tristan Caron

    07/11/2019, 3:44 PM
    Hmmm interesting work from Microsoft team with C# Blazor and Flutter

    https://youtu.be/uW-Kk7Qpv5U?t=3265▾

    r
    • 2
    • 1
  • d

    dewildte

    07/12/2019, 2:19 PM
    I have not chimed in here for awhile. Has any work been done to get the Compose tools to run on Windows machines yet?
    😂 5
    r
    r
    l
    • 4
    • 4
  • a

    Antanas A.

    07/17/2019, 9:33 AM
    Hi everybody, I've design question when using tools such Jetpack Compose. Is it possible to have some "methods" on a GUI components? example ListGrid.selectRecord(), ListGrid.sortColumn(), ListGrid.hideColumn(), ListGrid.disableClicks()? Or this is the same as React Redux and we can control components UI only thru explicit view state management? Or do you have some alternatives for this scenario? Problem is that currently we need for simple list grid to create "View Object (for rendering)", "View Component/Controller (for managing state) with methods" have some state container, bind state container to View Object and to View Component, and do actions thru some action dispatchers aka reducers which do not have references to either View Object nor View Component. How to handle that if there is multiple list grids or many different objects. I've largely used MVC / MVP / MVVM styles of GUI programming, and MVVM without two way binding was best available at time and now it's hard to understand how do you do programming when you do not have some reference-able graph of objects which can have a "methods". Do you thought about this during Jetpack Compose design? Any recommended way to handle state (more focus on state of UI component, not the model state)? (disclose: I personally dislike redux like designs where everything is completely separated and by that becomes hard to track what belongs to whom with custom made dynamic dispatch system which emulates OOP language method calls)
    t
    • 2
    • 7
  • j

    Jurriaan Mous

    07/18/2019, 5:33 AM
    Slides which explain Compose internals step by step. https://twitter.com/intelligibabble/status/1151649562685136897
    👍 17
    c
    l
    +4
    • 7
    • 8
  • t

    Tristan Caron

    07/18/2019, 2:44 PM
    Will Compose be the definitive name?
    l
    r
    d
    • 4
    • 7
  • r

    rkeazor

    07/19/2019, 12:42 AM
    So will jetpack compose, support constraint layouts.
    l
    k
    +2
    • 5
    • 13
  • v

    voddan

    07/22/2019, 1:44 PM
    I am reading @Leland Richardson [G]’s slides and they mention a very specific data structure (flat array) for the UI tree. Some questions: 1) Will the selected data structure have any impact on the semantics of Compose or impose any structural limitations on it (vs a naive tree)? 2) What sources and methods were used to confirm the "the structure of a UI doesn't change very often" assumption (slide 33)? E.i. what frameworks and types of UI did you looked at? 3) Do you know of any use cases that are atypical for the existing UI frameworks, but would fit Compose well that would break the (2) assumption and, as a result, would not have good performance with the Slot Table currently used? I can think of loops with variable number of iterations, but I did not confirm that. 4) If there are valuable use cases in (3) that do not perform well with the current implementation of Compose, how hard will it be to switch Compose to a different (presumably non-flat) data structure?
    👍 6
    c
    • 2
    • 2
Powered by Linen
Title
v

voddan

07/22/2019, 1:44 PM
I am reading @Leland Richardson [G]’s slides and they mention a very specific data structure (flat array) for the UI tree. Some questions: 1) Will the selected data structure have any impact on the semantics of Compose or impose any structural limitations on it (vs a naive tree)? 2) What sources and methods were used to confirm the "the structure of a UI doesn't change very often" assumption (slide 33)? E.i. what frameworks and types of UI did you looked at? 3) Do you know of any use cases that are atypical for the existing UI frameworks, but would fit Compose well that would break the (2) assumption and, as a result, would not have good performance with the Slot Table currently used? I can think of loops with variable number of iterations, but I did not confirm that. 4) If there are valuable use cases in (3) that do not perform well with the current implementation of Compose, how hard will it be to switch Compose to a different (presumably non-flat) data structure?
👍 6
c

Chuck Jazdzewski [G]

07/22/2019, 4:00 PM
1) ... structural limitations
No. The data structure is an internal detail. We could switch to a different data structure if performance dictates. We have already switched twice before we went public.
2) What sources and methods ....
Mostly experience with many different frameworks over our careers (for me personally this is my 6th framework). This, however, is just an observation and is not required for the performance of the system. Compose can handle large radical changes in the UI just a easily but we are optimizing around localized changes as that is what we believe will be most common.
3) Do you know of any use cases that are atypical for....
Yes. Inserting and removing nodes at the beginning and end of the slot table in the same composition or any other form of non-local change. As the slot table is a flattening of the of a tree, any non-local changes to the tree will cause copying of the array as the buffer gap moves. If this is common we can introduce multiple gaps or using an internal tree; but, for now, we have a flat array with a single gap.
4) ...how hard will it be to switch...
Not hard. We are keeping the data structure internal and only exposing an abstraction to the code generation to call. We have switched the implementation twice already without impacting the programming model. Even if the code generation takes a more active role (such as producing a scope record to avoid boxing) we still anticipate using the same API as the scope record could just be stored a
memo
like call. We do plan some significant surface changes to the API, moving to a more of a code-flow approach instead of call interception, as explain in Leland's talk which will result in changes to the API the compiler uses but it will still be abstract enough to hide the flat vs. tree based data structure.
👍 6
v

voddan

07/23/2019, 12:59 AM
Thanks!
View count: 2