From 69b8a1158f16c8d41c0a1c19a208514aedff8d32 Mon Sep 17 00:00:00 2001 From: Dan Lew Date: Thu, 25 Oct 2018 10:59:46 -0500 Subject: [PATCH] Deprecating rxlifecycle-navi Navi itself is being deprecated and rxlifecycle-android-lifecycle works just as well (if not better). --- README.md | 25 +++---------------- .../rxlifecycle2/navi/NaviLifecycle.java | 4 +++ 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 4e27b67..acea75f 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 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 @@ -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' @@ -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 diff --git a/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycle.java b/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycle.java index 3cc19b8..c494c3a 100644 --- a/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycle.java +++ b/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycle.java @@ -24,6 +24,10 @@ import static com.trello.rxlifecycle2.internal.Preconditions.checkNotNull; +@Deprecated +/** + * @Deprecated switch to using rxlifecycle-android-lifecycle + */ public final class NaviLifecycle { @NonNull