Skip to content

Commit 4b1f33f

Browse files
committed
Documentation for features/location
1 parent 9e45f31 commit 4b1f33f

File tree

8 files changed

+72
-1
lines changed

8 files changed

+72
-1
lines changed

feature/location/src/androidMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.android.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ import com.google.maps.android.compose.Marker
1818
import com.google.maps.android.compose.MarkerState
1919
import com.google.maps.android.compose.rememberCameraPositionState
2020

21+
/**
22+
* Android-specific implementation of the [RenderMap] composable function.
23+
* This function displays a Google Map centered on the Mifos Initiative headquarters.
24+
*
25+
* @param modifier A [Modifier] for this composable.
26+
*/
2127
@Composable
2228
actual fun RenderMap(modifier: Modifier) {
2329
val headquarterLatLng = LatLng(47.61115, -122.34481)

feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ import mifos_mobile.feature.location.generated.resources.mifos_initiative
2323
import mifos_mobile.feature.location.generated.resources.mifos_location
2424
import org.jetbrains.compose.resources.stringResource
2525

26+
/**
27+
* A composable function that displays the location of the Mifos Initiative.
28+
* It includes the name, address, and a map view showing the location.
29+
*
30+
* @param modifier A [Modifier] for this composable.
31+
*/
2632
@Composable
2733
internal fun LocationsScreen(
2834
modifier: Modifier = Modifier,
@@ -45,5 +51,11 @@ internal fun LocationsScreen(
4551
}
4652
}
4753

54+
/**
55+
* An expect composable function for rendering a map. Each platform is expected
56+
* to provide its own implementation.
57+
*
58+
* @param modifier A [Modifier] for this composable.
59+
*/
4860
@Composable
4961
expect fun RenderMap(modifier: Modifier = Modifier)

feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavGraph.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@ import androidx.navigation.compose.composable
1515
import androidx.navigation.compose.navigation
1616
import org.mifos.mobile.feature.location.LocationsScreen
1717

18+
/**
19+
* Navigates to the locations screen.
20+
*/
1821
fun NavController.navigateToLocationsScreen() {
1922
navigate(LocationsNavigation.LocationsScreen.route)
2023
}
2124

25+
/**
26+
* Defines the navigation graph for the locations feature.
27+
*
28+
* @receiver [NavGraphBuilder]
29+
*/
2230
fun NavGraphBuilder.locationsNavGraph() {
2331
navigation(
2432
startDestination = LocationsNavigation.LocationsScreen.route,
@@ -28,6 +36,11 @@ fun NavGraphBuilder.locationsNavGraph() {
2836
}
2937
}
3038

39+
/**
40+
* Defines the route for the locations screen.
41+
*
42+
* @receiver [NavGraphBuilder]
43+
*/
3144
fun NavGraphBuilder.locationsScreenRoute() {
3245
composable(
3346
route = LocationsNavigation.LocationsScreen.route,

feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,27 @@
1010
package org.mifos.mobile.feature.location.navigation
1111

1212
// Constants for Routes
13+
/**
14+
* Base route for the locations feature navigation graph.
15+
*/
1316
const val LOCATIONS_NAVIGATION_ROUTE_BASE = "locations_base_route"
17+
/**
18+
* Route for the locations screen.
19+
*/
1420
const val LOCATIONS_SCREEN_ROUTE = "locations_screen_route"
1521

16-
// Sealed class for Navigation Routes
22+
/**
23+
* Sealed class representing the navigation routes for the locations feature.
24+
*
25+
* @property route The route string for the navigation destination.
26+
*/
1727
sealed class LocationsNavigation(val route: String) {
28+
/**
29+
* Represents the base navigation route for the locations feature.
30+
*/
1831
data object LocationsBase : LocationsNavigation(route = LOCATIONS_NAVIGATION_ROUTE_BASE)
32+
/**
33+
* Represents the screen for displaying locations.
34+
*/
1935
data object LocationsScreen : LocationsNavigation(route = LOCATIONS_SCREEN_ROUTE)
2036
}

feature/location/src/desktopMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.desktop.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location
1212
import androidx.compose.runtime.Composable
1313
import androidx.compose.ui.Modifier
1414

15+
/**
16+
* Desktop-specific implementation of the [RenderMap] composable function.
17+
* This is currently a no-op.
18+
*
19+
* @param modifier A [Modifier] for this composable.
20+
*/
1521
@Composable
1622
actual fun RenderMap(modifier: Modifier) {
1723
}

feature/location/src/jsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.js.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location
1212
import androidx.compose.runtime.Composable
1313
import androidx.compose.ui.Modifier
1414

15+
/**
16+
* JS-specific implementation of the [RenderMap] composable function.
17+
* This is currently a no-op.
18+
*
19+
* @param modifier A [Modifier] for this composable.
20+
*/
1521
@Composable
1622
actual fun RenderMap(modifier: Modifier) {
1723
}

feature/location/src/nativeMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.native.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location
1212
import androidx.compose.runtime.Composable
1313
import androidx.compose.ui.Modifier
1414

15+
/**
16+
* Native-specific implementation of the [RenderMap] composable function.
17+
* This is currently a no-op.
18+
*
19+
* @param modifier A [Modifier] for this composable.
20+
*/
1521
@Composable
1622
actual fun RenderMap(modifier: Modifier) {
1723
}

feature/location/src/wasmJsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.wasmJs.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location
1212
import androidx.compose.runtime.Composable
1313
import androidx.compose.ui.Modifier
1414

15+
/**
16+
* WasmJs-specific implementation of the [RenderMap] composable function.
17+
* This is currently a no-op.
18+
*
19+
* @param modifier A [Modifier] for this composable.
20+
*/
1521
@Composable
1622
actual fun RenderMap(modifier: Modifier) {
1723
}

0 commit comments

Comments
 (0)