Skip to content

Commit

Permalink
Support RxJava2
Browse files Browse the repository at this point in the history
Fix #14
  • Loading branch information
yongjhih committed Feb 19, 2017
1 parent e19f506 commit 7df342f
Show file tree
Hide file tree
Showing 65 changed files with 300 additions and 268 deletions.
File renamed without changes.
8 changes: 4 additions & 4 deletions rxparse-app-v3/build.gradle → rxparse2-app-v3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ dependencies {

compile 'com.parse:parse-android:1.13.1'
compile 'com.parse.bolts:bolts-tasks:1.4.0'
compile project(':rxparse')
compile project(':rxparse-facebook-v3')
//compile 'com.github.yongjhih.RxParse:rxparse:-SNAPSHOT'
//compile 'com.github.yongjhih.RxParse:rxparse-facebook-v3:-SNAPSHOT'
compile project(':rxparse2')
compile project(':rxparse2-facebook-v3')
//compile 'com.github.yongjhih.RxParse:rxparse2:-SNAPSHOT'
//compile 'com.github.yongjhih.RxParse:rxparse2-facebook-v3:-SNAPSHOT'

compile 'io.reactivex:rxjava:1.2.4'
compile 'io.reactivex:rxandroid:0.24.0'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import android.app.Application;
import android.test.ApplicationTestCase;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import android.view.View;
import android.support.v7.widget.RecyclerView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import android.net.Uri;
import android.os.Bundle;
Expand All @@ -25,7 +25,7 @@
import rx.android.app.AppObservable;
import rx.functions.Action1;
import rx.functions.Func2;
import rx.parse.ParseObservable;
import rx.parse2.ParseObservable;

//import android.support.v4.app.NavUtils;
//import android.support.v7.widget.StaggeredGridLayoutManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import android.app.Application;

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions rxparse-app-v4/build.gradle → rxparse2-app-v4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ dependencies {

compile 'com.parse:parse-android:1.13.1'
compile 'com.parse.bolts:bolts-android:1.4.0'
compile project(':rxparse')
compile project(':rxparse-facebook-v4')
//compile 'com.github.yongjhih.RxParse:rxparse:-SNAPSHOT'
//compile 'com.github.yongjhih.RxParse:rxparse-facebook-v3:-SNAPSHOT'
compile project(':rxparse2')
compile project(':rxparse2-facebook-v4')
//compile 'com.github.yongjhih.RxParse:rxparse2:-SNAPSHOT'
//compile 'com.github.yongjhih.RxParse:rxparse2-facebook-v3:-SNAPSHOT'

compile 'io.reactivex:rxjava:1.2.4'
compile 'io.reactivex:rxandroid:0.24.0'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import android.app.Application;
import android.test.ApplicationTestCase;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import android.view.View;
import android.support.v7.widget.RecyclerView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import android.net.Uri;
import android.os.Bundle;
Expand All @@ -25,7 +25,7 @@
import rx.android.app.AppObservable;
import rx.functions.Action1;
import rx.functions.Func2;
import rx.parse.ParseObservable;
import rx.parse2.ParseObservable;

//import android.support.v4.app.NavUtils;
//import android.support.v7.widget.StaggeredGridLayoutManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rx.parse.app;
package rx.parse2.app;

import android.app.Application;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ buildscript {
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.4.0'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.github.JakeWharton:sdk-manager-plugin:-SNAPSHOT'
classpath 'com.novoda:bintray-release:0.4.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
Expand Down Expand Up @@ -49,12 +48,9 @@ dependencies {
compile 'com.parse.bolts:bolts-android:1.4.0'
compile 'com.parse:parsefacebookutils-v3-android:1.10.4@aar'

//compile 'com.parse.bolts:bolts-tasks:1.4.0'
//compile 'com.github.yongjhih.RxBolts:rxbolts-android:-SNAPSHOT'
//compile 'com.github.yongjhih:RxBolts:-SNAPSHOT'
compile 'com.infstory:rxbolts-tasks:1.0.3'
compile 'com.github.yongjhih.RxBolts:rxbolts2-tasks:e9efae0ffd'

compile 'io.reactivex:rxjava:1.2.4'
compile 'io.reactivex.rxjava2:rxjava:2.0.1'

compile 'com.facebook.android:facebook-android-sdk:3.23.1'
//testCompile "org.mockito:mockito-core:1.+"
Expand All @@ -80,8 +76,8 @@ def getRepositoryPassword() {
publish {
userOrg = 'yongjhih'
groupId = 'com.infstory'
artifactId = 'rxparse-facebook-v3'
publishVersion = '2.0.3'
artifactId = 'rxparse2-facebook-v3'
publishVersion = '2.0.4'
desc = 'Reactive ParseFacebooUtils v3'
website = 'https://github.com/yongjhih/RxParse'
bintrayUser = getRepositoryUsername()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="rx.parse.facebook">
package="rx.parse2.facebook">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package rx.parse;
package rx.parse2;

import android.app.Activity;

Expand All @@ -24,38 +24,38 @@
import java.util.Collection;
import java.util.Date;

import rx.Observable;
import rx.bolts.TaskObservable;
import io.reactivex.Observable;
import rx.bolts2.TaskObservable;

public class ParseFacebookObservable {

public static Observable<ParseUser> link(ParseUser user, Activity activity) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.linkInBackground(user, activity))
return TaskObservable.defer(() -> ParseFacebookUtils.linkInBackground(user, activity))
.map(v -> user);
}

public static Observable<ParseUser> link(ParseUser user, Activity activity, int activityCode) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.linkInBackground(user, activity, activityCode))
return TaskObservable.defer(() -> ParseFacebookUtils.linkInBackground(user, activity, activityCode))
.map(v -> user);
}

public static Observable<ParseUser> link(ParseUser user, Collection<String> permissions, Activity activity) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.linkInBackground(user, permissions, activity))
return TaskObservable.defer(() -> ParseFacebookUtils.linkInBackground(user, permissions, activity))
.map(v -> user);
}

public static Observable<ParseUser> link(ParseUser user, Collection<String> permissions, Activity activity, int activityCode) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.linkInBackground(user, permissions, activity, activityCode))
return TaskObservable.defer(() -> ParseFacebookUtils.linkInBackground(user, permissions, activity, activityCode))
.map(v -> user);
}

