Allows code to run on the UI thread within the TiPresenter. This is most likely not a method for users of Ti but for extensions using the LifecycleObserver-API (another PR will follow).
public API changes
The action of TiPresenter#sendToView(Runnable action) will be now be called on the UI thread. Furthermore will those actions be executed after onAttachView(TiView) and after all lifecycle observers have been called. This allows preparing the view in onAttachView(TiView) for those actions. That way the view should be in a "running" state as if the view was never gone.
For very rare and special cases TiPresenter#getQueuedViewActions() can be used to manually execute queued actions. People are creative.
Another change has been made to RxTiPresenterUtils#isViewReady() which was firing the ready event before onAttachView(TiView) was called. The ready event is now fired after onAttachView(TiView)
The execution order of lifecycle obersvers when receiving teardown events has been reversed; following "first in, last out"
internal changes
The method in DelegatedTiActivity#postToMessageQueue(Runnable runnable) has been replaced with DelegatedTiActivity#Executor getUiThreadExecutor();, same for the Fragment interface. All classes have been adjusted.
I think the API changes are not critical and could also be bug fixes preventing rare race conditions.
Allows code to run on the UI thread within the
TiPresenter
. This is most likely not a method for users ofTi
but for extensions using theLifecycleObserver
-API (another PR will follow).public API changes
The action of
TiPresenter#sendToView(Runnable action)
will be now be called on the UI thread. Furthermore will those actions be executed afteronAttachView(TiView)
and after all lifecycle observers have been called. This allows preparing the view inonAttachView(TiView)
for those actions. That way the view should be in a "running" state as if the view was never gone. For very rare and special casesTiPresenter#getQueuedViewActions()
can be used to manually execute queued actions. People are creative.Another change has been made to
RxTiPresenterUtils#isViewReady()
which was firing the ready event beforeonAttachView(TiView)
was called. The ready event is now fired afteronAttachView(TiView)
The execution order of lifecycle obersvers when receiving teardown events has been reversed; following "first in, last out"
internal changes
The method in
DelegatedTiActivity#postToMessageQueue(Runnable runnable)
has been replaced withDelegatedTiActivity#Executor getUiThreadExecutor();
, same for theFragment
interface. All classes have been adjusted.I think the API changes are not critical and could also be bug fixes preventing rare race conditions.