Skip to content

Commit 60825e7

Browse files
Merge branch 'dev' into fix/standing-instruction-amount-validation
2 parents f30639e + 78d468b commit 60825e7

368 files changed

Lines changed: 33216 additions & 2486 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.run/cmp-web-wasm.run.xml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="cmp-web-wasm" type="GradleRunConfiguration" factoryName="Gradle">
3-
<ExternalSystemSettings>
4-
<option name="executionName" />
5-
<option name="externalProjectPath" value="$PROJECT_DIR$/cmp-web" />
6-
<option name="externalSystemIdString" value="GRADLE" />
7-
<option name="scriptParameters" value="" />
8-
<option name="taskDescriptions">
9-
<list />
10-
</option>
11-
<option name="taskNames">
12-
<list>
13-
<option value="wasmJsBrowserDevelopmentRun" />
14-
</list>
15-
</option>
16-
<option name="vmOptions" />
17-
</ExternalSystemSettings>
18-
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
19-
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
20-
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
21-
<EXTENSION ID="com.android.tools.idea.testartifacts.testsuite.GradleRunConfigurationExtension">
22-
<com.android.tools.idea.testartifacts.testsuite.SHOW_TEST_RESULT_IN_ANDROID_TEST_SUITE_VIEW>false</com.android.tools.idea.testartifacts.testsuite.SHOW_TEST_RESULT_IN_ANDROID_TEST_SUITE_VIEW>
23-
<android.execution.deploysToLocalDevice>false</android.execution.deploysToLocalDevice>
24-
</EXTENSION>
25-
<DebugAllEnabled>false</DebugAllEnabled>
26-
<RunAsTest>false</RunAsTest>
27-
<GradleProfilingDisabled>true</GradleProfilingDisabled>
28-
<GradleCoverageDisabled>true</GradleCoverageDisabled>
29-
<method v="2" />
30-
</configuration>
2+
<configuration default="false" name="cmp-web-wasm" type="GradleRunConfiguration" factoryName="Gradle">
3+
<ExternalSystemSettings>
4+
<option name="executionName" />
5+
<option name="externalProjectPath" value="$PROJECT_DIR$/cmp-web" />
6+
<option name="externalSystemIdString" value="GRADLE" />
7+
<option name="scriptParameters" value="" />
8+
<option name="taskDescriptions">
9+
<list />
10+
</option>
11+
<option name="taskNames">
12+
<list>
13+
<option value="wasmJsBrowserDevelopmentRun" />
14+
</list>
15+
</option>
16+
<option name="vmOptions" />
17+
</ExternalSystemSettings>
18+
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
19+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
20+
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
21+
<EXTENSION ID="com.android.tools.idea.testartifacts.testsuite.GradleRunConfigurationExtension">
22+
<com.android.tools.idea.testartifacts.testsuite.SHOW_TEST_RESULT_IN_ANDROID_TEST_SUITE_VIEW>false</com.android.tools.idea.testartifacts.testsuite.SHOW_TEST_RESULT_IN_ANDROID_TEST_SUITE_VIEW>
23+
<android.execution.deploysToLocalDevice>false</android.execution.deploysToLocalDevice>
24+
</EXTENSION>
25+
<DebugAllEnabled>false</DebugAllEnabled>
26+
<RunAsTest>false</RunAsTest>
27+
<GradleProfilingDisabled>true</GradleProfilingDisabled>
28+
<GradleCoverageDisabled>true</GradleCoverageDisabled>
29+
<method v="2" />
30+
</configuration>
3131
</component>

cmp-android/dependencies/prodReleaseRuntimeClasspath.tree.txt

Lines changed: 222 additions & 187 deletions
Large diffs are not rendered by default.

cmp-android/dependencies/prodReleaseRuntimeClasspath.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
:core:ui
1616
:feature:accounts
1717
:feature:auth
18+
:feature:autopay
1819
:feature:beneficiary
1920
:feature:editpassword
2021
:feature:faq
@@ -33,12 +34,12 @@
3334
:feature:profile
3435
:feature:receipt
3536
:feature:savedcards
37+
:feature:send-money
3638
:feature:settings
3739
:feature:standing-instruction
3840
:feature:transfer-interbank
3941
:feature:transfer-intrabank
4042
:feature:upi-setup
41-
:libs:mifos-passcode
4243
androidx.activity:activity-compose:1.12.2
4344
androidx.activity:activity-ktx:1.12.2
4445
androidx.activity:activity:1.12.2
@@ -287,8 +288,6 @@ com.google.mlkit:barcode-scanning:17.3.0
287288
com.google.mlkit:common:18.11.0
288289
com.google.mlkit:vision-common:17.3.0
289290
com.google.mlkit:vision-interfaces:16.3.0
290-
com.google.protobuf:protobuf-javalite:4.31.1
291-
com.google.protobuf:protobuf-kotlin-lite:4.31.1
292291
com.google.zxing:core:3.5.3
293292
com.mohamedrejeb.calf:calf-permissions-android:0.8.0
294293
com.mohamedrejeb.calf:calf-permissions:0.8.0
@@ -345,10 +344,10 @@ io.github.jan-tennert.supabase:postgrest-kt-android:3.1.1
345344
io.github.jan-tennert.supabase:postgrest-kt:3.1.1
346345
io.github.jan-tennert.supabase:supabase-kt-android:3.1.1
347346
io.github.jan-tennert.supabase:supabase-kt:3.1.1
348-
io.github.openmf:mifos-authenticator-biometrics-android:2.0.4
349-
io.github.openmf:mifos-authenticator-biometrics:2.0.4
350-
io.github.openmf:mifos-authenticator-passcode-android:2.0.6
351-
io.github.openmf:mifos-authenticator-passcode:2.0.6
347+
io.github.openmf:mifos-authenticator-biometrics-android:2.3.0-beta
348+
io.github.openmf:mifos-authenticator-biometrics:2.3.0-beta
349+
io.github.openmf:mifos-authenticator-passcode-android:2.3.0-beta
350+
io.github.openmf:mifos-authenticator-passcode:2.3.0-beta
352351
io.github.vinceglb:filekit-coil-android:0.12.0
353352
io.github.vinceglb:filekit-coil:0.12.0
354353
io.github.vinceglb:filekit-core-android:0.12.0

cmp-android/prodRelease-badging.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ uses-permission: name='android.permission.CAMERA'
66
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE' maxSdkVersion='32'
77
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE' maxSdkVersion='32'
88
uses-permission: name='android.permission.VIBRATE'
9+
uses-permission: name='android.permission.READ_CONTACTS'
910
uses-permission: name='android.permission.FLASHLIGHT'
1011
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
1112
uses-permission: name='android.permission.USE_BIOMETRIC'

cmp-android/src/main/kotlin/org/mifospay/MainActivity.kt

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
*/
1010
package org.mifospay
1111

12+
import android.content.res.Resources
1213
import android.os.Bundle
1314
import androidx.activity.compose.setContent
1415
import androidx.activity.enableEdgeToEdge
1516
import androidx.appcompat.app.AppCompatActivity
17+
import androidx.appcompat.app.AppCompatDelegate
1618
import androidx.compose.runtime.getValue
1719
import androidx.compose.runtime.mutableStateOf
1820
import androidx.compose.runtime.setValue
21+
import androidx.core.os.LocaleListCompat
1922
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
2023
import androidx.core.view.WindowCompat
2124
import androidx.lifecycle.Lifecycle
@@ -31,9 +34,10 @@ import org.koin.androidx.viewmodel.ext.android.viewModel
3134
import org.mifospay.core.data.util.NetworkMonitor
3235
import org.mifospay.core.data.util.TimeZoneMonitor
3336
import org.mifospay.core.ui.utils.ShareUtils
34-
import org.mifospay.shared.MainUiState
3537
import org.mifospay.shared.MifosPaySharedApp
3638
import org.mifospay.shared.MifosPayViewModel
39+
import org.mifospay.shared.UserState
40+
import java.util.Locale
3741

3842
class MainActivity : AppCompatActivity() {
3943
private val networkMonitor: NetworkMonitor by inject()
@@ -51,21 +55,21 @@ class MainActivity : AppCompatActivity() {
5155
// Initialize FileKit
5256
FileKit.init(this)
5357

54-
var uiState: MainUiState by mutableStateOf(MainUiState.Loading)
58+
var uiState: UserState by mutableStateOf(UserState.UnAuthenticated)
5559

5660
// Update the uiState
5761
lifecycleScope.launch {
5862
lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
59-
viewModel.uiState
63+
viewModel.userState
6064
.onEach { uiState = it }
6165
.collect()
6266
}
6367
}
6468

6569
splashScreen.setKeepOnScreenCondition {
6670
when (uiState) {
67-
MainUiState.Loading -> true
68-
is MainUiState.Success -> false
71+
UserState.UnAuthenticated -> true
72+
is UserState.Authenticated -> false
6973
}
7074
}
7175

@@ -75,6 +79,30 @@ class MainActivity : AppCompatActivity() {
7579
MifosPaySharedApp(
7680
networkMonitor = networkMonitor,
7781
timeZoneMonitor = timeZoneMonitor,
82+
handleAppLocale = { localeTag ->
83+
val currentLocales = AppCompatDelegate.getApplicationLocales()
84+
val newLocales = if (localeTag != null) {
85+
LocaleListCompat.forLanguageTags(localeTag)
86+
} else {
87+
// System Default: clear app-specific locale
88+
LocaleListCompat.getEmptyLocaleList()
89+
}
90+
91+
// Only update if the locale has actually changed
92+
if (currentLocales != newLocales) {
93+
AppCompatDelegate.setApplicationLocales(newLocales)
94+
// Update Locale.setDefault for non-UI formatting
95+
if (localeTag != null) {
96+
// Use forLanguageTag to properly parse locales like "en-GB", "pt-BR"
97+
Locale.setDefault(Locale.forLanguageTag(localeTag))
98+
} else {
99+
// Reset to true system default locale from device configuration
100+
// Use Resources.getSystem() to get device locale unaffected by app overrides
101+
val systemLocale = Resources.getSystem().configuration.locales[0]
102+
Locale.setDefault(systemLocale)
103+
}
104+
}
105+
},
78106
)
79107
}
80108
}

