{"id":20938480,"url":"https://github.com/jshvarts/mosbymvp","last_synced_at":"2025-05-13T22:31:42.856Z","repository":{"id":130096787,"uuid":"111547727","full_name":"jshvarts/MosbyMVP","owner":"jshvarts","description":"Exploring Mosby and Mosby plugin for Conductor for building Android apps with MVP","archived":false,"fork":false,"pushed_at":"2018-10-24T22:42:14.000Z","size":221,"stargazers_count":27,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T09:03:53.193Z","etag":null,"topics":["conductor","gson","kotlin","mosby","mosby3","moshi","multi-project","mvp","mvp-android","rxjava2","viewstate"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jshvarts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-21T12:43:55.000Z","updated_at":"2024-05-22T15:20:32.000Z","dependencies_parsed_at":"2023-06-30T07:00:34.717Z","dependency_job_id":null,"html_url":"https://github.com/jshvarts/MosbyMVP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshvarts%2FMosbyMVP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshvarts%2FMosbyMVP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshvarts%2FMosbyMVP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshvarts%2FMosbyMVP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jshvarts","download_url":"https://codeload.github.com/jshvarts/MosbyMVP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036813,"owners_count":22003655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conductor","gson","kotlin","mosby","mosby3","moshi","multi-project","mvp","mvp-android","rxjava2","viewstate"],"created_at":"2024-11-18T22:51:09.260Z","updated_at":"2025-05-13T22:31:42.846Z","avatar_url":"https://github.com/jshvarts.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Getting Started with Mosby MVP\n\n[![Build Status](https://travis-ci.org/jshvarts/MosbyMVP.svg?branch=master)](https://travis-ci.org/jshvarts/MosbyMVP)\n\nMy Medium article to accompany this repo is here: [Get your MVP right with Mosby](https://proandroiddev.com/get-your-mvp-right-with-mosby-1928eaf9daec)\n\nThis repo explores [Mosby](https://github.com/sockeqwe/mosby/) and [Mosby Conductor plugin](https://github.com/sockeqwe/mosby-conductor/) implementing MVP pattern.\n\nBoth Mosby and Conductor have excellent documentation on GitHub and at [Hannes Dorfmann's blog](http://hannesdorfmann.com/mosby/).\n \n## Why use a library to implement MVP?\n\nModel-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.\n\nIf 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? \n\n## Definitions \n* `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. \nMore details at [ViewState](http://hannesdorfmann.com/mosby/viewstate/)\n* LCE describes Loading-Content-Error flow typical of many Android apps where loading indicator (such as `ProgressBar`) is followed by displaying content or error. \n* Delegate Callbacks is a set of interfaces that Mosby uses internally which you are welcome to implement yourself instead of inheriting from base MVP classes. For instance, instead of extending `MvpActivity`, implement `MvpDelegateCallback` or instead of extending `MvpViewStateController` implement `MvpViewStateConductorDelegateCallback` and so forth.\n* `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.\n* `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.\n\n## Modules in this repo\n\n*All examples implement MVP pattern*\n\n* **Hello World**\n    * Simple Hello World sample. [[link]](https://github.com/jshvarts/MosbyMVP/tree/master/hello-world)\n* **Hello World with ViewState**\n    * Hello World with `ViewState` preserved across configuration changes. [[link]](https://github.com/jshvarts/MosbyMVP/tree/master/hello-world-viewstate)\n* **LCE pull-to-refresh with ViewState**\n    * Todo-style notes screen using RecyclerView with `ViewState` preserved across configuration changes. [[link]](https://github.com/jshvarts/MosbyMVP/tree/master/lce-pull-to-refresh-viewstate)\n* **Mosby Conductor Hello World**\n    * Mosby with Conductor plugin sample. [[link]](https://github.com/jshvarts/MosbyMVP/tree/master/conductor-hello-world) \n* **Mosby Conductor Hello World with ViewState**\n    * Mosby with Conductor plugin with `ViewState` preserved across configuration changes. [[link]](https://github.com/jshvarts/MosbyMVP/tree/master/conductor-hello-world-viewstate)\n* **Mosby Conductor LCE pull-to-refresh with ViewState**\n    * Mosby with Conductor plugin LCE pull-to-refresh with `ViewState` preserved across configuration changes. [[link]](https://github.com/jshvarts/MosbyMVP/tree/master/conductor-lce-pull-to-refresh-viewstate)\n* **Mosby Conductor Dagger Sample**\n    * Mosby with Conductor plugin used in a small Clean Architecture sample app with [Dagger](https://google.github.io/dagger/) and [Retrofit](http://square.github.io/retrofit/). Uses custom Dagger scopes. [[link]](https://github.com/jshvarts/MosbyMVP/tree/master/conductor-dagger-sample)\n\n## License\n\n    Copyright 2017 James Shvarts\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshvarts%2Fmosbymvp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjshvarts%2Fmosbymvp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshvarts%2Fmosbymvp/lists"}