• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Plugin for conductor to integrate Mosby

Mosby - Conductor

Plugin for using Mosby with Conductor, a small, yet full-featured framework that allows building View-based Android applications.

Dependencies

Build Status

For Conductor 2.x with Mosby 3.x use:

dependencies {
    compile 'com.hannesdorfmann.mosby3:mvp-conductor:3.1.0'
    // or
    compile 'com.hannesdorfmann.mosby3:viewstate-conductor:3.1.0' // optional viewstate feature
    // or
    compile 'com.hannesdorfmann.mosby3:mvi-conductor:3.1.0' // Model-View-Intent
}

Snapshot

Latest snapshot (from master branch):

dependencies {
    compile 'com.hannesdorfmann.mosby3:mvi-conductor:3.1.1-SNAPSHOT' // Model-View-Intent
    // or
    compile 'com.hannesdorfmann.mosby3:mvp-conductor:3.1.1-SNAPSHOT'
    // or
    compile 'com.hannesdorfmann.mosby3:viewstate-conductor:3.1.1-SNAPSHOT' // optional viewstate feature

}

You also have to add the url to the snapshot repository:

allprojects {
  repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
  }
}

Usage

Extend your own Conductor Controller from MvpController or from MvpViewStateController if you want to use ViewState feature or from or MviController if you want to use the Model-View-Intent feature.

There are also two base LCE (Loading-Content-Error) Controllers you can extend from: MvpLceController and MvpLceViewStateController.

If you don't want to extend from one of the base controller classes shown above, you can always bring in Mosby easily in any Conductor controller:

class MyController extends Controller
                  implements MvpView, MvpConductorDelegateCallback<V, P> {

  // Initializer block (will be copied into constructor)
  {
    addLifecycleListener(new MvpConductorLifecycleListener<V, P>(this);
  }

  // implement all methods from  MvpConductorDelegateCallback like createPresenter() etc.
  ...

}

If you need ViewState support simply use MvpViewStateConductorLifecycleListener and MvpViewStateConductorDelegateCallback. Do the same for Model-View-Intent but use MviConductorLifecycleListener and MviConductorDelegateCallback.

Lifecycle

Presenter will be created right after Controller.onCreateView() but before Controller.onAttach(). So in onAttach() presenter is ready to be used. View will be detached from Presenter in Controller.onDestroyView() by calling presenter.detachView(true) (true if view is just detached temporarily i.e. screen orientation change, false if view is detached permanently because Controller will be destroyed)

Example

There is a nice external repository that shows how to use Mosby-Conductor. All credit goes to James Shvarts.

This repository contains a simple TO DO List app which is still work in progress.

License

Copyright 2016 Hannes Dorfmann

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.

More Repositories

1

mosby

A Model-View-Presenter / Model-View-Intent library for modern Android apps
Java
5,489
star
2

AdapterDelegates

"Favor composition over inheritance" for RecyclerView Adapters
Java
2,934
star
3

fragmentargs

Annotation Processor for setting arguments in android fragments
Java
1,077
star
4

SwipeBack

SwipeBack for Android Activities to do pretty the same as the android "back-button" will do, but in a really intuitive way by using a swipe gesture
Java
695
star
5

annotationprocessing101

Java
431
star
6

ParcelablePlease

Annotation Processor for generating Parcelable code
Java
259
star
7

AnnotatedAdapter

Write less code with AnnotatedAdapter, an annotation processor for generating RecyclerView and AbsListView adapters
Java
195
star
8

sqlbrite-dao

DAO for SQLBrite
Java
182
star
9

debugoverlay

A tiny window overlay to log app internal on top of your android app
Java
151
star
10

CoordinatorsAndroid

Sample that shows how to apply the Coordinator Pattern on Android
Kotlin
121
star
11

Model-View-Intent-Android

A demo that shows how to apply Model-View-Intent on Android
Kotlin
86
star
12

AdapterCommands

Drop in solution to animate RecyclerView's dataset changes by using command pattern
Java
74
star
13

Instantiator

Tired of manually setup test data of Kotlin data classes or POJOs? Instantiator creates Instances of any class for you so that you can focus on writing tests instead of spending time and effort to setup test data
Kotlin
60
star
14

Vaadin-MVP-Lite

This is a Vaadin Addon that provides a Model-View-Presenter Framework
Java
51
star
15

CircleProgressView

Fork from SmoothProgressbar for internal development of another UI library ...
Java
38
star
16

mvi-timing

Just a simple demo app for blog post about MVI and Timing
Java
29
star
17

Todo-Testing-By-Design

Kotlin
13
star
18

rxworkshop

Kotlin
12
star
19

conductor-shared-element-transition

Kotlin
9
star
20

Vaadin-MVP-Lite-MailExample

This is an example project that shows how to use the VaadinMVP framework
JavaScript
9
star
21

appkit

Develop android application in a modern way. Write less code: appkit uses many popular Annotation Processing libraries like Butterknife, IcePick, Dependency Injection with Dagger and achieve a very clean software architecture with Model-View-Presenter (MVP)
Java
9
star
22

SecureBitcoinWallet

Java
8
star
23

SealedSubclassInstantiator

Instantiates instances of subclasses of a sealed class (Kotlin)
Kotlin
8
star
24

website-old

Personal blog, please read README
CSS
7
star
25

MosbyDagger

Example that shows best practices for Dagger2 + Mosby
4
star
26

AndroidCollections

Some usefu collection implementation like List, Map, Set (and combinations of all) etc. that can be useful in Android Projects
Java
4
star
27

OkHttpCertificate

Kotlin
3
star
28

hdlib

Java
2
star
29

fragmentargs-samples

Java
2
star
30

AndroidDesignPatterns

A Collection of Software Design Patterns for Android Applications
Java
2
star
31

ColorProgressBar

A circular (loading spinner) ProgressBar for Android that let you customize the colors of the loading spinner
Java
2
star
32

MosbyViewPagerDemo

Demo of viewpager + mosby
Java
1
star
33

RobolectircTest

Java
1
star
34

DexUtil

How many mehtods are used in your androids .dex file?
Java
1
star
35

annotationprocessing

Some utilities for writing annotation processors
Java
1
star
36

AndroidCollectionsTest

The eclipcse Android Test Project to run unit tests from eclipse
1
star
37

ason

Java
1
star
38

Vaadin-LoadingPanel

A simple LoadingPanel component, where you can switch beetween showing a loading animation and the "normal" content
Java
1
star
39

HippoHappa

Java
1
star
40

stdlib-android-test

Units test for the stdlib-android library
Java
1
star