Skip to content

Commit

Permalink
feat!: view callback and layout functionality improvements (#239)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jokerttu authored Sep 3, 2024
1 parent 017d7a1 commit d24855b
Show file tree
Hide file tree
Showing 31 changed files with 1,841 additions and 2,256 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ in an unbounded widget will cause the application to behave unexpectedly.
// Permissions must have been granted by this point.
<NavigationView
width={navViewWidth}
height={navViewHeight}
androidStylingOptions={{
primaryDayModeThemeColor: '#34eba8',
headerDistanceValueTextColor: '#76b5c5',
Expand Down Expand Up @@ -142,6 +140,16 @@ const requestPermissions = async () => {
};
```

### Changing the NavigationView size
By default, `NavigationView` uses all the available space provided to it. To adjust the size of the NavigationView, use the `style` prop.

```tsx
<NavigationView
style={{width: 200, height: 50%}}
...
/>
```

## Contributing

See the [Contributing guide](./CONTRIBUTING.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

public class Constants {
public static final String NAV_JAVASCRIPT_FLAG = "NavJavascriptBridge";
public static final String NAV_VIEW_JAVASCRIPT_FLAG = "NavViewJavascriptBridge";
public static final String LAT_FIELD_KEY = "lat";
public static final String LNG_FIELD_KEY = "lng";
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ private void cleanup() {
mWaypoints.clear();

UiThreadUtil.runOnUiThread(() -> {
mNavigator.clearDestinations();
mNavigator.cleanup();
});
}
Expand Down
Loading

0 comments on commit d24855b

Please sign in to comment.