mirror of
https://github.com/YTVanced/VancedMicroG
synced 2025-01-05 06:51:00 +00:00
Temporary disable place picker
This commit is contained in:
parent
9f922b5a19
commit
2a01e6cb74
2 changed files with 19 additions and 19 deletions
|
@ -46,8 +46,8 @@ import com.google.android.gms.maps.model.LatLng;
|
||||||
import com.google.android.gms.maps.model.LatLngBounds;
|
import com.google.android.gms.maps.model.LatLngBounds;
|
||||||
|
|
||||||
import org.microg.gms.location.LocationConstants;
|
import org.microg.gms.location.LocationConstants;
|
||||||
import org.microg.gms.maps.vtm.BackendMapView;
|
//import org.microg.gms.maps.vtm.BackendMapView;
|
||||||
import org.microg.gms.maps.vtm.GmsMapsTypeHelper;
|
//import org.microg.gms.maps.vtm.GmsMapsTypeHelper;
|
||||||
import org.microg.safeparcel.SafeParcelUtil;
|
import org.microg.safeparcel.SafeParcelUtil;
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.event.Event;
|
import org.oscim.event.Event;
|
||||||
|
@ -61,13 +61,13 @@ import static android.Manifest.permission.ACCESS_FINE_LOCATION;
|
||||||
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||||
import static org.microg.gms.location.LocationConstants.EXTRA_PRIMARY_COLOR;
|
import static org.microg.gms.location.LocationConstants.EXTRA_PRIMARY_COLOR;
|
||||||
import static org.microg.gms.location.LocationConstants.EXTRA_PRIMARY_COLOR_DARK;
|
import static org.microg.gms.location.LocationConstants.EXTRA_PRIMARY_COLOR_DARK;
|
||||||
import static org.microg.gms.maps.vtm.GmsMapsTypeHelper.fromLatLngBounds;
|
//import static org.microg.gms.maps.vtm.GmsMapsTypeHelper.fromLatLngBounds;
|
||||||
|
|
||||||
public class PlacePickerActivity extends AppCompatActivity implements Map.UpdateListener {
|
public class PlacePickerActivity extends AppCompatActivity implements Map.UpdateListener {
|
||||||
private static final String TAG = "GmsPlacePicker";
|
private static final String TAG = "GmsPlacePicker";
|
||||||
|
|
||||||
private PlaceImpl place;
|
private PlaceImpl place;
|
||||||
private BackendMapView mapView;
|
// private BackendMapView mapView;
|
||||||
private Intent resultIntent;
|
private Intent resultIntent;
|
||||||
private AtomicBoolean geocoderInProgress = new AtomicBoolean(false);
|
private AtomicBoolean geocoderInProgress = new AtomicBoolean(false);
|
||||||
|
|
||||||
|
@ -91,17 +91,17 @@ public class PlacePickerActivity extends AppCompatActivity implements Map.Update
|
||||||
((TextView) findViewById(R.id.place_picker_title)).setTextColor(getIntent().getIntExtra(EXTRA_PRIMARY_COLOR_DARK, 0));
|
((TextView) findViewById(R.id.place_picker_title)).setTextColor(getIntent().getIntExtra(EXTRA_PRIMARY_COLOR_DARK, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
mapView = (BackendMapView) findViewById(R.id.map);
|
// mapView = (BackendMapView) findViewById(R.id.map);
|
||||||
mapView.map().getEventLayer().enableRotation(false);
|
// mapView.map().getEventLayer().enableRotation(false);
|
||||||
mapView.map().getEventLayer().enableTilt(false);
|
// mapView.map().getEventLayer().enableTilt(false);
|
||||||
mapView.map().events.bind(this);
|
// mapView.map().events.bind(this);
|
||||||
|
|
||||||
LatLngBounds latLngBounds = getIntent().getParcelableExtra(LocationConstants.EXTRA_BOUNDS);
|
LatLngBounds latLngBounds = getIntent().getParcelableExtra(LocationConstants.EXTRA_BOUNDS);
|
||||||
if (latLngBounds != null) {
|
if (latLngBounds != null) {
|
||||||
place.viewport = latLngBounds;
|
place.viewport = latLngBounds;
|
||||||
MapPosition mp = new MapPosition();
|
// MapPosition mp = new MapPosition();
|
||||||
mp.setByBoundingBox(fromLatLngBounds(latLngBounds), mapView.map().getWidth(), mapView.map().getHeight());
|
// mp.setByBoundingBox(fromLatLngBounds(latLngBounds), mapView.map().getWidth(), mapView.map().getHeight());
|
||||||
mapView.map().getMapPosition(mp);
|
// mapView.map().getMapPosition(mp);
|
||||||
} else {
|
} else {
|
||||||
if (ActivityCompat.checkSelfPermission(PlacePickerActivity.this, ACCESS_FINE_LOCATION) != PERMISSION_GRANTED) {
|
if (ActivityCompat.checkSelfPermission(PlacePickerActivity.this, ACCESS_FINE_LOCATION) != PERMISSION_GRANTED) {
|
||||||
ActivityCompat.requestPermissions(PlacePickerActivity.this, new String[]{ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}, 0);
|
ActivityCompat.requestPermissions(PlacePickerActivity.this, new String[]{ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}, 0);
|
||||||
|
@ -136,7 +136,7 @@ public class PlacePickerActivity extends AppCompatActivity implements Map.Update
|
||||||
}
|
}
|
||||||
Log.d(TAG, "Set location to " + last);
|
Log.d(TAG, "Set location to " + last);
|
||||||
if (last != null) {
|
if (last != null) {
|
||||||
mapView.map().setMapPosition(new MapPosition(last.getLatitude(), last.getLongitude(), 4096));
|
// mapView.map().setMapPosition(new MapPosition(last.getLatitude(), last.getLongitude(), 4096));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,12 +163,12 @@ public class PlacePickerActivity extends AppCompatActivity implements Map.Update
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
mapView.onResume();
|
// mapView.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
mapView.onPause();
|
// mapView.onPause();
|
||||||
super.onPause();
|
super.onPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,9 +188,9 @@ public class PlacePickerActivity extends AppCompatActivity implements Map.Update
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMapEvent(Event event, MapPosition position) {
|
public void onMapEvent(Event event, MapPosition position) {
|
||||||
place.viewport = GmsMapsTypeHelper.toLatLngBounds(mapView.map().viewport().getBBox(null, 0));
|
// place.viewport = GmsMapsTypeHelper.toLatLngBounds(mapView.map().viewport().getBBox(null, 0));
|
||||||
resultIntent.putExtra(LocationConstants.EXTRA_FINAL_BOUNDS, place.viewport);
|
// resultIntent.putExtra(LocationConstants.EXTRA_FINAL_BOUNDS, place.viewport);
|
||||||
place.latLng = GmsMapsTypeHelper.toLatLng(position.getGeoPoint());
|
// place.latLng = GmsMapsTypeHelper.toLatLng(position.getGeoPoint());
|
||||||
place.name = "";
|
place.name = "";
|
||||||
place.address = "";
|
place.address = "";
|
||||||
updateInfoText();
|
updateInfoText();
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
<org.microg.gms.maps.vtm.BackendMapView
|
<!-- <org.microg.gms.maps.vtm.BackendMapView
|
||||||
android:id="@+id/map"
|
android:id="@+id/map"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:paddingBottom="41dip"
|
android:paddingBottom="41dip"
|
||||||
android:src="@drawable/maps_default_marker"/>
|
android:src="@drawable/maps_default_marker"/>-->
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
Loading…
Reference in a new issue