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

    Florian

    08/21/2021, 11:10 AM
    is there something like
    clipToPadding = false
    in Compose that avoids a LazyRow getting cut off by the container's padding?
    s
    c
    • 3
    • 5
  • f

    Florian

    08/21/2021, 11:39 AM
    I want to create a
    Spacer
    with the size of an
    Icon
    but there doesn't seem to be adDefault value for this (like we have for many other standard composables). So what should I use here?
    Icon(
         Icons.Default.Check,
         contentDescription = stringResource(R.string.task_completed),
         tint = MaterialTheme.colors.primary,
    )
    d
    s
    l
    • 4
    • 15
  • a

    Ashu

    08/21/2021, 11:43 AM
    The
    onSizeChanged
    modifier provides size values in
    IntSize
    , and the
    onSizeChanged
    lambda is not a composable function either. How can I get size in
    Dp
    inside
    onSizeChanged
    modifier lambda.??
    d
    • 2
    • 4
  • s

    Stylianos Gakis

    08/21/2021, 12:12 PM
    I want to know whether the last item of a lazy list is available and I am having trouble making that happen without making my composable recompose endlessly. And by endlessly I mean
    SideEffect {}
    triggers more than 10 times a second forever without anything changing on the screen. More details in thread 🧵
    d
    • 2
    • 26
  • k

    Kaustubh Patange

    08/21/2021, 2:01 PM
    Is there a way to animate
    Dialog
    ? Like dialog enter & exit animation with
    AnimatedVisibility
    or something else?
    i
    d
    +2
    • 5
    • 7
  • f

    Florian

    08/21/2021, 3:11 PM
    Are there plans to make the default transition animation in
    navigation-compose
    optional? With separate app bars per screen it looks pretty bad.
    s
    i
    • 3
    • 8
  • f

    Florian

    08/21/2021, 3:12 PM
    Also, it seems that now in
    alpha07
    tapping a selected bottom nav item again does nothing anymore. Isn't the expected behavior to reload that screen or am I wrong? If it isn't, how can I achieve this behavior?
    i
    c
    • 3
    • 20
  • m

    Mehdi Haghgoo

    08/21/2021, 3:56 PM
    I need something like a finish listener when using Transition.AnimatedVisibility(), but I don't find any in the API. For example, how can I fade out a heart that has been faded in with previous transition?
    d
    • 2
    • 6
  • r

    Rafiul Islam

    08/21/2021, 4:13 PM
    What am I doing wrong with observeAsState() method. See details in the thread.
    z
    • 2
    • 13
  • t

    theapache64

    08/21/2021, 5:14 PM
    ❓ Can anyone give me an example of
    rememberUpdateState
    ? 🤔 Maybe “with and without
    rememberUpdateState
    ”
    👍 5
    a
    a
    +4
    • 7
    • 37
  • j

    Jason Inbody

    08/21/2021, 6:59 PM
    I've almost got the facebook login working but I'm stuck in an android activity and can't get out. I've started and launched the activity, retrieved the token inside the activity callbacks but now I'm stuck with a token in the activity with no way to get it back out...
    • 1
    • 2
  • c

    Chuck Stein

    08/21/2021, 11:17 PM
    In a sliding content transition, is there any way to target an absolute X or Y value, rather than an offset? For example, in this animation I want the purple search button to slide up to the position where the text field appears in the top app bar. Right now I just guessed and hardcoded an offset that looks about right, but there is still a jump cut at the end of the animation (if you look at the top of the chip group) because it's slightly too low. I also doubt this magical hardcoded offset will get it to the same position at the top of the screen on all device screen sizes.
    21-08-21-19-10-46.mp4
    d
    • 2
    • 5
  • a

    Anton Dmytryshyn

    08/22/2021, 2:40 AM
    Is there a way to make the Modifier.swipeable less jarring when you are swiping side to side. The overall speed of the motion seems to be too fast. Code in🧵.
    • 1
    • 1
  • a

    Ashu

    08/22/2021, 8:00 AM
    So there are 2 ways to get the size of the container, one is the
    Modifier.onSizeChanged
    (or globally positioned) and the other one is to use
    BoxWithConstraints
    , but I am not sure when to use which. Can someone provide examples of use-cases of both of these. The examples should be such that only one of these is a perfect fit for that scenario. Thanks :)
    z
    c
    a
    • 4
    • 3
  • r

    Rafiul Islam

    08/22/2021, 9:37 AM
    Is there any problem if I use something like below in viewModel
    val name = mutableStateOf("")
    instead of using this and viewmodel.name.observeAsState("") in UI.
    private val _name = MutableLiveData("")
    val name: LiveData<String> = _username
    c
    o
    +3
    • 6
    • 13
  • r

    rajesh

    08/22/2021, 10:13 AM
    I've a details screen where i want to scroll item to specified index in LazyColumn. Below code (in thread) works, but it recomposes multiple times because i can't use LaunchedEffect() in
    index?.let {}
    block. What are the alternatives?
    o
    c
    • 3
    • 8
  • a

    Amin Bahiraei

    08/22/2021, 12:07 PM
    Hi, how can I Bridge my Classical Material Theme to compose one?
    s
    • 2
    • 1
  • a

    Anton Dmytryshyn

    08/22/2021, 6:28 PM
    I have encountered a strange occurrence with
    swipeableState
    and
    Modifier.swipeable
    . I would like to confirm If I am missing something before filing a bug. Code in 🧵
    • 1
    • 2
  • n

    Nthily

    08/22/2021, 6:59 PM
    hi there, Im using navigation compose, I have a main screen which is composed by
    Scaffold
    (bottom navigation bar), there are three Screens inside, but I have another Screen which is not composed inside
    Scaffold
    , how should I use
    NavHost
    to do it? I tried to use
    Nested Navigation
    in
    NavHost
    , but it doesn't display the Screen inside
    Scaffold
    properly.
    i
    n
    • 3
    • 8
  • r

    robnik

    08/22/2021, 7:58 PM
    Is there a way to prioritize one Text content over another in ConstraintLayout? Details in thread.
    • 1
    • 1
  • f

    Florian

    08/22/2021, 11:16 PM
    Are there any known problems with dark mode not being displayed correctly on some devices? My whole app is wrapped in a
    Surface
    but the text doesn't always have the correct color in dark mode for some people (it works on my testing devices)
    s
    o
    • 3
    • 14
  • r

    rnett

    08/23/2021, 6:42 AM
    I'd like to scale the local Density for a composable so that it fills it's constraints without overflowing, with bounds. I can do this manually using
    LocalDensity
    and
    onGloballyPositioned
    , but this seems like it would be very sub-optimal. Is there a way to do this built in, or using a custom layout? I could not find a way to alter the density in a custom layout
    a
    • 2
    • 3
  • d

    Dmitrii Smirnov

    08/23/2021, 7:34 AM
    Hello everyone! Is there any possible way to remove TextField inner paddings? The problem is with small height value: when I set height to 32.dp, there is no visible text in TextField. Is there any option except making my own TextField based on BasicTextField ? some pics displaying problem: I just comment Modifier.height(32.dp) and everything is fine... except height.
    d
    t
    • 3
    • 5
  • t

    Tgo1014

    08/23/2021, 8:20 AM
    How do I avoid multiple fast clicks on the same composable?
    s
    i
    j
    • 4
    • 17
  • r

    rsktash

    08/23/2021, 8:30 AM
    There is a bug with the
    FocusRequester.freeFocus()
    method. When we call freeFocus the textfield releasing focus but when we switch to another app and come back again the keyboard is appearing again As a workaround I’m calling
    FocusManager.clearFocus()
    instead of
    FocusRequester.freeFocus()
    r
    • 2
    • 1
  • i

    iamraghavawasthi

    08/23/2021, 9:05 AM
    Hey I want to make the Height Of an Item of LazyColumn to fill complete height.
    a
    b
    y
    • 4
    • 15
  • t

    theapache64

    08/23/2021, 9:48 AM
    🧭 Navigation: when calling
    arguments?.getString
    ,which
    userId
    should be used? red or yellow? and what abt
    navArgument
    ? 🤔
    f
    j
    • 3
    • 16
  • e

    Ernestas Balčiūnas

    08/23/2021, 12:30 PM
    Has anyone used compose with traditional espresso test? Integrated into our app bottom navigation with compose and I'm struggling to access buttons in espresso tests
    onView(withContentDescription(BottomItem.Notifications.contentDescription)).perform(click())
    does not find item and view hierarchy does not show any of bottom bar items as identifiable item
    a
    • 2
    • 2
  • d

    darkmoon_uk

    08/23/2021, 12:53 PM
    ⚠️ I found that enabling Compose + Kotlin/JS + the popular BuildKonfig plugin = Compiler Assertion Error! 😱
    java.lang.AssertionError: Unexpected field without property myapp.MyConfig.$stable
    ☝️ Can't find this assertion type mentioned anywhere on Slack, Google or YouTrack - is there a prize for catching a new one? 😅 Minimal reproduction project included in raised YouTrack Issue ✅ ❓ Anyone know what this
    $stable
    field is, for any clues how the issue might be worked-around?
    a
    • 2
    • 1
  • m

    Marcin Środa

    08/23/2021, 1:26 PM
    Hey, trying to place an item after ellipsized text. When text is not ellipsized it works fine, but when overflow happens, the icon is not displayed. Any ideas? 🧵
    a
    • 2
    • 3
Powered by Linen
Title
m

Marcin Środa

08/23/2021, 1:26 PM
Hey, trying to place an item after ellipsized text. When text is not ellipsized it works fine, but when overflow happens, the icon is not displayed. Any ideas? 🧵
Row {
        Text(
            text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
            maxLines = 1,
            overflow = TextOverflow.Ellipsis,
        )
        Icon(
            imageVector = Icons.Filled.ArrowRight,
            contentDescription = "Icon",
        )
    }
a

Adam Powell

08/23/2021, 1:40 PM
Row measures its children in order by default. If the text is ellipsizing it's because you're out of horizontal space and there's none left for the icon either. Try
Modifier.weight(1f, false)
on the
Text
. That will request the
Text
be measured after unweighted children.
m

Marcin Środa

08/23/2021, 4:38 PM
Thanks! 🙂
👍 1
View count: 5