From 2b71bd6b0e6c66c08bea2fd4fddaaaec21a3c6aa Mon Sep 17 00:00:00 2001 From: Serchinastico <54cymru@gmail.com> Date: Wed, 30 Jan 2019 12:28:07 +0100 Subject: [PATCH] Replace RelativeLayout by ConstraintLayout. Fix linting and be more consistent with quote usages in build.gradle file --- app/build.gradle | 28 +++++++++--------- ..._showsEmptyCaseIfThereAreNoSuperHeroes.png | Bin 8151 -> 8150 bytes .../superheroes/common/TimeProviders.kt | 1 - app/src/main/res/layout/main_activity.xml | 22 ++++++++++---- .../res/layout/super_hero_detail_activity.xml | 3 +- 5 files changed, 33 insertions(+), 21 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 42adbf2..cba598c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,12 +1,12 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' -apply plugin: 'shot' +apply plugin: "com.android.application" +apply plugin: "kotlin-android" +apply plugin: "kotlin-android-extensions" +apply plugin: "shot" android { compileSdkVersion 28 defaultConfig { - applicationId "com.karumi" + applicationId "com.karumi.superheroes.jetpack" minSdkVersion 16 targetSdkVersion 28 versionCode 1 @@ -30,7 +30,7 @@ configurations { dependencies { /* Lint */ - ktlint 'com.github.shyiko:ktlint:0.29.0' + ktlint "com.github.shyiko:ktlint:0.29.0" /* Kotlin */ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" @@ -45,15 +45,15 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0" /* DI */ - implementation 'org.kodein.di:kodein-di-erased-jvm:6.0.1' - implementation 'org.kodein.di:kodein-di-framework-android-x:6.0.1' + implementation "org.kodein.di:kodein-di-erased-jvm:6.0.1" + implementation "org.kodein.di:kodein-di-framework-android-x:6.0.1" /* UI */ - implementation 'com.squareup.picasso:picasso:2.5.2' + implementation "com.squareup.picasso:picasso:2.5.2" implementation "com.google.android.material:material:1.0.0" /* Testing */ - testImplementation 'junit:junit:4.12' + testImplementation "junit:junit:4.12" testImplementation "org.mockito:mockito-core:2.23.4" androidTestImplementation "org.mockito:mockito-android:2.23.4" androidTestImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0" @@ -64,16 +64,16 @@ dependencies { } 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("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" } shot { - appId = 'com.karumi' + appId = "com.karumi.superheroes.jetpack" } task ktlint(type: JavaExec) { diff --git a/app/screenshots/com.karumi.jetpack.superheroes.ui.view.MainActivityTest_showsEmptyCaseIfThereAreNoSuperHeroes.png b/app/screenshots/com.karumi.jetpack.superheroes.ui.view.MainActivityTest_showsEmptyCaseIfThereAreNoSuperHeroes.png index 1500e0e908abf98d166a3eee329df7f47562c14d..2b7b895da07d0febc16be184b007986f4860c684 100644 GIT binary patch delta 5283 zcmZ9Qc~sKb`^VLqu^Go~ajRUWWm;V_4R@Vs(J@mqD{}!-b16kr6BNXcOxY0Y%`;@BIGy{qDKv+;i@^_nhZ_&wZZrdOw5C1I~{R zsTSn?anSYL8I3M-j9<$ytTSdi>)G=^5W@%ThmSq2etbgg5W|@L+GAzuK_Zf&Me7%N zUu}7gE8RAfB(^w-<5Nui0RyyDZjdWrI=JII_HId4*@8QgWSNDT zs-*5bsj}@P?#~_CThyZd&pkkS?tiC>+Hdhe4Oe}$WuhOZz_dy_dmkhc76I~O0{tY;LeZ6K|2m$)e#(i7L<#|kw}bfOOxmzKQvjcNOxc_b zFQRh29C_A_zdi$p%?`nM+3R%9#r&h~?H_lKb!`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C-C${YW@1nH#ZZv`Ma74E|Vl7YUyG3M?w-b zz~HIFKPMv@L|XO`C#xbv_#85@S9~bT$iI@4A{BlL^d3qr5eJc%o|Z)F!OJ6_+?-F@ z%pMuMfE(t)q#(JOxQ1ioBk@3a`$2?t6|Zs#`xJ@ap!(>VPrh{7;2EddinOnEORBhP* z9&?}xf2(AJgFiiG#iZ|4n%in$-=1omc-^otf+0Wi+<%tWCZ&K2F@k4h1j5pwO|KNt za=uB_zp2W|tBEb+r_IjpS!u9|dlQ>R57)VseXbg+0Qmgt<6sGFUh(dST{sOt>vg@g8A`p=-C&cW%r! zAlbZhMcId7e{0nf-0}8kd(;J5itC4=D;h-8A5a6VAfzUsANXOA(uXqZ4dTXKUW>g z7z66PdmW`Z6;g^U|3Hb8!h3MY_!UO@Hw_0FxxK)1RFlQMgpX=waP#2M&7V{cx#J4JBZ}u<-FR% z^F*a=2&`-w@r)w)+P)B?oa{r%nR&kiAhfO(TFYN0pD|t}D!!7kAd@c6X*AiCRPmV0 z9TaV8#bp!T1%_od!U&)#VR4MOXXtG}*E^nAv36b4J;D9Qi2R%Ioqh!*;&Dp+aQDZF zl#bP(x693mv-_#-6B3W@StBfs5ub$5KE4R|Ceh)Y#~hy~#aA3>YEAh72X%SuqtaTB z4oFPLjGsR%OqP{>sBnrdqFCwU$d`Vp6Gp-h^&HLVm7tW)0%B!h_@jxrr*g^CQ2x|wm19xN&+^Ln3 zUe%w^|9#2)hNc{%qTgy;NGpIl(a&^FqstEM{vX~o(J!@jqB{?Km3D2pdO38Sj{g5R i#s4p9saBmPkqdtRhfmg3NsWxOIoZ4Z-f-#8pZ^8XUvEnQ diff --git a/app/src/main/java/com/karumi/jetpack/superheroes/common/TimeProviders.kt b/app/src/main/java/com/karumi/jetpack/superheroes/common/TimeProviders.kt index e92ae28..a554ae6 100644 --- a/app/src/main/java/com/karumi/jetpack/superheroes/common/TimeProviders.kt +++ b/app/src/main/java/com/karumi/jetpack/superheroes/common/TimeProviders.kt @@ -7,4 +7,3 @@ interface TimeProvider { class RealTimeProvider : TimeProvider { override val time = System.currentTimeMillis() } - diff --git a/app/src/main/res/layout/main_activity.xml b/app/src/main/res/layout/main_activity.xml index 5a551c9..8f4cf2e 100644 --- a/app/src/main/res/layout/main_activity.xml +++ b/app/src/main/res/layout/main_activity.xml @@ -1,5 +1,5 @@ - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:visibility="visible" /> - + diff --git a/app/src/main/res/layout/super_hero_detail_activity.xml b/app/src/main/res/layout/super_hero_detail_activity.xml index f08fa9f..7c2787d 100644 --- a/app/src/main/res/layout/super_hero_detail_activity.xml +++ b/app/src/main/res/layout/super_hero_detail_activity.xml @@ -118,7 +118,8 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + tools:visibility="visible" />