cmp-android/src/main/kotlin/org/mifospay/MifosPayApp.kt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@
1010
package org.mifospay
1111

1212
import android.app.Application
13+
import androidx.appcompat.app.AppCompatDelegate
14+
import androidx.core.os.LocaleListCompat
15+
import kotlinx.coroutines.flow.first
16+
import kotlinx.coroutines.runBlocking
17+
import org.koin.android.ext.android.inject
1318
import org.koin.android.ext.koin.androidContext
1419
import org.koin.android.ext.koin.androidLogger
1520
import org.koin.core.context.GlobalContext.startKoin
21+
import org.mifospay.core.datastore.UserPreferencesRepository
1622
import org.mifospay.shared.di.KoinModules
1723

1824
class MifosPayApp : Application() {
25+
private val userDataRepository: UserPreferencesRepository by inject()
26+
1927
override fun onCreate() {
2028
super.onCreate()
2129

@@ -24,5 +32,27 @@ class MifosPayApp : Application() {
2432
androidLogger()
2533
modules(KoinModules.allModules)
2634
}
35+
36+
restoreSavedLanguage()
37+
}
38+
39+
private fun restoreSavedLanguage() {
40+
runBlocking {
41+
val language = userDataRepository.language.first()
42+
43+
// Convert the saved LanguageConfig to LocaleListCompat
44+
val desiredLocales = if (language.localeName != null) {
45+
LocaleListCompat.forLanguageTags(language.localeName)
46+
} else {
47+
// System default
48+
LocaleListCompat.getEmptyLocaleList()
49+
}
50+
51+
// Only update if the current locale differs from saved preference
52+
val currentLocales = AppCompatDelegate.getApplicationLocales()
53+
if (currentLocales != desiredLocales) {
54+
AppCompatDelegate.setApplicationLocales(desiredLocales)
55+
}
56+
}
2757
}
2858
}

cmp-desktop/src/desktopMain/kotlin/main.kt

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@
88
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
99
*/
1010

11+
import androidx.compose.runtime.getValue
12+
import androidx.compose.runtime.mutableStateOf
13+
import androidx.compose.runtime.remember
14+
import androidx.compose.runtime.setValue
1115
import androidx.compose.ui.window.Window
1216
import androidx.compose.ui.window.application
1317
import androidx.compose.ui.window.rememberWindowState
1418
import io.github.vinceglb.filekit.FileKit
1519
import org.mifospay.shared.MifosPaySharedApp
1620
import org.mifospay.shared.di.initKoin
21+
import java.util.Locale
1722

1823
fun main() {
1924
application {
2025
initKoin()
26+
var localeVersion by remember { mutableStateOf(0) }
2127
// Initialize FileKit
2228
FileKit.init(appId = "org.mifospay")
2329
val windowState = rememberWindowState()
@@ -26,7 +32,27 @@ fun main() {
2632
state = windowState,
2733
title = "MifosWallet",
2834
) {
29-
MifosPaySharedApp()
35+
MifosPaySharedApp(
36+
handleAppLocale = { languageTag ->
37+
if (languageTag != null) {
38+
// Parse language tag and set as default locale
39+
val locale = when {
40+
languageTag.contains("-") -> {
41+
val parts = languageTag.split("-")
42+
Locale(parts[0], parts[1])
43+
}
44+
else -> Locale(languageTag)
45+
}
46+
Locale.setDefault(locale)
47+
} else {
48+
// System Default: reset to system locale
49+
val systemLocale = Locale.getDefault(Locale.Category.DISPLAY)
50+
Locale.setDefault(systemLocale)
51+
}
52+
// Trigger recomposition with new locale
53+
localeVersion++
54+
},
55+
)
3056
}
3157
}
3258
}

cmp-shared/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ kotlin {
3434
implementation(libs.window.size)
3535

3636
implementation(projects.feature.auth)
37-
implementation(projects.libs.mifosPasscode)
3837
implementation(projects.feature.home)
3938
implementation(projects.feature.settings)
4039
implementation(projects.feature.faq)
@@ -59,6 +58,8 @@ kotlin {
5958
implementation(projects.feature.merchants)
6059
implementation(projects.feature.upiSetup)
6160
implementation(projects.feature.passcode)
61+
implementation(projects.feature.autopay)
62+
implementation(projects.feature.sendMoney)
6263
}
6364

6465
desktopMain.dependencies {

cmp-shared/src/commonMain/composeResources/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<string name="app_name">Mifos Pay</string>
1313
<string name="home">Home</string>
1414
<string name="payments">Payments</string>
15+
<string name="upi_and_autopay"> UPI Payments &amp; AutoPay </string>
1516
<string name="finance">Finance</string>
1617
<string name="history">History</string>
1718
<string name="transaction_history">Transaction History</string>

0 commit comments

Comments
 (0)