u

    ursus

    3 years ago
    hi reduxy folks, I want ask OT but related to the paradigm shift, since Compose is way in the future. If I were to have a Edit text, in proper reduxy way, one should emit a new state state every new char is typed. Which I then in thoery need to set back on the Edit text. If I do that, it visibly lags. Is there a way to make this performant now? (without ©ompose)
    gildor

    gildor

    3 years ago
    now? So you use Android Views for this?
    And how exactly you apply those changes? Inflate it each time is obviously too slow
    u

    ursus

    3 years ago
    yes android edittext; no inflation, just mutation lf the same instance via edittext.textWatcher -- on every char + apply state.text back to edittext
    gildor

    gildor

    3 years ago
    it should work relatively fast, but may cause problems with selections and cursor position, anyway I don’t think this related to this channel topic or to Kotlin in general
    u

    ursus

    3 years ago
    well not sure whether its the edittect.setSelection(state.text.size) or the setText itself, but its unusable, not nicpicking, if you were to try it you'd see
    david.bilik

    david.bilik

    3 years ago
    Each time I’ve implemented something like this I’ve added some checks to not set the text if it was the same as already presented in EditText .. in that time no cursor of other lags was not there .. but its not ideal, sure
    u

    ursus

    3 years ago
    @david.bilik did you compare against previousState.text or if(newState.text != ediText.text.toString())?
    david.bilik

    david.bilik

    3 years ago
    against edittext itself