Skip to content
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: 10 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ android {
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:${rootProject.SUPPORT_VERSION}"
implementation "com.android.support.constraint:constraint-layout:${rootProject.CONSTRAINT_VERSION}"
implementation "com.android.support:recyclerview-v7:${rootProject.SUPPORT_VERSION}"
implementation "com.android.support:design:${rootProject.SUPPORT_VERSION}"
implementation "androidx.appcompat:appcompat:${rootProject.ANDROIDX_APPCOMPAT_VERSION}"
implementation "androidx.constraintlayout:constraintlayout:${rootProject.ANDROIDX_CONSTRAINT_VERSION}"
implementation "androidx.recyclerview:recyclerview:${rootProject.ANDROIDX_RECYCLER_VERSION}"
// implementation "com.google.android.material:material:1.0.0"

// retrofit
implementation "com.squareup.retrofit2:retrofit:${rootProject.RETROFIT_VERSION}"
Expand All @@ -82,11 +82,13 @@ dependencies {

testImplementation "junit:junit:${rootProject.JUNIT_VERSION}"

androidTestImplementation "com.android.support.test:runner:${rootProject.RUNNER_VERSION}"
androidTestImplementation "com.android.support.test.espresso:espresso-core:${rootProject.ESPRESSO_VERSION}"
androidTestImplementation "androidx.test:core:${rootProject.TEST_CORE_VERSION}"
androidTestImplementation "androidx.test:rules:${rootProject.TEST_RULES_VERSION}"
androidTestImplementation "androidx.test.ext:junit:${rootProject.TEST_EXT_JUNIT_VERSION}"
androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ESPRESSO_VERSION}"

androidTestImplementation 'com.squareup.assertj:assertj-android:1.2.0'
androidTestImplementation 'org.assertj:assertj-core:3.6.2'
androidTestImplementation "com.squareup.assertj:assertj-android:${rootProject.ASSERTJ_ANDROID_VERSION}"
androidTestImplementation "org.assertj:assertj-core:${rootProject.ASSERTJ_VERSION}"

testImplementation "org.mockito:mockito-core:${rootProject.MOCKITO_VERSION}"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:${rootProject.MOCKITO_KOTLIN_VERSION}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import android.content.Context
import android.content.pm.PackageManager
import android.os.Bundle
import android.os.IBinder
import android.support.test.runner.AndroidJUnitRunner
import androidx.test.runner.AndroidJUnitRunner
import android.util.Log

import java.lang.reflect.Method
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package app.we.go.emojidraw.api

import android.util.Log

import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import org.junit.Before
import org.junit.Ignore
import org.junit.Test

import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
Expand Down Expand Up @@ -79,4 +77,3 @@ class EmojiDetectionProviderTest {
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.we.go.emojidraw.data

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 app.we.go.emojidraw.model.Emoji
import app.we.go.emojidraw.util.EmojiFileReader
import junit.framework.Assert.assertEquals
Expand All @@ -22,7 +22,7 @@ class RandomEmojiToDrawProviderTest {
@Before
@Throws(Exception::class)
fun setUp() {
val context = InstrumentationRegistry.getTargetContext()
val context = InstrumentationRegistry.getInstrumentation().targetContext
val reader = EmojiFileReader(context)
emojiList = reader.emojiList
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
package app.we.go.emojidraw.features.practice

import android.support.test.espresso.matcher.ViewMatchers
import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4

import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.swipeRight
import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import app.we.go.emojidraw.R
import app.we.go.emojidraw.ThisApplication
import app.we.go.emojidraw.arch.di.TestApplicationComponent
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

import app.we.go.emojidraw.R
import app.we.go.emojidraw.ThisApplication
import app.we.go.emojidraw.arch.di.TestApplicationComponent

import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.action.ViewActions.click
import android.support.test.espresso.action.ViewActions.swipeRight
import android.support.test.espresso.assertion.ViewAssertions.doesNotExist
import android.support.test.espresso.assertion.ViewAssertions.matches
import android.support.test.espresso.matcher.ViewMatchers.isDisplayed
import android.support.test.espresso.matcher.ViewMatchers.withId
import android.support.test.espresso.matcher.ViewMatchers.withText

@RunWith(AndroidJUnit4::class)
class PracticeActivityTest {

@Rule
@JvmField
var rule = ActivityTestRule(PracticeActivity::class.java)
@get:Rule
val rule = ActivityTestRule(PracticeActivity::class.java)

private var duration: Int = 0

Expand All @@ -42,7 +35,7 @@ class PracticeActivityTest {
@Test
fun whenTimeExpires_thenTimeoutPopupShown() {

onView(ViewMatchers.withText(R.string.draw_prompt)).check(matches(isDisplayed()))
onView(withText(R.string.draw_prompt)).check(matches(isDisplayed()))

// Sleeping in an espresso test is not a recommended technique, but in our
// case, this is exactly what we want to do, so that the timer expires
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.we.go.emojidraw.features.main

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.widget.Toast
import app.we.go.emojidraw.R
import app.we.go.emojidraw.features.practice.PracticeActivity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package app.we.go.emojidraw.features.practice

import android.content.Context
import android.support.v7.util.DiffUtil
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import app.we.go.emojidraw.R

class EmojiDetectedAdapter(val context: Context) : RecyclerView.Adapter<EmojiDetectedViewHolder>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package app.we.go.emojidraw.features.practice

import android.animation.ObjectAnimator
import android.animation.PropertyValuesHolder
import android.support.v7.widget.RecyclerView
import android.view.View
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView

class EmojiDetectedViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.we.go.emojidraw.features.practice

import android.support.v7.util.DiffUtil
import androidx.recyclerview.widget.DiffUtil

internal class EmojiDiffCallback(private val newEmojis: List<String>, private val oldEmojis: List<String>) : DiffUtil.Callback() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.os.Handler
import android.support.annotation.LayoutRes
import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.LinearLayoutManager
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.annotation.LayoutRes
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import app.we.go.emojidraw.R
import app.we.go.emojidraw.ThisApplication
import app.we.go.emojidraw.arch.di.PracticeDuration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.we.go.emojidraw.widget

import android.content.Context
import android.support.annotation.StringRes
import androidx.annotation.StringRes
import android.view.Gravity
import android.widget.LinearLayout
import android.widget.TextView
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/app/we/go/emojidraw/widget/DrawingView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Path
import android.support.annotation.ColorInt
import android.support.v4.content.ContextCompat
import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.View
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/drawing_view_with_controls.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/relativeLayout"
Expand Down Expand Up @@ -100,4 +100,4 @@
app:layout_constraintTop_toBottomOf="@+id/drawingArea" />


</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/emoji_timer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.AppCompatTextView
<androidx.appcompat.widget.AppCompatTextView
android:textSize="@dimen/timer_text_size"
android:id="@+id/timerText"
android:textAppearance="@style/emojiTextAppearance"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/main_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
app:srcCompat="@drawable/draw" />
</FrameLayout>

<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
Expand Down Expand Up @@ -74,6 +74,6 @@
app:layout_constraintTop_toBottomOf="@+id/startPracticeButton" />


</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

</LinearLayout>
4 changes: 2 additions & 2 deletions app/src/main/res/layout/popup_generic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
style="@style/popup_window"
tools:parentTag="android.widget.FrameLayout">

<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/popupContainer"
android:layout_width="@dimen/popup_size"
android:layout_height="@dimen/popup_size"
Expand Down Expand Up @@ -51,5 +51,5 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/secondLineTextView" />

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</merge>
10 changes: 5 additions & 5 deletions app/src/main/res/layout/practice_activity.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand All @@ -19,7 +19,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<android.support.v7.widget.AppCompatTextView
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/whatToDrawTextView"
android:layout_width="0dp"
android:layout_height="@dimen/emoji_to_draw_height"
Expand Down Expand Up @@ -70,14 +70,14 @@
android:text="@string/you_are_drawing"
android:textAppearance="@style/defaultTextAppearance" />

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/emojiDetectedRecycler"
android:layout_width="wrap_content"
android:layout_height="@dimen/emoji_detected_height"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp">

</android.support.v7.widget.RecyclerView>
</androidx.recyclerview.widget.RecyclerView>

<RelativeLayout
android:id="@+id/tooltipContainer"
Expand Down Expand Up @@ -120,4 +120,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/emojiDetectedContainer" />

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
22 changes: 18 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.70'
ext.kotlin_version = '1.3.60'

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:3.5.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -28,9 +28,14 @@ task clean(type: Delete) {
}

ext {
ANDROIDX_APPCOMPAT_VERSION = '1.1.0'
ANDROIDX_CONSTRAINT_VERSION = '1.1.3'
ANDROIDX_RECYCLER_VERSION = '1.1.0'
MATERIAL_VERSION = '1.0.0'

DAGGER_VERSION = '2.15'
RUNNER_VERSION = '1.0.1'
SUPPORT_VERSION = '28.0.0-rc02'
SUPPORT_VERSION = '28.0.0'
ASSERTJ_VERSION = '1.1.1'
LEAKCANARY_VERSION = '1.5.1'
GOOGLEPLAY_VERSION = '11.6.0'
Expand All @@ -41,13 +46,22 @@ ext {
ESPRESSO_VERSION = '3.0.1'
MOCKITO_VERSION = '2.8.9'
CRASHLYTICS_VERSION = '2.7.1'

HAMCREST_VERSION = '1.3'
TIMBER_VERSION = '4.7.0'
CONSTRAINT_VERSION = '1.1.3'
AAC_VERSION="1.1.1"
MOCKITO_KOTLIN_VERSION="2.0.0-RC1"

RX_JAVA_VERSION = '2.1.16'
RX_ANDROID_VERSION = '2.0.2'
RX_ANDROID_VERSION = '2.1.1'

ASSERTJ_VERSION = '3.6.0'
ASSERTJ_ANDROID_VERSION = '1.2.0'

TEST_CORE_VERSION = '1.2.0'
TEST_RULES_VERSION = '1.2.0'
TEST_EXT_JUNIT_VERSION = '1.1.1'
ESPRESSO_VERSION = '3.2.0'

}
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 @@
#Fri Sep 14 10:23:24 CEST 2018
#Wed Dec 04 10:34:29 CET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip