Exploring Mosby and Mosby plugin for Conductor for building Android apps with MVP
My Medium article to accompany this repo is here: Get your MVP right with Mosby
This repo explores Mosby and Mosby Conductor plugin implementing MVP pattern.
Both Mosby and Conductor have excellent documentation on GitHub and at Hannes Dorfmann's blog.
Model-View-Presenter (MVP) is hard to implement correctly (bug-free). Handling view state is another big challenge. There are many different implementations of MVP out there.
If there is a library that manages MVP wiring and view state for you so you can concentrate on your app logic and UI, why not check it out?
ViewState
is used to preserve current view data such as loading in progress, data displayed, error displayed, etc. after configuration changes such as device rotation.
More details at ViewState
ProgressBar
) is followed by displaying content or error.MvpActivity
, implement MvpDelegateCallback
or instead of extending MvpViewStateController
implement MvpViewStateConductorDelegateCallback
and so forth.MvpNullObjectBasePresenter
is a special kind of Presenter which implements the Null Object Pattern. It makes it unnecessary for you to check if the View is attached prior to calling methods on it. Any calls on the View that is not attached will do nothing (no op); no NullPointerExceptions will be thrown.MvpQueuingBasePresenter
is a special kind of Presenter which lets you queue the calls on the View and replay them in same order once the View becomes available.All examples implement MVP pattern
ViewState
preserved across configuration changes. [link]
ViewState
preserved across configuration changes. [link]
ViewState
preserved across configuration changes. [link]
ViewState
preserved across configuration changes. [link]
Copyright 2017 James Shvarts
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.