Skip to content
This repository was archived by the owner on Jul 17, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ before_install:
- echo "d56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license"

- sdkmanager tools
- sdkmanager "system-images;android-18;default;armeabi-v7a"
- echo no | avdmanager create avd --force -n test -k "system-images;android-18;default;armeabi-v7a"
- sdkmanager "system-images;android-22;default;armeabi-v7a"
- echo no | avdmanager create avd --force -n test -k "system-images;android-22;default;armeabi-v7a"
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window &

before_script:
Expand Down
26 changes: 16 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.novoda:bintray-release:0.7.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.novoda:bintray-release:0.8.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
ext {
compileSdkVersion = 26
buildToolVersion = '26.0.2'
compileSdkVersion = 28
buildToolVersion = '28.0.3'
minSdkVersion = 14

//publish
Expand All @@ -28,6 +27,7 @@ allprojects {
reactiveAndroidSupportV4 = 'reactiveandroid-support-v4'
reactiveAndroidUI = 'reactiveandroid-ui'
reactiveAndroidDesign = 'reactiveandroid-design'
reactiveAndroidXAppcompat = 'reactiveandroidx-appcompat'

autoPublish = true
desc = 'Reactive events and properties with RxJava for Android'
Expand All @@ -37,7 +37,7 @@ allprojects {
website = 'https://github.com/kittinunf/ReactiveAndroid'

//kotlin
kotlinVersion = '1.1.60'
kotlinVersion = '1.2.71'
kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
kotlinStdLib = "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
kotlinAndroidExtensions = "org.jetbrains.kotlin:kotlin-android-extensions:$kotlinVersion"
Expand All @@ -52,9 +52,15 @@ allprojects {
androidSupportGridLayout = "com.android.support:gridlayout-v7:$supportVersion"
androidSupportDesign = "com.android.support:design:$supportVersion"

//androidx
androidxVersion = '1.0.0'
androidxAppCompat = "androidx.appcompat:appcompat:$androidxVersion"
androidxRecyclerView = "androidx.recyclerview:recyclerview:$androidxVersion"
androidxCardView = "androidx.cardview:cardview:$androidxVersion"

//rxjava2
reactivexRxJava2 = 'io.reactivex.rxjava2:rxjava:2.1.0'
reactivexRxAndroid2 = 'io.reactivex.rxjava2:rxandroid:2.0.1'
reactivexRxJava2 = 'io.reactivex.rxjava2:rxjava:2.2.2'
reactivexRxAndroid2 = 'io.reactivex.rxjava2:rxandroid:2.1.0'

//test
junit = 'junit:junit:4.12'
Expand Down
2 changes: 1 addition & 1 deletion deploy_bintray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [[ "$TRAVIS_BRANCH" == */release-v* ]]; then

echo "We're on release branch, deploying at $TRAVIS_BRANCH"

modules=("reactiveandroid" "reactiveandroid-design" "reactiveandroid-ui" "reactiveandroid-support-v4" "reactiveandroid-appcompat-v7")
modules=("reactiveandroid" "reactiveandroid-design" "reactiveandroid-ui" "reactiveandroid-support-v4" "reactiveandroid-appcompat-v7" "reactiveandroidx-appcompat")
for i in "${modules[@]}"
do
echo ">> Deploying $i ..."
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip
25 changes: 14 additions & 11 deletions reactiveandroid-appcompat-v7/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
api fileTree(dir: 'libs', include: ['*.jar'])

compile project(':reactiveandroid-ui')
api project(':reactiveandroid-ui')

compile parent.ext.androidAppCompatV7
compile parent.ext.androidSupportGridLayout
compile parent.ext.androidSupportRecyclerView
compile parent.ext.androidSupportCardView
api parent.ext.androidAppCompatV7
api parent.ext.androidSupportGridLayout
api parent.ext.androidSupportRecyclerView
api parent.ext.androidSupportCardView

androidTestCompile parent.ext.supportTestEspressoCore
androidTestCompile parent.ext.supportTestEspressoContrib
androidTestCompile parent.ext.supportTestRunner
androidTestCompile parent.ext.supportTestRules
androidTestCompile parent.ext.awaitility
androidTestImplementation parent.ext.supportTestEspressoCore
androidTestImplementation parent.ext.supportTestEspressoContrib
androidTestImplementation parent.ext.supportTestRunner
androidTestImplementation parent.ext.supportTestRules
androidTestImplementation parent.ext.awaitility
}

buildscript {
Expand All @@ -82,4 +82,7 @@ publish {

tasks.withType(Javadoc) {
enabled = false
}
repositories {
mavenCentral()
}
13 changes: 8 additions & 5 deletions reactiveandroid-design/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
api fileTree(dir: 'libs', include: ['*.jar'])

compile project(':reactiveandroid-ui')
api project(':reactiveandroid-ui')

compile parent.ext.androidSupportDesign
api parent.ext.androidSupportDesign

testCompile parent.ext.junit
testCompile parent.ext.robolectric
testImplementation parent.ext.junit
testImplementation parent.ext.robolectric\
}

buildscript {
Expand All @@ -74,4 +74,7 @@ publish {

tasks.withType(Javadoc) {
enabled = false
}
repositories {
mavenCentral()
}
13 changes: 8 additions & 5 deletions reactiveandroid-support-v4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
api fileTree(dir: 'libs', include: ['*.jar'])

compile project(':reactiveandroid-ui')
api project(':reactiveandroid-ui')

compile parent.ext.androidSupportV4
api parent.ext.androidSupportV4

testCompile parent.ext.junit
testCompile parent.ext.robolectric
testImplementation parent.ext.junit
testImplementation parent.ext.robolectric
}

buildscript {
Expand All @@ -74,4 +74,7 @@ publish {

tasks.withType(Javadoc) {
enabled = false
}
repositories {
mavenCentral()
}
22 changes: 13 additions & 9 deletions reactiveandroid-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,19 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
api fileTree(dir: 'libs', include: ['*.jar'])

compile project(':reactiveandroid')
api project(':reactiveandroid')

compile parent.ext.reactivexRxAndroid2
compile parent.ext.androidSupportAnnotation
api parent.ext.kotlinStdLib
api parent.ext.reactivexRxAndroid2
api parent.ext.androidSupportAnnotation

androidTestCompile parent.ext.supportTestEspressoCore
androidTestCompile parent.ext.supportTestEspressoContrib
androidTestCompile parent.ext.supportTestRunner
androidTestCompile parent.ext.supportTestRules
androidTestCompile parent.ext.awaitility
androidTestImplementation parent.ext.supportTestEspressoCore
androidTestImplementation parent.ext.supportTestEspressoContrib
androidTestImplementation parent.ext.supportTestRunner
androidTestImplementation parent.ext.supportTestRules
androidTestImplementation parent.ext.awaitility
}

buildscript {
Expand All @@ -80,4 +81,7 @@ publish {

tasks.withType(Javadoc) {
enabled = false
}
repositories {
mavenCentral()
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class AndroidBindingConsumer<out E, T>(item: E,

private object Threads {
val mainThreadHandler = Handler(Looper.getMainLooper())
val mainThread = Looper.getMainLooper().thread
val mainThread: Thread = Looper.getMainLooper().thread
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ private class ReadWriteLazyVal<T>(private val initializer: () -> T) : ReadWriteP

private var value: Any? = null

operator override fun getValue(thisRef: Any?, property: KProperty<*>): T {
override operator fun getValue(thisRef: Any?, property: KProperty<*>): T {
if (value == null) {
value = (initializer()) ?: throw IllegalStateException("Initializer block of property ${property.name} return null")
}
@Suppress("UNCHECKED_CAST")
return value as T
}

operator override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) {
override operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T) {
this.value = value
}

Expand Down
6 changes: 3 additions & 3 deletions reactiveandroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ repositories {
}

dependencies {
compile parent.ext.kotlinStdLib
compile parent.ext.reactivexRxJava2
api parent.ext.kotlinStdLib
api parent.ext.reactivexRxJava2

sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6

testCompile parent.ext.junit
testImplementation parent.ext.junit
}

buildscript {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ExtensionFieldDelegate<in R, T : Any>(private val initializer: (R) -> T,
private val map = WeakIdentityHashMap<R, T>()

operator fun getValue(ref: R, property: KProperty<*>): T =
map.getOrPut(ref, { setValue(ref, property, initializer(ref)) })
map.getOrPut(ref) { setValue(ref, property, initializer(ref)) }

operator fun setValue(ref: R, property: KProperty<*>, value: T): T {
ref.builder(value)
Expand All @@ -25,7 +25,7 @@ class FieldDelegate<in T, U : Any>(private val initializer: (T) -> U,
private val map = WeakIdentityHashMap<T, U>()

operator fun getValue(ref: T, property: KProperty<*>): U =
map.getOrPut(ref, { setValue(ref, property, initializer(ref)) })
map.getOrPut(ref) { setValue(ref, property, initializer(ref)) }

operator fun setValue(ref: T, property: KProperty<*>, value: U): U {
ref.builder(value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ interface PropertyType<T> {

val observable: Observable<T>

fun subscribe(observer: Observer<T>) = observable.subscribeWith(observer)
fun subscribe(observer: Observer<T>): Observer<T> = observable.subscribeWith(observer)

fun subscribe(onNext: (T) -> Unit) = observable.subscribe(onNext)
fun subscribe(onNext: (T) -> Unit): Disposable = observable.subscribe(onNext)

fun subscribe(onNext: (T) -> Unit, onError: (Throwable) -> Unit) = observable.subscribe(onNext, onError)
fun subscribe(onNext: (T) -> Unit, onError: (Throwable) -> Unit): Disposable = observable.subscribe(onNext, onError)

fun subscribe(onNext: (T) -> Unit, onError: (Throwable) -> Unit, onComplete: () -> Unit) = observable.subscribe(onNext, onError, onComplete)
fun subscribe(onNext: (T) -> Unit, onError: (Throwable) -> Unit, onComplete: () -> Unit): Disposable = observable.subscribe(onNext, onError, onComplete)

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import io.reactivex.functions.Function3

object Observables {

inline fun <T1, T2, R> combineLatest(s1: Observable<T1>, s2: Observable<T2>, crossinline f: (T1, T2) -> R) =
inline fun <T1, T2, R> combineLatest(s1: Observable<T1>, s2: Observable<T2>, crossinline f: (T1, T2) -> R): Observable<R> =
Observable.combineLatest<T1, T2, R>(s1, s2, BiFunction { t1, t2 -> f(t1, t2) })

inline fun <T1, T2, T3, R> combineLatest(s1: Observable<T1>, s2: Observable<T2>, s3: Observable<T3>, crossinline f: (T1, T2, T3) -> R) =
inline fun <T1, T2, T3, R> combineLatest(s1: Observable<T1>, s2: Observable<T2>, s3: Observable<T3>, crossinline f: (T1, T2, T3) -> R): Observable<R> =
Observable.combineLatest<T1, T2, T3, R>(s1, s2, s3, Function3 { t1, t2, t3 -> f(t1, t2, t3) })
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ fun <T> Observable<T>.cachedPrevious(): Observable<Pair<T?, T?>> {
.skip(1)
}

inline fun <reified T> Observable<in T>.ofType() = ofType(T::class.java)
inline fun <reified T> Observable<in T>.ofType(): Observable<T> = ofType(T::class.java)
1 change: 1 addition & 0 deletions reactiveandroidx-appcompat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
Loading