ubu

    ubu

    2 years ago
    Hi guys, what would be the best presentation pattern for implementing a rich text editor on Android? What do you think?
    Anastasia Finogenova

    Anastasia Finogenova

    2 years ago
    Why does a text editor differ from other apps? I think it should be mvvvm no matter what is the app you are creating unless there is some unique things to the use case (like a particular library or you can't add lifecycle dependencies )
    stantronic

    stantronic

    2 years ago
    I would imagine this is the kind of thing that Compose would really shine at. In the mean time, I’d second mvvm with databinding. Sounds like a complex task though.
    u

    ursus

    2 years ago
    Well, yes MVVM/MVI ish would be best, however I'd look into diffing of the Spannables, since it can be nontrivial perf wise I think, since youd be ditching the whole String/SpananbleString every emit (every char types)
    And then youre basically reimplementing compose lolz
    tldr; If perf were and issue, I'd ditch immutability and keep some mutable tree structure, and handle it on main thread only to prevent threading issues, look into Dank reddit app https://github.com/saket/Dank
    btw you should be handling state on main thread only anyways, if you wont wanna mess with synchronization
    ubu

    ubu

    2 years ago
    thanks, guys