Skip to content

Commit

Permalink
Merge pull request #12 from alphagov/GOVUKAPP-499_onboarding_feature_…
Browse files Browse the repository at this point in the history
…module

GOVUKAPP-499: Add onboarding module
  • Loading branch information
gclssvglx authored Jun 19, 2024
2 parents f932d39 + efd52af commit 95d5441
Show file tree
Hide file tree
Showing 26 changed files with 107 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ google-services.json

# Android Profiling
*.hprof

*.DS_Store
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ android {
dependencies {
implementation(projects.feature.home)
implementation(projects.feature.settings)
implementation(projects.feature.onboarding)

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
Expand Down
1 change: 1 addition & 0 deletions feature/onboarding/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
45 changes: 45 additions & 0 deletions feature/onboarding/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Todo - extract to common file reusable across all feature modules

plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.jetbrainsKotlinAndroid)
}

android {
namespace = "uk.govuk.app.onboarding"
compileSdk = 34

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
}
}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)

implementation(libs.androidx.activity.compose)
implementation(libs.androidx.navigation.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.material3)

testImplementation(libs.junit)

androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package uk.govuk.app.onboarding

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("uk.govuk.app.settings.test", appContext.packageName)
}
}
4 changes: 4 additions & 0 deletions feature/onboarding/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package uk.govuk.app.onboarding.ui

import androidx.compose.material3.Text
import androidx.compose.runtime.Composable

@Composable
fun OnboardingRoute() {
// Collect UI state from view model here and pass to screen (if necessary)
OnboardingScreen()
}

@Composable
private fun OnboardingScreen() {
Text("Onboarding Screen")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package uk.govuk.app.onboarding

import org.junit.Assert.assertEquals
import org.junit.Test

/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ rootProject.name = "govuk-mobile-android-app"

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
include(":app")
include(":feature")
include(":feature:home")
include(":feature:settings")
include(":feature:onboarding")

0 comments on commit 95d5441

Please sign in to comment.