Skip to content

Commit

Permalink
Merge pull request #287 from trello/dlew/merge-2.x
Browse files Browse the repository at this point in the history
Merge 2.x into master branch
  • Loading branch information
dlew authored Oct 25, 2018
2 parents 474a764 + 30410d5 commit ed10155
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
25 changes: 4 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ those implemented?
You have a few options for that:

1. Use rxlifecycle-components and subclass the provided `RxActivity`, `RxFragment`, etc. classes.
1. Use [Navi](https://github.com/trello/navi/) + rxlifecycle-navi to generate providers.
1. Use [Android's lifecycle](https://developer.android.com/topic/libraries/architecture/lifecycle.html) + rxlifecycle-android-lifecycle to generate providers.
1. Write the implementation yourself.

Expand All @@ -63,23 +62,6 @@ public class MyActivity extends RxActivity {
}
```

If you use rxlifecycle-navi, then you just pass your `NaviComponent` to `NaviLifecycle` to generate a provider:

```java
public class MyActivity extends NaviActivity {
private final LifecycleProvider<ActivityEvent> provider
= NaviLifecycle.createActivityLifecycleProvider(this);

@Override
public void onResume() {
super.onResume();
myObservable
.compose(provider.bindToLifecycle())
.subscribe();
}
}
```

If you use rxlifecycle-android-lifecycle, then you just pass your `LifecycleOwner` to `AndroidLifecycle` to generate a provider:

```java
Expand Down Expand Up @@ -146,9 +128,6 @@ implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.2.2'
// If you want pre-written support preference Fragments you can subclass as providers
implementation 'com.trello.rxlifecycle2:rxlifecycle-components-preference:2.2.2'
// If you want to use Navi for providers
implementation 'com.trello.rxlifecycle2:rxlifecycle-navi:2.2.2'
// If you want to use Android Lifecycle for providers
implementation 'com.trello.rxlifecycle2:rxlifecycle-android-lifecycle:2.2.2'
Expand All @@ -157,6 +136,10 @@ implementation 'com.trello.rxlifecycle2:rxlifecycle-kotlin:2.2.2'
// If you want to use Kotlin syntax with Android Lifecycle
implementation 'com.trello.rxlifecycle2:rxlifecycle-android-lifecycle-kotlin:2.2.2'
// If you want to use Navi for providers
// DEPRECATED: Use rxlifecycle-android-lifecycle instead. This will be removed in a future release.
implementation 'com.trello.rxlifecycle2:rxlifecycle-navi:2.2.2'
```

## License
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

import static com.trello.rxlifecycle3.internal.Preconditions.checkNotNull;

@Deprecated
/**
* @Deprecated switch to using rxlifecycle-android-lifecycle
*/
public final class NaviLifecycle {

@NonNull
Expand Down

0 comments on commit ed10155

Please sign in to comment.