From 4b1f33f4709451e8b326aa50ae386b01cdc5ba7c Mon Sep 17 00:00:00 2001 From: Wizcoderr Date: Tue, 28 Oct 2025 02:17:03 +0530 Subject: [PATCH 1/2] Documentation for features/location --- .../feature/location/LocationScreen.android.kt | 6 ++++++ .../mobile/feature/location/LocationScreen.kt | 12 ++++++++++++ .../location/navigation/LocationNavGraph.kt | 13 +++++++++++++ .../location/navigation/LocationNavigation.kt | 18 +++++++++++++++++- .../feature/location/LocationScreen.desktop.kt | 6 ++++++ .../feature/location/LocationScreen.js.kt | 6 ++++++ .../feature/location/LocationScreen.native.kt | 6 ++++++ .../feature/location/LocationScreen.wasmJs.kt | 6 ++++++ 8 files changed, 72 insertions(+), 1 deletion(-) diff --git a/feature/location/src/androidMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.android.kt b/feature/location/src/androidMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.android.kt index 8e2f52bbb4..7f88a0e22b 100644 --- a/feature/location/src/androidMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.android.kt +++ b/feature/location/src/androidMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.android.kt @@ -18,6 +18,12 @@ import com.google.maps.android.compose.Marker import com.google.maps.android.compose.MarkerState import com.google.maps.android.compose.rememberCameraPositionState +/** + * Android-specific implementation of the [RenderMap] composable function. + * This function displays a Google Map centered on the Mifos Initiative headquarters. + * + * @param modifier A [Modifier] for this composable. + */ @Composable actual fun RenderMap(modifier: Modifier) { val headquarterLatLng = LatLng(47.61115, -122.34481) diff --git a/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt b/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt index 9388a1ff9e..5b869a9caf 100644 --- a/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt +++ b/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt @@ -23,6 +23,12 @@ import mifos_mobile.feature.location.generated.resources.mifos_initiative import mifos_mobile.feature.location.generated.resources.mifos_location import org.jetbrains.compose.resources.stringResource +/** + * A composable function that displays the location of the Mifos Initiative. + * It includes the name, address, and a map view showing the location. + * + * @param modifier A [Modifier] for this composable. + */ @Composable internal fun LocationsScreen( modifier: Modifier = Modifier, @@ -45,5 +51,11 @@ internal fun LocationsScreen( } } +/** + * An expect composable function for rendering a map. Each platform is expected + * to provide its own implementation. + * + * @param modifier A [Modifier] for this composable. + */ @Composable expect fun RenderMap(modifier: Modifier = Modifier) diff --git a/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavGraph.kt b/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavGraph.kt index b578fe9e07..40e269c846 100644 --- a/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavGraph.kt +++ b/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavGraph.kt @@ -15,10 +15,18 @@ import androidx.navigation.compose.composable import androidx.navigation.compose.navigation import org.mifos.mobile.feature.location.LocationsScreen +/** + * Navigates to the locations screen. + */ fun NavController.navigateToLocationsScreen() { navigate(LocationsNavigation.LocationsScreen.route) } +/** + * Defines the navigation graph for the locations feature. + * + * @receiver [NavGraphBuilder] + */ fun NavGraphBuilder.locationsNavGraph() { navigation( startDestination = LocationsNavigation.LocationsScreen.route, @@ -28,6 +36,11 @@ fun NavGraphBuilder.locationsNavGraph() { } } +/** + * Defines the route for the locations screen. + * + * @receiver [NavGraphBuilder] + */ fun NavGraphBuilder.locationsScreenRoute() { composable( route = LocationsNavigation.LocationsScreen.route, diff --git a/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt b/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt index dea35dde21..44dd078181 100644 --- a/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt +++ b/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt @@ -10,11 +10,27 @@ package org.mifos.mobile.feature.location.navigation // Constants for Routes +/** + * Base route for the locations feature navigation graph. + */ const val LOCATIONS_NAVIGATION_ROUTE_BASE = "locations_base_route" +/** + * Route for the locations screen. + */ const val LOCATIONS_SCREEN_ROUTE = "locations_screen_route" -// Sealed class for Navigation Routes +/** + * Sealed class representing the navigation routes for the locations feature. + * + * @property route The route string for the navigation destination. + */ sealed class LocationsNavigation(val route: String) { + /** + * Represents the base navigation route for the locations feature. + */ data object LocationsBase : LocationsNavigation(route = LOCATIONS_NAVIGATION_ROUTE_BASE) + /** + * Represents the screen for displaying locations. + */ data object LocationsScreen : LocationsNavigation(route = LOCATIONS_SCREEN_ROUTE) } diff --git a/feature/location/src/desktopMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.desktop.kt b/feature/location/src/desktopMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.desktop.kt index b2afa1c041..97d4949bfe 100644 --- a/feature/location/src/desktopMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.desktop.kt +++ b/feature/location/src/desktopMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.desktop.kt @@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +/** + * Desktop-specific implementation of the [RenderMap] composable function. + * This is currently a no-op. + * + * @param modifier A [Modifier] for this composable. + */ @Composable actual fun RenderMap(modifier: Modifier) { } diff --git a/feature/location/src/jsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.js.kt b/feature/location/src/jsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.js.kt index b2afa1c041..55e9add538 100644 --- a/feature/location/src/jsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.js.kt +++ b/feature/location/src/jsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.js.kt @@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +/** + * JS-specific implementation of the [RenderMap] composable function. + * This is currently a no-op. + * + * @param modifier A [Modifier] for this composable. + */ @Composable actual fun RenderMap(modifier: Modifier) { } diff --git a/feature/location/src/nativeMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.native.kt b/feature/location/src/nativeMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.native.kt index b2afa1c041..5a57c8c899 100644 --- a/feature/location/src/nativeMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.native.kt +++ b/feature/location/src/nativeMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.native.kt @@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +/** + * Native-specific implementation of the [RenderMap] composable function. + * This is currently a no-op. + * + * @param modifier A [Modifier] for this composable. + */ @Composable actual fun RenderMap(modifier: Modifier) { } diff --git a/feature/location/src/wasmJsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.wasmJs.kt b/feature/location/src/wasmJsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.wasmJs.kt index b2afa1c041..494d8e95e5 100644 --- a/feature/location/src/wasmJsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.wasmJs.kt +++ b/feature/location/src/wasmJsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.wasmJs.kt @@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +/** + * WasmJs-specific implementation of the [RenderMap] composable function. + * This is currently a no-op. + * + * @param modifier A [Modifier] for this composable. + */ @Composable actual fun RenderMap(modifier: Modifier) { } From 79da93482ac75243f0ce5fef600384d2444e3bf6 Mon Sep 17 00:00:00 2001 From: Wizcoderr Date: Tue, 28 Oct 2025 02:21:21 +0530 Subject: [PATCH 2/2] Documentation for features/location --- .../mobile/feature/location/navigation/LocationNavigation.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt b/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt index 44dd078181..cac07eb370 100644 --- a/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt +++ b/feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt @@ -14,6 +14,7 @@ package org.mifos.mobile.feature.location.navigation * Base route for the locations feature navigation graph. */ const val LOCATIONS_NAVIGATION_ROUTE_BASE = "locations_base_route" + /** * Route for the locations screen. */ @@ -29,6 +30,7 @@ sealed class LocationsNavigation(val route: String) { * Represents the base navigation route for the locations feature. */ data object LocationsBase : LocationsNavigation(route = LOCATIONS_NAVIGATION_ROUTE_BASE) + /** * Represents the screen for displaying locations. */