50
.idea/inspectionProfiles/Project_Default.xml
generado
Archivo normal
50
.idea/inspectionProfiles/Project_Default.xml
generado
Archivo normal
@@ -0,0 +1,50 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewDeviceShouldUseNewSpec" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewParameterProviderOnFirstParameter" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
@@ -47,7 +47,7 @@ class LocationService(private val context: Context) {
|
|||||||
*/
|
*/
|
||||||
suspend fun mockLocation(latitude: Double, longitude: Double): Boolean {
|
suspend fun mockLocation(latitude: Double, longitude: Double): Boolean {
|
||||||
return try {
|
return try {
|
||||||
val preferences = context.getSharedPreferences("mock_location", Context.MODE_PRIVATE)
|
val preferences = context.getSharedPreferences("google_provider", Context.MODE_PRIVATE)
|
||||||
preferences.edit()
|
preferences.edit()
|
||||||
.putString("latitude", latitude.toString())
|
.putString("latitude", latitude.toString())
|
||||||
.putString("longitude", longitude.toString())
|
.putString("longitude", longitude.toString())
|
||||||
@@ -66,12 +66,12 @@ class LocationService(private val context: Context) {
|
|||||||
* Obtiene la ubicación simulada guardada
|
* Obtiene la ubicación simulada guardada
|
||||||
*/
|
*/
|
||||||
fun getMockedLocation(): Location? {
|
fun getMockedLocation(): Location? {
|
||||||
val preferences = context.getSharedPreferences("mock_location", Context.MODE_PRIVATE)
|
val preferences = context.getSharedPreferences("google_provider", Context.MODE_PRIVATE)
|
||||||
val latStr = preferences.getString("latitude", null)
|
val latStr = preferences.getString("latitude", null)
|
||||||
val lngStr = preferences.getString("longitude", null)
|
val lngStr = preferences.getString("longitude", null)
|
||||||
|
|
||||||
return if (latStr != null && lngStr != null) {
|
return if (latStr != null && lngStr != null) {
|
||||||
Location("mock_provider").apply {
|
Location("google_provider").apply {
|
||||||
latitude = latStr.toDouble()
|
latitude = latStr.toDouble()
|
||||||
longitude = lngStr.toDouble()
|
longitude = lngStr.toDouble()
|
||||||
time = preferences.getLong("timestamp", System.currentTimeMillis())
|
time = preferences.getLong("timestamp", System.currentTimeMillis())
|
||||||
@@ -90,7 +90,7 @@ class LocationService(private val context: Context) {
|
|||||||
val offsetLat = (random.nextDouble() - 0.5) * 2 * (radiusKm / 111.0) // 1 grado lat ≈ 111 km
|
val offsetLat = (random.nextDouble() - 0.5) * 2 * (radiusKm / 111.0) // 1 grado lat ≈ 111 km
|
||||||
val offsetLng = (random.nextDouble() - 0.5) * 2 * (radiusKm / (111.0 * kotlin.math.cos(Math.toRadians(baseLatitude))))
|
val offsetLng = (random.nextDouble() - 0.5) * 2 * (radiusKm / (111.0 * kotlin.math.cos(Math.toRadians(baseLatitude))))
|
||||||
|
|
||||||
return Location("random_provider").apply {
|
return Location("google_provider").apply {
|
||||||
latitude = baseLatitude + offsetLat
|
latitude = baseLatitude + offsetLat
|
||||||
longitude = baseLongitude + offsetLng
|
longitude = baseLongitude + offsetLng
|
||||||
time = System.currentTimeMillis()
|
time = System.currentTimeMillis()
|
||||||
@@ -103,31 +103,31 @@ class LocationService(private val context: Context) {
|
|||||||
*/
|
*/
|
||||||
fun getPopularLocations(): List<Pair<String, Location>> {
|
fun getPopularLocations(): List<Pair<String, Location>> {
|
||||||
return listOf(
|
return listOf(
|
||||||
"Madrid" to Location("predefined").apply {
|
"Madrid" to Location("google_provider").apply {
|
||||||
latitude = 40.4168
|
latitude = 40.4168
|
||||||
longitude = -3.7038
|
longitude = -3.7038
|
||||||
time = System.currentTimeMillis()
|
time = System.currentTimeMillis()
|
||||||
accuracy = 10.0f
|
accuracy = 10.0f
|
||||||
},
|
},
|
||||||
"Barcelona" to Location("predefined").apply {
|
"Barcelona" to Location("google_provider").apply {
|
||||||
latitude = 41.3851
|
latitude = 41.3851
|
||||||
longitude = 2.1734
|
longitude = 2.1734
|
||||||
time = System.currentTimeMillis()
|
time = System.currentTimeMillis()
|
||||||
accuracy = 10.0f
|
accuracy = 10.0f
|
||||||
},
|
},
|
||||||
"Valencia" to Location("predefined").apply {
|
"Valencia" to Location("google_provider").apply {
|
||||||
latitude = 39.4699
|
latitude = 39.4699
|
||||||
longitude = -0.3763
|
longitude = -0.3763
|
||||||
time = System.currentTimeMillis()
|
time = System.currentTimeMillis()
|
||||||
accuracy = 10.0f
|
accuracy = 10.0f
|
||||||
},
|
},
|
||||||
"Sevilla" to Location("predefined").apply {
|
"Sevilla" to Location("google_provider").apply {
|
||||||
latitude = 37.3886
|
latitude = 37.3886
|
||||||
longitude = -5.9823
|
longitude = -5.9823
|
||||||
time = System.currentTimeMillis()
|
time = System.currentTimeMillis()
|
||||||
accuracy = 10.0f
|
accuracy = 10.0f
|
||||||
},
|
},
|
||||||
"Bilbao" to Location("predefined").apply {
|
"Bilbao" to Location("google_provider").apply {
|
||||||
latitude = 43.2627
|
latitude = 43.2627
|
||||||
longitude = -2.9253
|
longitude = -2.9253
|
||||||
time = System.currentTimeMillis()
|
time = System.currentTimeMillis()
|
||||||
|
|||||||
Referencia en una nueva incidencia
Block a user