This repository was archived by the owner on Oct 7, 2024. It is now read-only.
Open
Conversation
LukasPaczos
reviewed
Sep 2, 2019
| List<Feature> renderedStationFeatures = mapboxMap.queryRenderedFeatures( | ||
| mapboxMap.getProjection().toScreenLocation(point), LAYER_ID); | ||
| if (!renderedStationFeatures.isEmpty()) { | ||
| Point pointOfSelectedStation = (Point) renderedStationFeatures.get(0).geometry(); |
Contributor
There was a problem hiding this comment.
This should assign the feature to be reused later, not the geometry.
| matrixLocationList.get(x).setDistanceFromOrigin(finalConvertedFormattedDistance); | ||
| matrixApiLocationRecyclerViewAdapter.notifyDataSetChanged(); | ||
| if (response.body() != null) { | ||
| List<Double[]> durationsToAllOfTheLocationsFromTheOrigin = response.body().durations(); |
Contributor
There was a problem hiding this comment.
We are fetching durations, the title of the activity mentions time, but we're converting the data (which I understand is travel time) to distance. I think something's off here.
| List<Feature> featureList = featureCollection.features(); | ||
| for (int i = 0; i < featureList.size(); i++) { | ||
| if (featureList.get(i).getStringProperty(STATION_NAME_PROPERTY).equals(selectedBoltFeatureName)) { | ||
| makeMapboxMatrixApiCall(i); |
Contributor
There was a problem hiding this comment.
The request could've been made during initialization and cached to be reused on map click.
aea0eba to
4be4ff9
Compare
4be4ff9 to
0441d3a
Compare
| if (pointOfSelectedStation != null) { | ||
| String selectedBoltFeatureName = renderedStationFeatures.get(0).getStringProperty(STATION_NAME_PROPERTY); | ||
| List<Feature> featureList = featureCollection.features(); | ||
| for (int i = 0; i < featureList.size(); i++) { |
There was a problem hiding this comment.
NULL_DEREFERENCE: object featureList last assigned on line 137 could be null and is dereferenced at line 138.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MatrixApiActivitywas using a bunch of deprecated Maps SDK classes and methods, such asaddMarker(),setOnMarkerClickListener(), etc.This pr brings this example up-to-date with
SymbolLayericons,onMapClick()logic, adding null checks, etc. This pr gets rid of the final usage ofaddMarker()🐛 🔨