-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal_history.patch
250 lines (235 loc) · 9.86 KB
/
local_history.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
Index: Woods App/src/main/res/layout/fragment_map.xml
===================================================================
diff --git a/Woods App/src/main/res/layout/fragment_map.xml b/Woods App/src/main/res/layout/fragment_map.xml
deleted file mode 100644
--- a/Woods App/src/main/res/layout/fragment_map.xml (date 0)
+++ /dev/null (date 0)
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:map="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:orientation="vertical" android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <Button
- android:id="@+id/btnFiltro"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="4dp"
- android:layout_marginTop="4dp"
- android:text="Filtro"
- map:layout_constraintStart_toStartOf="parent"
- map:layout_constraintTop_toTopOf="parent" />
-
- <fragment
- android:id="@+id/map"
- class="com.google.android.gms.maps.SupportMapFragment"
- android:layout_width="411dp"
- android:layout_height="610dp"
- android:layout_weight="1"
- android:scrollbars="vertical"
- map:layout_constraintBottom_toBottomOf="parent"
- map:layout_constraintEnd_toEndOf="parent"
- map:layout_constraintStart_toStartOf="parent" />
-
-</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Index: Woods App/src/main/res/values/strings.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Woods App/src/main/res/values/strings.xml b/Woods App/src/main/res/values/strings.xml
--- a/Woods App/src/main/res/values/strings.xml (date 1637526456837)
+++ b/Woods App/src/main/res/values/strings.xml (date 1637526456837)
@@ -4,6 +4,4 @@
<string name="txt_cadastre_se"><u>Cadastre-se</u></string>
<string name="open">Open</string>
<string name="close">Close</string>
- <!-- TODO: Remove or change this placeholder text -->
- <string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
\ No newline at end of file
Index: Woods App/src/main/java/com/example/woods/Maps.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Woods App/src/main/java/com/example/woods/Maps.java b/Woods App/src/main/java/com/example/woods/Maps.java
--- a/Woods App/src/main/java/com/example/woods/Maps.java (date 1637526456832)
+++ b/Woods App/src/main/java/com/example/woods/Maps.java (date 1637526456832)
@@ -9,21 +9,15 @@
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
-import androidx.fragment.app.Fragment;
import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
-import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
@@ -31,7 +25,7 @@
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
-public class Maps extends Fragment implements OnMapReadyCallback, GoogleMap.OnMapClickListener {
+public class Maps extends SupportMapFragment implements OnMapReadyCallback, GoogleMap.OnMapClickListener {
int TAG_CODE_PERMISSION_LOCATION;
float LOCATION_REFRESH_DISTANCE = 1;
@@ -40,7 +34,6 @@
private Context context;
private GoogleMap mMap;
- private MapView mapView;
private LocationManager locationManager;
private final MarkerOptions marker = new MarkerOptions();
private FusedLocationProviderClient client;
@@ -62,25 +55,7 @@
context = getActivity().getApplicationContext();
- if(mapView != null) {
- mapView.getMapAsync(this);
- }
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- return inflater.inflate(R.layout.fragment_map, container, false);
- }
-
- @Override
- public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
-
- mapView = (MapView) view.findViewById(R.id.map);
- mapView.onCreate(savedInstanceState);
- mapView.onResume();
- mapView.getMapAsync(this);
+ getMapAsync(this);
}
@Override
@@ -129,7 +104,7 @@
@Override
public void onSuccess(Location location) {
if(location != null) {
- mapView.getMapAsync(new OnMapReadyCallback() {
+ getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(@NonNull GoogleMap googleMap) {
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
@@ -142,7 +117,7 @@
}
private void moveMapToLocation(LatLng latLng) {
- mapView.getMapAsync(new OnMapReadyCallback() {
+ getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(@NonNull GoogleMap googleMap) {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 13));
@@ -156,7 +131,7 @@
double lon = latLng.longitude;
latLng = new LatLng(lat, lon);
- //moveMapToLocation(latLng);
+ moveMapToLocation(latLng);
Log.i("santi_movingToClick", latLng.toString());
}
}
\ No newline at end of file
Index: Woods App/src/main/java/com/example/woods/MainActivity.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Woods App/src/main/java/com/example/woods/MainActivity.java b/Woods App/src/main/java/com/example/woods/MainActivity.java
--- a/Woods App/src/main/java/com/example/woods/MainActivity.java (date 1637526456820)
+++ b/Woods App/src/main/java/com/example/woods/MainActivity.java (date 1637526456820)
@@ -47,7 +47,7 @@
fragmentManager = getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
- transaction.add(R.id.container, new MapFragment());
+ transaction.add(R.id.container, new Maps());
transaction.commitNow();
}
Index: Woods App/src/main/java/com/example/woods/MapFragment.java
===================================================================
diff --git a/Woods App/src/main/java/com/example/woods/MapFragment.java b/Woods App/src/main/java/com/example/woods/MapFragment.java
deleted file mode 100644
--- a/Woods App/src/main/java/com/example/woods/MapFragment.java (date 0)
+++ /dev/null (date 0)
@@ -1,36 +0,0 @@
-package com.example.woods;
-
-import android.os.Bundle;
-
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentManager;
-
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.google.android.gms.maps.GoogleMap;
-import com.google.android.gms.maps.OnMapReadyCallback;
-import com.google.android.gms.maps.SupportMapFragment;
-import com.google.android.gms.maps.model.MarkerOptions;
-
-public class MapFragment extends Fragment {
-
- SupportMapFragment mapFragment;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.fragment_map, container, false);
-
- mapFragment = SupportMapFragment.newInstance();
- getChildFragmentManager().beginTransaction().replace(R.id.map, mapFragment).commit();
-
- return view;
- }
-}
\ No newline at end of file
Index: Woods App/src/main/AndroidManifest.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Woods App/src/main/AndroidManifest.xml b/Woods App/src/main/AndroidManifest.xml
--- a/Woods App/src/main/AndroidManifest.xml (date 1637526456817)
+++ b/Woods App/src/main/AndroidManifest.xml (date 1637526456817)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.woods">
+ package="com.example.woods" >
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
@@ -19,7 +19,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
- android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
+ android:theme="@style/Theme.AppCompat.Light.DarkActionBar" >
<!--
The API key for Google Maps-based APIs is defined as a string resource.
@@ -42,7 +42,7 @@
android:exported="false" />
<activity
android:name=".MainActivity"
- android:exported="true">
+ android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />