diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b4df086ac..3eaeafeca 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -90,6 +90,7 @@ dependencies { implementation(projects.feature.recentTransaction) implementation(projects.feature.thirdPartyTransfer) implementation(projects.feature.help) + implementation(projects.feature.notification) implementation("androidx.legacy:legacy-support-v4:1.0.0") diff --git a/app/src/main/java/org/mifos/mobile/ui/notification/NotificationFragment.kt b/app/src/main/java/org/mifos/mobile/ui/notification/NotificationFragment.kt index 002d6bd3c..651b146c3 100644 --- a/app/src/main/java/org/mifos/mobile/ui/notification/NotificationFragment.kt +++ b/app/src/main/java/org/mifos/mobile/ui/notification/NotificationFragment.kt @@ -6,6 +6,7 @@ import android.view.View import android.view.ViewGroup import dagger.hilt.android.AndroidEntryPoint import org.mifos.mobile.core.ui.component.mifosComposeView +import org.mifos.mobile.feature.notification.NotificationScreen import org.mifos.mobile.ui.activities.base.BaseActivity import org.mifos.mobile.ui.fragments.base.BaseFragment diff --git a/feature/notification/.gitignore b/feature/notification/.gitignore new file mode 100644 index 000000000..42afabfd2 --- /dev/null +++ b/feature/notification/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/feature/notification/build.gradle.kts b/feature/notification/build.gradle.kts new file mode 100644 index 000000000..aea537f97 --- /dev/null +++ b/feature/notification/build.gradle.kts @@ -0,0 +1,23 @@ +plugins { + alias(libs.plugins.mifos.android.feature) + alias(libs.plugins.mifos.android.library.compose) +} + +android { + namespace = "org.mifos.mobile.feature.notification" +} + +dependencies { + implementation(projects.ui) + implementation(projects.core.common) + implementation(projects.core.model) + implementation(projects.core.data) + implementation(projects.core.datastore) + + // DBFlow + implementation(libs.dbflow) + + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.espresso.core) +} \ No newline at end of file diff --git a/feature/notification/consumer-rules.pro b/feature/notification/consumer-rules.pro new file mode 100644 index 000000000..e69de29bb diff --git a/feature/notification/proguard-rules.pro b/feature/notification/proguard-rules.pro new file mode 100644 index 000000000..481bb4348 --- /dev/null +++ b/feature/notification/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/feature/notification/src/androidTest/java/org/mifos/mobile/feature/notification/ExampleInstrumentedTest.kt b/feature/notification/src/androidTest/java/org/mifos/mobile/feature/notification/ExampleInstrumentedTest.kt new file mode 100644 index 000000000..35fb3c53b --- /dev/null +++ b/feature/notification/src/androidTest/java/org/mifos/mobile/feature/notification/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package org.mifos.mobile.feature.notification + +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("org.mifos.mobile.feature.notification.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/feature/notification/src/main/AndroidManifest.xml b/feature/notification/src/main/AndroidManifest.xml new file mode 100644 index 000000000..a5918e68a --- /dev/null +++ b/feature/notification/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/java/org/mifos/mobile/ui/notification/NotificationScreen.kt b/feature/notification/src/main/java/org/mifos/mobile/feature/notification/NotificationScreen.kt similarity index 99% rename from app/src/main/java/org/mifos/mobile/ui/notification/NotificationScreen.kt rename to feature/notification/src/main/java/org/mifos/mobile/feature/notification/NotificationScreen.kt index 8c2974228..7aa3d96dc 100644 --- a/app/src/main/java/org/mifos/mobile/ui/notification/NotificationScreen.kt +++ b/feature/notification/src/main/java/org/mifos/mobile/feature/notification/NotificationScreen.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.notification +package org.mifos.mobile.feature.notification import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -36,7 +36,6 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle -import org.mifos.mobile.R import org.mifos.mobile.core.ui.component.EmptyDataView import org.mifos.mobile.core.ui.component.MFScaffold import org.mifos.mobile.core.ui.component.MifosErrorComponent diff --git a/app/src/main/java/org/mifos/mobile/ui/notification/NotificationViewModel.kt b/feature/notification/src/main/java/org/mifos/mobile/feature/notification/NotificationViewModel.kt similarity index 96% rename from app/src/main/java/org/mifos/mobile/ui/notification/NotificationViewModel.kt rename to feature/notification/src/main/java/org/mifos/mobile/feature/notification/NotificationViewModel.kt index 3bab85ace..f79dec489 100644 --- a/app/src/main/java/org/mifos/mobile/ui/notification/NotificationViewModel.kt +++ b/feature/notification/src/main/java/org/mifos/mobile/feature/notification/NotificationViewModel.kt @@ -1,6 +1,5 @@ -package org.mifos.mobile.ui.notification +package org.mifos.mobile.feature.notification -import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel diff --git a/app/src/main/res/drawable/ic_notifications.xml b/feature/notification/src/main/res/drawable/ic_notifications.xml similarity index 91% rename from app/src/main/res/drawable/ic_notifications.xml rename to feature/notification/src/main/res/drawable/ic_notifications.xml index 0d92e0f33..94190607d 100644 --- a/app/src/main/res/drawable/ic_notifications.xml +++ b/feature/notification/src/main/res/drawable/ic_notifications.xml @@ -5,6 +5,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/feature/notification/src/main/res/values/strings.xml b/feature/notification/src/main/res/values/strings.xml new file mode 100644 index 000000000..c3b1528c4 --- /dev/null +++ b/feature/notification/src/main/res/values/strings.xml @@ -0,0 +1,7 @@ + + + Notification + OK + No Notification + + \ No newline at end of file diff --git a/feature/notification/src/test/java/org/mifos/mobile/feature/notification/ExampleUnitTest.kt b/feature/notification/src/test/java/org/mifos/mobile/feature/notification/ExampleUnitTest.kt new file mode 100644 index 000000000..cf9b3e8f3 --- /dev/null +++ b/feature/notification/src/test/java/org/mifos/mobile/feature/notification/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package org.mifos.mobile.feature.notification + +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/settings.gradle.kts b/settings.gradle.kts index 616901166..0859dc53d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -41,3 +41,4 @@ include(":feature:recent_transaction") include(":feature:client_charge") include(":feature:third-party-transfer") include(":feature:help") +include(":feature:notification")