Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 618 Bytes

EnhanceAsView.md

File metadata and controls

41 lines (29 loc) · 618 Bytes

Enhance as View

To start using MVP features in a Bean class, annotate it with @EMvpView:

@EBean
@EMvpView
public class MyView {

}

Inject Presenter Callback

With @MvpCallback you can automatically let inject the back reference to the presenter instance.

@EBean
@EMvpView
public class MyView {

    interface Callback {
        void onSomeEvent()
    }

    @MvpCallback
    Callback callback;
}

@EActivity
@EMvpPresenter
public class AnyPresenter implements MyView.Callback {

    @Override
    void onSomeEvent() {
        // do something here
    }

}