Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import dev.ohs.fhir.catalog.ui.questionnaire.components.ErrorStateToggleAction
import dev.ohs.fhir.catalog.views.barcode.BarcodeItemViewFactoryMatcher
import dev.ohs.fhir.catalog.views.locationwidget.LocationCaptureItemViewFactoryMatcher
import dev.ohs.fhir.catalog.views.locationwidget.LocationCoordinateItemViewFactoryMatcher
import dev.ohs.fhir.datacapture.Questionnaire
import dev.ohs.fhir.datacapture.QuestionnaireConfig
import dev.ohs.fhir.datacapture.QuestionnaireItemViewFactoryMatcher
import dev.ohs.fhir.datacapture.QuestionnaireItemViewFactoryMatchersProvider
import dev.ohs.fhir.datacapture.views.barcode.BarcodeItemViewFactoryMatcher
import dev.ohs.fhir.datacapture.views.locationwidget.LocationCaptureItemViewFactoryMatcher
import dev.ohs.fhir.datacapture.views.locationwidget.LocationCoordinateItemViewFactoryMatcher
import kotlin_fhir_data_capture.catalog.generated.resources.Res
import kotlin_fhir_data_capture.catalog.generated.resources.arrow_back_filled_24dp
import kotlin_fhir_data_capture.catalog.generated.resources.behavior_name_calculated_expression
Expand Down
21 changes: 21 additions & 0 deletions datacapture/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ kotlin {
implementation(libs.navigation.compose)
implementation(libs.ohs.fhir.model)
implementation(libs.ohs.fhir.path)
implementation(libs.compass.geolocation)
}
}

Expand Down Expand Up @@ -137,6 +138,26 @@ kotlin {
implementation(libs.kotlinx.coroutines.swing)
}
}
androidMain {
dependencies {
implementation(libs.compass.geolocation.mobile)
implementation(libs.compass.permissions.mobile)
implementation(libs.moko.permissions.camera)
implementation(libs.moko.permissions.compose)
implementation(libs.kscan)
}
}

iosMain {
dependencies {
implementation(libs.compass.geolocation.mobile)
implementation(libs.compass.permissions.mobile)
implementation(libs.moko.permissions.camera)
implementation(libs.moko.permissions.compose)
}
}

wasmJsMain { dependencies { implementation(libs.compass.geolocation.browser) } }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.ohs.fhir.catalog.views.locationwidget
package dev.ohs.fhir.datacapture.views.locationwidget

import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import dev.jordond.compass.geolocation.Geolocator
import dev.jordond.compass.geolocation.mobile

@Composable internal actual fun rememberGeolocator(): Geolocator = remember { Geolocator.mobile() }
@Composable actual fun rememberGeolocator(): Geolocator = remember { Geolocator.mobile() }
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal"
>
<path
android:fillColor="#FFFF"
android:pathData="M480,480q33,0 56.5,-23.5T560,400q0,-33 -23.5,-56.5T480,320q-33,0 -56.5,23.5T400,400q0,33 23.5,56.5T480,480ZM480,774q122,-112 181,-203.5T720,408q0,-109 -69.5,-178.5T480,160q-101,0 -170.5,69.5T240,408q0,71 59,162.5T480,774ZM480,880Q319,743 239.5,625.5T160,408q0,-150 96.5,-239T480,80q127,0 223.5,89T800,408q0,100 -79.5,217.5T480,880ZM480,400Z"
/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="24"
android:viewportHeight="24"
>
<path
android:fillColor="#1A73E8"
android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"
/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,5 @@
<string name="space_asterisk">\u0020\u002a</string>
<string name="repeated_group_title">%1$s. %2$s</string>
<string name="add_repeated_group_item">Add %1$s</string>
<string name="record_gps_location">Record GPS Location</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.ohs.fhir.catalog.views.locationwidget
package dev.ohs.fhir.datacapture.views.locationwidget

import androidx.compose.runtime.Composable
import dev.jordond.compass.geolocation.Geolocator

