https://kotlinlang.org logo
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
  • e

    elye

    05/26/2021, 9:42 AM
    Hi @cb, Just check with you… I can get your
    implementation "dev.chrisbanes.accompanist:accompanist-coil:0.6.0"
    from
    mavenCentral()
    . But I cannot get
    0.10.0
    from there. Which repo should I get it from? Thanks!
    n
    c
    l
    • 4
    • 7
  • k

    Kulwinder Singh

    05/26/2021, 10:55 AM
    is there any Good Shimmer Library Implemented in Compose available ?
    s
    s
    • 3
    • 3
  • d

    David Edwards

    05/26/2021, 11:50 AM
    I want to feed search terms into a repository to asynchronous get a list of items, which in turn will be displayed in a LazyColumn. What is the best way to do that with MutableState? Ideally I want to place a debounce in the ViewModel and have that regulate calls to the repository. If I had a LiveData, I would have used a switchMap, for example, observing changes on the search term.
    r
    • 2
    • 3
  • m

    Marcin Środa

    05/26/2021, 12:36 PM
    Is there a modifier for maxWidth? Cannot see it. Looking for a wrapContent with percentage max.
    fillMaxWidth(X).wrapContentWidth
    is not working for me
    n
    r
    c
    • 4
    • 9
  • m

    Muhammad Zaryab Rafique

    05/26/2021, 12:55 PM
    Hi Everyone, guide me. I want to add new screen in my app without making new activity. My case is that in MainActivity UI has setting button when user click on button then new screen open from left side.
    f
    v
    • 3
    • 4
  • t

    Tin Tran

    05/26/2021, 1:37 PM
    Hi! Has anyone have this error while trying to run a composable preview in simulated device on Artic fox beta 2?
    C:\.....\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug\R.jar: The process cannot access the file because it is being used by another process.
    I tried to delete the file manually and run again but no luck
    z
    r
    • 3
    • 4
  • v

    Vitaliy Zarubin

    05/26/2021, 4:11 PM
    Please tell me where to dig the position of the list is not saved Paging 3.0 + paging-compose. PageSource ViewModel LazyColumn
    vokoscreen-2021-05-26_19-04-25.mp4
    a
    v
    • 3
    • 3
  • s

    Shakil Karim

    05/26/2021, 6:30 PM
    Very Cool! Google play clone build using Compose. https://github.com/pushpalroy/jetstore
    👏 6
    r
    m
    • 3
    • 5
  • c

    Colton Idle

    05/26/2021, 9:48 PM
    Are there docs anywhere about avoiding
    onXChanged
    as an event name and instead having
    onXChange
    ? I'm reading that back to myself in Florina's voice, but I can't seem to place my finger on where I saw that guidance.
    💡 3
    a
    r
    • 3
    • 3
  • b

    Billy Newman

    05/26/2021, 11:00 PM
    Is it possible to convert the material icons which are of type compose ImageVector to a Drawable. Trying to pass icon as a Drawable to an older library.
    c
    • 2
    • 3
  • k

    Kulwinder Singh

    05/27/2021, 5:01 AM
    is it bad practice to get Activity reference inside Composables like this (LocalContex.current) ?, We need activity Reference in some situations like asking of permissions or currently i am working on BiometricPrompt which requires Activity to open it, so in these cases what would be best approach ?
    ➕ 1
    r
    • 2
    • 3
  • r

    Ravi

    05/27/2021, 6:01 AM
    Hi' I'm getting following crash in few devices with
    Free Ram < 1gb
    , Exception log in 🧵
    f
    a
    • 3
    • 13
  • i

    iamthevoid

    05/27/2021, 6:38 AM
    Is it possible to make Composable tree semitransparent? for example i have red layout and white button inside. I want both to become semitransparent, but i don’t want to see red layout background under button, i want to see this button as semitransparent white (see underlay layout behind it)
    c
    • 2
    • 2
  • t

    Tolriq

    05/27/2021, 7:21 AM
    I can't find anything in the docs, but when using Crossfade in a column with a composable that add multiple views the views are stacked and not in columns as it is without the Crossfade. Is this a normal behavior?
    c
    d
    a
    • 4
    • 12
  • a

    Akram Bensalem

    05/27/2021, 8:02 AM
    Hello, I noticed that the drag item doesn't rotate with the item .
    n
    z
    • 3
    • 6
  • m

    Mehdi Haghgoo

    05/27/2021, 8:18 AM
    Is this a Compose bug that the top-left corner is removed during animation?
    Screen Recording 2021-05-27 at 4.14.53 AM.mov
    t
    z
    • 3
    • 4
  • t

    Timo Drick

    05/27/2021, 9:01 AM
    Is there any best practice for adding two PaddingValues() together?
    • 1
    • 1
  • m

    Muhammad Zaryab Rafique

    05/27/2021, 10:21 AM
    Hi Everyone, How to add parallax effect while navigating to one compose function to another compose? Kindly guide me
    👀 1
    a
    • 2
    • 4
  • v

    Vitaliy Zarubin

    05/27/2021, 12:03 PM
    What could be wrong?
    n
    b
    • 3
    • 7
  • g

    Guilherme Delgado

    05/27/2021, 1:06 PM
    Hello! I was using
    accompanist.insets
    systemBarsPadding()
    version 0.8.0 with 1.0.0-beta05. Now I’m using 0.10.0 with beta07 and no systemPadding is applied. Did I miss any change? 🤔
    c
    l
    • 3
    • 3
  • h

    Hachemi Hamadi

    05/27/2021, 1:47 PM
    Hello, I am wondering if it is possible to build something like Canva (www.canva.com) with Jetpack Compose ? i did try it with xml and found some examples but was hoping to find something better with Jetpack Compose
    c
    • 2
    • 1
  • d

    dimsuz

    05/27/2021, 2:04 PM
    I noticed that
    Typograhpy
    class is now not a
    data class
    (it used to be), but has the same semantics. Why is this so? If I'm making my own
    Typography
    -like class why shouldn't I use
    data class
    ?
    j
    b
    +2
    • 5
    • 9
  • i

    iamthevoid

    05/27/2021, 2:15 PM
    Something that i dont’t understand with Compose. Why when i toggle theme icons (checkboxes mock) not changes?
    isAppDarkTheme()
    surely works correct, colors depends on it. I checked with logs what lays in the
    res
    val and it changes! Why
    Icon
    can not recomposing? Another strange thing is that there are 4 “checkboxes”, but when i toggled theme i saw sometimes only one, sometimes two log lines (
    log
    prints from
    else
    block)
    z
    • 2
    • 4
  • d

    Daniel Rampelt

    05/27/2021, 2:18 PM
    I wrote a tutorial for creating a custom weekly schedule layout like in Google Calendar with Compose. It was my first time working with custom layouts so there might have been even simpler ways to do some things (any feedback would be appreciated), but I was pleasantly surprised by how easy and short (~230 lines) it ended up being! https://danielrampelt.com/blog/jetpack-compose-custom-schedule-layout-part-1/
    compose schedule layout.mp4
    :kotlin: 8
    c
    z
    h
    • 4
    • 4
  • j

    Jeff

    05/27/2021, 2:18 PM
    Anyone with an idea of how to achieve overlapping avatars?
    a
    h
    +6
    • 9
    • 18
  • c

    chris

    05/27/2021, 2:26 PM
    Trying to set the accessibility content description with the
    Modifier.semantics{}
    on the DropDownMenu component, but TalkBack seems to read out the panel package and activity name. Any ideas of how to get around it? Code in 🧵
    • 1
    • 1
  • i

    iamthevoid

    05/27/2021, 2:48 PM
    Hmm, why Icon with painter not changing on recompose? I have mechanics to change dark theme. And line below works: icons changing when app theme change (used for example just random vectors)
    Icon(
        imageVector = with(Icons.Default) { if (isAppDarkTheme()) DateRange else KeyboardArrowRight },
        contentDescription = null
    )
    but if i replace it with resources icon not changing
    Icon(
        painter = painterResource(id = if (isAppDarkTheme()) R.drawable.ic_checkbox_on_night else R.drawable.ic_checkbox_on_day),
        contentDescription = null
    )
    n
    z
    +3
    • 6
    • 25
  • j

    julioromano

    05/27/2021, 3:29 PM
    Is
    navController.previousBackStackEntry?.savedStateHandle.set()
    still a valid way to pass return values from a screen to the previous screen in the backstack using
    navigation-compose
    ? Are there any other preferred ways? (asking coz I didn’t notice it in the navigation compose docs)
    i
    • 2
    • 1
  • j

    julioromano

    05/27/2021, 3:45 PM
    Other unrelated
    navigation-compose
    question: Is it possible to scope a
    viewModel()
    to a nested navigation graph? (So that 2 screens in a nested graph can share state without making that state “global”)
    a
    s
    • 3
    • 5
  • d

    Daniel

    05/27/2021, 4:58 PM
    I'm trying to integrate a complex android view (Mapbox) with compose. I can't figure out how to handle updating/getting state that's "owned" by the view. For example, I was planning on the following api
    val state = rememberMapboxState(initialPosition, style)
    MapboxView(state)
    
    // later
    state.animatePosition(newPosition)
    The problem is I can't figure out how to have a method on the state trigger an update to the
    AndroidView
    . I'm considering having the state have a flow of events that the
    MapboxView
    attaches to in the `AndroidView`'s
    update
    , but I was wondering if there's a better approach
    d
    • 2
    • 3
Powered by Linen
Title
d

Daniel

05/27/2021, 4:58 PM
I'm trying to integrate a complex android view (Mapbox) with compose. I can't figure out how to handle updating/getting state that's "owned" by the view. For example, I was planning on the following api
val state = rememberMapboxState(initialPosition, style)
MapboxView(state)

// later
state.animatePosition(newPosition)
The problem is I can't figure out how to have a method on the state trigger an update to the
AndroidView
. I'm considering having the state have a flow of events that the
MapboxView
attaches to in the `AndroidView`'s
update
, but I was wondering if there's a better approach
d

Derek Ellis

05/27/2021, 8:51 PM
I could be wrong about this, but I believe in your
MapboxState
the position member would need to be a
MutableState
. Since the entire state is passed into your
MapboxView
(which I'm assuming is your composable wrapper?), when that state is updated (such as by calling
animatePosition
) then your mapbox composable will automatically recompose
d

Daniel

05/27/2021, 8:53 PM
Thanks. The problem is that model (state tracked in parent, auto-recompose on change) doesn't work with this specific example because this view really wants to keep the state itself for various reasons
I ended up solving it by having the component register the MapboxState with the view so that you can call methods on the state you passed in and have them forwarded to the view
View count: 8