GithubHelp home page GithubHelp logo

mvpcleanarchitecture's People

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  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  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

mvpcleanarchitecture's Issues

objectGraph = ObjectGraph.create(new RootModule(this));

Hello,
Very nice project
But when I try to execute I have a bug.
I do 1change : turning minSDKVersion from 21 to 14.
Caused by: java.lang.UnsupportedOperationException: No no-args constructor on com.github.glomadrian.mvpcleanarchitecture.app.dependencyinjection.ActivityModule$$ModuleAdapter
Any Ideas. Thank

Handling navigation (not really an issue)

Hi there,

Thanks a lot for your project, he give a clean MVP implementation for Android. However I miss an important part; the navigation.
Imagine that you allow users to add Character. You add a button to the list with a callback method to the presenter : onAddCharacterButtonClicked and then ?

  • A naive implementation can be to invoke a method on the view : setAddFormVisible(true) but then the view has to decide how you would present the form (display a view, open a dialog, move to another activity, ..). I dislike this solution.
  • The other solution is then to manage that from the presenter. He can decide to add a Fragment to the view, or open it as a dialog, or start another activity. But then you cannot test your presenter because he has direct dependencies to the Context or FragmentManager.
  • Some use an EventBus to send a message who is received by the Application or current Activity. But, again, I dislike the idea to use "system events" to handle navigation.
  • My current solution is to write a Navigator who decide what to do (dialog, activity, ..) and has everything to do it :
public interface Navigator {
  void moveTo(Class<?> target);
}

public class AndroidNavigator implements Navigator {
  private Activity activity = null;
  public void moveTo(Class<?> target) {
    if ( SomePresenter.class.equals(target) ) {
      new DialogFragmentWhoImplementSomePresenterView().show(activity.getFragementManager(), "..");
    } else if ( AnotherPresenter.class.equals(target) ) {
      activity.startActivity(new Intent(this, ActivityWhoImplementAnotherPresenterView.class));
    }
  }

  void setCurrentActivity(Activity activity) {
    this.activity = activity;
  }
}

public abstract class BaseActivity extends ActionBarActivity {
  @Inject Navigator navigator;
  public void onCreate(Bundle savedInstanceState) {
    // ...
    (AndroidNavigator) navigator).setCurrentActivity(this);
  }
}

So that I can test everything inside plain Junit tests. This is also the solution used in EffectiveAndroidUI

Do you have a better approach ? Did you plan to describe it in your project ?

Why isn't Retrofit working?

I saw that only the mocked objects appear. I logged something from the class with Retrofit code and it doesn't execute. What's the point of putting Retrofit if it doesn't actually execute????

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.