Skip to content

Commit 69a04d8

Browse files
authored
Feat: [:core:ui] - Migrated to KMP with CMP Library (#1775)
1 parent d5b7c52 commit 69a04d8

File tree

63 files changed

+218
-217
lines changed

Some content is hidden

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

63 files changed

+218
-217
lines changed

build-logic/convention/src/main/kotlin/KMPLibraryConventionPlugin.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class KMPLibraryConventionPlugin: Plugin<Project> {
1818
apply("mifospay.kmp.koin")
1919
apply("mifos.detekt.plugin")
2020
apply("mifos.spotless.plugin")
21-
apply("mifos.ktlint.plugin")
2221
}
2322

2423
configureKotlinMultiplatform()

core/analytics/consumer-rules.pro

Whitespace-only changes.

core/analytics/proguard-rules.pro

Lines changed: 0 additions & 21 deletions
This file was deleted.

core/common/consumer-rules.pro

Whitespace-only changes.

core/common/proguard-rules.pro

Lines changed: 0 additions & 21 deletions
This file was deleted.

core/common/src/androidMain/kotlin/org/mifospay/core/common/Utils.android.kt renamed to core/common/src/androidMain/kotlin/org/mifospay/core/common/CurrencyFormatter.android.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
/*
2+
* Copyright 2024 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
9+
*/
110
package org.mifospay.core.common
211

312
import java.text.NumberFormat
413
import java.util.Currency
514

6-
actual class CurrencyFormatter {
15+
actual object CurrencyFormatter {
716
actual fun format(
817
balance: Double?,
918
currencyCode: String?,
@@ -14,4 +23,4 @@ actual class CurrencyFormatter {
1423
balanceFormatter.currency = Currency.getInstance(currencyCode)
1524
return balanceFormatter.format(balance)
1625
}
17-
}
26+
}
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
/*
2+
* Copyright 2024 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
9+
*/
110
package org.mifospay.core.common
211

3-
412
// JVM and Android implementation
5-
actual fun createPlatformFileUtils(): FileUtils = CommonFileUtils()
13+
actual fun createPlatformFileUtils(): FileUtils = CommonFileUtils()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2024 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
9+
*/
10+
package org.mifospay.core.common
11+
12+
expect object CurrencyFormatter {
13+
fun format(balance: Double?, currencyCode: String?, maximumFractionDigits: Int?): String
14+
}
15+
16+
fun <T> List<T>.toArrayList(): ArrayList<T> {
17+
return ArrayList(this)
18+
}

core/common/src/commonMain/kotlin/org/mifospay/core/common/FileUtils.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
* Copyright 2024 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
9+
*/
110
package org.mifospay.core.common
211

312
import co.touchlab.kermit.Logger
@@ -7,7 +16,6 @@ import okio.FileSystem
716
import okio.Path.Companion.toPath
817
import okio.SYSTEM
918

10-
1119
interface FileUtils {
1220
suspend fun writeInputStreamDataToFile(inputStream: ByteArray, filePath: String): Boolean
1321

@@ -36,4 +44,4 @@ class CommonFileUtils : FileUtils {
3644
false
3745
}
3846
}
39-
}
47+
}

core/common/src/commonMain/kotlin/org/mifospay/core/common/Result.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
* Copyright 2024 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
9+
*/
110
package org.mifospay.core.common
211

312
import kotlinx.coroutines.flow.Flow
@@ -13,4 +22,4 @@ sealed interface Result<out T> {
1322

1423
fun <T> Flow<T>.asResult(): Flow<Result<T>> = map<T, Result<T>> { Result.Success(it) }
1524
.onStart { emit(Result.Loading) }
16-
.catch { emit(Result.Error(it)) }
25+
.catch { emit(Result.Error(it)) }

0 commit comments

Comments
 (0)