-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sdk] Use cached resourceOptions if it's initialized. #77
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Chaoba let's imagine we have 2 MapView
s in one layout and we want to set different tokens to each of it programatically (and also different from <string name="mapbox_access_token"></string>
) . Can it be done with current setup? If yes - guess we should provide an example in app
module.
assertEquals(defaultOptions.assetPath, currentOptions.assetPath) | ||
assertEquals(defaultOptions.cachePath, currentOptions.cachePath) | ||
assertEquals(defaultOptions.cacheSize, currentOptions.cacheSize) | ||
assertEquals(defaultOptions, currentOptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch!
I guess it's hard to showcase this example without exposing the access token in the code. |
@kiryldz Even without the changes in this pr, set different tokens to 2 MapView is available. This pr resolves the scenario that if users use interface |
We could use any string and not make |
My concern here is that our current logic will work fine with 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, created a task to track revisiting approach in general.
PRs must be submitted under the terms of our Contributor License Agreement CLA.
Fixes: < Link to related issues that will be fixed by this pull request, if they exist >
Pull request checklist:
mapbox-maps-android
changelog:<changelog>[sdk] Use cached resourceOptions if it's initialized.</changelog>
.Summary of changes
This pr add the function that checks and use the cached
resourceOptions
if it's initialized instead of recreate it from ResourcesOptionsUser impact (optional)