Skip to content

Commit d24855b

Browse files
authored
feat!: view callback and layout functionality improvements (#239)
Fixes the NavigationView callback registration issue when using multiple view instances. Resolves navigation view scaling issues by removing the mandatory height and width properties and adding support for an optional style property (breaking change). This allows developers to use flex or width/height parameters with percentage values. BREAKING CHANGE: The height and width properties have been removed from NavigationView in favor of an optional style property.
1 parent 017d7a1 commit d24855b

31 files changed

Lines changed: 1841 additions & 2256 deletions

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ in an unbounded widget will cause the application to behave unexpectedly.
8888
// Permissions must have been granted by this point.
8989
9090
<NavigationView
91-
width={navViewWidth}
92-
height={navViewHeight}
9391
androidStylingOptions={{
9492
primaryDayModeThemeColor: '#34eba8',
9593
headerDistanceValueTextColor: '#76b5c5',
@@ -142,6 +140,16 @@ const requestPermissions = async () => {
142140
};
143141
```
144142

143+
### Changing the NavigationView size
144+
By default, `NavigationView` uses all the available space provided to it. To adjust the size of the NavigationView, use the `style` prop.
145+
146+
```tsx
147+
<NavigationView
148+
style={{width: 200, height: 50%}}
149+
...
150+
/>
151+
```
152+
145153
## Contributing
146154

147155
See the [Contributing guide](./CONTRIBUTING.md).

android/src/main/java/com/google/android/react/navsdk/Constants.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
public class Constants {
1717
public static final String NAV_JAVASCRIPT_FLAG = "NavJavascriptBridge";
18-
public static final String NAV_VIEW_JAVASCRIPT_FLAG = "NavViewJavascriptBridge";
1918
public static final String LAT_FIELD_KEY = "lat";
2019
public static final String LNG_FIELD_KEY = "lng";
2120
}

android/src/main/java/com/google/android/react/navsdk/INavigationViewCallback.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

android/src/main/java/com/google/android/react/navsdk/NavModule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ private void cleanup() {
187187
mWaypoints.clear();
188188

189189
UiThreadUtil.runOnUiThread(() -> {
190+
mNavigator.clearDestinations();
190191
mNavigator.cleanup();
191192
});
192193
}

0 commit comments

Comments
 (0)