I would like to create a unit test that verifies that the API successfully gets the List of Repos. I would like that the test actually makes the network connection instead of using a Mock Server. And also, would be good to use RoboElectric for…
I used joda-time-android library's classes in my Presenter class and it must not have any Android dependencies. So I can't test it properly. I know that I can use Robolectric for this, but I want to keep out of this tool and my Presenter clean.…
Trying new architecture paradigm where presenter creates immutable state(model) stream and view just renders it.
Can't understand how to handle situations where we need to make some event for the one time only. There are couple examples.
1) Notes…
In MVI with the Mosby library, what is the best way to access the state outside of the reducer function in the stream? For example, when you need to load the next page for your recycler, you need to know which page was loaded last. (In the sample…
How to apply Firebase Analytics(for example) on MVP app architecture? (I use Mosby to build MVP)
I want to track events of "opening screen", "do click action".
There is how I send "opening screen" event.
private const val ANALYTICS_SCREEN_NAME =…
I use Mosby to build apps with MVP-pattern. And this is one of the rules:
Don't use android library code in Presenter.
But what if I want to log something from Presenter? The only way that I see is to use System.out.println(); but it sounds not…
I'm using the new Mosby MVI library for a new demo app.
When defining intents in a presenter it is inconsistent when the intent is triggered/emitted when the view is attached.
For example: Let's define very simple intent in an activity
public…
For example, I have EditProjectFragment which contains few elements:
TextView (project name)
ColorPicker (project color)
Spinner (project type)
Let's see:
Project name will be restored by TextView itself
Who must store project's color?
Who must…
I'm trying to set up a Base Presenter using Mosby's MvpBasePresenter in Dagger 2 I have the following base component:
public interface BaseViewComponent {
void injectView(V object);
void…
I have a question regarding MVP pattern in Android. I want to write my own "application core" which will have base classes for presenters, views etc. It has to be simple, clean and "stable". My idea is very similiar to what Mosby has to offer, I'm…
I wanna test my Presenter
public class MainPresenter extends MvpBasePresenter {
private Repository repository;
private final CompositeDisposable disposables = new CompositeDisposable();
public void setRepository(Repository…
I am creating a small app using Mosby.
The app has a service which I want to bind to. I guess the correct place to do this is in the presenter. But I can't really figure out how to do it.
What I want to archive is when the service is bound I want to…
I just create a simple/blank fragment, which should use the MosbyFramework. Every time I'm using the getView()method I'm getting the error:
java.lang.ClassCastException:
de.xxx.projectZ.packA.AFragment cannot be cast to
…
Sample scheme:
It based on Mosby examples. I want to share Project object between ProjectFragment and ProjectHistoryFragment with @PerProject scope.
ProjectModule:
@Module
public class ProjectModule {
private Project project;
public…