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

PR for migrating to android x, updating firebase dependency and some lint issues #1

Open
wants to merge 2 commits 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
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
targetSdkVersion versions.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "en"
}
buildTypes {
Expand All @@ -28,8 +28,8 @@ dependencies {
implementation project(':space')
implementation project(':dance')
implementation project(':dogos')
implementation "com.android.support:palette-v7:$support.compat"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.palette:palette:1.0.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
127 changes: 0 additions & 127 deletions app/src/main/java/cl/cutiko/firebaseuiauth/Example.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cl.cutiko.firebaseuiauth

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import cl.cutiko.dance.DanceIntent
import cl.cutiko.dance.RC_DANCE_AUTH
import cl.cutiko.dogos.DogosIntent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cl.cutiko.firebaseuiauth.menu

import android.app.Activity
import android.os.Bundle
import android.support.v4.app.Fragment
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -42,13 +42,13 @@ class MenuFragment : Fragment() {
setText(demo, getString(R.string.logged))
return
} else {
var result = ""
val result: String
if (response == null) {
result = getString(R.string.cancelled)
setText(demo, result)
return
}
if (response.getError()?.getErrorCode() == ErrorCodes.NO_NETWORK) {
if (response.error?.errorCode == ErrorCodes.NO_NETWORK) {
result = getString(R.string.no_internet)
setText(demo, result)
return
Expand Down
24 changes: 16 additions & 8 deletions app/src/main/java/cl/cutiko/firebaseuiauth/widgets/IntroView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,40 @@ package cl.cutiko.firebaseuiauth.widgets
import android.content.Context
import android.content.res.ColorStateList
import android.graphics.BitmapFactory
import android.support.annotation.DrawableRes
import android.support.annotation.StringRes
import android.support.v4.content.ContextCompat
import android.support.v7.graphics.Palette
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.core.content.ContextCompat
import androidx.palette.graphics.Palette
import cl.cutiko.firebaseuiauth.R
import kotlinx.android.synthetic.main.content_intro_view.view.*

class IntroView(context: Context?, attrs: AttributeSet?) : FrameLayout(context, attrs) {
class IntroView(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs) {

fun setView(@DrawableRes image : Int, @StringRes text : Int) : View {
fun setView(@DrawableRes image: Int, @StringRes text: Int): View {
LayoutInflater.from(context).inflate(R.layout.content_intro_view, this, true)

val bitmap = BitmapFactory.decodeResource(resources, image)
val palette = Palette.from(bitmap).generate()
val mainColor = palette.getDarkMutedColor(ContextCompat.getColor(context, R.color.blackTransparent))
val mainColor =
palette.getDarkMutedColor(ContextCompat.getColor(context, R.color.blackTransparent))

imageIv.setImageBitmap(bitmap)

overlayIv.backgroundTintList = ColorStateList.valueOf(mainColor)


textIv.setTextColor(palette.getLightVibrantColor(ContextCompat.getColor(context, R.color.white)))
textIv.setTextColor(
palette.getLightVibrantColor(
ContextCompat.getColor(
context,
R.color.white
)
)
)
textIv.setText(text)

return textIv
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_splash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:orientation="vertical"
tools:context=".SplashActivity">

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:background="@color/colorPrimary"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize">
Expand All @@ -19,7 +19,7 @@
android:layout_height="match_parent"
tools:layout="@layout/fragment_menu"/>

</android.support.v7.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>

<cl.cutiko.firebaseuiauth.widgets.IntroView
android:id="@+id/danceIv"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/content_intro_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
android:background="@color/blackTransparent" />

<TextView
tools:text="Texto de Pruebas"
android:textSize="21sp"
android:id="@+id/textIv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center" />
android:gravity="center"
android:textSize="21sp"
tools:text="Texto de Pruebas" />
</merge>
10 changes: 3 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
buildscript {
ext {
versions = [
'kotlin': '1.3.10',
'kotlin': '1.3.72',
'compileSdkVersion': 28,
'targetSdkVersion': 28,
'minSdkVersion': 21
]
support = [
'compat': '28.0.0',
'constraints': '1.1.3'
]

}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.google.gms:google-services:4.3.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
20 changes: 12 additions & 8 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
targetSdkVersion versions.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -25,11 +25,15 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlin"
api "com.android.support:appcompat-v7:$support.compat"
api "com.android.support:support-v4:$support.compat"
api "com.android.support.constraint:constraint-layout:$support.constraint"
api 'com.firebaseui:firebase-ui-auth:4.3.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
api 'androidx.appcompat:appcompat:1.1.0'
api 'androidx.legacy:legacy-support-v4:1.0.0'
api "androidx.constraintlayout:constraintlayout:1.1.3"
api 'com.firebaseui:firebase-ui-auth:5.0.0'

def recyclerViewVersion = "1.1.0"
api "androidx.recyclerview:recyclerview:$recyclerViewVersion"

testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package cl.cutiko.core;

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

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import org.junit.Test;
import org.junit.runner.RunWith;

Expand All @@ -18,7 +20,7 @@ public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();

assertEquals("cl.cutiko.core.test", appContext.getPackageName());
}
Expand Down
8 changes: 4 additions & 4 deletions dance/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
targetSdkVersion versions.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -24,7 +24,7 @@ android {

dependencies {
implementation project(':core')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package cl.cutiko.dance;

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

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import org.junit.Test;
import org.junit.runner.RunWith;

Expand All @@ -18,7 +20,7 @@ public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();

assertEquals("cl.cutiko.dance.test", appContext.getPackageName());
}
Expand Down
Loading