diff --git a/build-logic/convention/src/main/kotlin/KMPLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/KMPLibraryConventionPlugin.kt index 678e698f2..8f2e00185 100644 --- a/build-logic/convention/src/main/kotlin/KMPLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/KMPLibraryConventionPlugin.kt @@ -18,7 +18,6 @@ class KMPLibraryConventionPlugin: Plugin { apply("mifospay.kmp.koin") apply("mifos.detekt.plugin") apply("mifos.spotless.plugin") - apply("mifos.ktlint.plugin") } configureKotlinMultiplatform() diff --git a/core/analytics/consumer-rules.pro b/core/analytics/consumer-rules.pro deleted file mode 100644 index e69de29bb..000000000 diff --git a/core/analytics/proguard-rules.pro b/core/analytics/proguard-rules.pro deleted file mode 100644 index 481bb4348..000000000 --- a/core/analytics/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# 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/core/common/consumer-rules.pro b/core/common/consumer-rules.pro deleted file mode 100644 index e69de29bb..000000000 diff --git a/core/common/proguard-rules.pro b/core/common/proguard-rules.pro deleted file mode 100644 index 481bb4348..000000000 --- a/core/common/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# 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/core/common/src/androidMain/kotlin/org/mifospay/core/common/Utils.android.kt b/core/common/src/androidMain/kotlin/org/mifospay/core/common/CurrencyFormatter.android.kt similarity index 57% rename from core/common/src/androidMain/kotlin/org/mifospay/core/common/Utils.android.kt rename to core/common/src/androidMain/kotlin/org/mifospay/core/common/CurrencyFormatter.android.kt index 9ece3cb54..4fee020b7 100644 --- a/core/common/src/androidMain/kotlin/org/mifospay/core/common/Utils.android.kt +++ b/core/common/src/androidMain/kotlin/org/mifospay/core/common/CurrencyFormatter.android.kt @@ -1,9 +1,18 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.common import java.text.NumberFormat import java.util.Currency -actual class CurrencyFormatter { +actual object CurrencyFormatter { actual fun format( balance: Double?, currencyCode: String?, @@ -14,4 +23,4 @@ actual class CurrencyFormatter { balanceFormatter.currency = Currency.getInstance(currencyCode) return balanceFormatter.format(balance) } -} \ No newline at end of file +} diff --git a/core/common/src/androidMain/kotlin/org/mifospay/core/common/FileUtils.android.kt b/core/common/src/androidMain/kotlin/org/mifospay/core/common/FileUtils.android.kt index 53d528d60..83a3f6ff1 100644 --- a/core/common/src/androidMain/kotlin/org/mifospay/core/common/FileUtils.android.kt +++ b/core/common/src/androidMain/kotlin/org/mifospay/core/common/FileUtils.android.kt @@ -1,5 +1,13 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.common - // JVM and Android implementation -actual fun createPlatformFileUtils(): FileUtils = CommonFileUtils() \ No newline at end of file +actual fun createPlatformFileUtils(): FileUtils = CommonFileUtils() diff --git a/core/common/src/commonMain/kotlin/org/mifospay/core/common/CurrencyFormatter.kt b/core/common/src/commonMain/kotlin/org/mifospay/core/common/CurrencyFormatter.kt new file mode 100644 index 000000000..9ef39ab76 --- /dev/null +++ b/core/common/src/commonMain/kotlin/org/mifospay/core/common/CurrencyFormatter.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.common + +expect object CurrencyFormatter { + fun format(balance: Double?, currencyCode: String?, maximumFractionDigits: Int?): String +} + +fun List.toArrayList(): ArrayList { + return ArrayList(this) +} diff --git a/core/common/src/commonMain/kotlin/org/mifospay/core/common/FileUtils.kt b/core/common/src/commonMain/kotlin/org/mifospay/core/common/FileUtils.kt index 1c664646e..26b62d47f 100644 --- a/core/common/src/commonMain/kotlin/org/mifospay/core/common/FileUtils.kt +++ b/core/common/src/commonMain/kotlin/org/mifospay/core/common/FileUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.common import co.touchlab.kermit.Logger @@ -7,7 +16,6 @@ import okio.FileSystem import okio.Path.Companion.toPath import okio.SYSTEM - interface FileUtils { suspend fun writeInputStreamDataToFile(inputStream: ByteArray, filePath: String): Boolean @@ -36,4 +44,4 @@ class CommonFileUtils : FileUtils { false } } -} \ No newline at end of file +} diff --git a/core/common/src/commonMain/kotlin/org/mifospay/core/common/Result.kt b/core/common/src/commonMain/kotlin/org/mifospay/core/common/Result.kt index 19a72890e..fbc2e14ef 100644 --- a/core/common/src/commonMain/kotlin/org/mifospay/core/common/Result.kt +++ b/core/common/src/commonMain/kotlin/org/mifospay/core/common/Result.kt @@ -1,3 +1,12 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.common import kotlinx.coroutines.flow.Flow @@ -13,4 +22,4 @@ sealed interface Result { fun Flow.asResult(): Flow> = map> { Result.Success(it) } .onStart { emit(Result.Loading) } - .catch { emit(Result.Error(it)) } \ No newline at end of file + .catch { emit(Result.Error(it)) } diff --git a/core/common/src/commonMain/kotlin/org/mifospay/core/common/Utils.kt b/core/common/src/commonMain/kotlin/org/mifospay/core/common/Utils.kt deleted file mode 100644 index faa6d8f50..000000000 --- a/core/common/src/commonMain/kotlin/org/mifospay/core/common/Utils.kt +++ /dev/null @@ -1,9 +0,0 @@ -package org.mifospay.core.common - -expect class CurrencyFormatter { - fun format(balance: Double?, currencyCode: String?, maximumFractionDigits: Int?): String -} - -fun List.toArrayList(): ArrayList { - return ArrayList(this) -} \ No newline at end of file diff --git a/core/common/src/jvmMain/kotlin/org/mifospay/core/common/Utils.jvm.kt b/core/common/src/jvmMain/kotlin/org/mifospay/core/common/CurrencyFormatter.jvm.kt similarity index 57% rename from core/common/src/jvmMain/kotlin/org/mifospay/core/common/Utils.jvm.kt rename to core/common/src/jvmMain/kotlin/org/mifospay/core/common/CurrencyFormatter.jvm.kt index 806fd7af7..ce7c14600 100644 --- a/core/common/src/jvmMain/kotlin/org/mifospay/core/common/Utils.jvm.kt +++ b/core/common/src/jvmMain/kotlin/org/mifospay/core/common/CurrencyFormatter.jvm.kt @@ -1,9 +1,18 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.common import java.text.NumberFormat import java.util.Currency -actual class CurrencyFormatter { +actual object CurrencyFormatter { actual fun format( balance: Double?, currencyCode: String?, @@ -14,4 +23,4 @@ actual class CurrencyFormatter { numberFormat.currency = Currency.getInstance(currencyCode) return numberFormat.format(balance) } -} \ No newline at end of file +} diff --git a/core/common/src/jvmMain/kotlin/org/mifospay/core/common/FileUtils.jvm.kt b/core/common/src/jvmMain/kotlin/org/mifospay/core/common/FileUtils.jvm.kt index a619afac0..83a3f6ff1 100644 --- a/core/common/src/jvmMain/kotlin/org/mifospay/core/common/FileUtils.jvm.kt +++ b/core/common/src/jvmMain/kotlin/org/mifospay/core/common/FileUtils.jvm.kt @@ -1,5 +1,13 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.common // JVM and Android implementation actual fun createPlatformFileUtils(): FileUtils = CommonFileUtils() - diff --git a/core/common/src/nativeMain/kotlin/org/mifospay/core/common/Utils.native.kt b/core/common/src/nativeMain/kotlin/org/mifospay/core/common/CurrencyFormatter.native.kt similarity index 59% rename from core/common/src/nativeMain/kotlin/org/mifospay/core/common/Utils.native.kt rename to core/common/src/nativeMain/kotlin/org/mifospay/core/common/CurrencyFormatter.native.kt index a7c68ea45..f42222181 100644 --- a/core/common/src/nativeMain/kotlin/org/mifospay/core/common/Utils.native.kt +++ b/core/common/src/nativeMain/kotlin/org/mifospay/core/common/CurrencyFormatter.native.kt @@ -1,8 +1,17 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.common import platform.Foundation.NSNumberFormatter -actual class CurrencyFormatter { +actual object CurrencyFormatter { actual fun format( balance: Double?, currencyCode: String?, @@ -14,4 +23,4 @@ actual class CurrencyFormatter { numberFormatter.maximumFractionDigits = maximumFractionDigits ?: 0 return numberFormatter.stringFromNumber(balance ?: 0.0) ?: "" } -} \ No newline at end of file +} diff --git a/core/common/src/nativeMain/kotlin/org/mifospay/core/common/FileUtils.native.kt b/core/common/src/nativeMain/kotlin/org/mifospay/core/common/FileUtils.native.kt index d60f3b49e..ae5069aa3 100644 --- a/core/common/src/nativeMain/kotlin/org/mifospay/core/common/FileUtils.native.kt +++ b/core/common/src/nativeMain/kotlin/org/mifospay/core/common/FileUtils.native.kt @@ -1,3 +1,12 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.common import kotlinx.cinterop.ExperimentalForeignApi @@ -21,4 +30,4 @@ actual fun createPlatformFileUtils(): FileUtils = object : FileUtils { } private fun ByteArray.toNSData(): NSData = NSData.create(bytes = this.refTo(0), length = this.size.toULong()) -} \ No newline at end of file +} diff --git a/core/datastore-proto/consumer-rules.pro b/core/datastore-proto/consumer-rules.pro deleted file mode 100644 index e69de29bb..000000000 diff --git a/core/datastore-proto/proguard-rules.pro b/core/datastore-proto/proguard-rules.pro deleted file mode 100644 index 481bb4348..000000000 --- a/core/datastore-proto/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# 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/core/datastore/proguard-rules.pro b/core/datastore/proguard-rules.pro deleted file mode 100644 index 481bb4348..000000000 --- a/core/datastore/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# 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/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/PreferencesMapper.kt b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/PreferencesMapper.kt index a1fc33861..cd67a1dfc 100644 --- a/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/PreferencesMapper.kt +++ b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/PreferencesMapper.kt @@ -1,3 +1,12 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.datastore import org.mifospay.core.datastore.proto.ClientPreferences @@ -113,4 +122,4 @@ fun UserData.toUserPreferences(): UserPreferences { client = client.toClientPreferences(), user = user.toUserInfoPreferences(), ) -} \ No newline at end of file +} diff --git a/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/UserPreferencesDataSource.kt b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/UserPreferencesDataSource.kt index a15d60c56..36a76f39a 100644 --- a/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/UserPreferencesDataSource.kt +++ b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/UserPreferencesDataSource.kt @@ -1,3 +1,12 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ @file:OptIn(ExperimentalSerializationApi::class, ExperimentalSettingsApi::class) package org.mifospay.core.datastore diff --git a/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/di/PreferenceModule.kt b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/di/PreferenceModule.kt index fb8139122..d3b57761f 100644 --- a/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/di/PreferenceModule.kt +++ b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/di/PreferenceModule.kt @@ -1,3 +1,12 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.datastore.di import com.russhwolf.settings.Settings @@ -9,4 +18,4 @@ val PreferencesModule = module { factory { Settings() } // Use the IO dispatcher name - MifosDispatchers.IO.name factory { UserPreferencesDataSource(get(), get(named("IO"))) } -} \ No newline at end of file +} diff --git a/core/designsystem/build.gradle.kts b/core/designsystem/build.gradle.kts index c361c81d8..fc4ae96c9 100644 --- a/core/designsystem/build.gradle.kts +++ b/core/designsystem/build.gradle.kts @@ -75,8 +75,6 @@ kotlin { implementation(compose.components.resources) implementation(compose.components.uiToolingPreview) implementation(libs.back.handler) - implementation(libs.moko.permission) - implementation(libs.moko.permission.compose) } } } diff --git a/core/designsystem/src/commonMain/kotlin/org/mifospay/core/designsystem/component/MifosTopBar.kt b/core/designsystem/src/commonMain/kotlin/org/mifospay/core/designsystem/component/MifosTopBar.kt index a03847ea5..beabb5148 100644 --- a/core/designsystem/src/commonMain/kotlin/org/mifospay/core/designsystem/component/MifosTopBar.kt +++ b/core/designsystem/src/commonMain/kotlin/org/mifospay/core/designsystem/component/MifosTopBar.kt @@ -53,4 +53,4 @@ fun MifosTopBar( actions = actions, modifier = modifier, ) -} \ No newline at end of file +} diff --git a/core/designsystem/src/commonMain/resources/values/values.xml b/core/designsystem/src/commonMain/resources/values/values.xml deleted file mode 100644 index e69de29bb..000000000 diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/ClientInfo.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/ClientInfo.kt index 54213d788..6a9bf7701 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/ClientInfo.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/ClientInfo.kt @@ -1,3 +1,12 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.model data class ClientInfo( diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/RoleInfo.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/RoleInfo.kt index c100f8e69..224b9ad7a 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/RoleInfo.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/RoleInfo.kt @@ -1,8 +1,17 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.model data class RoleInfo( val id: String, val name: String, val description: String, - val disabled: Boolean + val disabled: Boolean, ) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/UserInfo.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/UserInfo.kt index c5274d25d..d34179e07 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/UserInfo.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/UserInfo.kt @@ -1,3 +1,12 @@ +/* + * Copyright 2024 Mifos Initiative + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md + */ package org.mifospay.core.model data class UserInfo( @@ -11,5 +20,5 @@ data class UserInfo( val permissions: List, val clients: List, val shouldRenewPassword: Boolean, - val isTwoFactorAuthenticationRequired: Boolean + val isTwoFactorAuthenticationRequired: Boolean, ) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/Client.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/Client.kt index 00eb538fe..151fd5a2e 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/Client.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/Client.kt @@ -19,4 +19,4 @@ data class Client( val clientId: Long = 0L, val displayName: String? = null, val mobileNo: String? = null, -) \ No newline at end of file +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Invoice.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Invoice.kt index cf0093f03..f14092bf9 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Invoice.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Invoice.kt @@ -23,7 +23,7 @@ data class Invoice( val title: String? = null, val date: List = ArrayList(), - ) { +) { constructor() : this( consumerId = null, consumerName = null, diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Currency.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Currency.kt index 1d9824bc7..abc0bc9ae 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Currency.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Currency.kt @@ -19,7 +19,7 @@ data class Currency( val inMultiplesOf: Int? = null, val displaySymbol: String = "", val nameCode: String = "", - val displayLabel: String = "" + val displayLabel: String = "", ) { constructor() : this( code = "", diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionType.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionType.kt index baed86912..975a3018d 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionType.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionType.kt @@ -32,4 +32,4 @@ data class TransactionType( val escheat: Boolean? = null, val amountHold: Boolean = false, val amountRelease: Boolean = false, -) \ No newline at end of file +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionsEntity.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionsEntity.kt index 45c081985..6407fcf72 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionsEntity.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionsEntity.kt @@ -32,4 +32,4 @@ data class TransactionsEntity( val originalTransactionId: Long? = null, val lienTransaction: Boolean = false, val releaseTransactionId: Long? = null, -) \ No newline at end of file +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/DepositType.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/DepositType.kt index ed8887621..2ef4b138f 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/DepositType.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/DepositType.kt @@ -30,7 +30,7 @@ data class DepositType( RECURRING( id = 300, code = "depositAccountType.recurringDeposit", - endpoint = "recurringdepositaccounts" + endpoint = "recurringdepositaccounts", ), ; diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountType.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountType.kt index 5eaaa3da7..e9eab35bd 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountType.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountType.kt @@ -16,4 +16,4 @@ data class AccountType( val id: Int? = null, val code: String? = null, val value: String? = null, -) \ No newline at end of file +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/utils/DateHelper.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/utils/DateHelper.kt index a5d0b223b..981e3d6eb 100644 --- a/core/model/src/commonMain/kotlin/org/mifospay/core/model/utils/DateHelper.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/utils/DateHelper.kt @@ -146,4 +146,4 @@ object DateHelper { val currentDate = Clock.System.now().toEpochMilliseconds().toString() val formattedDate = fullMonthFormat.parse(currentDate).toString() -} \ No newline at end of file +} diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index 3426567e3..ae180d6af 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -29,6 +29,7 @@ kotlin { api(projects.core.analytics) api(projects.core.designsystem) api(projects.core.model) + api(projects.core.common) implementation(libs.coil.kt) implementation(libs.coil.kt.compose) implementation(compose.material3) diff --git a/core/ui/consumer-rules.pro b/core/ui/consumer-rules.pro deleted file mode 100644 index e69de29bb..000000000 diff --git a/core/ui/proguard-rules.pro b/core/ui/proguard-rules.pro deleted file mode 100644 index 481bb4348..000000000 --- a/core/ui/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# 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/core/ui/src/main/AndroidManifest.xml b/core/ui/src/androidMain/AndroidManifest.xml similarity index 100% rename from core/ui/src/main/AndroidManifest.xml rename to core/ui/src/androidMain/AndroidManifest.xml diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/JankStatsExtensions.kt b/core/ui/src/androidMain/kotlin/org/mifospay/core/ui/JankStatsExtensions.kt similarity index 100% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/JankStatsExtensions.kt rename to core/ui/src/androidMain/kotlin/org/mifospay/core/ui/JankStatsExtensions.kt diff --git a/core/ui/src/main/res/drawable/core_ui_baseline_info_outline_24.xml b/core/ui/src/commonMain/composeResources/drawable/core_ui_info_outline.xml similarity index 100% rename from core/ui/src/main/res/drawable/core_ui_baseline_info_outline_24.xml rename to core/ui/src/commonMain/composeResources/drawable/core_ui_info_outline.xml diff --git a/core/ui/src/main/res/drawable/core_ui_money_in.png b/core/ui/src/commonMain/composeResources/drawable/core_ui_money_in.png similarity index 100% rename from core/ui/src/main/res/drawable/core_ui_money_in.png rename to core/ui/src/commonMain/composeResources/drawable/core_ui_money_in.png diff --git a/core/ui/src/main/res/drawable/core_ui_money_out.png b/core/ui/src/commonMain/composeResources/drawable/core_ui_money_out.png similarity index 100% rename from core/ui/src/main/res/drawable/core_ui_money_out.png rename to core/ui/src/commonMain/composeResources/drawable/core_ui_money_out.png diff --git a/core/ui/src/main/res/values/strings.xml b/core/ui/src/commonMain/composeResources/values/strings.xml similarity index 80% rename from core/ui/src/main/res/values/strings.xml rename to core/ui/src/commonMain/composeResources/values/strings.xml index 6ac6f61e8..bb6e8fb48 100644 --- a/core/ui/src/main/res/values/strings.xml +++ b/core/ui/src/commonMain/composeResources/values/strings.xml @@ -11,5 +11,5 @@ Retry Error Occurred! - Please check your connection or try again + Please check your connection or try again \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/DevicePreviews.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/DevicePreviews.kt similarity index 59% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/DevicePreviews.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/DevicePreviews.kt index 6e15874c9..c573a6297 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/DevicePreviews.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/DevicePreviews.kt @@ -9,14 +9,11 @@ */ package org.mifospay.core.ui -import androidx.compose.ui.tooling.preview.Preview +import org.jetbrains.compose.ui.tooling.preview.Preview /** * Multipreview annotation that represents various device sizes. Add this annotation to a composable * to render various devices. */ -@Preview(name = "phone", device = "spec:width=360dp,height=640dp,dpi=480") -@Preview(name = "landscape", device = "spec:width=640dp,height=360dp,dpi=480") -@Preview(name = "foldable", device = "spec:width=673dp,height=841dp,dpi=480") -@Preview(name = "tablet", device = "spec:width=1280dp,height=800dp,dpi=480") +@Preview annotation class DevicePreviews diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/EmptyContentScreen.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/EmptyContentScreen.kt similarity index 92% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/EmptyContentScreen.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/EmptyContentScreen.kt index 1441d645c..fe2adb76c 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/EmptyContentScreen.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/EmptyContentScreen.kt @@ -28,11 +28,13 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.platform.testTag -import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import mobile_wallet.core.ui.generated.resources.Res +import mobile_wallet.core.ui.generated.resources.core_ui_money_in +import org.jetbrains.compose.resources.DrawableResource +import org.jetbrains.compose.resources.painterResource import org.mifospay.core.designsystem.icon.MifosIcons import org.mifospay.core.designsystem.theme.MifosTheme @@ -89,7 +91,7 @@ fun EmptyContentScreen( fun EmptyContentScreen( title: String, subTitle: String, - iconDrawable: Int, + iconDrawable: DrawableResource, modifier: Modifier = Modifier, iconTint: Color = MaterialTheme.colorScheme.surfaceTint, ) { @@ -99,7 +101,7 @@ fun EmptyContentScreen( imageContent = { Image( modifier = Modifier.size(64.dp), - painter = painterResource(id = iconDrawable), + painter = painterResource(iconDrawable), colorFilter = if (iconTint != Color.Unspecified) ColorFilter.tint(iconTint) else null, contentDescription = null, ) @@ -131,21 +133,21 @@ fun EmptyContentScreen( ) } -@Preview(device = "id:pixel_5") +@DevicePreviews @Composable fun EmptyContentScreenDrawableImagePreview() { MifosTheme { EmptyContentScreen( title = "No data found", subTitle = "Please check you connection or try again", - iconDrawable = R.drawable.core_ui_baseline_info_outline_24, + iconDrawable = Res.drawable.core_ui_money_in, modifier = Modifier, iconTint = MaterialTheme.colorScheme.primary, ) } } -@Preview(device = "id:pixel_5") +@DevicePreviews @Composable fun EmptyContentScreenImageVectorPreview() { MifosTheme { diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/ErrorScreenContent.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ErrorScreenContent.kt similarity index 84% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/ErrorScreenContent.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ErrorScreenContent.kt index da9b7c755..fb91d0759 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/ErrorScreenContent.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ErrorScreenContent.kt @@ -23,19 +23,22 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag -import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import mobile_wallet.core.ui.generated.resources.Res +import mobile_wallet.core.ui.generated.resources.core_ui_error_occurred +import mobile_wallet.core.ui.generated.resources.core_ui_retry +import mobile_wallet.core.ui.generated.resources.core_ui_try_again +import org.jetbrains.compose.resources.stringResource import org.mifospay.core.designsystem.component.MifosButton import org.mifospay.core.designsystem.theme.MifosTheme @Composable fun ErrorScreenContent( modifier: Modifier = Modifier, - title: String = stringResource(id = R.string.core_ui_error_occurred), - subTitle: String = stringResource(id = R.string.core_ui_please_check_your_connection_or_try_again), + title: String = stringResource(resource = Res.string.core_ui_error_occurred), + subTitle: String = stringResource(resource = Res.string.core_ui_try_again), onClickRetry: () -> Unit = { }, ) { Column( @@ -80,13 +83,13 @@ fun ErrorScreenContent( .padding(top = 16.dp), onClick = onClickRetry, ) { - Text(text = stringResource(id = R.string.core_ui_retry)) + Text(text = stringResource(resource = Res.string.core_ui_retry)) } } } } -@Preview(device = "id:pixel_5") +@DevicePreviews @Composable fun ErrorContentScreenDrawableImagePreview() { MifosTheme { diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/ExpiryDateInput.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ExpiryDateInput.kt similarity index 98% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/ExpiryDateInput.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ExpiryDateInput.kt index a758f3bc6..42098cf56 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/ExpiryDateInput.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ExpiryDateInput.kt @@ -34,7 +34,6 @@ import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @OptIn(ExperimentalComposeUiApi::class) @@ -128,7 +127,7 @@ fun FormattedDateView( ) } -@Preview(showBackground = true) +@DevicePreviews @Composable fun ExpiryDateInputPreview() { ExpiryDateInput(date = "", onDateChange = {}, onDone = {}) diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/FaqItemScreen.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/FaqItemScreen.kt similarity index 100% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/FaqItemScreen.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/FaqItemScreen.kt diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/HeadingTitile.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/HeadingTitile.kt similarity index 97% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/HeadingTitile.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/HeadingTitile.kt index 891347c2e..0f31c6762 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/HeadingTitile.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/HeadingTitile.kt @@ -24,9 +24,9 @@ import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import org.jetbrains.compose.ui.tooling.preview.Preview import org.mifospay.core.designsystem.icon.MifosIcons import org.mifospay.core.designsystem.theme.MifosTheme diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/LocalTimeZone.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/LocalTimeZone.kt similarity index 100% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/LocalTimeZone.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/LocalTimeZone.kt diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/MifosUserImage.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/MifosUserImage.kt similarity index 89% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/MifosUserImage.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/MifosUserImage.kt index 84f4ad55e..9db2430d2 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/MifosUserImage.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/MifosUserImage.kt @@ -9,7 +9,6 @@ */ package org.mifospay.core.ui -import android.graphics.Bitmap import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.shape.CircleShape @@ -17,14 +16,14 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.asImageBitmap +import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.layout.ContentScale import org.mifospay.core.designsystem.component.MifosTextUserImage @Composable fun MifosUserImage( modifier: Modifier = Modifier, - bitmap: Bitmap? = null, + bitmap: ImageBitmap? = null, username: String? = null, ) { if (bitmap == null) { @@ -37,7 +36,7 @@ fun MifosUserImage( modifier = modifier .clip(CircleShape) .background(MaterialTheme.colorScheme.primary), - bitmap = bitmap.asImageBitmap(), + bitmap = bitmap, contentDescription = "Profile Image", contentScale = ContentScale.Crop, ) diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/OtpTextField.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/OtpTextField.kt similarity index 98% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/OtpTextField.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/OtpTextField.kt index 59b034b7d..abb1b40ec 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/OtpTextField.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/OtpTextField.kt @@ -35,8 +35,8 @@ import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import org.jetbrains.compose.ui.tooling.preview.Preview @Composable fun OtpTextField( diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/ProfileConcentricImage.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ProfileConcentricImage.kt similarity index 95% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/ProfileConcentricImage.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ProfileConcentricImage.kt index 79ca16e76..0ed47bb10 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/ProfileConcentricImage.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ProfileConcentricImage.kt @@ -9,7 +9,6 @@ */ package org.mifospay.core.ui -import android.graphics.Bitmap import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -22,12 +21,13 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.unit.dp @Composable fun ProfileImage( modifier: Modifier = Modifier, - bitmap: Bitmap? = null, + bitmap: ImageBitmap? = null, ) { Row( modifier = modifier diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/ScrollableTabRow.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ScrollableTabRow.kt similarity index 90% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/ScrollableTabRow.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ScrollableTabRow.kt index b806e14fb..b668cc682 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/ScrollableTabRow.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/ScrollableTabRow.kt @@ -9,6 +9,9 @@ */ package org.mifospay.core.ui +import androidx.compose.foundation.ExperimentalFoundationApi +import androidx.compose.foundation.pager.HorizontalPager +import androidx.compose.foundation.pager.PagerState import androidx.compose.material3.MaterialTheme import androidx.compose.material3.ScrollableTabRow import androidx.compose.runtime.Composable @@ -17,12 +20,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp -import com.google.accompanist.pager.HorizontalPager -import com.google.accompanist.pager.PagerState import kotlinx.coroutines.launch import org.mifospay.core.designsystem.component.MifosTab import org.mifospay.core.ui.utility.TabContent +@OptIn(ExperimentalFoundationApi::class) @Suppress("MultipleEmitters") @Composable fun MifosScrollableTabRow( @@ -58,7 +60,6 @@ fun MifosScrollableTabRow( } HorizontalPager( - count = tabContents.size, state = pagerState, ) { tabContents[it].content.invoke() diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/TransactionItemScreen.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/TransactionItemScreen.kt similarity index 81% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/TransactionItemScreen.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/TransactionItemScreen.kt index cb9c5bc71..c97fe367e 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/TransactionItemScreen.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/TransactionItemScreen.kt @@ -22,18 +22,21 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.ColorFilter -import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.mifospay.core.model.domain.Transaction -import com.mifospay.core.model.domain.TransactionType -import org.mifospay.common.Utils.getFormattedAccountBalance +import mobile_wallet.core.ui.generated.resources.Res +import mobile_wallet.core.ui.generated.resources.core_ui_money_in +import mobile_wallet.core.ui.generated.resources.core_ui_money_out +import org.jetbrains.compose.resources.painterResource +import org.jetbrains.compose.ui.tooling.preview.Preview +import org.mifospay.core.common.CurrencyFormatter import org.mifospay.core.designsystem.theme.green import org.mifospay.core.designsystem.theme.red +import org.mifospay.core.model.domain.Transaction +import org.mifospay.core.model.domain.TransactionType @Composable fun TransactionItemScreen( @@ -51,10 +54,10 @@ fun TransactionItemScreen( .size(20.dp) .padding(top = 2.dp), painter = painterResource( - id = when (transaction.transactionType) { - TransactionType.DEBIT -> R.drawable.core_ui_money_out - TransactionType.CREDIT -> R.drawable.core_ui_money_in - else -> R.drawable.core_ui_money_in + resource = when (transaction.transactionType) { + TransactionType.DEBIT -> Res.drawable.core_ui_money_out + TransactionType.CREDIT -> Res.drawable.core_ui_money_in + else -> Res.drawable.core_ui_money_in }, ), contentDescription = null, @@ -83,7 +86,7 @@ fun TransactionItemScreen( ), ) } - val formattedAmount = getFormattedAccountBalance( + val formattedAmount = CurrencyFormatter.format( balance = transaction.amount, currencyCode = transaction.currency.code, maximumFractionDigits = 2, diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/utility/AddBtnChip.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/utility/AddBtnChip.kt similarity index 90% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/utility/AddBtnChip.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/utility/AddBtnChip.kt index 8d094a6ca..410d4a54a 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/utility/AddBtnChip.kt +++ b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/utility/AddBtnChip.kt @@ -18,15 +18,14 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import org.mifospay.core.designsystem.icon.MifosIcons @Composable fun AddCardChip( - text: Int, - btnText: Int, + text: String, + btnText: String, onAddBtn: () -> Unit, modifier: Modifier = Modifier, ) { @@ -35,7 +34,7 @@ fun AddCardChip( onClick = onAddBtn, label = { Text( - stringResource(text), + text = text, style = MaterialTheme.typography.bodyLarge.copy( fontWeight = FontWeight.Bold, color = MaterialTheme.colorScheme.onPrimary, @@ -46,7 +45,7 @@ fun AddCardChip( leadingIcon = { Icon( imageVector = MifosIcons.Add, - contentDescription = stringResource(btnText), + contentDescription = btnText, modifier = Modifier.size(16.dp), tint = MaterialTheme.colorScheme.onPrimary, ) diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/utility/DialogState.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/utility/DialogState.kt similarity index 100% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/utility/DialogState.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/utility/DialogState.kt diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/utility/DialogType.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/utility/DialogType.kt similarity index 100% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/utility/DialogType.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/utility/DialogType.kt diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/utility/TabContent.kt b/core/ui/src/commonMain/kotlin/org/mifospay/core/ui/utility/TabContent.kt similarity index 100% rename from core/ui/src/main/kotlin/org/mifospay/core/ui/utility/TabContent.kt rename to core/ui/src/commonMain/kotlin/org/mifospay/core/ui/utility/TabContent.kt diff --git a/core/ui/src/test/java/org/mifospay/mobilewallet/mifospay/ui/ExampleUnitTest.kt b/core/ui/src/test/java/org/mifospay/mobilewallet/mifospay/ui/ExampleUnitTest.kt deleted file mode 100644 index 45d28910b..000000000 --- a/core/ui/src/test/java/org/mifospay/mobilewallet/mifospay/ui/ExampleUnitTest.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2024 Mifos Initiative - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md - */ -package org.mifospay.mobilewallet.mifospay.ui - -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) - } -} diff --git a/feature/invoices/src/main/kotlin/org/mifospay/feature/invoices/InvoiceDetailScreen.kt b/feature/invoices/src/main/kotlin/org/mifospay/feature/invoices/InvoiceDetailScreen.kt index eec164824..555a2b1f1 100644 --- a/feature/invoices/src/main/kotlin/org/mifospay/feature/invoices/InvoiceDetailScreen.kt +++ b/feature/invoices/src/main/kotlin/org/mifospay/feature/invoices/InvoiceDetailScreen.kt @@ -37,7 +37,6 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.mifospay.core.model.entity.Invoice -import org.mifospay.core.model.utils.DateHelper import org.koin.androidx.compose.koinViewModel import org.mifospay.core.common.Constants import org.mifospay.core.designsystem.component.MfOverlayLoadingWheel diff --git a/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionScreen.kt b/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionScreen.kt index 45db65ee7..e69d5b565 100644 --- a/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionScreen.kt +++ b/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionScreen.kt @@ -45,7 +45,6 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.mifos.library.pullrefresh.PullRefreshIndicator import com.mifos.library.pullrefresh.pullRefresh import com.mifos.library.pullrefresh.rememberPullRefreshState -import org.mifospay.core.model.entity.kyc.KYCLevel1Details import org.koin.androidx.compose.koinViewModel import org.mifospay.core.designsystem.component.MifosButton import org.mifospay.core.designsystem.component.MifosOverlayLoadingWheel