Skip to content

Commit

Permalink
[docs] improv: changelog, readme and todo
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoslacz committed Nov 5, 2016
1 parent 4111bd7 commit cf871ca
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## 1.1.0-alpha

### General

* Change the Moviper stage of development to alpha as some API methods may change.
* Introduced completely new samples.

### Enhancements

* Added the Rx flavored version of Moviper that lacks Presenter references in Interactor and Routing.
* Added the Presenter args Bundle that allows passing arguments from Activity/Fragment extras to Routing and Interactor constructors.
* Added the Moviper Inter-Presenter-Communication tool to avoid using a bus in the mentioned communication.

### Deprecated (will be removed in the next release)

* Unnecessary Presenter `isRoutingAttached()` and `isInteractorAttached()` methods.

### Internal

* Removed the unnecessary double-purging Interactor and Routing references in Presenter.
* Fixed some improper @Nullable marks for Routing and Interactor in Presenter and ViewHelper/Context weak references in Routing, change them to @NonNull.
* Bumped dependencies versions:
- buildtools, appcompat and sdk to 25
- gradle to 2.2.2
- gradle-retrolambda to 3.3.1
- RxJava to 1.2.2

### Credits

* Great thanks to Jakub Jodełka ([@jakubjodelka](https://github.com/jakubjodelka)) for providing the brand new samples.


## 1.0.0

### Initial release
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,51 @@ dependencies {
## Getting started

Just create a VIPER files set using [Moviper Template Generator](https://github.com/mkoslacz/MoviperTemplateGenerator), fill up the contract, generate missing methods using Android Studio autofix
and implement them. Most probably you will want to check out a sample module provided in this repository to see how to use Moviper.
and implement them. Most probably you will want to check out a sample module provided in this repository to see how to use Moviper. You have two flavours of Moviper. The "regular" one — to use with callbacks, and the Rx one, to use with RxJava.

## Advanced features

### Args Bundle

You can easily pass extras from your Activity or Fragment to the presenter using Moviper Args Bundle. You can check out how to use it in the Sample's `FullscreenPhotoPresenter` constructor and its call.

### Moviper Inter-Presenter-Communication (IPC) (RxJava)

_(sample coming soon)_

Enable IPC in your Application class.
```java
Moviper.getInstance().setConfig(
new Config.Builder()
.withPresenterAccessUtilEnabled(true) // plain IPC
.withInstancePresentersEnabled(false) // acces to specific presenters
.build());
```

#### Plain IPC

You can access all alive Presenters of a given class from any place in your app like this:
```java
Moviper.getInstance().getPresenters(SomePresenter.class)
.subscribe(somePresenter -> somePresenter.someMethod(false)); // stream of all Presenters goes here
```

For readability mark your external methods in the Presenter using the `@ExternalCall` annotation.

#### Instance Presenters Access

If you set the `withInstancePresentersEnabled` in the config to true you can use Instance Presenter Access. After that you must ensure that every Presenter of given class has an unique name. To do so you have to override Presenter `String getName()` method (in default it returns "default").

After that you can access any Presenter Instance like this:

```java
Moviper.getInstance().getPresenterInstance(SomePresenter.class, "someName")
.subscribe(somePresenter -> somePresenter.someMethod(false)); // exactly one or zero Presenters with given name and class goes here
```

## Examples

Just check out the sample module in this repo.
For the basic usage just check out the sample module in this repo. Advanced features samples coming soon.

## Credits

Expand Down
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#Viper-framework TODOs:
- add sample showcasing Moviper inter-presenter communications
- add helper methods to BasePresenters, Interactors etc: ifViewIsAttachedDo( () -> {actions});
- learn & implement Dagger2 Viper injection (to use in example and maybe to remove passing
activity through presenter to let it be android-free. another (no-dagger) option is to pass
Expand Down

0 comments on commit cf871ca

Please sign in to comment.