Open mplekunov opened 2 years ago
Literally have no idea what to do....
Used viewModelScope and launch Coroutine Factory to create new coroutine which will call EvaluateExpression and assign new values to result and expression... Problems: it works as intended... however newly "added" changes to result and expression aren't being shown until I call to show them on "new input" or any other "action" which forces them to be shown... I tried converting everything to LiveData... Same thing. I need to figure out how to update "UI" output and input based on the "new info" received from Coroutine...
Currently I literally have 0 clue... No reason to use Async and Await because... from my Understanding they are only used to "access" data inside of the coroutine
Well... The only way that I "could" possibly implement concurrency would be by creating Deferred
Why?... well...Editable Input class is responsible for "conversion of input to spannable input"... As such, it is the first place where "viewModel.expression" will be called... So, I have to use await() there before this class will try to "format" expression to spannable.
I have around 13 days before I will need to do other things... So... This whole thing looks like pain in the ass and therefore I guess I will have to do other stuff before coming back to this issue.
I AM IN DIRE NEED FOR MULTITHREADING.... There is nothing much to say about it... After settings menu all time should be allocated to multithreading/bug fixing
Calculator works but only after removing concurrency.... Need to implement thread management which would allow me, once again, to have an app where UI will be on the main thread and all calculation somewhere else... (could use Dispatchers.DEFAULT) coroutine context for "CPU" intensive calculations.