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

    manueldidonna

    11/09/2021, 10:26 PM
    How can I animate a bottom navigation in/out in according to the screen transition with navigation for compose?
    i
    • 2
    • 1
  • z

    Zsolt

    11/09/2021, 10:50 PM
    Hello! Is my understanding wrong of what should happen or is this a bug? When running an
    updateTransition
    , any updates to the
    targetState
    seem to not respect the passed
    transitionSpec
    but to create a new one with default values. E.g.: 1. Have an
    updateTransition.animateFloat
    with
    transitionSpec = { tween(4000, 0, LinearEasing) }
    2. Start a transition between states A → B 3. While the transition is running, set a new
    targetState
    for the transition: C ER: The transition towards the new state finishes in
    4000ms
    with
    LinearEasing
    AR: The transition towards the new state finishes in
    300ms
    with
    FastOutSlowIn
    easing (default values of
    TweenSpec
    )
    d
    • 2
    • 6
  • s

    Skc

    11/09/2021, 11:06 PM
    Hi everyone 👋 Any hints what might be happening here, setting up a new compose project. config and error in 🧵
    🧵 1
    :thread-please: 1
    z
    • 2
    • 3
  • c

    Colton Idle

    11/10/2021, 2:53 AM
    Simplifying a question I asked earlier: I need a modal bottom sheet that is only ever HIDDEN or EXPANDED. I never want it to be in a half-expanded state. Is that possible when using
    ModalBottomSheetLayout
    ?
    t
    • 2
    • 6
  • n

    Nurseyit Tursunkulov

    11/10/2021, 7:25 AM
    https://stackoverflow.com/questions/69904006/how-to-draw-3d-objects-in-jetpack-compose How to draw 3D objects like cube in Jetpack Compose? I want to draw a cube and rotate it. I could find any samples or tutorials for it except this. But it was too difficult for me.
    ➕ 1
    s
    r
    c
    • 4
    • 10
  • h

    Hachemi Hamadi

    11/10/2021, 9:05 AM
    Hello, is there any way to disable swipe gestures for HorizontalPager. i want to manage the swipe manually via the pager state.
    c
    • 2
    • 1
  • a

    androidcactus

    11/10/2021, 10:07 AM
    I’m using navigation-compose 2.4.0-beta02. I open dialog destination and then restart application process. After restart that dialog is not visible but it looks like it’s still in backstack (I have to press back button 2x to leave the screen). Is this some known bug?
    😭 1
    • 1
    • 1
  • a

    Alex

    11/10/2021, 11:00 AM
    I am trying to make a composable draggable but also clickable, how can I do proper click routing? Code in 🧵
    z
    c
    • 3
    • 6
  • a

    Alex

    11/10/2021, 11:15 AM
    Is there a way to trigger the ripple click effect programmatically in compose?
    r
    l
    • 3
    • 4
  • d

    darkmoon_uk

    11/10/2021, 11:55 AM
    It's great that :compose-multiplatform: Compose for Desktop gives us out-of-the-box SVG rendering support now, and unfortunate that the same direct support doesn't exist for Android 😞 . Those who are using SVG across multiple platforms including Android, what does your solution look like? In a recent project, I wrapped the
    SVGView
    from Caverock's AndroidSVG library. It was last updated in 2019 but works well, wrapped in an `AndroidView`; no complaints! I might do that again, but interested to hear alternatives?
    c
    j
    e
    • 4
    • 7
  • s

    Steffen Funke

    11/10/2021, 4:21 PM
    Is there a way to make
    Surface
    to not set any
    contentColor
    , e.g. make it behave like a
    Box
    in this regard? I have custom colored content (Texts, Sliders, etc….), but as soon as I wrap them into a
    ModalBottomSheetLayout
    - which is backed by a
    Surface
    - everything gets tinted with the
    contentColor
    . I surely miss something here. 🤔
    l
    • 2
    • 6
  • j

    John Aoussou

    11/10/2021, 4:37 PM
    Does anyone know what is the proper way to use Factory with viewModel() functions? I couldn't find any official example (the best I could find was this Stack post, but I'm not sure using an object is ideal) https://stackoverflow.com/questions/67985585/why-do-we-need-viewmodelprovider-factory-to-pass-view-model-to-a-screen
    c
    • 2
    • 4
  • a

    Ali Albaali

    11/10/2021, 5:59 PM
    What's the best way to implement a comment Composable and nested replies that follow it? I tried using nested
    LazyColumn
    but it's prohibited, so now I'm using a
    Column
    and loop thru items but that's not the most optimal solution. Any ideas?
    b
    • 2
    • 17
  • t

    Tanaka

    11/10/2021, 6:28 PM
    How does one navigate screens controlled by bottom navigation and the bottom nav is in a screen in NavHost. The documentation it's pretty vague in this aspect. They implement a NavHost wc results in ViewModelStore should be set before setGraph call Exception
    i
    • 2
    • 6
  • n

    Nathan Castlehow

    11/11/2021, 5:32 AM
    hey hopefully a quick one, has anyone been able to make an item focused for the previews in AS? My items have a focused style they show based on being focused (from an interaction source)
    • 1
    • 1
  • m

    Mehdi Haghgoo

    11/11/2021, 5:55 AM
    My material3 app wants material:1.0.0 very badly, and it can't find it. What should I do?
    g
    • 2
    • 7
  • s

    Stylianos Gakis

    11/11/2021, 9:20 AM
    A question about whether to
    remember
    something or not. More in thread: 🧵
    👀 3
    z
    z
    o
    • 4
    • 22
  • g

    Geert

    11/11/2021, 9:30 AM
    Can someone help me with the source id for Jetpack Compose? I have an app in the play store where you have to login, so the prelaunch rapport won’t login to test the application. So when I enter an username and account I have to put source-id. But I dont know where to find it? Is it like findViewById(R.id.xxxx) but then for compose?
    ➕ 1
    s
    z
    • 3
    • 3
  • c

    Clament John

    11/11/2021, 11:54 AM
    How to do
    NestedNavigation
    (jetpack navigation) with arguments? How would I pass
    id
    to the
    login
    nav graph?
    fun NavGraphBuilder.loginGraph(navController: NavController) {
        navigation(
            startDestination = "username", 
            route = "login/{id}", 
            arguments = listOf(navArgument("id") { type = NavType.StringType }),
        ) {
            composable("username") { ... }
            composable("password") { ... }
            composable("registration") { ... }
        }
    }
    j
    i
    • 3
    • 9
  • a

    alorma

    11/11/2021, 3:19 PM
    Hi! Is there a way to have different Snackbar colors? On our design system we have 3 snackbar types: Success (green), Info (default), Error (red)
    a
    • 2
    • 7
  • j

    Jorge Domínguez

    11/11/2021, 3:27 PM
    hi all!, does anybody know how can I restart a Transition?
    val currentState = remember {
        MutableTransitionState(TransitionState.START)
            .apply { targetState = TransitionState.END }
    }
    val transition = updateTransition(currentState, label = "")
    the initial composition triggers the transition but I need to restart it whenever a Canvas draws something, which happens some time after the initial Transition is triggered. I've tried doing
    currentState.targetState = TransitionState.END
    right before drawing inside the Canvas but it doesn't work.
    d
    • 2
    • 2
  • r

    Rick Regan

    11/11/2021, 3:40 PM
    I'm trying to (properly) implement Material Theming in my app so that it can support light and dark themes. One screen of my app requires additional colors beyond the Material primary, secondary, etc. I was looking at the Rally sample app as a model because it uses extra colors to color code the account types. However, it uses `Color`s, which appears to go against the advice to use
    MaterialTheme.colors
    instead. What is the recommended way to declare additional colors that are sensitive to theme changes? (References in 🧵.)
    a
    l
    c
    • 4
    • 6
  • c

    Colton Idle

    11/11/2021, 4:37 PM
    I know the general rule of thumb is to not overuse composition locals. Would analytics be an "okay" reason to use them or should I just properly keep passing them down into all of my composables?
    j
    a
    • 3
    • 4
  • a

    Arpit Shukla

    11/11/2021, 5:55 PM
    Why were flow layouts removed from jetpack compose and added to accompanist?
    f
    • 2
    • 1
  • m

    Mohamed Ahmed ALi

    11/11/2021, 6:44 PM
    Hello, In which container I can arrange tags element to fill the row first then start new row and not showing in a column or a row as the IMG shows
    c
    • 2
    • 2
  • b

    bohregard

    11/11/2021, 8:21 PM
    I have a data class that contains a mutableState property but when I create the object (through retrofit with a gson serializer) the mutableState property always ends with a the error
    "Attempt to invoke interface method 'java.lang.Object androidx.compose.runtime.State.getValue()' on a null object reference
    .
    data class ActivationResponder(
        val id: Long,
        val firstName: String,
        val lastName: String,
        @SerializedName("callSign")
        val callsign: String,
        val phoneNumber: String,
    ) {
    
        var isChecked: Boolean by mutableStateOf(false)
        val name: String
        get() = "$firstName $lastName"
    
    }
    Any insight on to why that would be the case?
    z
    a
    • 3
    • 4
  • c

    Colton Idle

    11/11/2021, 11:07 PM
    Trying to create a pinpad like this in compose and strugling more than I thought. Left is my "desired" look and the right is my implementation. My two main issues: 1. The text doesn't seem centered in my button? 2. I don't know how to make "DEL" show instead of just the D that's showing now. code in 🧵
    r
    c
    +3
    • 6
    • 9
  • l

    Luis Daivid

    11/12/2021, 5:22 AM
    Is it possible to move cursor to end position in TextField with initial value? I set it to the end of the text using TextFieldValue’s selection, and the cursor stays fixed at the last position even if the user clicks in the middle of the text. What I want is for the cursor to be positioned at the last position only when it is first focused, and the user should be able to move the cursor.
    🙌 1
    z
    • 2
    • 9
  • s

    Stylianos Gakis

    11/12/2021, 9:36 AM
    Trying to work on a custom
    Layout()
    . Have some problems with constraints, more in thread 🧵
    • 1
    • 2
  • s

    Stefan Oltmann

    11/12/2021, 10:43 AM
    Is there a equivalent to SwiftUI
    .dynamicTypeSize(.large ... .xxxLarge)
    to limit the automatic scaling of the font size for regions where there largest font size may be too big?
    🤔 1
    a
    • 2
    • 1
Powered by Linen
Title
s

Stefan Oltmann

11/12/2021, 10:43 AM
Is there a equivalent to SwiftUI
.dynamicTypeSize(.large ... .xxxLarge)
to limit the automatic scaling of the font size for regions where there largest font size may be too big?
🤔 1
a

Albert Chang

11/12/2021, 12:36 PM
https://developer.android.com/jetpack/androidx/compose-roadmap Autosize text support is on the roadmap.
:thank-you: 1
View count: 15