Skip to content

Commit

Permalink
Resolve #835 Android support androidx libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
npurushe committed Nov 27, 2018
1 parent e19b82e commit e209295
Show file tree
Hide file tree
Showing 20 changed files with 76 additions and 76 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -8,8 +8,8 @@ jdk:
android:
components:
- tools
- build-tools-27.0.3
- android-26
- build-tools-28.0.3
- android-28
- extra

services:
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
@@ -1 +1,3 @@
org.gradle.configureondemand=false
org.gradle.configureondemand=false
android.useAndroidX=true
android.enableJetifier=true
19 changes: 9 additions & 10 deletions requery-android/build.gradle
Expand Up @@ -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
}
Expand All @@ -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"
}

Expand Down
16 changes: 8 additions & 8 deletions requery-android/example-kotlin/build.gradle
Expand Up @@ -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"
}
Expand All @@ -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>'
}
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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)
}
}
Expand Down
@@ -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
Expand Down
@@ -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>
17 changes: 9 additions & 8 deletions requery-android/example/build.gradle
@@ -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"
}
Expand All @@ -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.
Expand All @@ -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 {

Expand Down
@@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
@@ -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.
Expand All @@ -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;
Expand Down
@@ -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.
Expand All @@ -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;
Expand Down
@@ -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.
Expand All @@ -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;
Expand Down
@@ -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.
Expand All @@ -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;
Expand Down
@@ -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.
Expand All @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e209295

Please sign in to comment.