@Composable internal expect fun rememberGeolocator(): Geolocator
@Composable expect fun rememberGeolocator(): Geolocator
Comment thread
MeshackKangi marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.ohs.fhir.catalog.views.locationwidget
package dev.ohs.fhir.datacapture.views.locationwidget

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -45,9 +45,9 @@ import dev.ohs.fhir.datacapture.views.QuestionnaireViewItem
import dev.ohs.fhir.datacapture.views.components.Header
import dev.ohs.fhir.datacapture.views.components.MediaItem
import dev.ohs.fhir.datacapture.views.factories.QuestionnaireItemViewFactory
import kotlin_fhir_data_capture.catalog.generated.resources.Res
import kotlin_fhir_data_capture.catalog.generated.resources.gm_location_on_24
import kotlin_fhir_data_capture.catalog.generated.resources.record_gps_location
import kotlin_fhir_data_capture.datacapture.generated.resources.Res
import kotlin_fhir_data_capture.datacapture.generated.resources.gm_location_on_24
import kotlin_fhir_data_capture.datacapture.generated.resources.record_gps_location
import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.resources.stringResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.ohs.fhir.catalog.views.locationwidget
package dev.ohs.fhir.datacapture.views.locationwidget

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -38,8 +38,8 @@ import dev.ohs.fhir.datacapture.views.factories.QuestionnaireItemViewFactory
import dev.ohs.fhir.model.r4.Decimal
import dev.ohs.fhir.model.r4.Questionnaire
import dev.ohs.fhir.model.r4.QuestionnaireResponse
import kotlin_fhir_data_capture.catalog.generated.resources.Res
import kotlin_fhir_data_capture.catalog.generated.resources.required_text_and_new_line
import kotlin_fhir_data_capture.datacapture.generated.resources.Res
import kotlin_fhir_data_capture.datacapture.generated.resources.required_text_and_new_line
import org.jetbrains.compose.resources.stringResource

internal const val PRIMARY_GPS_COORDINATE_EXTENSION_URL =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.ohs.fhir.catalog.views.locationwidget
package dev.ohs.fhir.datacapture.views.locationwidget

import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.asSharedFlow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.ohs.fhir.catalog.views.locationwidget
package dev.ohs.fhir.datacapture.views.locationwidget

import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import dev.jordond.compass.geolocation.Geolocator
import dev.jordond.compass.geolocation.mobile

@Composable internal actual fun rememberGeolocator(): Geolocator = remember { Geolocator.mobile() }
@Composable actual fun rememberGeolocator(): Geolocator = remember { Geolocator.mobile() }
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.ohs.fhir.catalog.views.locationwidget
package dev.ohs.fhir.datacapture.views.locationwidget

import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import dev.jordond.compass.geolocation.Geolocator
import dev.jordond.compass.geolocation.NotSupportedLocator

@Composable
internal actual fun rememberGeolocator(): Geolocator = remember { Geolocator(NotSupportedLocator) }
actual fun rememberGeolocator(): Geolocator = remember { Geolocator(NotSupportedLocator) }
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.ohs.fhir.catalog.views.locationwidget
package dev.ohs.fhir.datacapture.views.locationwidget

import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import dev.jordond.compass.geolocation.Geolocator
import dev.jordond.compass.geolocation.browser

@Composable internal actual fun rememberGeolocator(): Geolocator = remember { Geolocator.browser() }
@Composable actual fun rememberGeolocator(): Geolocator = remember { Geolocator.browser() }
8 changes: 5 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Gradle
org.gradle.jvmargs=-Xmx16g -XX:MaxMetaspaceSize=8g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=512m
org.gradle.workers.max=2
org.gradle.parallel=true
Comment on lines +1 to +3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

org.gradle.caching=true
org.gradle.configuration-cache=true
Comment thread
MeshackKangi marked this conversation as resolved.

#Kotlin
kotlin.code.style=official
Expand All @@ -23,3 +23,5 @@ androidNamespace=dev.ohs.fhir.datacapture
#Kotest
io.kotest.multiplatform.compiler.plugin.enabled=false
kotest.compiler.plugin.enabled=false
org.gradle.jvmargs=-Xmx4g
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1024m
Comment thread
MeshackKangi marked this conversation as resolved.
Loading