Add offline plugin#72
Conversation
a6bb22b to
4066863
Compare
1c848a8 to
1001ebf
Compare
|
@zugaldia would you able to review current state? would love to merge this initial version and continue iterating on it with different issues and PRs. (will start working on ticketing out the issues). |
58bab99 to
29e4751
Compare
|
@zugaldia this PR is ready for review |
zugaldia
left a comment
There was a problem hiding this comment.
Small comments. Also, for some strange reason, notifications aren't working for me. When I click to download a region I can see in the logs that tiles are being downloaded, but I don't see any progress/notification on the UI. I also see this logs being constantly repeated:
10-04 15:51:38.587 29189-29189/com.mapbox.mapboxsdk.plugins.testapp W/Notification: Use of stream types is deprecated for operations other than volume control
10-04 15:51:38.587 29189-29189/com.mapbox.mapboxsdk.plugins.testapp W/Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
| repositories { | ||
| jcenter() | ||
| maven { url 'https://maven.google.com' } | ||
| maven { url "http://oss.sonatype.org/content/repositories/snapshots/" } |
There was a problem hiding this comment.
@tobrun We should make a note to remove this before final release (ticket?).
There was a problem hiding this comment.
I consider above comment a great note for that ;)
|
|
||
| GeoJsonSource locationSource = new GeoJsonSource(LocationLayerConstants.LOCATION_SOURCE, emptyFeature); | ||
| mapboxMap.addSource(locationSource); | ||
| if (mapboxMap.getSource(LocationLayerConstants.LOCATION_SOURCE) == null) { |
There was a problem hiding this comment.
Are these changes required by 5.2? If so, 👍
There was a problem hiding this comment.
yes, it seems so, will fix this up in a seperate PR
| private int smallIconRes; | ||
| private String returnActivity; | ||
| private String contentTitle = "Offline download"; | ||
| private String contextText = "Downloading.."; |
|
|
||
| // restrict visibility, only libs allowed to invoke building the OfflineDownload | ||
| OfflineDownload build() { | ||
| //TODO add validation |
| return definition; | ||
| } | ||
|
|
||
| byte[] getMetadata() { |
There was a problem hiding this comment.
What if we exposed a higher level API for the metadata (can be ticketed separately). Instead of exposing the byte[] separately, we'd expose a POJO with, say, title and description, that we serialize/deserialize as part of this plugin?
There was a problem hiding this comment.
Just saw OfflineUtils, it simplifies things but I'd even go further than that and never expose that directly.
There was a problem hiding this comment.
Yeah, initially I went with String name and afterwards went back for byte[]. I'm liking the idea of a POJO. To make that work, we will need an object that is Parceable as we need to be able to push that into a Bundle for Intent communication.
There was a problem hiding this comment.
@tobrun Or a small POJO easily convertible to JSON with Gson and use the String representation? Or would that potentially be too large for a Bundle?
| return this; | ||
| } | ||
|
|
||
| public String getContextText() { |
251aaae to
97c6f26
Compare
97c6f26 to
5e32ddc
Compare
Let's do it, just went ahead and approved the PR. CI is complaining about the following: @cammace Do you know why? Is this because of the changes in #144? |
|
The Bitrise script is still in this repo and ran correctly through all the same checks that circle ci would have. It's safe to ignore the fact that circleci is failing. |
WIP offline plugin, closes #19