public static Observable<ParseUser> link(ParseUser user, String facebookId, String accessToken, Date expirationDate) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.linkInBackground(user, facebookId, accessToken, expirationDate))
return TaskObservable.defer(() -> ParseFacebookUtils.linkInBackground(user, facebookId, accessToken, expirationDate))
.map(v -> user);
}

public static Observable<ParseUser> logIn(Collection<String> permissions, Activity activity, int activityCode) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.logInInBackground(permissions, activity, activityCode));
return TaskObservable.defer(() -> ParseFacebookUtils.logInInBackground(permissions, activity, activityCode));
}

public static Observable<ParseUser> logIn(Collection<String> permissions, Activity activity) {
Expand All @@ -65,16 +65,16 @@ public static Observable<ParseUser> logIn(Collection<String> permissions, Activi
}

public static Observable<ParseUser> logIn(String facebookId, String accessToken, Date expirationDate) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.logInInBackground(facebookId, accessToken, expirationDate));
return TaskObservable.defer(() -> ParseFacebookUtils.logInInBackground(facebookId, accessToken, expirationDate));
}

public static Observable<ParseUser> saveLatestSessionData(ParseUser user) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.saveLatestSessionDataInBackground(user))
return TaskObservable.defer(() -> ParseFacebookUtils.saveLatestSessionDataInBackground(user))
.map(v -> user);
}

public static Observable<ParseUser> unlink(ParseUser user) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.unlinkInBackground(user))
return TaskObservable.defer(() -> ParseFacebookUtils.unlinkInBackground(user))
.map(v -> user);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ buildscript {
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.4.0'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.github.JakeWharton:sdk-manager-plugin:-SNAPSHOT'
classpath 'com.novoda:bintray-release:0.4.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
Expand Down Expand Up @@ -49,9 +48,9 @@ dependencies {
compile 'com.parse:parsefacebookutils-v4-android:1.10.4@aar'

compile 'com.parse.bolts:bolts-tasks:1.4.0'
compile 'com.infstory:rxbolts:1.0.3'
compile 'com.github.yongjhih.RxBolts:rxbolts2-tasks:e9efae0ffd'

compile 'io.reactivex:rxjava:1.2.4'
compile 'io.reactivex.rxjava2:rxjava:2.0.1'

compile 'com.facebook.android:facebook-android-sdk:4.18.0'
//testCompile "org.mockito:mockito-core:1.+"
Expand All @@ -74,8 +73,8 @@ def getRepositoryPassword() {
publish {
userOrg = 'yongjhih'
groupId = 'com.infstory'
artifactId = 'rxparse-facebook-v4'
publishVersion = '2.0.3'
artifactId = 'rxparse2-facebook-v4'
publishVersion = '2.0.4'
desc = 'Reactive ParseFacebooUtils v4'
website = 'https://github.com/yongjhih/RxParse'
bintrayUser = getRepositoryUsername()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="rx.parse.facebook">
package="rx.parse2.facebook">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package rx.parse;
package rx.parse2;

import android.app.Activity;
import android.support.v4.app.Fragment;
Expand All @@ -24,58 +24,58 @@

import java.util.Collection;

import rx.Observable;
import rx.bolts.TaskObservable;
import io.reactivex.Observable;
import rx.bolts2.TaskObservable;

public class ParseFacebookObservable {

public static Observable<ParseUser> link(ParseUser user, com.facebook.AccessToken accessToken) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.linkInBackground(user, accessToken))
return TaskObservable.defer(() -> ParseFacebookUtils.linkInBackground(user, accessToken))
.map(v -> user);
}

public static Observable<ParseUser> linkWithPublishPermissions(ParseUser user, Activity activity, Collection<String> permissions) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.linkWithPublishPermissionsInBackground(user, activity, permissions))
return TaskObservable.defer(() -> ParseFacebookUtils.linkWithPublishPermissionsInBackground(user, activity, permissions))
.map(v -> user);
}

public static Observable<ParseUser> linkWithPublishPermissions(ParseUser user, Fragment fragment, Collection<String> permissions) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.linkWithPublishPermissionsInBackground(user, fragment, permissions))
return TaskObservable.defer(() -> ParseFacebookUtils.linkWithPublishPermissionsInBackground(user, fragment, permissions))
.map(v -> user);
}

public static Observable<ParseUser> linkWithReadPermissions(ParseUser user, Activity activity, Collection<String> permissions) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.linkWithReadPermissionsInBackground(user, activity, permissions))
return TaskObservable.defer(() -> ParseFacebookUtils.linkWithReadPermissionsInBackground(user, activity, permissions))
.map(v -> user);
}

public static Observable<ParseUser> linkWithReadPermissions(ParseUser user, Fragment fragment, Collection<String> permissions) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.linkWithReadPermissionsInBackground(user, fragment, permissions))
return TaskObservable.defer(() -> ParseFacebookUtils.linkWithReadPermissionsInBackground(user, fragment, permissions))
.map(v -> user);
}

public static Observable<ParseUser> logIn(com.facebook.AccessToken accessToken) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.logInInBackground(accessToken));
return TaskObservable.defer(() -> ParseFacebookUtils.logInInBackground(accessToken));
}

public static Observable<ParseUser> logInWithPublishPermissions(Activity activity, Collection<String> permissions) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.logInWithPublishPermissionsInBackground(activity, permissions));
return TaskObservable.defer(() -> ParseFacebookUtils.logInWithPublishPermissionsInBackground(activity, permissions));
}

public static Observable<ParseUser> logInWithPublishPermissions(Fragment fragment, Collection<String> permissions) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.logInWithPublishPermissionsInBackground(fragment, permissions));
return TaskObservable.defer(() -> ParseFacebookUtils.logInWithPublishPermissionsInBackground(fragment, permissions));
}

public static Observable<ParseUser> logInWithReadPermissions(Activity activity, Collection<String> permissions) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.logInWithReadPermissionsInBackground(activity, permissions));
return TaskObservable.defer(() -> ParseFacebookUtils.logInWithReadPermissionsInBackground(activity, permissions));
}

public static Observable<ParseUser> logInWithReadPermissions(Fragment fragment, Collection<String> permissions) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.logInWithReadPermissionsInBackground(fragment, permissions));
return TaskObservable.defer(() -> ParseFacebookUtils.logInWithReadPermissionsInBackground(fragment, permissions));
}

public static Observable<ParseUser> unlink(ParseUser user) {
return TaskObservable.deferNullable(() -> ParseFacebookUtils.unlinkInBackground(user))
return TaskObservable.defer(() -> ParseFacebookUtils.unlinkInBackground(user))
.map(v -> user);
}

Expand Down
Loading

0 comments on commit 7df342f

Please sign in to comment.