GithubHelp home page GithubHelp logo

retainpresenter's People

Contributors

localh0rzd avatar nikitakozlov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

retainpresenter's Issues

Potential NPE in PresenterFragment

FragmentManager is an optional dependency (here), but afterwards you do rely that it will be there.

This may occurs when someone use this Fragment in an Activity which does not inherit from PresenterActivity

Issue with PresenterFragment

PresenterFragment is constantly adding new items to PresenterManager on every start when attachViewToPresenter() is called
You can probably change attachViewToPresenter(); to look like this:

  private void attachViewToPresenter() {
    P presenter = getPresenter();

    if (presenter == null) {
        presenter = onCreatePresenter();
        if (mPresenterManager != null) {
            mPresenterUUID = mPresenterManager.addPresenter(presenter);
        }
    }

    final V view = getPresenterView();

    if (presenter != null && view != null) {
        presenter.onAttachView(view);
    } else if (presenter == null && view != null) {
        throw new IllegalStateException("You provided a view, but didn't create presenter");
    } else if (presenter != null) {
        throw new IllegalStateException("You created a presenter, but didn't provide a " +
                "view for it");
    }
}

PresenterView

Have you considered to apply this methodology on Custom Views?

PresenterManager looses instance

Hi! I am trying out your approach for retaining presenters instances, and I came across with an odd issue.
Im any fragment, when I rotate the screen and call getPresenter() I am getting a null pointer exception because the presenterManager is null at the time.

I tried to debug this issue but until this moment I have no clue what this issue could be. The strange thing is that I don't know when the presenterManager looses its instance because I can state that in onResume() the presenterManager has its instance.

Are you aware of this problem?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.