Skip to content

Commit

Permalink
Update dependencies and update README to match branch names
Browse files Browse the repository at this point in the history
  • Loading branch information
Serchinastico committed May 21, 2019
1 parent 29367d1 commit 64e3b73
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 44 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This repository contains an Android application to show Super Heroes information

This Application is based on three Activities:

* ``MainActivity`` showing a list of super heroes with name, photo and a special badge if it is part of the Avengers Team.
- ``MainActivity`` showing a list of super heroes with name, photo and a special badge if it is part of the Avengers Team.

![MainActivity screenhot][mainActivityScreenshot]

Expand Down Expand Up @@ -42,17 +42,15 @@ To be able to get a deterministic test scenario all our tests will be executed o

## Tasks

Your task as Android Developer is to **migrate the application to Jetpack components**. You will do so step by step and always using tests to verify everything is still working.

**This repository is ready to build the application, pass the checkstyle and your tests in Travis-CI environments.**
Your task as Android Developer is to **migrate the application to Jetpack architecture components**. You will do so step by step and always using tests to verify everything is still working.

Our recommendation for this exercise is:

- Before starting
1. Fork this repository.
2. Checkout `kata-jetpack` branch.
2. Checkout `00-start` branch.
3. Execute the application, explore it manually and make yourself familiar with the code.
4. Execute `MainActivityTest` and `SuperHeroDetailActivityTest` to see tests run.
4. Execute `MainActivityTest`, `SuperHeroDetailActivityTest` and `EditSuperHeroActivityTest` to see tests run.
- Feel free to migrate at your own pace and order but if you want to make it a bit easier, follow this order:
1. [Lifecycle][lifecycle]
2. [Room][room]
Expand All @@ -63,7 +61,7 @@ Our recommendation for this exercise is:

## Considerations

If you get stuck, `master` branch contains the finished kata using all architecture components. There are also tags for every single new component following the above order.
If you get stuck, `master` branch contains the finished kata using all architecture components. There are also tags for every single new component following the above order and PRs for them showcasing what are the steps we followed to migrate the whole project.

---

Expand Down Expand Up @@ -117,4 +115,4 @@ limitations under the License.
[androidDataBindingCodelab]: https://codelabs.developers.google.com/codelabs/android-room-with-a-view-kotlin/index.html#0
[androidPagingCodelab]: https://codelabs.developers.google.com/codelabs/android-paging/index.html#0
[androidLifecycleCodelab]: https://codelabs.developers.google.com/codelabs/android-lifecycles/index.html#0
[workManagerCodelab]: https://codelabs.developers.google.com/codelabs/android-workmanager-kt/index.html#0
[workManagerCodelab]: https://codelabs.developers.google.com/codelabs/android-workmanager-kt/index.html#0
28 changes: 12 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ configurations {
}

dependencies {
ktlint 'com.github.shyiko:ktlint:0.29.0'
ktlint "com.pinterest:ktlint:0.32.0"

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
Expand All @@ -39,45 +39,41 @@ dependencies {
implementation 'com.github.salomonbrys.kodein:kodein-android:4.1.0'
implementation 'com.github.salomonbrys.kodein:kodein-conf:4.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1"

testImplementation 'junit:junit:4.12'

testImplementation "org.mockito:mockito-core:2.23.4"
androidTestImplementation "org.mockito:mockito-android:2.23.4"
testImplementation "org.mockito:mockito-core:2.27.0"
androidTestImplementation "org.mockito:mockito-android:2.27.0"
androidTestImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0"
androidTestImplementation "com.github.tmurakami:dexopener:2.0.0"
androidTestImplementation "com.github.tmurakami:dexopener:2.0.2"
androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.2"
androidTestImplementation("com.android.support.test.espresso:espresso-contrib:3.0.2") {
exclude group: "com.android.support"
}
androidTestImplementation "com.android.support.test.espresso:espresso-intents:3.0.2"

androidTestImplementation('com.facebook.testing.screenshot:core:0.8.0') {
exclude group: 'com.crittercism.dexmaker', module: 'dexmaker'
exclude group: 'com.crittercism.dexmaker', module: 'dexmaker-dx'
}

androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.1.0"
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.2.1"
}

shot {
appId = 'com.karumi'
}

task ktlint(type: JavaExec) {
main = "com.github.shyiko.ktlint.Main"
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt"
}

check.dependsOn ktlint

task ktlintFormat(type: JavaExec) {
main = "com.github.shyiko.ktlint.Main"
description = "Fix Kotlin code style deviations."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package com.karumi.jetpack.superheroes.ui.utils

import android.content.Context
import android.widget.ImageView
import com.squareup.picasso.Picasso

fun ImageView.setImageBackground(path: String?) {
if (path != null) {
context.picasso.load(path).fit().centerCrop().fit().into(this)
Picasso.get().load(path).fit().centerCrop().fit().into(this)
}
}

val Context.picasso: Picasso
get() = Picasso.with(this)
}
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
buildscript {
ext.kotlin_version = '1.3.11'
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.karumi:shot:2.1.1'
}
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 @@
#Wed Jan 23 15:21:56 CET 2019
#Tue May 21 11:46:35 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

0 comments on commit 64e3b73

Please sign in to comment.