Skip to content

Commit

Permalink
Migrate to RxJava 3
Browse files Browse the repository at this point in the history
Fix code style

Update README and CHANGELOG
  • Loading branch information
MrAsterisco committed Jun 1, 2020
1 parent 58b0b17 commit e7b8304
Show file tree
Hide file tree
Showing 41 changed files with 856 additions and 825 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
CHANGELOG
=========

v. 4.0.0
--------
*01 Jun 2020*

- **migrated library to RxJava3.x** on RxJava3.x branch and released it as `reactivenetwork-rx3` artifact
- the `onError` method in `NetworkObservingStrategy` now requires a `Throwable` instead of an `Exception`.
- updated project dependencies
- update gradle version

v. 3.0.8
--------
*02 Apr 2020*
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ReactiveNetwork-brightgreen.svg?style=flat-square)](https://android-arsenal.com/details/1/2290)

view website with documentation: [RxJava1.x](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava1.x/), [**RxJava2.x**](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava2.x/)
view website with documentation: [RxJava1.x](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava1.x/), [**RxJava2.x**](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava2.x/), [RxJava3.x](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava3.x/)

ReactiveNetwork is an Android library listening **network connection state** and **Internet connectivity** with RxJava Observables. It's a successor of [Network Events](https://github.com/pwittchen/NetworkEvents) library rewritten with Reactive Programming approach. Library supports both new and legacy network monitoring strategies. Min sdk version = 9.

| Current Branch | Branch | Artifact Id | Build Status | Coverage | Maven Central |
|:--------------:|:-------:|:-----------:|:-------------:|:--------:|:-------------:|
| | [`RxJava1.x`](https://github.com/pwittchen/ReactiveNetwork/tree/RxJava1.x) | `reactivenetwork` | [![Build Status for RxJava1.x](https://img.shields.io/travis/pwittchen/ReactiveNetwork/RxJava1.x.svg?style=flat-square)](https://travis-ci.org/pwittchen/ReactiveNetwork) | [![codecov](https://img.shields.io/codecov/c/github/pwittchen/ReactiveNetwork/RxJava1.x.svg?style=flat-square&label=coverage)](https://codecov.io/gh/pwittchen/ReactiveNetwork/branch/RxJava1.x) | ![Maven Central](https://img.shields.io/maven-central/v/com.github.pwittchen/reactivenetwork.svg?style=flat-square) |
| :ballot_box_with_check: | [`RxJava2.x`](https://github.com/pwittchen/ReactiveNetwork/tree/RxJava2.x) | `reactivenetwork-rx2` | [![Build Status for RxJava2.x](https://img.shields.io/travis/pwittchen/ReactiveNetwork/RxJava2.x.svg?style=flat-square)](https://travis-ci.org/pwittchen/ReactiveNetwork) | [![codecov](https://img.shields.io/codecov/c/github/pwittchen/ReactiveNetwork/RxJava2.x.svg?style=flat-square&label=coverage)](https://codecov.io/gh/pwittchen/ReactiveNetwork/branch/RxJava2.x) | ![Maven Central](https://img.shields.io/maven-central/v/com.github.pwittchen/reactivenetwork-rx2.svg?style=flat-square) |
| | [`RxJava3.x`](https://github.com/pwittchen/ReactiveNetwork/tree/RxJava3.x) | `reactivenetwork-rx3` | [![Build Status for RxJava3.x](https://img.shields.io/travis/pwittchen/ReactiveNetwork/RxJava3.x.svg?style=flat-square)](https://travis-ci.org/pwittchen/ReactiveNetwork) | [![codecov](https://img.shields.io/codecov/c/github/pwittchen/ReactiveNetwork/RxJava3.x.svg?style=flat-square&label=coverage)](https://codecov.io/gh/pwittchen/ReactiveNetwork/branch/RxJava3.x) | ![Maven Central](https://img.shields.io/maven-central/v/com.github.pwittchen/reactivenetwork-rx3.svg?style=flat-square) |

Contents
--------
Expand Down Expand Up @@ -600,7 +601,7 @@ Then commit and push your changes to `gh-pages` branch.
Documentation
--------------------------

view website with documentation: [RxJava1.x](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava1.x/), [**RxJava2.x**](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava2.x/)
view website with documentation: [RxJava1.x](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava1.x/), [**RxJava2.x**](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava2.x/), [RxJava3.x](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava3.x/)

It can be generated as follows:

Expand Down
4 changes: 4 additions & 0 deletions app-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ android {
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

detekt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ package com.github.pwittchen.reactivenetwork.kotlinapp
import android.app.Activity
import android.os.Bundle
import android.util.Log
import com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import com.github.pwittchen.reactivenetwork.library.rx3.ReactiveNetwork
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.schedulers.Schedulers
import kotlinx.android.synthetic.main.activity_main.connectivity_status
import kotlinx.android.synthetic.main.activity_main.internet_status

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import com.github.pwittchen.reactivenetwork.library.rx3.ReactiveNetwork;

import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.schedulers.Schedulers;

public class MainActivity extends Activity {
private static final String TAG = "ReactiveNetwork";
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ ext {
minSdkVersion = 14
minSdkVersionApps = 23
compileSdkVersion = 28
buildToolsVersion = '28.0.3'
gradleVersion = '4.6'
buildToolsVersion = '29.0.2'
gradleVersion = '6.3'
kotlinVersion = '1.3.72'
detektVersion = '1.0.0.RC6-1'
}

ext.deps = [rxjava2 : 'io.reactivex.rxjava2:rxjava:2.2.19',
rxandroid2 : 'io.reactivex.rxjava2:rxandroid:2.1.1',
ext.deps = [rxjava3 : 'io.reactivex.rxjava3:rxjava:3.0.4',
rxandroid3 : 'io.reactivex.rxjava3:rxandroid:3.0.0',
annotation : 'androidx.annotation:annotation:1.1.0',
appcompat : 'androidx.appcompat:appcompat:1.1.0',
junit : 'junit:junit:4.13',
Expand All @@ -38,7 +38,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath('com.hiya:jacoco-android:0.2') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ org.gradle.jvmargs=-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+Heap

android.useAndroidX=true
android.enableJetifier=true
android.enableR8.fullMode=false
android.enableUnitTestBinaryResources=true
android.enableR8.fullMode=false
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Mon Jun 01 10:11:40 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ android {
}

dependencies {
api deps.rxjava2
api deps.rxandroid2
api deps.rxjava3
api deps.rxandroid3
implementation deps.annotation

testImplementation deps.junit
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.pwittchen.reactivenetwork.library.rx2">
package="com.github.pwittchen.reactivenetwork.library.rx3">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit e7b8304

Please sign in to comment.