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

    Naing Aung Luu

    11/11/2022, 9:03 AM
    Hello guys :android-wave: have you ever been in a situation where the compose preview in android studio won’t show up when you have
    kotlin reflect
    related codes in your composables? I’m trying to use a form validation library for compose which uses kotlin reflect under the hood and it makes the preview builds to be fail ☹️ I get the following stack trace from preview issues panel
    java.lang.ClassCastException: class _layoutlib_._internal_.kotlin.jvm.internal.ClassReference cannot be cast to class _layoutlib_._internal_.kotlin.reflect.jvm.internal.KClassImpl (_layoutlib_._internal_.kotlin.jvm.internal.ClassReference and _layoutlib_._internal_.kotlin.reflect.jvm.internal.KClassImpl are in unnamed module of loader org.jetbrains.android.uipreview.ModuleClassLoader @447dcf4d)
    	at _layoutlib_._internal_.kotlin.reflect.full.KClasses.getPrimaryConstructor(KClasses.kt:36)
    	at me.naingaungluu.formconductor.FormImpl.constructorRequirementSatisfied(FormImpl.kt:135)
    	at me.naingaungluu.formconductor.FormImpl.<init>(FormImpl.kt:46)
    	at me.naingaungluu.formconductor.composeui.FormComposablesKt.form(FormComposables.kt:36)
    	at com.memoto.mobileapp.feature.booking.checkin.guests.ComposableSingletons$CheckInGuestFormScreenKt$lambda-2$1.invoke(CheckInGuestFormScreen.kt:44)
    	at com.memoto.mobileapp.feature.booking.checkin.guests.ComposableSingletons$CheckInGuestFormScreenKt$lambda-2$1.invoke(CheckInGuestFormScreen.kt:43)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    	at androidx.compose.foundation.lazy.LazyListScopeImpl$item$3.invoke(LazyListScopeImpl.kt:54)
    	at androidx.compose.foundation.lazy.LazyListScopeImpl$item$3.invoke(LazyListScopeImpl.kt:54)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:135)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    	at androidx.compose.foundation.lazy.LazyListItemsSnapshot.Item(LazyListItemProviderImpl.kt:99)
    	at androidx.compose.foundation.lazy.LazyListItemProviderImpl.Item(LazyListItemProviderImpl.kt:126)
    	at ......
    j
    c
    • 3
    • 6
  • k

    K Merle

    11/11/2022, 11:55 AM
    Is it possible to hide status-bar behind ModalNavigationDrawer?
  • c

    Colton Idle

    11/11/2022, 2:36 PM
    I have a column with it's height set to maxSize. And I have 4 text composables in that column. I want to be able to say that the 2nd Text "if there is no room for all 4 texts on the screen, please hide this one text" How would I do that in compose? Essentially I feel like I want to create a
    Modifier.onlyShowIfTheresEnoughSpace
    s
    f
    +2
    • 5
    • 7
  • m

    mattinger

    11/11/2022, 3:35 PM
    Is there any particular reason why the default ime action on a text input is
    Done
    , but the actual callback does nothing? I would have expected the default behavior to at least close the keyboard. I’m writing a wrapper to configure a visual transformation for phone numbers, but i can’t even fill in the onDone action because closing the keyboard requires getting the software keyboard controller, which is in a composition local, and can’t be accessed in the parameter list:
    keyboardActions: KeyboardActions = KeyboardActions(onDone = { …. } )
  • t

    Tolriq

    11/11/2022, 7:09 PM
    Just got some reports that animations no more runs on some devices for some users (Even simple CircularProgressIndicator without any change or infiniteTransition.animateColor) after Compose 1.4 A1 or A2 (needs to get more info). Since during those non working animation everything still works the main thread is not locked. Is there anyway to debug / identify what clock is supposed to run those so I can try to repro?
    i
    d
    c
    • 4
    • 17
  • a

    Arjan van Wieringen

    11/12/2022, 7:30 AM
    Are there any (Github) repo's where I can draw inspiration for how larger Compose applications are structured?
    y
    • 2
    • 1
  • t

    the great warrior

    11/12/2022, 8:34 AM
    Hi guys, I have a mutableStateListOf named descriptionListState and I want LaunchedEffect to be triggered when the mutableStateListOf changes. I tried converting mutableStateListOf to list, but it didn't work. Is there any solution?
    val descriptionListState = remember{ mutableStateListOf("") }
    
    LaunchedEffect(descriptionListState.toList()) {
        alarmViewModel.changeCreateAlarmState(
            createAlarmState.copy(description = descriptionListState.joinToString(" "))
        )
    }
    r
    z
    m
    • 4
    • 6
  • p

    PHondogo

    11/12/2022, 9:37 AM
    Hello! Is it possible to listen to State from non composable function?
    z
    • 2
    • 1
  • j

    Jiri Bruchanov

    11/12/2022, 10:12 AM
    Hi folks, anyone who could help me with ConstraintLayout ?
    a
    r
    • 3
    • 8
  • a

    Abdelilah El Aissaoui

    11/12/2022, 12:40 PM
    I've got a lazy column of text lines wrapped with a SelectionContainer. It works quite nicely as long as I don't scroll, if I scroll, the selection simply stops working when the first selected item is no longer visible. Sample to reproduce it:
    SelectionContainer {
            LazyColumn {
                items(100) {
                    Text("Line number $it")
                }
            }
        }
    The "copy" button also jumps around in the same situation. Seems like a compose bug but not completly sure. A normal column works without any issues (expected since everything is composed unlike the LazyColumn).
    ListWithSelectionContainer.webm
    c
    • 2
    • 10
  • s

    Slackbot

    11/12/2022, 1:13 PM
    This message was deleted.
  • t

    Tower Guidev2

    11/12/2022, 1:56 PM
    Can anyone assit me with thi sbackdrop issue 😄 https://stackoverflow.com/questions/74372019/how-to-employ-backdropscaffoldstate-offset-correctly-to-offset-front-contentlaye
    a
    p
    • 3
    • 15
  • c

    Colton Idle

    11/12/2022, 3:07 PM
    ExposedDropdownMenu
    has a field called
    onDismissRequest
    but it gets called even when I'm typing on the keyboard which makes implementing an AutocompleteTextView-esque composable impossible. Am I missing something here?
  • d

    Darryl Pierce

    11/12/2022, 7:25 PM
    Hi, all. Is this a good place to ask questions about building cross-platform UIs with KMM? I’m hoping so.
    o
    c
    +2
    • 5
    • 14
  • d

    Darryl Pierce

    11/12/2022, 7:26 PM
    I’m looking for a tutorial to get me started (I’m fairly new to Kotlin and KMM but am a seasoned programmer).
  • g

    Gonzalo Renedo

    11/13/2022, 12:21 AM
    Hi guys, i have a performance problems with my app. I have two mobile devices, an android 10 and an android 11, in my android 11 it goes very well but in my android 10 it goes very badly, I have been following all the rules of compose for better maintenance, but even so in one of the devices it goes very bad. What could I do?
    a
    c
    a
    • 4
    • 27
  • r

    Ryan Smith

    11/13/2022, 3:23 PM
    Hi everyone, I'm working on a simple Compose Desktop app with a ribbon, content view, and bottom tray for showing progress of long running tasks. Right now a Scaffold is the main component I'm using for this and that's working well as advertised. What I'm stuck on is how to allow any part of the app to show and update the progress indicator. Is this a case for an App-level state holder that gets passed around? Maybe I just stick with callbacks? I appreciate any insight or examples you can share!
    a
    • 2
    • 2
  • s

    Sam Stone

    11/13/2022, 10:48 PM
    Does compose look native (look and feel) on iOS, or like material design?
    j
    k
    +2
    • 5
    • 7
  • g

    Gonzalo Renedo

    11/14/2022, 1:33 AM
    Does anyone know of a tutorial or something to ask for foreground and background location permissions in compose for all SDK versions?
    a
    k
    • 3
    • 2
  • z

    Zoltan Demant

    11/14/2022, 9:43 AM
    ⚠️ After upgrading to
    1.4.0-alpha02
    , you may run into issues if youre using
    value ?: return
    in your composables. Ive reported it already, just sharing this since I didnt manage to detect the issue myself until it was too late!
  • a

    abbic

    11/14/2022, 10:28 AM
    hi all, just a quick question about using list.forEach inside a row or column to emit composables. i remember a while back it was recommended to not do this, and in fact it wasnt possible because calling a composable inside forEach would raise a compilation error as you were calling a Composable function inside a non-composable one. But now i've seen it be done in snippets online, and also there is no longer a compilation error (maybe there never was?) so my question is, is it ok to use? i dont always want to rely on lazy rows or columns if i dont have to, just unclear about the "best practice"
    c
    a
    f
    • 4
    • 3
  • p

    Pedro Alberto

    11/14/2022, 11:51 AM
    Hi guys is there going to be a way to style the Titles on MediumAppBar ? I want to style them differently
    s
    s
    • 3
    • 42
  • j

    Jrichards1408

    11/14/2022, 12:23 PM
    Hi, is there a way to add a onclick listener applied to a whole constraintlayout? in compose? i could not find an onclick parameter on it
    s
    • 2
    • 2
  • b

    bodo

    11/14/2022, 12:58 PM
    I am struggling with the implementation of
    dimensionResource(...)
    . At the moment i am setting a custom LocalDensity if the device has a certain width. The reason I am setting a custom density is to achieve the autoscaling of composables, e.g. when an image has a size in COMPACT mode from 50.dp (e.g. =150px) it should be bigger in MEDIUM mode (e.g. =150px * 1.2 = 180px)
    val density = LocalDensity.current.density
    val fontScale = LocalDensity.current.fontScale
    val scaleFactor = if (windowSizeClass == MEDIUM) 1.2F else 1.0F
    
    CompositionLocalProvider(
      LocalDensity provides Density(density = scaleFactor * density, fontScale = fontScale)
    ) {
       val dpDirectly = 130.dp
       val dpViaResources = dimensionResource(id = R.dimen.dimen_130)
       
       // windowSizeClass == COMPACT
       // dpDirectly = 130.dp
       // dpViaResources = 130.dp
    
       // windowSizeClass == MEDIUM
       // dpDirectly = 130.dp
       // dpViaResources = 108.33333.dp -> WRONG VALUE!!!!
    }
    The problem is the dimensionResource function, because here the displayMetrics are used and they have a different density than the LocalDensity:
    fun dimensionResource(@DimenRes id: Int): Dp {
        val context = LocalContext.current
        val density = LocalDensity.current
        val pxValue = context.resources.getDimension(id) // this returns the wrong value because here the DisplayMetrics are used
        return Dp(pxValue / density.density) -> this tries to get the correct value by dividing through the LocalDensity
    }
    The main problem is the LocalDensity and DisplayMetrics have different density values. Two questions: 1. Can it be done like this 2. If not what is the best way to achieve autoscaling of dp and sp values?
  • d

    dimsuz

    11/14/2022, 1:04 PM
    What is the best way to detect if user-initiated (not programmatical!) scroll was performed on
    LazyColumn
    ? I need only to detect this fact and not interfere with the gesture itself in any way. Should I use lower level gesture detection modifiers?
    a
    • 2
    • 4
  • t

    Tower Guidev2

    11/14/2022, 2:45 PM
    Hi i am trying to implement a compose
    debounce
    for clickables and have this
    Modifier
    extension...
    z
    • 2
    • 2
  • a

    abbic

    11/14/2022, 2:55 PM
    hi all, have the feeling im doing something a bit backwards wrt handling events.
    LaunchedEffect(key1 = event) {
            when (event) {
                ManualPaymentEvent.LoadingError -> {
                    scaffoldState.snackbarHostState.showSnackbar(
                        message = snackbarMessage,
                        actionLabel = snackbarAction,
                        duration = SnackbarDuration.Indefinite
                    )
                    viewModel.onSnackBarDismissClicked()
                }
                ManualPaymentEvent.NavigateBack ->
                    navigateUp()
                is ManualPaymentEvent.NavigateWithCards ->
                    navigateToSelectCard(event.amount, event.cards)
    
                is ManualPaymentEvent.NavigateWithoutCards ->
                    navigateToAddCard(event.amount)
    
                null -> Unit
            }
            viewModel.eventConsumed()
        }
    viewModel.eventConsumed()
    sets the event to null again, to show it has been consumed.
    onSnackbarDismissClicked
    updates the uiState with
    uiState = uiState.copy(event = ManualPaymentEvent.NavigateBack)
    . the intent here is that the NavigateBack event triggers the
    navigateUp()
    function but this never happens. The issue appears to be that the event is first set to NavigateBack. then before this LaunchedEvent can trigger, the event is first set to null, and this NavigateBack event is ignored. What should i be doing? would this be resolved if i was holding my state in a Flow of some kind?
    • 1
    • 1
  • n

    nuhkoca

    11/14/2022, 3:20 PM
    Hello, How could I achieve animated content using Compose? (without custom layout)

    https://miro.medium.com/max/1200/1*CE9Szh6jkPZA3jcnC4xBsQ.gif▾

    g
    f
    +6
    • 9
    • 11
  • r

    rishabhsinghbisht

    11/14/2022, 5:04 PM
    We added a
    AndroidView
    inside
    LazyList
    . And the list started janking when scrolled fast. Profiled and noticed that android view is inflating the view every-time a new item comes becomes visible. Is there a way to make them recycle views? have added key and content type to list items but that doesn’t help.
    f
    c
    +2
    • 5
    • 12
  • c

    chiq

    11/14/2022, 8:26 PM
    Hello 👋 Does anybody know how to make a text button in compose, pressed state not have background? I tried setting indication=null, but it'll just remove the ripple effect, but there's still a background/highlight when pressed.
    TextButton(onClick = { /*TODO*/ }, 
                    elevation = null, 
                    modifier = Modifier.indication(
                    interactionSource = MutableInteractionSource(),
                    indication = null
                ),
                ) {
                    Text(text = "Default")
                }
    c
    c
    • 3
    • 15
Powered by Linen
Title
c

chiq

11/14/2022, 8:26 PM
Hello 👋 Does anybody know how to make a text button in compose, pressed state not have background? I tried setting indication=null, but it'll just remove the ripple effect, but there's still a background/highlight when pressed.
TextButton(onClick = { /*TODO*/ }, 
                elevation = null, 
                modifier = Modifier.indication(
                interactionSource = MutableInteractionSource(),
                indication = null
            ),
            ) {
                Text(text = "Default")
            }
c

Casey Brooks

11/14/2022, 8:39 PM
Are you basically just looking for clickable text, without any extra styling? A Button is basically just a
Surface
with styling around
Text()
, so you might just want to set your text style/color and use
Modifier.clickable
on a
Text()
instead of
TextButton()
. You can see the source of Button and TextButton, which may help you in getting the right fonts/sizing to create your own custom text button with only the things you want
And this general pattern is true of pretty much everything in the Compose APIs. The material UI widgets are opinionated and built to the fairly rigid specifications of Material Design. But they’re all just pretty small wrappers over more generic Composable functions, and you’re free to drop down to that lower level to create the specific widgets you need. This idea is outlined in the documentation page forArchitectural Layering
c

Chris Fillmore

11/14/2022, 8:51 PM
Are you passing
buttonColors
? I’m not actually sure this solves the problem of background color in pressed state, but take a look. https://developer.android.com/reference/kotlin/androidx/compose/material/ButtonColors
c

chiq

11/14/2022, 8:57 PM
I'm using the default which should be transparent, I looked at the source code of Surface which is used by Buttons, they're the ones that's propagating the highlight color even when you set indicator= null. I might go with the custom Text Button implementation that doesn't use Surface 😬
c

Chris Fillmore

11/14/2022, 8:58 PM
I don’t think a custom solution is necessary, you can modify the background color as part of the theme
Rather than being a parameter you pass, it’s a composition local… I think
c

chiq

11/14/2022, 8:59 PM
It's not the background color that im worried about, its the highlight when you pressed a Text Button
c

Chris Fillmore

11/14/2022, 9:00 PM
Sorry what do you mean “highlight”?
Is it an outline?
Your question said
pressed state not have background
Maybe I misunderstood
You can remove the background of the pressed state by setting the color to
Color.Transparent
. And I think you can do this via a local theme
c

chiq

11/14/2022, 9:03 PM
Yeah sorry for the confusion, I found the culprit though, its the Surface composable that adding ripple effect on top. So to achieve what I want for my Text Button, I need to not use
TextButton
and make a custom one 🙂 But thanks y'all
c

Chris Fillmore

11/14/2022, 9:05 PM
You can remove the ripple without implementing a custom button. This would also save you from having to implement button semantics (for e.g. screen readers), and minimum touch target, etc.
I say this because I recently had your exact problem where I wanted to customize the ripple on a TextButton
You can modify the ripple locally doing this
@Composable
fun ProvideSecondaryRippleTheme(content: @Composable () -> Unit) {
  CompositionLocalProvider(
    LocalRippleTheme provides SecondaryRippleTheme,
    content = content,
  )
}

@Immutable
private object SecondaryRippleTheme : RippleTheme {
  @Composable
  override fun defaultColor(): Color {
    return RippleTheme.defaultRippleColor(
      // Use whatever colors you want here
      contentColor = MaterialTheme.colors.onSurface,
      lightTheme = MaterialTheme.colors.isLight,
    )
  }

  @Composable
  override fun rippleAlpha(): RippleAlpha {
    return RippleTheme.defaultRippleAlpha(
      // Use whatever colors you want here
      contentColor = MaterialTheme.colors.onSurface,
      lightTheme = MaterialTheme.colors.isLight,
    )
  }
}
And use it like this:
@Composable
fun SecondaryTextButton(
  onClick: () -> Unit,
  content: @Composable RowScope.() -> Unit,
) {
  ProvideSecondaryRippleTheme {
    TextButton(
      ...
    )
  }
}
View count: 19