Questions tagged [mosby]

Mosby is a Model-View-Presenter (MVP) library for android apps.

More information about Mosby can be found on here

68 questions
10
votes
2 answers

How to test a REST API that uses Retrofit and Dagger2

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…
Kenenisa Bekele
  • 835
  • 13
  • 34
8
votes
2 answers

Unit-tests and joda-time-android

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.…
Alexandr
  • 3,859
  • 5
  • 32
  • 56
6
votes
1 answer

Single time events in MVI architecture

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…
pavelkorolevxyz
  • 1,380
  • 2
  • 14
  • 35
4
votes
1 answer

Accessing state outside of reducer function in MVI

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…
Grisu47
  • 530
  • 5
  • 16
4
votes
2 answers

OnErrorNotImplementedException using RxJava2 and Retrofit2 Mosby MVI

I'm getting a OnErrorNotImplementedException thrown and the app crashes, despite handling the error downstream(?). Exception E/AndroidRuntime: FATAL EXCEPTION: RxCachedThreadScheduler-1 Process: pl.netlandgroup.smartsab, PID:…
Snayk
  • 43
  • 1
  • 4
4
votes
2 answers

Android MVP and Analytics

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 =…
Alexandr
  • 3,859
  • 5
  • 32
  • 56
4
votes
1 answer

MVP: how to write to log from Presenter

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…
Alexandr
  • 3,859
  • 5
  • 32
  • 56
3
votes
2 answers

Mosby MVI: Inconsistent intent binding behavior

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…
TobiasRe
  • 111
  • 6
3
votes
1 answer

Presenter/View/ViewState relationshipts

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…
Alexandr
  • 3,859
  • 5
  • 32
  • 56
3
votes
1 answer

Using Generics in Base Presenter with Mosby and Dagger 2

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…
1tSurge
  • 663
  • 2
  • 7
  • 20
3
votes
2 answers

Android MVP - screen orientation - retain presenters state

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…
rafakob
  • 3,946
  • 3
  • 26
  • 36
2
votes
1 answer

RxJava and unit testing with mockito

I wanna test my Presenter public class MainPresenter extends MvpBasePresenter { private Repository repository; private final CompositeDisposable disposables = new CompositeDisposable(); public void setRepository(Repository…
jakub
  • 3,576
  • 3
  • 29
  • 55
2
votes
1 answer

Android Mosby MVI bind to service in presenter

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…
2
votes
1 answer

Mosby Framework - getView cause ClassCastException

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 …
Tobias
  • 4,921
  • 4
  • 31
  • 40
2
votes
1 answer

Dagger 2: Update provided object in scope

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…
Alexandr
  • 3,859
  • 5
  • 32
  • 56
1
2 3 4 5