nucleus.view.ViewWithPresenter Maven / Gradle / Ivy
Show all versions of nucleus Show documentation
package nucleus.view;
import nucleus.factory.PresenterFactory;
import nucleus.factory.ReflectionPresenterFactory;
import nucleus.presenter.Presenter;
public interface ViewWithPresenter {
/**
* Returns a current presenter factory.
*/
PresenterFactory
getPresenterFactory();
/**
* Sets a presenter factory.
* Call this method before onCreate/onFinishInflate to override default {@link ReflectionPresenterFactory} presenter factory.
* Use this method for presenter dependency injection.
*/
void setPresenterFactory(PresenterFactory
presenterFactory);
/**
* Returns a current attached presenter.
* This method is guaranteed to return a non-null value between
* onResume/onPause and onAttachedToWindow/onDetachedFromWindow calls
* if the presenter factory returns a non-null value.
*
* @return a currently attached presenter or null.
*/
P getPresenter();
}