Skip to content

Commit

Permalink
Merge pull request #4 from skedgo/emm/migrate-to-androidx
Browse files Browse the repository at this point in the history
Migrate to androidx
  • Loading branch information
thuutin authored Nov 6, 2018
2 parents 705f2a9 + cbba044 commit 8eb74e5
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ android:

# The BuildTools version used by your project
- build-tools-27.0.3
- build-tools-28.0.3

# The SDK version used to compile your project
- android-27
- android-28

# Additional components
- extra-android-m2repository
Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.androidPluginVersion = "3.1.3"
ext.kotlinVersion = "1.2.41"
ext.androidPluginVersion = "3.2.1"
ext.kotlinVersion = "1.2.71"

repositories {
google()
Expand All @@ -27,15 +27,15 @@ repositories {
}

android {
compileSdkVersion 27
compileSdkVersion 28

defaultConfig {
minSdkVersion 15
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
dataBinding { enabled = true }

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

compileOptions {
Expand All @@ -49,7 +49,7 @@ android {

dependencies {
testImplementation "junit:junit:4.12"
implementation "io.reactivex:rxjava:1.2.4"
implementation "io.reactivex:rxjava:1.3.5"
implementation "androidx.core:core:1.0.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
kapt "com.android.databinding:compiler:3.1.3"
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
android.databinding.enableV2=true
android.useAndroidX=true
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':RxProperty'
6 changes: 3 additions & 3 deletions src/main/java/skedgo/rxproperty/RxObservableBoolean.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package skedgo.rxproperty

import android.databinding.ObservableBoolean
import androidx.databinding.ObservableBoolean
import rx.Observable
import rx.subscriptions.Subscriptions

Expand All @@ -13,8 +13,8 @@ fun ObservableBoolean.asObservable(): Observable<Boolean> {
return Observable.create {
// To emit the current value.
it.onNext(get())
val callback = object : android.databinding.Observable.OnPropertyChangedCallback() {
override fun onPropertyChanged(sender: android.databinding.Observable?, propertyId: Int) {
val callback = object : androidx.databinding.Observable.OnPropertyChangedCallback() {
override fun onPropertyChanged(sender: androidx.databinding.Observable?, propertyId: Int) {
it.onNext(get())
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/skedgo/rxproperty/RxObservableField.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package skedgo.rxproperty

import android.databinding.ObservableField
import androidx.databinding.ObservableField
import androidx.databinding.Observable.OnPropertyChangedCallback
import rx.Observable
import rx.subscriptions.Subscriptions

Expand All @@ -13,8 +14,8 @@ fun <T> ObservableField<T>.asObservable(): Observable<T> {
return Observable.create {
// To emit the current value.
it.onNext(get())
val callback = object : android.databinding.Observable.OnPropertyChangedCallback() {
override fun onPropertyChanged(sender: android.databinding.Observable?, propertyId: Int) {
val callback = object : OnPropertyChangedCallback() {
override fun onPropertyChanged(sender: androidx.databinding.Observable?, propertyId: Int) {
it.onNext(get())
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/skedgo/rxproperty/RxObservableInt.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package skedgo.rxproperty

import android.databinding.ObservableInt
import androidx.databinding.ObservableInt
import rx.Observable
import androidx.databinding.Observable.OnPropertyChangedCallback
import rx.subscriptions.Subscriptions

/**
Expand All @@ -12,8 +13,8 @@ import rx.subscriptions.Subscriptions
fun ObservableInt.asObservable(): Observable<Int> = Observable.create {
// To emit the current value.
it.onNext(get())
val callback = object : android.databinding.Observable.OnPropertyChangedCallback() {
override fun onPropertyChanged(sender: android.databinding.Observable?, propertyId: Int) {
val callback = object : OnPropertyChangedCallback() {
override fun onPropertyChanged(sender: androidx.databinding.Observable?, propertyId: Int) {
it.onNext(get())
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/skedgo/rxproperty/RxObservableList.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package skedgo.rxproperty

import android.databinding.ObservableList
import android.databinding.ObservableList.OnListChangedCallback
import androidx.databinding.ObservableList
import androidx.databinding.ObservableList.OnListChangedCallback
import rx.Observable
import rx.subscriptions.Subscriptions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package skedgo.rxproperty

import android.databinding.ObservableBoolean
import androidx.databinding.ObservableBoolean
import org.junit.Test
import rx.observers.TestSubscriber

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/skedgo/rxproperty/RxObservableListKtTest.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package skedgo.rxproperty

import android.databinding.ObservableArrayList
import android.databinding.ObservableList
import androidx.databinding.ObservableArrayList
import androidx.databinding.ObservableList
import org.junit.Test
import rx.observers.TestSubscriber

Expand Down

0 comments on commit 8eb74e5

Please sign in to comment.