-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparing 0.2.1 release to MCentral
- Loading branch information
Showing
11 changed files
with
234 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.ftinc.kit.di; | ||
|
||
/** | ||
* Project: android-52Kit | ||
* Package: com.ftinc.kit.di | ||
* Created by drew.heavner on 5/7/15. | ||
*/ | ||
public class Stub { | ||
} |
10 changes: 10 additions & 0 deletions
10
library/src/main/java/com/ftinc/kit/di/qualifiers/Flavor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.ftinc.kit.di.qualifiers; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
import javax.inject.Qualifier; | ||
|
||
@Qualifier | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface Flavor {} |
10 changes: 10 additions & 0 deletions
10
library/src/main/java/com/ftinc/kit/di/qualifiers/Sauce.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.ftinc.kit.di.qualifiers; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
import javax.inject.Qualifier; | ||
|
||
@Qualifier | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface Sauce {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
package com.ftinc.kit.util; | ||
|
||
import android.os.Handler; | ||
|
||
import rx.Observable; | ||
import rx.android.schedulers.AndroidSchedulers; | ||
import rx.schedulers.Schedulers; | ||
|
||
/** | ||
* Utility Helper class for RxJava additions | ||
* | ||
* Project: android-52Kit | ||
* Package: com.ftinc.kit.util | ||
* Created by drew.heavner on 5/7/15. | ||
*/ | ||
public class RxUtils { | ||
|
||
/** | ||
* <p> | ||
* Apply the subscribeOn/observeOn transformation of io/mainThread | ||
* to an observable via compose() | ||
* </p> | ||
* | ||
* <p> | ||
* Only apply this to observables that are handling I/O work, e.g.; Networking, Database, etc... | ||
* </p> | ||
* | ||
* @param <T> the transformation type | ||
* @return the observable post-transform | ||
*/ | ||
public static <T> Observable.Transformer<T, T> applyIOSchedulers() { | ||
return new Observable.Transformer<T, T>() { | ||
@Override | ||
public Observable<T> call(Observable<T> observable) { | ||
return observable.subscribeOn(Schedulers.io()) | ||
.observeOn(AndroidSchedulers.mainThread()); | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* <p> | ||
* Apply the subscribeOn/observeOn transformation of computation/mainThread | ||
* to an observable via compose() | ||
* </p> | ||
* | ||
* <p> | ||
* Only apply this to observables that are handling computation tasks in the background. Basically | ||
* all non-IO work | ||
* </p> | ||
* | ||
* @param <T> the transformation type | ||
* @return the observable post-transform | ||
*/ | ||
public static <T> Observable.Transformer<T, T> applyWorkSchedulers() { | ||
return new Observable.Transformer<T, T>() { | ||
@Override | ||
public Observable<T> call(Observable<T> observable) { | ||
return observable.subscribeOn(Schedulers.computation()) | ||
.observeOn(AndroidSchedulers.mainThread()); | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* <p> | ||
* Apply the subscribeOn/observeOn transformation of {custom_handler}/mainThread | ||
* to an observable via compose() | ||
* </p> | ||
* | ||
* <p> | ||
* Only apply this to observables that are handling computation tasks in the background. Basically | ||
* all non-IO work | ||
* </p> | ||
* | ||
* @param <T> the transformation type | ||
* @return the observable post-transform | ||
*/ | ||
public static <T> Observable.Transformer<T, T> applyCustomSchedulers(final Handler subscribeHandler) { | ||
return new Observable.Transformer<T, T>() { | ||
@Override | ||
public Observable<T> call(Observable<T> observable) { | ||
return observable.subscribeOn(AndroidSchedulers.handlerThread(subscribeHandler)) | ||
.observeOn(AndroidSchedulers.mainThread()); | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* <p> | ||
* Apply the subscribeOn/observeOn transformation of computation/mainThread | ||
* to an observable via compose() | ||
* </p> | ||
* | ||
* <p> | ||
* Only apply this to observables that are handling computation tasks in the background. Basically | ||
* all non-IO work | ||
* </p> | ||
* | ||
* @param <T> the transformation type | ||
* @return the observable post-transform | ||
*/ | ||
public static <T> Observable.Transformer<T, T> applyCustomSchedulers(final Handler subscribeHandler, final Handler observeHandler) { | ||
return new Observable.Transformer<T, T>() { | ||
@Override | ||
public Observable<T> call(Observable<T> observable) { | ||
return observable.subscribeOn(AndroidSchedulers.handlerThread(subscribeHandler)) | ||
.observeOn(AndroidSchedulers.handlerThread(observeHandler)); | ||
} | ||
}; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters