Skip to content
Permalink
Browse files

Resolve #835 Android support androidx libraries

  • Loading branch information...
npurushe committed Nov 27, 2018
1 parent e19b82e commit e209295de92ea9036fd731c9d4c988198d069770
Showing with 76 additions and 76 deletions.
  1. +2 −2 .travis.yml
  2. +5 −5 build.gradle
  3. +3 −1 gradle.properties
  4. +9 −10 requery-android/build.gradle
  5. +8 −8 requery-android/example-kotlin/build.gradle
  6. +7 −8 requery-android/example-kotlin/src/main/kotlin/io/requery/android/example/app/PeopleActivity.kt
  7. +1 −1 requery-android/example-kotlin/src/main/kotlin/io/requery/android/example/app/PersonEditActivity.kt
  8. +2 −2 requery-android/example-kotlin/src/main/res/layout/activity_people.xml
  9. +9 −8 requery-android/example/build.gradle
  10. +3 −3 requery-android/example/src/main/java/io/requery/android/example/app/BindingHolder.java
  11. +5 −5 requery-android/example/src/main/java/io/requery/android/example/app/PeopleActivity.java
  12. +3 −3 requery-android/example/src/main/java/io/requery/android/example/app/PersonEditActivity.java
  13. +3 −3 requery-android/example/src/main/java/io/requery/android/example/app/model/Address.java
  14. +3 −3 requery-android/example/src/main/java/io/requery/android/example/app/model/Person.java
  15. +3 −3 requery-android/example/src/main/java/io/requery/android/example/app/model/Phone.java
  16. +2 −2 requery-android/example/src/main/res/layout/activity_people.xml
  17. +3 −4 requery-android/src/androidTest/java/io/requery/test/SqliteFunctionalTest.java
  18. +2 −2 requery-android/src/main/java/io/requery/android/QueryRecyclerAdapter.kt
  19. +2 −2 requery-processor/src/main/java/io/requery/processor/AndroidObservableExtension.java
  20. +1 −1 requery-test/kotlin-test/src/main/kotlin/io/requery/test/kt/data/Person.kt
@@ -8,8 +8,8 @@ jdk:
android:
components:
- tools
- build-tools-27.0.3
- android-26
- build-tools-28.0.3
- android-28
- extra

services:
@@ -3,19 +3,19 @@ apply plugin: 'idea'
apply plugin: 'maven-publish'

buildscript {
ext.android_buildtools_version = '27.0.3'
ext.android_support_version = '26.1.0'
ext.android_buildtools_version = '28.0.3'
ext.androidx_version = '1.0.0'
ext.jackson_version = '2.8.6'
ext.jpa_version = '2.1.1'
ext.kotlin_version = '1.2.71'
ext.rxjava2_version = '2.1.9'
ext.reactor_version = '3.1.4.RELEASE'
ext.rxjava2_version = '2.2.3'
ext.reactor_version = '3.2.2.RELEASE'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.8"
@@ -1 +1,3 @@
org.gradle.configureondemand=false
org.gradle.configureondemand=false
android.useAndroidX=true
android.enableJetifier=true
@@ -10,15 +10,15 @@ apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'

android {
compileSdkVersion 26
compileSdkVersion 28
buildToolsVersion "$android_buildtools_version"

defaultConfig {
minSdkVersion 14
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'proguard-rules.pro'
multiDexEnabled true
}
@@ -39,16 +39,15 @@ android {

dependencies {
implementation project(':requery')
implementation 'android.arch.persistence:db:1.1.1'
implementation "com.android.support:support-v4:$android_support_version"
implementation "com.android.support:recyclerview-v7:$android_support_version"
implementation 'androidx.sqlite:sqlite:2.0.0'
implementation "androidx.recyclerview:recyclerview:$androidx_version"
implementation 'net.zetetic:android-database-sqlcipher:3.5.9'
implementation 'io.requery:sqlite-android:3.25.2'
implementation 'io.requery:sqlite-android:3.25.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation project(':requery-test')
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support:multidex:1.0.3'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test:rules:1.1.0'
androidTestImplementation 'androidx.multidex:multidex:2.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

@@ -8,13 +8,13 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 26
compileSdkVersion 28
buildToolsVersion "$android_buildtools_version"

defaultConfig {
applicationId "io.requery.android.example.kotlinapp"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
@@ -33,13 +33,13 @@ android {
}

dependencies {
implementation "com.android.support:appcompat-v7:$android_support_version"
implementation "com.android.support:recyclerview-v7:$android_support_version"
implementation "androidx.appcompat:appcompat:$androidx_version"
implementation "androidx.recyclerview:recyclerview:$androidx_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "io.reactivex.rxjava2:rxjava:$rxjava2_version"
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.requery:requery:1.5.1'
implementation 'io.requery:requery-android:1.5.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation project(':requery') // replace with 'io.requery:requery:<version>'
implementation project(':requery-android') // replace with 'io.requery:requery-android:<version>'
implementation 'io.requery:requery-kotlin:1.5.1'
kapt 'io.requery:requery-processor:1.5.1'
kapt project(':requery-processor') // // replace with 'io.requery:requery-processor:<version>'
}
@@ -3,13 +3,12 @@ package io.requery.android.example.app
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.support.v7.widget.RecyclerView.ViewHolder
import android.view.*
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import io.reactivex.Observable
import io.reactivex.schedulers.Schedulers
import io.requery.Persistable
@@ -83,7 +82,7 @@ class PeopleActivity : AppCompatActivity() {
super.onDestroy()
}

internal inner class PersonHolder(itemView: View) : ViewHolder(itemView) {
internal inner class PersonHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
var image : ImageView? = null
var name : TextView? = null
}
@@ -99,8 +98,8 @@ class PeopleActivity : AppCompatActivity() {
return ( data select(Person::class) orderBy Person::name.lower() ).get()
}

override fun onBindViewHolder(item: Person, holder: PersonHolder, position: Int) {
holder.name!!.text = item.name
override fun onBindViewHolder(item: Person?, holder: PersonHolder, position: Int) {
holder.name!!.text = item!!.name
holder.image!!.setBackgroundColor(colors[random.nextInt(colors.size)])
holder.itemView.tag = item
}
@@ -119,7 +118,7 @@ class PeopleActivity : AppCompatActivity() {
val person = v.tag as PersonEntity?
if (person != null) {
val intent = Intent(this@PeopleActivity, PersonEditActivity::class.java)
intent.putExtra(PersonEditActivity.Companion.EXTRA_PERSON_ID, person.id)
intent.putExtra(PersonEditActivity.EXTRA_PERSON_ID, person.id)
startActivity(intent)
}
}
@@ -1,7 +1,7 @@
package io.requery.android.example.app

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.view.Menu
import android.view.MenuItem
import android.widget.TextView
@@ -1,8 +1,8 @@
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

</android.support.v7.widget.RecyclerView>
</androidx.recyclerview.widget.RecyclerView>
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
compileSdkVersion 28
buildToolsVersion "$android_buildtools_version"

defaultConfig {
applicationId "io.requery.android.example.app"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
@@ -26,11 +26,12 @@ android {
}

dependencies {
implementation "com.android.support:appcompat-v7:$android_support_version"
implementation "com.android.support:recyclerview-v7:$android_support_version"
implementation "androidx.appcompat:appcompat:$androidx_version"
implementation "androidx.recyclerview:recyclerview:$androidx_version"
implementation "io.reactivex.rxjava2:rxjava:$rxjava2_version"
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.requery:requery:1.5.1'
implementation 'io.requery:requery-android:1.5.1'
annotationProcessor 'io.requery:requery-processor:1.5.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation project(':requery') // replace with 'io.requery:requery:<version>'
implementation project(':requery-android') // replace with 'io.requery:requery-android:<version>'
implementation 'androidx.multidex:multidex:2.0.0'
annotationProcessor project(':requery-processor') // replace with 'io.requery:requery-processor:<version>'
}
@@ -1,5 +1,5 @@
/*
* Copyright 2016 requery.io
* Copyright 2018 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@

package io.requery.android.example.app;

import android.databinding.ViewDataBinding;
import android.support.v7.widget.RecyclerView;
import androidx.databinding.ViewDataBinding;
import androidx.recyclerview.widget.RecyclerView;

class BindingHolder<B extends ViewDataBinding> extends RecyclerView.ViewHolder {

@@ -1,5 +1,5 @@
/*
* Copyright 2016 requery.io
* Copyright 2018 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,14 +19,14 @@
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import io.reactivex.Observable;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
@@ -60,7 +60,7 @@ protected void onCreate(Bundle savedInstanceState) {
getSupportActionBar().setTitle("People");
}
setContentView(R.layout.activity_people);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
RecyclerView recyclerView = findViewById(R.id.recyclerView);
data = ((PeopleApplication) getApplication()).getData();
executor = Executors.newSingleThreadExecutor();
adapter = new PersonAdapter();
@@ -1,5 +1,5 @@
/*
* Copyright 2017 requery.io
* Copyright 2018 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,9 +16,9 @@

package io.requery.android.example.app;

import android.databinding.DataBindingUtil;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import io.reactivex.Single;
@@ -1,5 +1,5 @@
/*
* Copyright 2016 requery.io
* Copyright 2018 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@
package io.requery.android.example.app.model;


import android.databinding.Bindable;
import android.databinding.Observable;
import androidx.databinding.Bindable;
import androidx.databinding.Observable;
import android.os.Parcelable;
import io.requery.Entity;
import io.requery.Generated;
@@ -1,5 +1,5 @@
/*
* Copyright 2016 requery.io
* Copyright 2018 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@

package io.requery.android.example.app.model;

import android.databinding.Bindable;
import android.databinding.Observable;
import androidx.databinding.Bindable;
import androidx.databinding.Observable;
import android.os.Parcelable;
import io.requery.CascadeAction;
import io.requery.Column;
@@ -1,5 +1,5 @@
/*
* Copyright 2016 requery.io
* Copyright 2018 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@

package io.requery.android.example.app.model;

import android.databinding.Bindable;
import android.databinding.Observable;
import androidx.databinding.Bindable;
import androidx.databinding.Observable;
import android.os.Parcelable;
import io.requery.Entity;
import io.requery.Generated;
@@ -1,8 +1,8 @@
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

</android.support.v7.widget.RecyclerView>
</androidx.recyclerview.widget.RecyclerView>
@@ -1,5 +1,5 @@
/*
* Copyright 2016 requery.io
* Copyright 2018 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
package io.requery.test;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import androidx.test.InstrumentationRegistry;
import io.requery.android.sqlcipher.SqlCipherDatabaseSource;
import io.requery.android.sqlite.DatabaseProvider;
import io.requery.android.sqlite.DatabaseSource;
@@ -28,7 +28,6 @@
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collection;

@@ -71,7 +70,7 @@ public SqliteFunctionalTest(Type type) {
}

@Override
public void setup() throws SQLException {
public void setup() {
dataSource.setLoggingEnabled(true);
Context context = InstrumentationRegistry.getContext();
context.deleteDatabase(dbName);
Oops, something went wrong.

0 comments on commit e209295

Please sign in to comment.
You can’t perform that action at this time.