Neal Sanche

    Neal Sanche

    1 year ago
    Attempting to use a bottom sheet to edit a record in a database. This has a few
    TextField
    in it, and a row of buttons to close, save the record, and delete the record. If I tap into any of the text fields, the keyboard pops up, and pretty much the only decent thing to do at this point is use
    windowSoftInputMode
    set to
    adjustResize
    on the base activity. Now, my problem is, the keyboard stays up after the bottom sheet is collapsed. I found
    AmbientTextInputService
    has a
    hideSoftwareKeyboard
    method, but I don't know where I'm supposed to get the required input session token from? Anyone know? So far, I'm finding text editing to be really complicated in Compose. What am I missing here? I'll drop the code I have into the thread.
    One functional level higher, we have this bottom sheet scaffold.
    Decided in the end to bubble an event up to the top of the composable tree and handle it using the usual kotlin extensions to close the keyboard from a given context and view.