Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: location module #2647

Merged
merged 1 commit into from
Jul 6, 2024
Merged
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
5 changes: 2 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ dependencies {
implementation(projects.feature.thirdPartyTransfer)
implementation(projects.feature.help)
implementation(projects.feature.notification)
implementation(projects.feature.location)


implementation("androidx.legacy:legacy-support-v4:1.0.0")
Expand All @@ -99,7 +100,7 @@ dependencies {
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.preference)
implementation(libs.play.services.maps)


// DBFlow
implementation(libs.dbflow)
Expand Down Expand Up @@ -197,8 +198,6 @@ dependencies {
debugApi(libs.androidx.compose.ui.tooling)
api(libs.androidx.hilt.navigation.compose)

// google maps
implementation ("com.google.maps.android:maps-compose:4.4.1")

//image cropper
implementation("com.github.CanHub:Android-Image-Cropper:4.0.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import org.mifos.mobile.core.ui.component.mifosComposeView
import org.mifos.mobile.core.ui.theme.MifosMobileTheme
import org.mifos.mobile.feature.location.LocationsScreen

class LocationsFragment : Fragment() {

Expand All @@ -16,9 +16,7 @@ class LocationsFragment : Fragment() {
savedInstanceState: Bundle?
): View {
return mifosComposeView(requireContext()) {
MifosMobileTheme {
LocationsScreen()
}
LocationsScreen()
}
}

Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/layout/fragment_locations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,5 @@
android:layout_height="wrap_content"
android:text="@string/mifos_location" />

<com.google.android.gms.maps.MapView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="@dimen/height_0dp"
android:layout_marginTop="@dimen/Mifos.DesignSystem.Spacing.CardInnerPaddingLarge"
android:layout_weight="1" />

</LinearLayout>
1 change: 1 addition & 0 deletions feature/location/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
17 changes: 17 additions & 0 deletions feature/location/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
plugins {
alias(libs.plugins.mifos.android.feature)
alias(libs.plugins.mifos.android.library.compose)
}

android {
namespace = "org.mifos.mobile.feature.location"
}

dependencies {
// google maps
implementation(libs.google.map.compose)

testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
}
Empty file.
21 changes: 21 additions & 0 deletions feature/location/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.mifos.mobile.feature.location

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("org.mifos.mobile.feature.location.test", appContext.packageName)
}
}
4 changes: 4 additions & 0 deletions feature/location/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.mifos.mobile.ui.location
package org.mifos.mobile.feature.location

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
Expand All @@ -14,15 +14,13 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.MapView
import com.google.android.gms.maps.model.CameraPosition
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.compose.GoogleMap
import com.google.maps.android.compose.Marker
import com.google.maps.android.compose.MarkerState
import com.google.maps.android.compose.rememberCameraPositionState
import org.mifos.mobile.R
import org.mifos.mobile.core.ui.theme.MifosMobileTheme
import kotlin.coroutines.coroutineContext

Expand Down
7 changes: 7 additions & 0 deletions feature/location/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="mifos_initiative">Mifos Initiative</string>
<string name="mifos_location">Mifos Initiative , Seattle , Washington 98121</string>
<string name="map_marker_heading">Seattle</string>
<string name="map_marker_desc">Home to large tech industry</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.mifos.mobile.feature.location

import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ playServicesCodeScanner = "16.1.0"
googleAppCodeScanner = "17.2.0"
cameraxVersion = "1.3.1"
compose-material = "1.6.8"
googleMaps = "4.4.1"

[libraries]
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "activityVersion" }
Expand Down Expand Up @@ -112,6 +113,7 @@ androidx-camera-camera2 = { group = "androidx.camera", name = "camera-camera2",
androidx-camera-lifecycle = { group = "androidx.camera", name = "camera-lifecycle", version.ref = "cameraxVersion"}
androidx-camera-view = { group = "androidx.camera", name = "camera-view", version.ref = "cameraxVersion"}
androidx-camera-core = { group = "androidx.camera", name = "camera-core", version.ref = "cameraxVersion" }
google-map-compose = { group = "com.google.maps.android", name = "maps-compose", version.ref = "googleMaps" }

# Dependencies of the included build-logic
android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ include(":feature:client_charge")
include(":feature:third-party-transfer")
include(":feature:help")
include(":feature:notification")
include(":feature:location")
Loading