• b

    Bradleycorn

    1 year ago
    Question about
    TextField
    value and State. Can someone explain why, given the following composable:
    var text by remember { mutableStateOf("") }
    TextField(
        value = text,
        onValueChange = { newText ->
            Log.d("TEXTFIELD", "NewText: $newText")
            val editedText = newText.replace(Regex("\\D"), "")
            if (editedText.startsWith("1"))
                text = editedText
        }
    )
    If I type the number 5 into the text field four times, the result I see in LogCat is:
    D/TEXTFIELD: NewText: 5
    D/TEXTFIELD: NewText: 5
    D/TEXTFIELD: NewText: 55
    D/TEXTFIELD: NewText: 5
    I’m stumped?
    b
    Stylianos Gakis
    +2
    28 replies
    Copy to Clipboard
  • itnoles

    itnoles

    1 year ago
    So Kotlin 1.5.31 isn't compatible?
    itnoles
    d
    +1
    5 replies
    Copy to Clipboard
  • dambakk

    dambakk

    1 year ago
    Hi! 👋 Testing + AnimatedNavController I want to test a composable that has its own navigation. I pass in an instance of
    TestNavHostController
    as
    NavHostController
    parameter (defaults to
    rememberAnimatedNavController
    ) but get an exception when the building the navgraph:
    androidx.navigation.testing.TestNavigatorProvider$navigator$1 cannot be cast to com.google.accompanist.navigation.animation.AnimatedComposeNavigator
      at com.google.accompanist.navigation.animation.NavGraphBuilderKt.composable(NavGraphBuilder.kt:124)
    Doesnt the accompanist nav animation lib support testing yet? (code in 🧵)
    dambakk
    2 replies
    Copy to Clipboard
  • Akram Bensalem

    Akram Bensalem

    1 year ago
    Hi, I integrate Google Map in one of Compose Screen but it's freeze for a bit of time, Is there any solution to prevent blocking the UI ? the freezing is because I use :
    val mapView = rememberMapViewWithLifecycle()
    Akram Bensalem
    Big Chungus
    6 replies
    Copy to Clipboard
  • r

    Roman Polach

    1 year ago
    Hi. Is there alternative for BulletSpan in Compose? In SpanStyle, it seems, there is not parameter for this
    r
    Filip Wiesner
    2 replies
    Copy to Clipboard
  • Orhan Tozan

    Orhan Tozan

    1 year ago
    Getting this build error: `e: This version (1.0.2) of the Compose Compiler requires Kotlin version 1.5.21 but you appear to be using Kotlin version 1.5.30 which is not known to be compatible. Please fix your configuration (or
    suppressKotlinVersionCompatibilityCheck
    but don't say I didn't warn you!).` while my kotlin version is currently at 1.5.21, with this in my root gradle file:
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
    Orhan Tozan
    1 replies
    Copy to Clipboard
  • Jakub Doležal

    Jakub Doležal

    1 year ago
    Hi, I have difficulties with
    ModalBottomSheetLayout
    . Clicking on
    Scrim
    area above the modal doesn't close it. According to a documentation a click should close it. Can you please confirm this is a bug?
    Jakub Doležal
    Colton Idle
    3 replies
    Copy to Clipboard
  • l

    Lilly

    1 year ago
    [SOLVED] I try to share a FAB between the content of multiple Tab items but I'm struggling. Can someone help?
    l
    2 replies
    Copy to Clipboard
  • Michał Diner

    Michał Diner

    1 year ago
    Why passing
    content: @Composable ColumnScope.() -> Unit
    in
    content: @Composable () -> Unit
    and invoking it in
    AnimatedVisibility(...) {
       content()
    }
    Cancels the ColumnScope?
    Michał Diner
    1 replies
    Copy to Clipboard
  • carbaj0

    carbaj0

    1 year ago
    there are a way to "clear" a rememberLazyListState(). I want clear the state only when i perform an action, the rest of the time i want to hold the state.
    carbaj0
    b
    +1
    8 replies
    Copy to Clipboard