Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Reduce boilerplate code for fragment view setup #1161

Merged
merged 11 commits into from
Sep 17, 2020

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Sep 15, 2020

Description

Taking #928 one step further. Reducing fragment view instantion/binding to 1 LOC.
Upgrading to Kotlin 1.4.0 which is also the current default for AndroidStudio 4.0.

How to test

  • Visit every screen in the app once
  • Review the code
    • Only the onViewCreate+binding creation logic was removed
    • Fragment(<layoutfile>) matches the binding: <ViewBindingClass> by viewmodels()

@d4rken d4rken added the maintainers Tag pull requests created by maintainers label Sep 15, 2020
@d4rken d4rken requested a review from a team September 15, 2020 08:09
@d4rken
Copy link
Member Author

d4rken commented Sep 15, 2020

Also made another addition to our codeStyle file to fix one more klint issue that wasn't automatically formatted correctly ( max 1 blank line before headers).

@@ -137,6 +137,14 @@ android {
jvmTarget = "1.8"
}

def jvmCompilerArgs = ["-Xno-kotlin-nothing-value-exception"]

tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround for possible bug in mockk+kotlin1.4:

mockk/mockk#490

@jakobmoellerdev jakobmoellerdev changed the base branch from dev to release/1.4.x September 16, 2020 10:23
@d4rken d4rken changed the base branch from release/1.4.x to release/1.5.x September 16, 2020 14:06
@d4rken d4rken added the 1.5.0 label Sep 16, 2020
@d4rken d4rken requested a review from ralfgehrer September 17, 2020 07:29
d4rken and others added 5 commits September 17, 2020 16:24
# Conflicts:
#	.idea/codeStyles/Project.xml
#	Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/TestRiskLevelCalculationFragment.kt
#	Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/api/ui/TestForAPIFragment.kt
@sonarcloud
Copy link

sonarcloud bot commented Sep 17, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@d4rken d4rken merged commit 0676ab7 into release/1.5.x Sep 17, 2020
@d4rken d4rken deleted the feature/smarter-view-binding branch September 17, 2020 15:39
@harambasicluka harambasicluka added this to the 1.5.0 milestone Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants