From a1c0519c45fc6387d4bdb874fec84dd854eb06c5 Mon Sep 17 00:00:00 2001 From: Asem Abu Alrub Date: Tue, 1 Oct 2024 12:16:23 +0300 Subject: [PATCH] Add base & settings modules to Feature Delivery module --- build.gradle.kts | 1 + feature_delivery/{ => base}/.gitignore | 0 feature_delivery/{ => base}/build.gradle.kts | 2 + .../{ => base}/proguard-rules.pro | 0 .../ExampleInstrumentedTest.kt | 0 .../{ => base}/src/main/AndroidManifest.xml | 0 .../samples/feature_delivery/MainActivity.kt | 2 + .../ui/dashboard/DashboardFragment.kt | 2 - .../ui/dashboard/DashboardViewModel.kt | 0 .../feature_delivery/ui/home/HomeFragment.kt | 0 .../feature_delivery/ui/home/HomeViewModel.kt | 0 .../ui/notifications/NotificationsFragment.kt | 0 .../notifications/NotificationsViewModel.kt | 0 .../res/drawable/ic_dashboard_black_24dp.xml | 0 .../main/res/drawable/ic_home_black_24dp.xml | 0 .../res/drawable/ic_launcher_background.xml | 0 .../res/drawable/ic_launcher_foreground.xml | 0 .../drawable/ic_notifications_black_24dp.xml | 0 .../src/main/res/layout/activity_main.xml | 0 .../main/res/layout/fragment_dashboard.xml | 0 .../src/main/res/layout/fragment_home.xml | 0 .../res/layout/fragment_notifications.xml | 0 .../src/main/res/menu/bottom_nav_menu.xml | 0 .../res/mipmap-anydpi-v26/ic_launcher.xml | 0 .../mipmap-anydpi-v26/ic_launcher_round.xml | 0 .../src/main/res/mipmap-hdpi/ic_launcher.webp | Bin .../res/mipmap-hdpi/ic_launcher_round.webp | Bin .../src/main/res/mipmap-mdpi/ic_launcher.webp | Bin .../res/mipmap-mdpi/ic_launcher_round.webp | Bin .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin .../main/res/navigation/mobile_navigation.xml | 0 .../src/main/res/values-night/themes.xml | 0 .../{ => base}/src/main/res/values/colors.xml | 0 .../src/main/res/values/strings.xml | 1 + .../{ => base}/src/main/res/values/themes.xml | 0 .../feature_delivery/ExampleUnitTest.kt | 0 feature_delivery/settings/.gitignore | 1 + feature_delivery/settings/build.gradle.kts | 42 ++++++++++++++++++ .../settings/ExampleInstrumentedTest.kt | 24 ++++++++++ .../settings/src/main/AndroidManifest.xml | 14 ++++++ .../feature_delivery/settings/ToastUtils.kt | 8 ++++ .../settings/ui/BlankFragment.kt | 25 +++++++++++ .../src/main/res/layout/fragment_blank.xml | 20 +++++++++ .../settings/src/main/res/values/strings.xml | 4 ++ .../settings/ExampleUnitTest.kt | 17 +++++++ gradle/libs.versions.toml | 1 + settings.gradle.kts | 3 +- 52 files changed, 164 insertions(+), 3 deletions(-) rename feature_delivery/{ => base}/.gitignore (100%) rename feature_delivery/{ => base}/build.gradle.kts (93%) rename feature_delivery/{ => base}/proguard-rules.pro (100%) rename feature_delivery/{ => base}/src/androidTest/java/com/asemlab/samples/feature_delivery/ExampleInstrumentedTest.kt (100%) rename feature_delivery/{ => base}/src/main/AndroidManifest.xml (100%) rename feature_delivery/{ => base}/src/main/java/com/asemlab/samples/feature_delivery/MainActivity.kt (99%) rename feature_delivery/{ => base}/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardFragment.kt (91%) rename feature_delivery/{ => base}/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardViewModel.kt (100%) rename feature_delivery/{ => base}/src/main/java/com/asemlab/samples/feature_delivery/ui/home/HomeFragment.kt (100%) rename feature_delivery/{ => base}/src/main/java/com/asemlab/samples/feature_delivery/ui/home/HomeViewModel.kt (100%) rename feature_delivery/{ => base}/src/main/java/com/asemlab/samples/feature_delivery/ui/notifications/NotificationsFragment.kt (100%) rename feature_delivery/{ => base}/src/main/java/com/asemlab/samples/feature_delivery/ui/notifications/NotificationsViewModel.kt (100%) rename feature_delivery/{ => base}/src/main/res/drawable/ic_dashboard_black_24dp.xml (100%) rename feature_delivery/{ => base}/src/main/res/drawable/ic_home_black_24dp.xml (100%) rename feature_delivery/{ => base}/src/main/res/drawable/ic_launcher_background.xml (100%) rename feature_delivery/{ => base}/src/main/res/drawable/ic_launcher_foreground.xml (100%) rename feature_delivery/{ => base}/src/main/res/drawable/ic_notifications_black_24dp.xml (100%) rename feature_delivery/{ => base}/src/main/res/layout/activity_main.xml (100%) rename feature_delivery/{ => base}/src/main/res/layout/fragment_dashboard.xml (100%) rename feature_delivery/{ => base}/src/main/res/layout/fragment_home.xml (100%) rename feature_delivery/{ => base}/src/main/res/layout/fragment_notifications.xml (100%) rename feature_delivery/{ => base}/src/main/res/menu/bottom_nav_menu.xml (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-anydpi-v26/ic_launcher.xml (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-hdpi/ic_launcher.webp (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-hdpi/ic_launcher_round.webp (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-mdpi/ic_launcher.webp (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-mdpi/ic_launcher_round.webp (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-xhdpi/ic_launcher.webp (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-xhdpi/ic_launcher_round.webp (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-xxhdpi/ic_launcher.webp (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-xxxhdpi/ic_launcher.webp (100%) rename feature_delivery/{ => base}/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp (100%) rename feature_delivery/{ => base}/src/main/res/navigation/mobile_navigation.xml (100%) rename feature_delivery/{ => base}/src/main/res/values-night/themes.xml (100%) rename feature_delivery/{ => base}/src/main/res/values/colors.xml (100%) rename feature_delivery/{ => base}/src/main/res/values/strings.xml (80%) rename feature_delivery/{ => base}/src/main/res/values/themes.xml (100%) rename feature_delivery/{ => base}/src/test/java/com/asemlab/samples/feature_delivery/ExampleUnitTest.kt (100%) create mode 100644 feature_delivery/settings/.gitignore create mode 100644 feature_delivery/settings/build.gradle.kts create mode 100644 feature_delivery/settings/src/androidTest/java/com/asemlab/samples/feature_delivery/settings/ExampleInstrumentedTest.kt create mode 100644 feature_delivery/settings/src/main/AndroidManifest.xml create mode 100644 feature_delivery/settings/src/main/java/com/asemlab/samples/feature_delivery/settings/ToastUtils.kt create mode 100644 feature_delivery/settings/src/main/java/com/asemlab/samples/feature_delivery/settings/ui/BlankFragment.kt create mode 100644 feature_delivery/settings/src/main/res/layout/fragment_blank.xml create mode 100644 feature_delivery/settings/src/main/res/values/strings.xml create mode 100644 feature_delivery/settings/src/test/java/com/asemlab/samples/feature_delivery/settings/ExampleUnitTest.kt diff --git a/build.gradle.kts b/build.gradle.kts index 90cee29..ca48220 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,5 +15,6 @@ plugins { // TODO Add the dependency for the Google services alias(libs.plugins.google.services) apply false alias(libs.plugins.androidTest) apply false + alias(libs.plugins.android.dynamic.feature) apply false } diff --git a/feature_delivery/.gitignore b/feature_delivery/base/.gitignore similarity index 100% rename from feature_delivery/.gitignore rename to feature_delivery/base/.gitignore diff --git a/feature_delivery/build.gradle.kts b/feature_delivery/base/build.gradle.kts similarity index 93% rename from feature_delivery/build.gradle.kts rename to feature_delivery/base/build.gradle.kts index 1c5686f..52654b2 100644 --- a/feature_delivery/build.gradle.kts +++ b/feature_delivery/base/build.gradle.kts @@ -40,10 +40,12 @@ android { viewBinding = true dataBinding = true } + dynamicFeatures += setOf(":feature_delivery:settings") } dependencies { + implementation(project(":feature_delivery:settings")) implementation(libs.androidx.core.ktx) implementation(libs.androidx.appcompat) implementation(libs.androidx.activity) diff --git a/feature_delivery/proguard-rules.pro b/feature_delivery/base/proguard-rules.pro similarity index 100% rename from feature_delivery/proguard-rules.pro rename to feature_delivery/base/proguard-rules.pro diff --git a/feature_delivery/src/androidTest/java/com/asemlab/samples/feature_delivery/ExampleInstrumentedTest.kt b/feature_delivery/base/src/androidTest/java/com/asemlab/samples/feature_delivery/ExampleInstrumentedTest.kt similarity index 100% rename from feature_delivery/src/androidTest/java/com/asemlab/samples/feature_delivery/ExampleInstrumentedTest.kt rename to feature_delivery/base/src/androidTest/java/com/asemlab/samples/feature_delivery/ExampleInstrumentedTest.kt diff --git a/feature_delivery/src/main/AndroidManifest.xml b/feature_delivery/base/src/main/AndroidManifest.xml similarity index 100% rename from feature_delivery/src/main/AndroidManifest.xml rename to feature_delivery/base/src/main/AndroidManifest.xml diff --git a/feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/MainActivity.kt b/feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/MainActivity.kt similarity index 99% rename from feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/MainActivity.kt rename to feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/MainActivity.kt index 2649a6b..d4ebc48 100644 --- a/feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/MainActivity.kt +++ b/feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/MainActivity.kt @@ -20,5 +20,7 @@ class MainActivity : AppCompatActivity() { val navView: BottomNavigationView = binding.navView val navController = findNavController(R.id.navHost) navView.setupWithNavController(navController) + + } } \ No newline at end of file diff --git a/feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardFragment.kt b/feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardFragment.kt similarity index 91% rename from feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardFragment.kt rename to feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardFragment.kt index b5c5944..ba9c09f 100644 --- a/feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardFragment.kt +++ b/feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardFragment.kt @@ -4,10 +4,8 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.TextView import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels -import androidx.lifecycle.ViewModelProvider import com.asemlab.samples.feature_delivery.databinding.FragmentDashboardBinding class DashboardFragment : Fragment() { diff --git a/feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardViewModel.kt b/feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardViewModel.kt similarity index 100% rename from feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardViewModel.kt rename to feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/dashboard/DashboardViewModel.kt diff --git a/feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/home/HomeFragment.kt b/feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/home/HomeFragment.kt similarity index 100% rename from feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/home/HomeFragment.kt rename to feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/home/HomeFragment.kt diff --git a/feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/home/HomeViewModel.kt b/feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/home/HomeViewModel.kt similarity index 100% rename from feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/home/HomeViewModel.kt rename to feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/home/HomeViewModel.kt diff --git a/feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/notifications/NotificationsFragment.kt b/feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/notifications/NotificationsFragment.kt similarity index 100% rename from feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/notifications/NotificationsFragment.kt rename to feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/notifications/NotificationsFragment.kt diff --git a/feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/notifications/NotificationsViewModel.kt b/feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/notifications/NotificationsViewModel.kt similarity index 100% rename from feature_delivery/src/main/java/com/asemlab/samples/feature_delivery/ui/notifications/NotificationsViewModel.kt rename to feature_delivery/base/src/main/java/com/asemlab/samples/feature_delivery/ui/notifications/NotificationsViewModel.kt diff --git a/feature_delivery/src/main/res/drawable/ic_dashboard_black_24dp.xml b/feature_delivery/base/src/main/res/drawable/ic_dashboard_black_24dp.xml similarity index 100% rename from feature_delivery/src/main/res/drawable/ic_dashboard_black_24dp.xml rename to feature_delivery/base/src/main/res/drawable/ic_dashboard_black_24dp.xml diff --git a/feature_delivery/src/main/res/drawable/ic_home_black_24dp.xml b/feature_delivery/base/src/main/res/drawable/ic_home_black_24dp.xml similarity index 100% rename from feature_delivery/src/main/res/drawable/ic_home_black_24dp.xml rename to feature_delivery/base/src/main/res/drawable/ic_home_black_24dp.xml diff --git a/feature_delivery/src/main/res/drawable/ic_launcher_background.xml b/feature_delivery/base/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from feature_delivery/src/main/res/drawable/ic_launcher_background.xml rename to feature_delivery/base/src/main/res/drawable/ic_launcher_background.xml diff --git a/feature_delivery/src/main/res/drawable/ic_launcher_foreground.xml b/feature_delivery/base/src/main/res/drawable/ic_launcher_foreground.xml similarity index 100% rename from feature_delivery/src/main/res/drawable/ic_launcher_foreground.xml rename to feature_delivery/base/src/main/res/drawable/ic_launcher_foreground.xml diff --git a/feature_delivery/src/main/res/drawable/ic_notifications_black_24dp.xml b/feature_delivery/base/src/main/res/drawable/ic_notifications_black_24dp.xml similarity index 100% rename from feature_delivery/src/main/res/drawable/ic_notifications_black_24dp.xml rename to feature_delivery/base/src/main/res/drawable/ic_notifications_black_24dp.xml diff --git a/feature_delivery/src/main/res/layout/activity_main.xml b/feature_delivery/base/src/main/res/layout/activity_main.xml similarity index 100% rename from feature_delivery/src/main/res/layout/activity_main.xml rename to feature_delivery/base/src/main/res/layout/activity_main.xml diff --git a/feature_delivery/src/main/res/layout/fragment_dashboard.xml b/feature_delivery/base/src/main/res/layout/fragment_dashboard.xml similarity index 100% rename from feature_delivery/src/main/res/layout/fragment_dashboard.xml rename to feature_delivery/base/src/main/res/layout/fragment_dashboard.xml diff --git a/feature_delivery/src/main/res/layout/fragment_home.xml b/feature_delivery/base/src/main/res/layout/fragment_home.xml similarity index 100% rename from feature_delivery/src/main/res/layout/fragment_home.xml rename to feature_delivery/base/src/main/res/layout/fragment_home.xml diff --git a/feature_delivery/src/main/res/layout/fragment_notifications.xml b/feature_delivery/base/src/main/res/layout/fragment_notifications.xml similarity index 100% rename from feature_delivery/src/main/res/layout/fragment_notifications.xml rename to feature_delivery/base/src/main/res/layout/fragment_notifications.xml diff --git a/feature_delivery/src/main/res/menu/bottom_nav_menu.xml b/feature_delivery/base/src/main/res/menu/bottom_nav_menu.xml similarity index 100% rename from feature_delivery/src/main/res/menu/bottom_nav_menu.xml rename to feature_delivery/base/src/main/res/menu/bottom_nav_menu.xml diff --git a/feature_delivery/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/feature_delivery/base/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from feature_delivery/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to feature_delivery/base/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/feature_delivery/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/feature_delivery/base/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from feature_delivery/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to feature_delivery/base/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/feature_delivery/src/main/res/mipmap-hdpi/ic_launcher.webp b/feature_delivery/base/src/main/res/mipmap-hdpi/ic_launcher.webp similarity index 100% rename from feature_delivery/src/main/res/mipmap-hdpi/ic_launcher.webp rename to feature_delivery/base/src/main/res/mipmap-hdpi/ic_launcher.webp diff --git a/feature_delivery/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/feature_delivery/base/src/main/res/mipmap-hdpi/ic_launcher_round.webp similarity index 100% rename from feature_delivery/src/main/res/mipmap-hdpi/ic_launcher_round.webp rename to feature_delivery/base/src/main/res/mipmap-hdpi/ic_launcher_round.webp diff --git a/feature_delivery/src/main/res/mipmap-mdpi/ic_launcher.webp b/feature_delivery/base/src/main/res/mipmap-mdpi/ic_launcher.webp similarity index 100% rename from feature_delivery/src/main/res/mipmap-mdpi/ic_launcher.webp rename to feature_delivery/base/src/main/res/mipmap-mdpi/ic_launcher.webp diff --git a/feature_delivery/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/feature_delivery/base/src/main/res/mipmap-mdpi/ic_launcher_round.webp similarity index 100% rename from feature_delivery/src/main/res/mipmap-mdpi/ic_launcher_round.webp rename to feature_delivery/base/src/main/res/mipmap-mdpi/ic_launcher_round.webp diff --git a/feature_delivery/src/main/res/mipmap-xhdpi/ic_launcher.webp b/feature_delivery/base/src/main/res/mipmap-xhdpi/ic_launcher.webp similarity index 100% rename from feature_delivery/src/main/res/mipmap-xhdpi/ic_launcher.webp rename to feature_delivery/base/src/main/res/mipmap-xhdpi/ic_launcher.webp diff --git a/feature_delivery/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/feature_delivery/base/src/main/res/mipmap-xhdpi/ic_launcher_round.webp similarity index 100% rename from feature_delivery/src/main/res/mipmap-xhdpi/ic_launcher_round.webp rename to feature_delivery/base/src/main/res/mipmap-xhdpi/ic_launcher_round.webp diff --git a/feature_delivery/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/feature_delivery/base/src/main/res/mipmap-xxhdpi/ic_launcher.webp similarity index 100% rename from feature_delivery/src/main/res/mipmap-xxhdpi/ic_launcher.webp rename to feature_delivery/base/src/main/res/mipmap-xxhdpi/ic_launcher.webp diff --git a/feature_delivery/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/feature_delivery/base/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp similarity index 100% rename from feature_delivery/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp rename to feature_delivery/base/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp diff --git a/feature_delivery/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/feature_delivery/base/src/main/res/mipmap-xxxhdpi/ic_launcher.webp similarity index 100% rename from feature_delivery/src/main/res/mipmap-xxxhdpi/ic_launcher.webp rename to feature_delivery/base/src/main/res/mipmap-xxxhdpi/ic_launcher.webp diff --git a/feature_delivery/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/feature_delivery/base/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp similarity index 100% rename from feature_delivery/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp rename to feature_delivery/base/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp diff --git a/feature_delivery/src/main/res/navigation/mobile_navigation.xml b/feature_delivery/base/src/main/res/navigation/mobile_navigation.xml similarity index 100% rename from feature_delivery/src/main/res/navigation/mobile_navigation.xml rename to feature_delivery/base/src/main/res/navigation/mobile_navigation.xml diff --git a/feature_delivery/src/main/res/values-night/themes.xml b/feature_delivery/base/src/main/res/values-night/themes.xml similarity index 100% rename from feature_delivery/src/main/res/values-night/themes.xml rename to feature_delivery/base/src/main/res/values-night/themes.xml diff --git a/feature_delivery/src/main/res/values/colors.xml b/feature_delivery/base/src/main/res/values/colors.xml similarity index 100% rename from feature_delivery/src/main/res/values/colors.xml rename to feature_delivery/base/src/main/res/values/colors.xml diff --git a/feature_delivery/src/main/res/values/strings.xml b/feature_delivery/base/src/main/res/values/strings.xml similarity index 80% rename from feature_delivery/src/main/res/values/strings.xml rename to feature_delivery/base/src/main/res/values/strings.xml index 6ba95e9..50b1733 100644 --- a/feature_delivery/src/main/res/values/strings.xml +++ b/feature_delivery/base/src/main/res/values/strings.xml @@ -3,4 +3,5 @@ Home Dashboard Notifications + Settings Module \ No newline at end of file diff --git a/feature_delivery/src/main/res/values/themes.xml b/feature_delivery/base/src/main/res/values/themes.xml similarity index 100% rename from feature_delivery/src/main/res/values/themes.xml rename to feature_delivery/base/src/main/res/values/themes.xml diff --git a/feature_delivery/src/test/java/com/asemlab/samples/feature_delivery/ExampleUnitTest.kt b/feature_delivery/base/src/test/java/com/asemlab/samples/feature_delivery/ExampleUnitTest.kt similarity index 100% rename from feature_delivery/src/test/java/com/asemlab/samples/feature_delivery/ExampleUnitTest.kt rename to feature_delivery/base/src/test/java/com/asemlab/samples/feature_delivery/ExampleUnitTest.kt diff --git a/feature_delivery/settings/.gitignore b/feature_delivery/settings/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/feature_delivery/settings/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/feature_delivery/settings/build.gradle.kts b/feature_delivery/settings/build.gradle.kts new file mode 100644 index 0000000..09ddca0 --- /dev/null +++ b/feature_delivery/settings/build.gradle.kts @@ -0,0 +1,42 @@ +import com.asemlab.samples.Configuration + +plugins { + alias(libs.plugins.android.dynamic.feature) + alias(libs.plugins.kotlin) +} +android { + namespace = "com.asemlab.samples.feature_delivery.settings" + compileSdk = Configuration.compileSdk + + defaultConfig { + minSdk = Configuration.minSdk + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + implementation(project(":feature_delivery:base")) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.constraintlayout) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) + implementation(libs.androidx.navigation.fragment.ktx) + +} \ No newline at end of file diff --git a/feature_delivery/settings/src/androidTest/java/com/asemlab/samples/feature_delivery/settings/ExampleInstrumentedTest.kt b/feature_delivery/settings/src/androidTest/java/com/asemlab/samples/feature_delivery/settings/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..93ec539 --- /dev/null +++ b/feature_delivery/settings/src/androidTest/java/com/asemlab/samples/feature_delivery/settings/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.asemlab.samples.feature_delivery.settings + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * 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("com.asemlab.samples.feature_delivery.settings", appContext.packageName) + } +} \ No newline at end of file diff --git a/feature_delivery/settings/src/main/AndroidManifest.xml b/feature_delivery/settings/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ad0a265 --- /dev/null +++ b/feature_delivery/settings/src/main/AndroidManifest.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/feature_delivery/settings/src/main/java/com/asemlab/samples/feature_delivery/settings/ToastUtils.kt b/feature_delivery/settings/src/main/java/com/asemlab/samples/feature_delivery/settings/ToastUtils.kt new file mode 100644 index 0000000..3d209a3 --- /dev/null +++ b/feature_delivery/settings/src/main/java/com/asemlab/samples/feature_delivery/settings/ToastUtils.kt @@ -0,0 +1,8 @@ +package com.asemlab.samples.feature_delivery.settings + +import android.content.Context +import android.widget.Toast + +fun showToast(context: Context, msg: String){ + Toast.makeText(context, "$msg from Settings!", Toast.LENGTH_SHORT).show() +} \ No newline at end of file diff --git a/feature_delivery/settings/src/main/java/com/asemlab/samples/feature_delivery/settings/ui/BlankFragment.kt b/feature_delivery/settings/src/main/java/com/asemlab/samples/feature_delivery/settings/ui/BlankFragment.kt new file mode 100644 index 0000000..9cfe895 --- /dev/null +++ b/feature_delivery/settings/src/main/java/com/asemlab/samples/feature_delivery/settings/ui/BlankFragment.kt @@ -0,0 +1,25 @@ +package com.asemlab.samples.feature_delivery.settings.ui + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import com.asemlab.samples.feature_delivery.settings.R + + +class BlankFragment : Fragment() { + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_blank, container, false) + } + + companion object { + + fun newInstance() = BlankFragment() + } +} \ No newline at end of file diff --git a/feature_delivery/settings/src/main/res/layout/fragment_blank.xml b/feature_delivery/settings/src/main/res/layout/fragment_blank.xml new file mode 100644 index 0000000..069dcdf --- /dev/null +++ b/feature_delivery/settings/src/main/res/layout/fragment_blank.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/feature_delivery/settings/src/main/res/values/strings.xml b/feature_delivery/settings/src/main/res/values/strings.xml new file mode 100644 index 0000000..6048840 --- /dev/null +++ b/feature_delivery/settings/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + Hello blank fragment + \ No newline at end of file diff --git a/feature_delivery/settings/src/test/java/com/asemlab/samples/feature_delivery/settings/ExampleUnitTest.kt b/feature_delivery/settings/src/test/java/com/asemlab/samples/feature_delivery/settings/ExampleUnitTest.kt new file mode 100644 index 0000000..2632e0f --- /dev/null +++ b/feature_delivery/settings/src/test/java/com/asemlab/samples/feature_delivery/settings/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.asemlab.samples.feature_delivery.settings + +import org.junit.Test + +import org.junit.Assert.* + +/** + * 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) + } +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a9c4a61..a3e2617 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -142,6 +142,7 @@ ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } androidTest = { id = "com.android.test", version.ref = "android-application" } apollo = { id = "com.apollographql.apollo", version.ref = "apollo" } +android-dynamic-feature = { id = "com.android.dynamic-feature", version.ref = "android-application" } [bundles] diff --git a/settings.gradle.kts b/settings.gradle.kts index 1c116ec..6106798 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -40,4 +40,5 @@ include(":graphql") include(":app_distribution") include(":media_player") include(":autofill") -include(":feature_delivery") +include(":feature_delivery:base") +include(":feature_delivery:settings")