Skip to content

Commit

Permalink
Merge commit '3469a224d2e38c5e6b81e03344bc211d8fbb28f1'
Browse files Browse the repository at this point in the history
* commit '3469a224d2e38c5e6b81e03344bc211d8fbb28f1':
  Address PR feedback from react-native-maps#1130
  Add android only note to showsIndoorLevelPicker

Conflicts:
	lib/android/googlemap/src/main/java/com/airbnb/android/react/maps/googlemap/AirGoogleMapView.java
	lib/android/src/main/AndroidManifest.xml
  • Loading branch information
jiaminglu committed May 24, 2017
2 parents b3abc30 + 3469a22 commit 69cec0f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/mapview.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
| `showsBuildings` | `Boolean` | `true` | A Boolean indicating whether the map displays extruded building information.
| `showsTraffic` | `Boolean` | `true` | A Boolean value indicating whether the map displays traffic information.
| `showsIndoors` | `Boolean` | `true` | A Boolean indicating whether indoor maps should be enabled.
| `showsIndoorLevelPicker` | `Boolean` | `false` | A Boolean indicating whether indoor level picker should be enabled.
| `showsIndoorLevelPicker` | `Boolean` | `false` | A Boolean indicating whether indoor level picker should be enabled. **Note:** Android only.
| `zoomEnabled` | `Boolean` | `true` | If `false` the user won't be able to pinch/zoom the map.
| `rotateEnabled` | `Boolean` | `true` | If `false` the user won't be able to pinch/rotate the map.
| `scrollEnabled` | `Boolean` | `true` | If `false` the user won't be able to change the map region being displayed.
Expand Down
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.airbnb.android.react.maps.example">

<uses-sdk android:minSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
}

public void onMapReady(final AMap map) {
if (destroyed) {
return;
}
this.map = map;
this.map.setInfoWindowAdapter(this);
this.map.setOnMarkerDragListener(this);
Expand Down Expand Up @@ -297,12 +300,18 @@ public void onHostDestroy() {
}

public synchronized void doDestroy() {
if (destroyed) {
return;
}
destroyed = true;

if (lifecycleListener != null && context != null) {
context.removeLifecycleEventListener(lifecycleListener);
lifecycleListener = null;
}
if(!paused) {
onPause();
paused = true;
}
if (!destroyed) {
onDestroy();
Expand Down
1 change: 1 addition & 0 deletions lib/android/common/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.airbnb.android.react.maps.common">
<uses-sdk android:minSdkVersion="16" />

<application
android:allowBackup="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,

@Override
public void onMapReady(final GoogleMap map) {
if (destroyed) {
return;
}
this.map = map;
this.map.setInfoWindowAdapter(this);
this.map.setOnMarkerDragListener(this);
Expand Down Expand Up @@ -305,18 +308,20 @@ private boolean hasPermissions() {
onDestroy is final method so I can't override it.
*/
public synchronized void doDestroy() {
if (destroyed) {
return;
}
destroyed = true;

if (lifecycleListener != null && context != null) {
context.removeLifecycleEventListener(lifecycleListener);
lifecycleListener = null;
}
if(!paused) {
if (!paused) {
onPause();
paused = true;
}
if (!destroyed) {
onDestroy();
destroyed = true;
}

onDestroy();
}

public void setRegion(ReadableMap region) {
Expand Down

0 comments on commit 69cec0f

Please sign in to comment.