Wednesday, February 7, 2018

MVP4G2 Beta 2

I just have updated mvp4g2.  

One of the major change is, that the historyOnStart-attribute has been remove from the @Event-annotation and been added to the @Application annotation.

Besides that a new feature is implemented that changes the way events and event handlers are defined. Now, it is no longer necessary to use the handler- or broadCast-attirbue inside the Event annotation to bind a presenter to an event. All you have to do now, is to define an event inside the event bus and annotate a method with @Event.

An event definition will look like this: 

@Event
void gotoDetail(long id);

Add this code to a mvp4g2 based  presenter or handler:

@EventHandler
public void onGotoDetail(long id) {
...
}

That’s all. Mvp4g2 will wire up the event with the handler method.

Of course the handler-attrnute as most of the other attributes from the mvp4g Event-annotation are still supported. 

You will find a list of features currently  implemented in mvp4g2 here: https://github.com/mvp4g/mvp4g2/wiki/Comparision:-Mvp4g-vs.-Mvp4g2

All examples have been updated.   

Next thing will be the implementation of the multi module feature.

No comments:

Post a Comment