-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MVI ViewModel #59
MVI ViewModel #59
Conversation
* mvi_reducer: Remove not needed null check Change changes to be a PublishSubject Use scan operator to reduce changes to a state Change wording to highlight that the query is updated add hideLoading and removeResults actions Expect SearchMiddleware to hide progress Move domain agnostic screen state and screen state changes from domain specific middleware to the reducer Rename domain specific changes to domain agnostic screen state changes # Conflicts: # ModelViewIntentSample/search/src/main/java/com/novoda/movies/mvi/search/domain/SearchDependencyProvider.kt # ModelViewIntentSample/search/src/main/java/com/novoda/movies/mvi/search/domain/SearchMiddleware.kt # ModelViewIntentSample/search/src/main/java/com/novoda/movies/mvi/search/presentation/SearchActivity.kt # ModelViewIntentSample/search/src/test/java/com/novoda/movies/mvi/search/domain/SearchMiddlewareTest.kt
@@ -40,17 +40,17 @@ class BaseStore<A, S, C>( | |||
return disposables | |||
} | |||
|
|||
override fun bind(view: MVIView<A, S>): Disposable { | |||
override fun bind(actionProvider: ActionProvider<A>, viewRender: ViewRender<S>): Disposable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe ViewRenderer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Displayer
?
private val reducer: Reducer<S, C>, | ||
private val middlewares: List<Middleware<A, S, C>>, | ||
private val initialValue: S | ||
private val schedulingStrategy: SchedulingStrategy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do I need to have a consistent indenting with the rest of the project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you import the novoda code styles from https:/novoda/novoda/tree/master/ide-settings/intellij ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some questions, otherwise 💯
private val reducer: Reducer<S, C>, | ||
private val middlewares: List<Middleware<A, S, C>>, | ||
private val initialValue: S | ||
private val schedulingStrategy: SchedulingStrategy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you import the novoda code styles from https:/novoda/novoda/tree/master/ide-settings/intellij ?
@@ -9,8 +9,7 @@ | |||
android:roundIcon="@mipmap/ic_launcher_round" | |||
android:supportsRtl="true" | |||
android:theme="@style/AppTheme"> | |||
<activity android:name=".presentation.SearchActivity" | |||
android:screenOrientation="portrait"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
ModelViewIntentSample/search/src/main/java/com/novoda/movies/mvi/search/data/SearchBackend.kt
Outdated
Show resolved
Hide resolved
...ntentSample/search/src/main/java/com/novoda/movies/mvi/search/presentation/SearchActivity.kt
Outdated
Show resolved
Hide resolved
import com.novoda.movies.mvi.search.domain.SearchReducer | ||
import io.reactivex.disposables.Disposable | ||
|
||
internal typealias SearchStore = BaseStore<SearchActivity.Action, SearchActivity.State, SearchReducer.Changes> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Now the UI state is preserved after the Activity is destroyed (for example after a rotation)
Some housekeeping:
ViewRender
andActionProvider
for better flexibility