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
  • i

    itnoles

    06/03/2019, 7:22 PM
    about SwiftUI, no more of IB?
    l
    b
    • 3
    • 2
  • s

    Slackbot

    06/03/2019, 7:30 PM
    This message was deleted.
    i
    • 2
    • 1
  • f

    Fudge

    06/03/2019, 9:03 PM
    Swift uses structs, react native and flutter use classes, compose uses functions.
    j
    k
    • 3
    • 3
  • f

    Fudge

    06/03/2019, 9:35 PM
    Text("Hello World")
             .padding()
    Seems nicer than
    Padding {
                Text("Hello World")
             }
    I have to be honest.
    :yes: 2
    🇳🇴 7
    ☝️ 4
    m
    l
    +11
    • 14
    • 98
  • c

    Chainchelliah

    06/04/2019, 7:32 AM
    I wonder how Google predicts it before Apple 😋
    🇳🇴 3
    g
    g
    +2
    • 5
    • 5
  • s

    Slackbot

    06/04/2019, 11:49 AM
    This message was deleted.
    s
    f
    g
    • 4
    • 4
  • f

    Fudge

    06/04/2019, 11:51 AM
    The syntax is already quite similiar
    g
    s
    • 3
    • 2
  • a

    aiidziis

    06/04/2019, 11:52 AM
    https://kotlinconf.com/workshops/
    Then we'll explore Jetpack Compose, a Kotlin native UI toolkit for Android. You'll learn how it fits together with your existing architecture to build reusable UI components. Built with a goal of integrating with your existing code we'll take a look at how to combine Jetpack Compose with Android views. We'll also cover some best practices for how to use Jetpack Compose!
    So I guess by December there will be alphaish release of Jetpack Compose?
    f
    d
    s
    • 4
    • 9
  • r

    Robert Menke

    06/05/2019, 1:24 PM
    https://twitter.com/rwenderlich/status/1136234468828700673?s=21
    👎 3
    f
    l
    • 3
    • 4
  • l

    Leland Richardson [G]

    06/05/2019, 3:36 PM
    also the fact that the order matters on them is a bit worrisome to me
    ➕ 5
    k
    • 2
    • 1
  • e

    elizarov

    06/05/2019, 3:41 PM
    I’d rather introduce a new primitive into the language (😱) that provides for this kind of composition but without nesting of curly braces. We run into it all the time even without compose. Instead of:
    fun foo() = logged { transactional { ... } } // (1)
    Padding(color=my) { OtherWrapper { Component() } } // (2)
    It would be preferable to be able to write:
    fun foo() = logged <compose> transactional { ... } // (1)
    Padding(color=my) <compose> OtherWrapper <compose> Component() // (2)
    The trick is what
    <compose>
    sequence of characters is. It is extremely hard to find a syntactic form that is readable and understandable, looks nicely, and is not ambiguous with all the current and potential future extensions of Kotlin language. Ideas are welcome, use a thread please :thread-please:
    ➕ 4
    r
    k
    +9
    • 12
    • 77
  • s

    sergio250

    06/05/2019, 3:42 PM
    Actually, we’ve been playing with SwiftUI and some snapshot testing and that nesting syntax is what’s using under the hood:
    struct ContentView: View {
        var body: some View {
            Spacer().padding()
        }
    }
    Is transformed into
    ▿ _ModifiedContent<Spacer, _PaddingLayout>
      ▿ content: Spacer
        - minLength: Optional<CGFloat>.none
      ▿ modifier: _PaddingLayout
        ▿ edges: Set
          - rawValue: 15
        - insets: Optional<EdgeInsets>.none
    r
    • 2
    • 8
  • r

    romainguy

    06/05/2019, 5:05 PM
    https://twitter.com/twostraws/status/1136117329782235137
    ☝️ 3
    😫 14
    s
    r
    • 3
    • 2
  • e

    elizarov

    06/05/2019, 5:23 PM
    The upside is that people skilled in reading SwiftUI code will boost their reverse Polish notation reading prowess and mental stack capacity and they’ll soon be able to fluently program in Forth!
    😂 10
    :trollface: 7
    f
    • 2
    • 4
  • t

    Tudor Luca

    06/05/2019, 5:42 PM
    anyone here from the flutter team? I wanna hear their thoughts as well 🙂
    👍 1
    g
    • 2
    • 1
  • f

    Fudge

    06/05/2019, 10:00 PM
    Interesting benefit of the
    tapAction
    modifier in SwiftUI.
    Text("hello")
    .tapAction { println("tapped") }
    Over
    Clickable(onClick = { println("tapped") }){
         Text("hello")
    }
    You get
    { println("tapped") }
    over
    (onClick = { println("tapped") })
    a
    v
    • 3
    • 8
  • f

    Fudge

    06/05/2019, 10:07 PM
    Text("/(capacity) people")
    is translatable
    l
    j
    • 3
    • 7
  • m

    Mihai Hrincescu

    06/09/2019, 12:46 PM
    Will this bring any performance improvement to rendering, measuring and layout phases or will just skip the xml parsing or the performance improvements are likely to come when the UI composing will be truly multi-threaded.
    g
    a
    m
    • 4
    • 11
  • a

    Adam Powell

    06/09/2019, 2:47 PM
    the on-device developer setting? I forget exactly what that keys off of, assuming it's readable as public api I see little reason why we wouldn't key off of it in debug modes or something. If you mean some of the new tooling in android studio, we already have plans there yes
    p
    • 2
    • 4
  • r

    raulraja

    06/09/2019, 8:42 PM
    Hi!, Jetpack Compose makes use of extensions such as
    org.jetbrains.kotlin.extensions.TypeResolutionInterceptorExtension
    in its component registration. I looked in Github and there are no such extensions in the Kotlin Compiler master branch. Where are those extensions coming from? Is there a list of available extensions available? Thanks.
    👍 3
    r
    • 2
    • 4
  • r

    raulraja

    06/09/2019, 8:56 PM
    Are there instructions to build jetpack compose in a dev machine? I’d like to learn and contribute since I’m getting involved with compiler plugins as well but I have not found a way to build the
    support
    repo or the subset of jetpack compose which is the one I’m interested in. Any help is appreciated, thanks.
    r
    • 2
    • 6
  • b

    Blundell

    06/10/2019, 7:58 AM
    Icon-1024.icns
    m
    f
    • 3
    • 3
  • v

    Vladimir Ivanov

    06/11/2019, 10:04 AM
    I am trying Jetpack Compose and I have tons of questions and bugreports 🙂 What is the idiomatic way of having the colored background? Just Surface with color property?
    a
    m
    +3
    • 6
    • 11
  • v

    Vladimir Ivanov

    06/11/2019, 10:05 AM
    Second: What about text input? EditableText doesn't seem like a component to provide proper input(if text is an empty string you can't even start typing)
    l
    f
    m
    • 4
    • 6
  • v

    voddan

    06/11/2019, 10:44 AM
    Hi! How can I contribute to Compose? Is there a public issue tracker where I could take some tasks from?
    f
    b
    +3
    • 6
    • 12
  • v

    Vladimir Ivanov

    06/11/2019, 12:14 PM
    Any plans on having a preview for Composable functions in AS ?
    a
    l
    +2
    • 5
    • 7
  • v

    Vladimir Ivanov

    06/11/2019, 12:17 PM
    Also, why root surface is expanded on a whole screen while surface enclosing say an EditableText does not?
    a
    l
    • 3
    • 3
  • v

    Vladimir Ivanov

    06/11/2019, 12:22 PM
    How do I access android Context in the Composable? Or I should pass all such code as properties?
    a
    l
    • 3
    • 3
  • v

    Vladimir Ivanov

    06/11/2019, 12:30 PM
    yep
    a
    g
    +4
    • 7
    • 9
  • u

    ursus

    06/13/2019, 5:18 AM
    hi reduxy folks, I want ask OT but related to the paradigm shift, since Compose is way in the future. If I were to have a Edit text, in proper reduxy way, one should emit a new state state every new char is typed. Which I then in thoery need to set back on the Edit text. If I do that, it visibly lags. Is there a way to make this performant now? (without ©ompose)
    g
    d
    • 3
    • 8
Powered by Linen
Title
u

ursus

06/13/2019, 5:18 AM
hi reduxy folks, I want ask OT but related to the paradigm shift, since Compose is way in the future. If I were to have a Edit text, in proper reduxy way, one should emit a new state state every new char is typed. Which I then in thoery need to set back on the Edit text. If I do that, it visibly lags. Is there a way to make this performant now? (without ©ompose)
g

gildor

06/13/2019, 5:38 AM
now? So you use Android Views for this?
And how exactly you apply those changes? Inflate it each time is obviously too slow
u

ursus

06/13/2019, 6:26 AM
yes android edittext; no inflation, just mutation lf the same instance via edittext.textWatcher -- on every char + apply state.text back to edittext
g

gildor

06/13/2019, 6:28 AM
it should work relatively fast, but may cause problems with selections and cursor position, anyway I don’t think this related to this channel topic or to Kotlin in general
u

ursus

06/13/2019, 6:30 AM
well not sure whether its the edittect.setSelection(state.text.size) or the setText itself, but its unusable, not nicpicking, if you were to try it you'd see
d

david.bilik

06/13/2019, 7:05 AM
Each time I’ve implemented something like this I’ve added some checks to not set the text if it was the same as already presented in EditText .. in that time no cursor of other lags was not there .. but its not ideal, sure
u

ursus

06/13/2019, 7:14 AM
@david.bilik did you compare against previousState.text or if(newState.text != ediText.text.toString())?
d

david.bilik

06/13/2019, 7:15 AM
against edittext itself
View count: 2