I'm drawing clocks for a list of events that have different times that need
to be displayed.
I am caching them so they aren't generated every time but they do need to
be generated at some point. Currently there are about 20 and it takes under
a second so it just 'sticks' the UI briefly.
I was concerned about scalability if there were 100+ but if there is
nothing that can be done to manage this I'll just put a static loading
message and block the UI while images are created on the EDT.
There is thread safe drawing on iOS since iOS 4.0 but I don't know enough
about the details under the hood of the VM to know if its possible with how
Codename One is handling the drawing.
What are circumstances where invokeAndBlock called from the EDT would be
useful? I've always used it to show a loading indicator while setting up a
form in postShow or beforeShow and it seems to work but if its not running
on the EDT it probably is causing issues.
Dialog d = new InfiniteProgress().showInifiniteBlocking();
Display.getInstance().invokeAndBlock(() -> {
//layout the form here, set models for list from local data sources (e.g.,
SQLite), add components to the heirarchy or whatever else can be done
(without network).
});
d.dispose();
On Wednesday, August 10, 2016 at 5:51:42 PM UTC+12, Shai Almog wrote:
>
> What do you need to draw that will take so long it will require progress
> indication?
> Drawing to any surface needs the EDT, the rendering pipeline is pretty
> deep in some OS's and very complex. Making it threadsafe would make it
> unusable...
>
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/3003cb92-aeea-40ba-8a4a-92e9abfda0ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.