Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #74 from mhacks/androidx-refactor
Browse files Browse the repository at this point in the history
Android X refactor
  • Loading branch information
jeffchang5 authored Oct 1, 2018
2 parents a381d61 + 85dee46 commit d733270
Show file tree
Hide file tree
Showing 99 changed files with 258 additions and 261 deletions.
4 changes: 2 additions & 2 deletions apk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}

Expand All @@ -36,5 +36,5 @@ dependencies {
implementation project(':base')
implementation project(':ui')

implementation "com.android.support:support-v4:$google_play_version"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
24 changes: 12 additions & 12 deletions base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ext {

android {
compileSdkVersion 28
buildToolsVersion "27.0.3"
buildToolsVersion '28.0.2'
baseFeature true
dexOptions {
javaMaxHeapSize "4g"
Expand Down Expand Up @@ -63,9 +63,9 @@ android {
}
}

// dataBinding {
// enabled = true
// }
dataBinding {
enabled = true
}

productFlavors {

Expand All @@ -76,22 +76,22 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$rootProject.kotlin_version"

kapt 'com.android.databinding:compiler:3.1.4'
// kapt 'androidx.databinding:databinding-compiler:3.2.0'

// Play Services
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-messaging:17.3.1'
implementation 'com.google.firebase:firebase-messaging:17.3.2'

implementation "com.android.support:appcompat-v7:$rootProject.google_play_version"
implementation "com.android.support:support-v4:$rootProject.google_play_version"
implementation "com.android.support:support-media-compat:$rootProject.google_play_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.media:media:1.0.0'

// Networking
implementation 'com.squareup.retrofit2:converter-moshi:2.4.0'

// Persistence
implementation "android.arch.persistence.room:runtime:$rootProject.room_version"
implementation "android.arch.persistence.room:rxjava2:$rootProject.room_version"
implementation 'androidx.room:room-runtime:2.0.0-rc01'
implementation 'androidx.room:room-rxjava2:2.0.0-rc01'

// RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
Expand All @@ -101,7 +101,7 @@ dependencies {
// Debugging
implementation 'com.jakewharton.timber:timber:4.7.0'

kapt "android.arch.persistence.room:compiler:$room_version"
kapt 'androidx.room:room-compiler:2.0.0-rc01'

feature project(':ui')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mhacks.app.data.models

import android.arch.persistence.room.Entity
import android.arch.persistence.room.PrimaryKey
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.squareup.moshi.Json

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mhacks.app.data.models
import android.arch.persistence.room.Entity
import android.arch.persistence.room.PrimaryKey

import androidx.room.*
import com.squareup.moshi.Json

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.mhacks.app.data.models

import android.arch.persistence.room.Entity
import android.arch.persistence.room.PrimaryKey
import androidx.room.*
import android.os.Parcel
import android.os.Parcelable
import com.squareup.moshi.Json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mhacks.app.data.models
import android.arch.persistence.room.Entity
import android.arch.persistence.room.PrimaryKey
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.squareup.moshi.Json

/**
Expand Down
2 changes: 1 addition & 1 deletion base/src/main/java/com/mhacks/app/data/models/Login.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.mhacks.app.data.models
* Model for storing login information.
*/

import android.arch.persistence.room.*
import androidx.room.*
import com.squareup.moshi.Json

@Entity(tableName = "login")
Expand Down
9 changes: 5 additions & 4 deletions base/src/main/java/com/mhacks/app/data/models/User.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.mhacks.app.data.models

import android.arch.persistence.room.ColumnInfo
import android.arch.persistence.room.Entity
import android.arch.persistence.room.PrimaryKey
import android.arch.persistence.room.TypeConverters

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import com.mhacks.app.data.room.Converters
import com.squareup.moshi.Json

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mhacks.app.data.models.common

import android.support.annotation.StringRes
import androidx.annotation.StringRes

data class TextMessage(
@StringRes val textResId: Int?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.mhacks.app.data.network.fcm
import android.app.Notification
import android.content.Intent
import android.provider.Settings
import android.support.v4.app.NotificationCompat
import android.support.v4.app.NotificationManagerCompat
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import com.mhacks.app.R
Expand Down
2 changes: 1 addition & 1 deletion base/src/main/java/com/mhacks/app/data/room/Converters.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mhacks.app.data.room

import android.arch.persistence.room.TypeConverter
import androidx.room.TypeConverter
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.Moshi
import com.squareup.moshi.Types
Expand Down
4 changes: 2 additions & 2 deletions base/src/main/java/com/mhacks/app/data/room/MHacksDatabase.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mhacks.app.data.room

import android.arch.persistence.room.Database
import android.arch.persistence.room.RoomDatabase
import androidx.room.Database
import androidx.room.RoomDatabase
import com.mhacks.app.data.models.*
import com.mhacks.app.data.room.dao.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mhacks.app.data.room.dao

import android.arch.persistence.room.*
import androidx.room.*
import com.mhacks.app.data.models.Announcement
import io.reactivex.Single

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.mhacks.app.data.room.dao

import android.arch.persistence.room.Dao
import android.arch.persistence.room.Insert
import android.arch.persistence.room.OnConflictStrategy
import android.arch.persistence.room.Query
import androidx.room.*
import com.mhacks.app.data.models.Configuration
import io.reactivex.Single

Expand Down
5 changes: 4 additions & 1 deletion base/src/main/java/com/mhacks/app/data/room/dao/EventDao.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.mhacks.app.data.room.dao

import android.arch.persistence.room.*

import android.os.Parcel
import android.os.Parcelable
import androidx.room.*
import com.mhacks.app.data.models.Event
import io.reactivex.Single

Expand Down
8 changes: 4 additions & 4 deletions base/src/main/java/com/mhacks/app/data/room/dao/LoginDao.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.mhacks.app.data.room.dao

import android.arch.persistence.room.Dao
import android.arch.persistence.room.Insert
import android.arch.persistence.room.OnConflictStrategy
import android.arch.persistence.room.Query
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.mhacks.app.data.models.Login
import io.reactivex.Single

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mhacks.app.data.room.dao

import android.arch.persistence.room.*
import androidx.room.*
import com.mhacks.app.data.models.MapFloor
import io.reactivex.Single

Expand Down
8 changes: 4 additions & 4 deletions base/src/main/java/com/mhacks/app/data/room/dao/UserDao.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.mhacks.app.data.room.dao

import android.arch.persistence.room.Dao
import android.arch.persistence.room.Insert
import android.arch.persistence.room.OnConflictStrategy
import android.arch.persistence.room.Query
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.mhacks.app.data.models.User
import io.reactivex.Single

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
buildscript {

ext {
dagger_version = '2.17'
dagger_version = '2.16'
kotlin_version = '1.2.70'
anko_version = '0.10.0'
room_version = '1.1.1'
Expand All @@ -16,7 +16,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
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 @@
#Fri Sep 07 19:14:36 PDT 2018
#Sun Sep 30 21:55:03 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
27 changes: 13 additions & 14 deletions ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ android {
versionCode 3
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

Expand All @@ -40,7 +39,7 @@ dependencies {

testImplementation 'junit:junit:4.12'

kapt 'com.android.databinding:compiler:3.1.4'
// kapt 'androidx.databinding:databinding-compiler:3.2.0'

implementation "com.google.dagger:dagger:$rootProject.dagger_version"
implementation "com.google.dagger:dagger-android-support:$rootProject.dagger_version"
Expand All @@ -51,14 +50,14 @@ dependencies {
implementation 'com.google.android.gms:play-services-vision:15.0.2'

// Support libraries
implementation "com.android.support:appcompat-v7:$rootProject.google_play_version"
implementation "com.android.support:support-v4:$rootProject.google_play_version"
implementation "com.android.support:cardview-v7:$rootProject.google_play_version"
implementation "com.android.support:recyclerview-v7:$rootProject.google_play_version"
implementation "com.android.support:design:$rootProject.google_play_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'

// View
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'com.github.kenglxn.QRGen:android:2.2.0'
implementation 'com.github.vipulasri:timelineview:1.0.5'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
Expand All @@ -76,19 +75,19 @@ dependencies {
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'

// Persistence
implementation "android.arch.persistence.room:runtime:$rootProject.room_version"
implementation "android.arch.persistence.room:rxjava2:$rootProject.room_version"
implementation 'androidx.room:room-runtime:2.0.0-rc01'
implementation 'androidx.room:room-rxjava2:2.0.0-rc01'

// RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'

// Architecture Components
implementation "android.arch.lifecycle:extensions:$rootProject.lifecycle_version"
implementation "android.arch.lifecycle:reactivestreams:$rootProject.lifecycle_version"
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.lifecycle:lifecycle-reactivestreams:2.0.0'

kapt "android.arch.lifecycle:compiler:$rootProject.lifecycle_version"
kapt 'androidx.lifecycle:lifecycle-compiler:2.0.0'

// Debugging
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mhacks.app.adapter

import android.databinding.BindingAdapter
import androidx.databinding.BindingAdapter
import com.mhacks.app.data.models.common.TextMessage
import com.mhacks.app.ui.common.ProgressWheel

Expand Down
4 changes: 2 additions & 2 deletions ui/src/main/java/com/mhacks/app/di/MHacksViewModelFactory.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mhacks.app.di

import android.arch.lifecycle.ViewModel
import android.arch.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import javax.inject.Inject
import javax.inject.Provider

Expand Down
2 changes: 1 addition & 1 deletion ui/src/main/java/com/mhacks/app/di/ViewModelKey.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mhacks.app.di

import android.arch.lifecycle.ViewModel
import androidx.lifecycle.ViewModel
import dagger.MapKey
import kotlin.reflect.KClass

Expand Down
2 changes: 1 addition & 1 deletion ui/src/main/java/com/mhacks/app/di/ViewModelModule.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mhacks.app.di

import android.arch.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelProvider
import dagger.Binds
import dagger.Module

Expand Down
3 changes: 1 addition & 2 deletions ui/src/main/java/com/mhacks/app/di/module/RoomModule.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.mhacks.app.di.module

import android.app.Application
import android.arch.persistence.room.Room
import androidx.room.Room
import com.mhacks.app.data.room.MHacksDatabase
import com.mhacks.app.data.room.dao.LoginDao
import dagger.Module
import dagger.Provides
import javax.inject.Singleton
Expand Down
4 changes: 2 additions & 2 deletions ui/src/main/java/com/mhacks/app/extension/View.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.mhacks.app.extension

import android.support.annotation.StringRes
import android.support.design.widget.Snackbar
import android.view.View
import androidx.annotation.StringRes
import com.google.android.material.snackbar.Snackbar
import com.mhacks.app.data.models.common.TextMessage

fun View.showSnackBar(duration: Int, textMessage: TextMessage?) {
Expand Down
Loading

0 comments on commit d733270

Please sign in to comment.