Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated to AndroidX #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'

android {
compileSdkVersion 25
compileSdkVersion 28
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.yuki312.androiddaggersample"
minSdkVersion 19
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand All @@ -32,12 +32,12 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
androidTestCompile('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.code.findbugs', module: 'jsr305'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'androidx.appcompat:appcompat:1.0.0'
compile 'androidx.constraintlayout:constraintlayout:1.1.3'
testCompile 'junit:junit:4.12'

// Core dependencies
Expand All @@ -52,7 +52,7 @@ dependencies {
compile 'com.google.dagger:dagger-android-support:2.11-rc1'

// Architecture components
compile "android.arch.lifecycle:runtime:1.0.0-alpha1"
compile "android.arch.lifecycle:extensions:1.0.0-alpha1"
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha1"
compile 'androidx.lifecycle:lifecycle-runtime:2.0.0'
compile 'androidx.lifecycle:lifecycle-extensions:2.0.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.0.0'
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.yuki312.androiddaggersample;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.yuki312.androiddaggersample;

import android.arch.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelProvider;
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.yuki312.androiddaggersample;

import android.arch.lifecycle.ViewModelProvider;
import android.arch.lifecycle.ViewModelProviders;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelProviders;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.support.v7.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.yuki312.androiddaggersample.databinding.ActivityMainBinding;
import dagger.android.AndroidInjection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.yuki312.androiddaggersample;

import android.arch.lifecycle.ViewModel;
import androidx.lifecycle.ViewModel;
import javax.inject.Inject;

public class MyViewModel extends ViewModel {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.yuki312.androiddaggersample;

import android.arch.lifecycle.ViewModel;
import android.arch.lifecycle.ViewModelProvider;
import android.support.v4.util.ArrayMap;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import androidx.collection.ArrayMap;
import java.util.Map;
import java.util.concurrent.Callable;
import javax.inject.Inject;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<data/>

<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
Expand All @@ -17,5 +17,5 @@
android:text='@{"Start Activity" + context.hashCode()}'
/>

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:3.2.0'

classpath 'me.tatarka:gradle-retrolambda:3.3.1'
// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -21,6 +25,10 @@ allprojects {
// Caution: Architecture Components are still in alpha. Expect breaking changes before the 1.0 release.
// https://developer.android.com/topic/libraries/architecture/adding-components.html
maven { url 'https://maven.google.com' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Apr 27 14:00:10 JST 2017
#Wed Oct 09 22:40:10 IST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip