Skip to content

Commit 07b6c44

Browse files
feat(feature:about): Migrate about module to CMP
1 parent d8aba05 commit 07b6c44

File tree

35 files changed

+534
-186
lines changed

35 files changed

+534
-186
lines changed

androidApp/dependencies/demoDebugRuntimeClasspath.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ androidx.core:core-splashscreen:1.0.1
6666
androidx.core:core:1.15.0
6767
androidx.cursoradapter:cursoradapter:1.0.0
6868
androidx.customview:customview-poolingcontainer:1.0.0
69-
androidx.customview:customview:1.0.0
69+
androidx.customview:customview:1.1.0
7070
androidx.databinding:viewbinding:7.4.2
7171
androidx.documentfile:documentfile:1.0.0
7272
androidx.drawerlayout:drawerlayout:1.0.0
@@ -106,6 +106,8 @@ androidx.multidex:multidex:2.0.1
106106
androidx.navigation:navigation-common-ktx:2.8.5
107107
androidx.navigation:navigation-common:2.8.5
108108
androidx.navigation:navigation-compose:2.8.5
109+
androidx.navigation:navigation-fragment-ktx:2.8.5
110+
androidx.navigation:navigation-fragment:2.8.5
109111
androidx.navigation:navigation-runtime-ktx:2.8.5
110112
androidx.navigation:navigation-runtime:2.8.5
111113
androidx.print:print:1.0.0
@@ -120,6 +122,7 @@ androidx.room:room-runtime-android:2.7.0-alpha12
120122
androidx.room:room-runtime:2.7.0-alpha12
121123
androidx.savedstate:savedstate-ktx:1.2.1
122124
androidx.savedstate:savedstate:1.2.1
125+
androidx.slidingpanelayout:slidingpanelayout:1.2.0
123126
androidx.sqlite:sqlite-android:2.5.0-alpha12
124127
androidx.sqlite:sqlite-bundled-android:2.5.0-alpha12
125128
androidx.sqlite:sqlite-bundled:2.5.0-alpha12
@@ -129,6 +132,7 @@ androidx.sqlite:sqlite:2.5.0-alpha12
129132
androidx.startup:startup-runtime:1.1.1
130133
androidx.tracing:tracing-ktx:1.2.0
131134
androidx.tracing:tracing:1.2.0
135+
androidx.transition:transition:1.4.1
132136
androidx.vectordrawable:vectordrawable-animated:1.1.0
133137
androidx.vectordrawable:vectordrawable:1.1.0
134138
androidx.versionedparcelable:versionedparcelable:1.1.1
@@ -244,6 +248,7 @@ io.github.vinceglb:filekit-core-android:0.8.7
244248
io.github.vinceglb:filekit-core:0.8.7
245249
io.insert-koin:koin-android:4.0.1-RC1
246250
io.insert-koin:koin-androidx-compose:4.0.1-RC1
251+
io.insert-koin:koin-androidx-navigation:4.0.1-RC1
247252
io.insert-koin:koin-annotations-jvm:1.4.0-RC4
248253
io.insert-koin:koin-annotations:1.4.0-RC4
249254
io.insert-koin:koin-bom:4.0.1-RC1

androidApp/dependencies/demoReleaseRuntimeClasspath.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ androidx.core:core-splashscreen:1.0.1
6161
androidx.core:core:1.15.0
6262
androidx.cursoradapter:cursoradapter:1.0.0
6363
androidx.customview:customview-poolingcontainer:1.0.0
64-
androidx.customview:customview:1.0.0
64+
androidx.customview:customview:1.1.0
6565
androidx.databinding:viewbinding:7.4.2
6666
androidx.documentfile:documentfile:1.0.0
6767
androidx.drawerlayout:drawerlayout:1.0.0
@@ -101,6 +101,8 @@ androidx.multidex:multidex:2.0.1
101101
androidx.navigation:navigation-common-ktx:2.8.5
102102
androidx.navigation:navigation-common:2.8.5
103103
androidx.navigation:navigation-compose:2.8.5
104+
androidx.navigation:navigation-fragment-ktx:2.8.5
105+
androidx.navigation:navigation-fragment:2.8.5
104106
androidx.navigation:navigation-runtime-ktx:2.8.5
105107
androidx.navigation:navigation-runtime:2.8.5
106108
androidx.print:print:1.0.0
@@ -115,6 +117,7 @@ androidx.room:room-runtime-android:2.7.0-alpha12
115117
androidx.room:room-runtime:2.7.0-alpha12
116118
androidx.savedstate:savedstate-ktx:1.2.1
117119
androidx.savedstate:savedstate:1.2.1
120+
androidx.slidingpanelayout:slidingpanelayout:1.2.0
118121
androidx.sqlite:sqlite-android:2.5.0-alpha12
119122
androidx.sqlite:sqlite-bundled-android:2.5.0-alpha12
120123
androidx.sqlite:sqlite-bundled:2.5.0-alpha12
@@ -124,6 +127,7 @@ androidx.sqlite:sqlite:2.5.0-alpha12
124127
androidx.startup:startup-runtime:1.1.1
125128
androidx.tracing:tracing-ktx:1.2.0
126129
androidx.tracing:tracing:1.2.0
130+
androidx.transition:transition:1.4.1
127131
androidx.vectordrawable:vectordrawable-animated:1.1.0
128132
androidx.vectordrawable:vectordrawable:1.1.0
129133
androidx.versionedparcelable:versionedparcelable:1.1.1
@@ -239,6 +243,7 @@ io.github.vinceglb:filekit-core-android:0.8.7
239243
io.github.vinceglb:filekit-core:0.8.7
240244
io.insert-koin:koin-android:4.0.1-RC1
241245
io.insert-koin:koin-androidx-compose:4.0.1-RC1
246+
io.insert-koin:koin-androidx-navigation:4.0.1-RC1
242247
io.insert-koin:koin-annotations-jvm:1.4.0-RC4
243248
io.insert-koin:koin-annotations:1.4.0-RC4
244249
io.insert-koin:koin-bom:4.0.1-RC1

androidApp/dependencies/prodDebugRuntimeClasspath.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ androidx.core:core-splashscreen:1.0.1
6666
androidx.core:core:1.15.0
6767
androidx.cursoradapter:cursoradapter:1.0.0
6868
androidx.customview:customview-poolingcontainer:1.0.0
69-
androidx.customview:customview:1.0.0
69+
androidx.customview:customview:1.1.0
7070
androidx.databinding:viewbinding:7.4.2
7171
androidx.documentfile:documentfile:1.0.0
7272
androidx.drawerlayout:drawerlayout:1.0.0
@@ -106,6 +106,8 @@ androidx.multidex:multidex:2.0.1
106106
androidx.navigation:navigation-common-ktx:2.8.5
107107
androidx.navigation:navigation-common:2.8.5
108108
androidx.navigation:navigation-compose:2.8.5
109+
androidx.navigation:navigation-fragment-ktx:2.8.5
110+
androidx.navigation:navigation-fragment:2.8.5
109111
androidx.navigation:navigation-runtime-ktx:2.8.5
110112
androidx.navigation:navigation-runtime:2.8.5
111113
androidx.print:print:1.0.0
@@ -120,6 +122,7 @@ androidx.room:room-runtime-android:2.7.0-alpha12
120122
androidx.room:room-runtime:2.7.0-alpha12
121123
androidx.savedstate:savedstate-ktx:1.2.1
122124
androidx.savedstate:savedstate:1.2.1
125+
androidx.slidingpanelayout:slidingpanelayout:1.2.0
123126
androidx.sqlite:sqlite-android:2.5.0-alpha12
124127
androidx.sqlite:sqlite-bundled-android:2.5.0-alpha12
125128
androidx.sqlite:sqlite-bundled:2.5.0-alpha12
@@ -129,6 +132,7 @@ androidx.sqlite:sqlite:2.5.0-alpha12
129132
androidx.startup:startup-runtime:1.1.1
130133
androidx.tracing:tracing-ktx:1.2.0
131134
androidx.tracing:tracing:1.2.0
135+
androidx.transition:transition:1.4.1
132136
androidx.vectordrawable:vectordrawable-animated:1.1.0
133137
androidx.vectordrawable:vectordrawable:1.1.0
134138
androidx.versionedparcelable:versionedparcelable:1.1.1
@@ -244,6 +248,7 @@ io.github.vinceglb:filekit-core-android:0.8.7
244248
io.github.vinceglb:filekit-core:0.8.7
245249
io.insert-koin:koin-android:4.0.1-RC1
246250
io.insert-koin:koin-androidx-compose:4.0.1-RC1
251+
io.insert-koin:koin-androidx-navigation:4.0.1-RC1
247252
io.insert-koin:koin-annotations-jvm:1.4.0-RC4
248253
io.insert-koin:koin-annotations:1.4.0-RC4
249254
io.insert-koin:koin-bom:4.0.1-RC1

androidApp/dependencies/prodReleaseRuntimeClasspath.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ androidx.core:core-splashscreen:1.0.1
6161
androidx.core:core:1.15.0
6262
androidx.cursoradapter:cursoradapter:1.0.0
6363
androidx.customview:customview-poolingcontainer:1.0.0
64-
androidx.customview:customview:1.0.0
64+
androidx.customview:customview:1.1.0
6565
androidx.databinding:viewbinding:7.4.2
6666
androidx.documentfile:documentfile:1.0.0
6767
androidx.drawerlayout:drawerlayout:1.0.0
@@ -101,6 +101,8 @@ androidx.multidex:multidex:2.0.1
101101
androidx.navigation:navigation-common-ktx:2.8.5
102102
androidx.navigation:navigation-common:2.8.5
103103
androidx.navigation:navigation-compose:2.8.5
104+
androidx.navigation:navigation-fragment-ktx:2.8.5
105+
androidx.navigation:navigation-fragment:2.8.5
104106
androidx.navigation:navigation-runtime-ktx:2.8.5
105107
androidx.navigation:navigation-runtime:2.8.5
106108
androidx.print:print:1.0.0
@@ -115,6 +117,7 @@ androidx.room:room-runtime-android:2.7.0-alpha12
115117
androidx.room:room-runtime:2.7.0-alpha12
116118
androidx.savedstate:savedstate-ktx:1.2.1
117119
androidx.savedstate:savedstate:1.2.1
120+
androidx.slidingpanelayout:slidingpanelayout:1.2.0
118121
androidx.sqlite:sqlite-android:2.5.0-alpha12
119122
androidx.sqlite:sqlite-bundled-android:2.5.0-alpha12
120123
androidx.sqlite:sqlite-bundled:2.5.0-alpha12
@@ -124,6 +127,7 @@ androidx.sqlite:sqlite:2.5.0-alpha12
124127
androidx.startup:startup-runtime:1.1.1
125128
androidx.tracing:tracing-ktx:1.2.0
126129
androidx.tracing:tracing:1.2.0
130+
androidx.transition:transition:1.4.1
127131
androidx.vectordrawable:vectordrawable-animated:1.1.0
128132
androidx.vectordrawable:vectordrawable:1.1.0
129133
androidx.versionedparcelable:versionedparcelable:1.1.1
@@ -239,6 +243,7 @@ io.github.vinceglb:filekit-core-android:0.8.7
239243
io.github.vinceglb:filekit-core:0.8.7
240244
io.insert-koin:koin-android:4.0.1-RC1
241245
io.insert-koin:koin-androidx-compose:4.0.1-RC1
246+
io.insert-koin:koin-androidx-navigation:4.0.1-RC1
242247
io.insert-koin:koin-annotations-jvm:1.4.0-RC4
243248
io.insert-koin:koin-annotations:1.4.0-RC4
244249
io.insert-koin:koin-bom:4.0.1-RC1

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ class AndroidFeatureConventionPlugin : Plugin<Project> {
3636
add("androidTestImplementation", libs.findLibrary("androidx.lifecycle.runtimeTesting").get())
3737

3838
add("testImplementation", kotlin("test"))
39-
add("testImplementation", project(":core:testing"))
39+
// add("testImplementation", project(":core:testing"))
4040
add("testImplementation", libs.findLibrary("hilt.android.testing").get())
4141
add("testImplementation", libs.findLibrary("squareup.okhttp").get())
4242

4343
add("debugImplementation", libs.findLibrary("androidx.compose.ui.test.manifest").get())
4444

45-
add("androidTestImplementation", project(":core:testing"))
45+
// add("androidTestImplementation", project(":core:testing"))
4646
add("androidTestImplementation", libs.findLibrary("androidx.navigation.testing").get())
4747
add("androidTestImplementation", libs.findLibrary("androidx.compose.ui.test").get())
4848
add("androidTestImplementation", libs.findLibrary("hilt.android.testing").get())

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CMPFeatureConventionPlugin : Plugin<Project> {
88
override fun apply(target: Project) {
99
with(target) {
1010
with(pluginManager) {
11-
apply("mifos.kmp.libray")
11+
apply("mifos.kmp.library")
1212
apply("mifos.kmp.koin")
1313
apply("org.jetbrains.kotlin.plugin.compose")
1414
apply("org.jetbrains.compose")
@@ -17,7 +17,7 @@ class CMPFeatureConventionPlugin : Plugin<Project> {
1717
dependencies {
1818
add("commonMainImplementation", project(":core:ui"))
1919
add("commonMainImplementation", project(":core:designsystem"))
20-
add("commonMainImplementation", project(":core:testing"))
20+
// add("commonMainImplementation", project(":core:testing"))
2121
add("commonMainImplementation", project(":core:data"))
2222

2323
add("commonMainImplementation", libs.findLibrary("koin.compose").get())

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import com.google.devtools.ksp.gradle.KspExtension
12
import org.gradle.api.Plugin
23
import org.gradle.api.Project
4+
import org.gradle.kotlin.dsl.configure
35
import org.gradle.kotlin.dsl.dependencies
46
import org.mifos.mobile.libs
57

68
class KMPKoinConventionPlugin : Plugin<Project> {
79

810
override fun apply(target: Project) {
9-
with(target){
10-
with(pluginManager){
11+
with(target) {
12+
with(pluginManager) {
1113
apply("com.google.devtools.ksp")
1214
}
1315

@@ -19,6 +21,9 @@ class KMPKoinConventionPlugin : Plugin<Project> {
1921
add("kspCommonMainMetadata", libs.findLibrary("koin.ksp.compiler").get())
2022
add("commonTestImplementation", libs.findLibrary("koin.test").get())
2123
}
24+
extensions.configure<KspExtension> {
25+
arg("KOIN_CONFIG_CHECK", "true")
26+
}
2227
}
2328
}
2429

feature/about/build.gradle.kts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@
88
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
99
*/
1010
plugins {
11-
alias(libs.plugins.mifos.android.feature)
12-
alias(libs.plugins.mifos.android.library.compose)
11+
alias(libs.plugins.mifos.cmp.feature)
1312
}
1413

1514
android {
1615
namespace = "org.mifos.mobile.feature.about"
1716
}
1817

19-
dependencies {
20-
18+
kotlin {
19+
sourceSets{
20+
commonMain.dependencies {
21+
implementation(compose.material3)
22+
implementation(compose.components.resources)
23+
implementation(compose.ui)
24+
api(projects.core.common)
25+
}
26+
}
2127
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright 2025 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-mobile/blob/master/LICENSE.md
9+
*/
10+
package org.mifos.mobile.feature.about
11+
12+
import android.graphics.Bitmap
13+
import android.webkit.WebResourceRequest
14+
import android.webkit.WebView
15+
import android.webkit.WebViewClient
16+
import androidx.compose.runtime.Composable
17+
import androidx.compose.ui.Modifier
18+
import androidx.compose.ui.viewinterop.AndroidView
19+
20+
@Composable
21+
actual fun MyWebView(
22+
htmlContent: String,
23+
isLoading: (isLoading: Boolean) -> Unit,
24+
onUrlClicked: (url: String) -> Unit,
25+
modifier: Modifier,
26+
) {
27+
AndroidView(
28+
modifier = modifier,
29+
factory = { context ->
30+
WebView(context).apply {
31+
settings.javaScriptEnabled = true
32+
settings.domStorageEnabled = true
33+
overScrollMode = WebView.OVER_SCROLL_NEVER
34+
this.webViewClient = object : WebViewClient() {
35+
@Deprecated("Deprecated in Java")
36+
override fun shouldOverrideUrlLoading(
37+
view: WebView,
38+
request: WebResourceRequest?,
39+
): Boolean {
40+
return if (request?.url.toString().contains("jpg") ||
41+
request?.url.toString().contains("png") ||
42+
request?.url.toString().contains("attachment_id")
43+
) {
44+
true
45+
} else {
46+
onUrlClicked(request?.url.toString())
47+
true
48+
}
49+
}
50+
51+
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
52+
isLoading(true)
53+
}
54+
55+
override fun onPageFinished(view: WebView?, url: String?) {
56+
isLoading(false)
57+
}
58+
}
59+
loadUrl(htmlContent)
60+
}
61+
},
62+
update = { webView ->
63+
webView.loadUrl(htmlContent)
64+
},
65+
)
66+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright 2025 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-mobile/blob/master/LICENSE.md
9+
*/
10+
package org.mifos.mobile.feature.about
11+
12+
import android.content.Intent
13+
import android.net.Uri
14+
15+
actual fun openUrl(url: String?) {
16+
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
17+
}

0 commit comments

Comments
 (0)