Skip to content
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

Update Android SDK v3 beta #608

Closed

Conversation

jeffdgr8
Copy link
Contributor

Update Android SDK v3 beta branch to master

jeffdgr8 and others added 30 commits November 2, 2018 23:06
Since ScreenBasedAlgorithm's GoogleMap.OnCameraChangeListener onCameraChange() method is only used within ClusterManager, it doesn't need to extend the deprecated listener.
…-warning

Fix deprecated API usage warnings
* upgrades the util  util and demo to Maps Android SDK v3-beta

* minor bug fixes to the assemble task and gradle upgrade

* updates deploy for v3 beta artifact

* changes build to use maven-publish plugin

* updates build for v3 compat deps

* bug fixes

* updates travis script to use new signing
…sdk-v3-beta

Revert "Updates deploy to use maven-publish instead of maven"
* changes build to use maven-publish

* update script in travis for new artifact signing
* Upgrades some tests to junit4

* upgrades the rest of the tests to  junit4
Solves the following error:

java.io.IOException: Cleartext HTTP traffic to googlemaps.github.io not permitted
    at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:407)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:244)
    at java.net.URL.openStream(URL.java:1072)
    at com.google.maps.android.utils.demo.KmlDemoActivity$DownloadKmlFile.doInBackground(KmlDemoActivity.java:88)
    at com.google.maps.android.utils.demo.KmlDemoActivity$DownloadKmlFile.doInBackground(KmlDemoActivity.java:79)
    at android.os.AsyncTask$2.call(AsyncTask.java:333)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)
* Fix Lint error

* Update Gradle wrapper to 5.6.2

* Update Android Gradle plugin to 3.5.0

This also removes an unused dependency.
This also removes a nested unnecessary Gradle wrapper files.
* update issue templates

* update issue templates

* update issue templates
jeffdgr8 and others added 13 commits February 6, 2020 09:18
…aps#607)

Move KmlLayer construction to AsyncTask doInBackground. Parsing large KML files can be long-running.
* Test caching BitmapDescriptors

* Update import for AndroidX

* Cache scaled BitmapDescriptors

BitmapDescriptorFactory.fromBitmap() copies the Bitmap on every call. Avoid duplicating Bitmaps for each Marker by caching the scaled BitmapDescriptors.

* Clear Bitmap cache when done

* Add doc comments

* Cleanup comments

* Fix marker icon scaling for screen density

* Scale marker from styles

* Reduce Renderer method access scopes

* Consolidate Renderer image caches into class

* Add method behavior details to doc comment

* Use string scale value as cache key
A clustering performance improvement was made in googlemaps#368 by switching from using an ArrayList to a HashSet. However, ArrayLists maintain insertion order of the elements when iterating over them later, while HashSets do not. Because the cluster has the center of the first element, that center will change if the iteration order of the elements change, which results in clusters changing position when updating an item model and reclustering.

This changes to using a LinkedHashSet, which should give the same constant time performance benefits as the Set for add/remove over the List, but still maintains insertion order.

A unit test for insertion order is also added.

Fixes googlemaps#615

Refs: 615
* Test caching BitmapDescriptors

* Update import for AndroidX

* Cache scaled BitmapDescriptors

BitmapDescriptorFactory.fromBitmap() copies the Bitmap on every call. Avoid duplicating Bitmaps for each Marker by caching the scaled BitmapDescriptors.

* Clear Bitmap cache when done

* Add doc comments

* Cleanup comments

* Fix marker icon scaling for screen density

* Scale marker from styles

* KMZ support

* Check clear bitmap cache for all-offline KMZ

* Fix input stream reset

* Comment

* Check for any .kml filename

* Reduce Renderer method access scopes

* Consolidate Renderer image caches into class

* Add method behavior details to doc comment

* Use string scale value as cache key

* Add storeKmzData()

* Log warning for unsupported KMZ content files
@jeffdgr8
Copy link
Contributor Author

I'm not sure the cla: no label is valid for this PR, since it's just merging commits that are already on master into the android-sdk-v3-beta branch.

barbeau and others added 13 commits February 20, 2020 16:54
As discussed in googlemaps#90, when an item instance is removed, updated, and re-added the ClusterManager, the updated item state wouldn't be reflected on the map.

The reason for this is that DefaultClusterRenderer.CreateMarkerTask.perform() was using a marker from its own mMarkerCache associated with that item to display that item on the map (even if ClusterManager.clearItems() was previously called). This resulted in the updated item contents not being reflected on the map, because the cached marker was not updated.

This PR does the following:

* Add new protected methods in DefaultClusterRenderer - onClusterItemUpdated() and onClusterUpdated() - which are called when an existing cached marker is found for an item/cluster when that item/cluster is being added back into the ClusterManager. The default implementation of these methods update the marker contents on the map, but then can also be overridden by applications for custom behavior (similar to onBeforeClusterItemRendered() and onBeforeClusterRendered()). Following this change, you can now do ClusterManager.clearItems() and re-add the same list instance (or remove() and then add() the same item) and then call cluster() and the map markers will be updated with the new item model contents.
* Add a new ClusterManager.updateItem() helper method for updating the ClusterManager and algorithms with an existing item. The current implementation in NonHierarchicalDistanceBasedAlgorithm is a wrapper for remove() and then add().
* Add more descriptive Javadocs to ClusterManager, DefaultClusterRenderer, and NonHierarchicalDistanceBasedAlgorithm to describe expected behavior, especially that cluster() should be invoked after any changes to ClusterManager to see changes on the map.
* Add boolean return values to Algorithm add/remove/update operations - Implementation follows the Java Collection definitions of the matching methods

Refs: 90

Fixes googlemaps#90
…emaps#631)

* fix: Update KmlLayer to take in a Context and not a FragmentActivity.

* Passing ImagesCache via constructor.

* Have tests compile.

* Remove import.

* Fix compile error.

* Address PR feedback.
* docs(README): Update README with more info.

* code of conduct.
* chore(Release): 1.0.0

* Adding 1.0.0 header and removing duplicate issue.

* Remove dupe issues.

* Add googlemaps#633 to breaking changes list.
* chore(Release): 1.0.0

* Linking README.

* Shorthand link
* docs: Add snippet.

* Update region tag.

* Comment back library include
* docs: Make Discord more visible.

* Update README.md

Co-Authored-By: Sean Barbeau <barbeau@cutr.usf.edu>

Co-authored-by: Sean Barbeau <sjbarbeau@gmail.com>
@arriolac arriolac mentioned this pull request May 12, 2020
@barbeau
Copy link
Collaborator

barbeau commented May 20, 2020

@jeffdgr8 Thanks for your effort trying to keep this branch for v3 beta up-to-date!

As you may have seen @arriolac and I have been working on a way to automate this using Gradle tasks, and the implementation finally landed in #721 a few days ago.

So, the utils library based on SDK v3 beta should now be available using the dependency:

implementation 'com.google.maps.android:android-maps-utils-v3:1.3.1'

Thanks again for all your contributions to the project!

@barbeau barbeau closed this May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: no This human has *not* signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet