Skip to content

Commit

Permalink
no movements of marker while already mocking through search
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanSmudja committed Nov 27, 2023
1 parent 99e3ece commit f8602f4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
Binary file added app/release/mockgps-app-release.apk
Binary file not shown.
20 changes: 20 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.lilstiffy.mockgps",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object StorageManager {
}
}

var locationHistory: MutableList<LatLng>
private var locationHistory: MutableList<LatLng>
get() {
val json = pref.getString(KEY_HISTORY, "[]")
val typeToken = object : TypeToken<MutableList<LatLng>>() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lilstiffy.mockgps.ui.screens

import android.widget.Toast
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
Expand Down Expand Up @@ -103,7 +104,7 @@ fun MapScreen(activity: MainActivity) {
.align(Alignment.BottomEnd),
checked = isMocking,
onCheckedChange = { checked ->
isMocking = activity.toggleMocking() ?: isMocking
isMocking = activity.toggleMocking()
},
colors = IconButtonDefaults.filledIconToggleButtonColors(
checkedContainerColor = ButtonRed, containerColor = ButtonGreen, contentColor = Color.White
Expand All @@ -127,6 +128,12 @@ fun MapScreen(activity: MainActivity) {
.fillMaxHeight(0.075f)
.fillMaxWidth(),
onSearch = { searchTerm ->
// We don't want to support switching locations while already mocking
if (isMocking) {
Toast.makeText(activity, "You can't search while mocking location", Toast.LENGTH_SHORT).show()
return@SearchComponent
}

LocationHelper.geocoding(searchTerm) { foundLatLng ->
foundLatLng?.let {
markerPosition = it
Expand Down

0 comments on commit f8602f4

Please sign in to comment.