glomadrian / mvpcleanarchitecture Goto Github PK
View Code? Open in Web Editor NEWA sample project using Clean architecture and MVP in Android
A sample project using Clean architecture and MVP in Android
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
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 ?
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.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
.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.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 ?
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????
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.