-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[google_maps_flutter] Add ability to animate camera with duration - platform impls #8659
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
[google_maps_flutter] Add ability to animate camera with duration - platform impls #8659
Conversation
reidbaker
left a comment
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.
I looked for a test for getCameraPosition which I believe was added in this pr. If there is a test can you point it out to me, if there is not can you add one?
...flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java
Outdated
Show resolved
Hide resolved
24d7e9f to
aee7fd1
Compare
@reidbaker this is addressed on latest commit: |
aee7fd1 to
58f08cc
Compare
58f08cc to
ff6ad17
Compare
|
Rebased and fixed conflicts causes by the 297d5a1 |
reidbaker
left a comment
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.
android code looks good.
| /// The suffix this instance was registered under with Pigeon. | ||
| @property(nonatomic, copy) NSString *pigeonSuffix; | ||
| /// The transaction wrapper to use for camera animations. | ||
| @property(nonatomic, strong) id<FGMCATransactionProtocol> transactionWrapper; |
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.
Unless I'm missing something this is identical to the declaration in the test header, in which case it shouldn't be repeated here.
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.
(This file should import #import "GoogleMapController_Test.h" just after #import "GoogleMapController.h", which it looks like is currently missing.)
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.
Done
| return _hostApi(mapId) | ||
| .animateCamera(_platformCameraUpdateFromCameraUpdate(cameraUpdate)); | ||
| return _hostApi(mapId).animateCamera( | ||
| _platformCameraUpdateFromCameraUpdate(cameraUpdate), null); |
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.
Prefer calling the replacement method (with a null duration in this case) to duplicating the implementation. Otherwise it's easy for someone to change the new method later and forget to keep the old method in sync.
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.
Replaced with:
return animateCameraWithConfiguration(
cameraUpdate, const CameraUpdateAnimationConfiguration(),
mapId: mapId);| return _hostApi(mapId) | ||
| .animateCamera(_platformCameraUpdateFromCameraUpdate(cameraUpdate)); | ||
| return _hostApi(mapId).animateCamera( | ||
| _platformCameraUpdateFromCameraUpdate(cameraUpdate), null); |
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.
See comment in iOS about calling the new method.
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.
Replaced with:
return animateCameraWithConfiguration(
cameraUpdate, const CameraUpdateAnimationConfiguration(),
mapId: mapId);| /// FLTGoogleMapController instance is what needs to trigger Pigeon unregistration, so can't be | ||
| /// the target of the registration. | ||
| @interface FGMMapInspector : NSObject <FGMMapsInspectorApi> | ||
| @end |
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.
Can these go in the test header instead? I would not expect this to need to be public for non-test purposes.
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.
Done
stuartmorgan-g
left a comment
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
| @import XCTest; | ||
| @import GoogleMaps; | ||
|
|
||
| #import <GoogleMapController_Test.h> |
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.
Is this needed? I would expect the @import on line 6 to handle this.
…ration - platform impls (flutter/packages#8659)
flutter/packages@6981639...c27d2fe 2025-03-24 [email protected] [google_maps_flutter] Add ability to animate camera with duration - platform impls (flutter/packages#8659) 2025-03-21 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump com.android.tools.build:gradle from 8.0.0 to 8.9.0 in /packages/interactive_media_ads/android (flutter/packages#8832) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…latform impls (flutter#8659) This PR contains platform implementations for the ability to animate camera with duration (flutter#7648). Linked issue: flutter/flutter#39810 Linked issue: flutter/flutter#44284
…r#165806) flutter/packages@6981639...c27d2fe 2025-03-24 [email protected] [google_maps_flutter] Add ability to animate camera with duration - platform impls (flutter/packages#8659) 2025-03-21 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump com.android.tools.build:gradle from 8.0.0 to 8.9.0 in /packages/interactive_media_ads/android (flutter/packages#8832) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…latform impls (flutter#8659) This PR contains platform implementations for the ability to animate camera with duration (flutter#7648). Linked issue: flutter/flutter#39810 Linked issue: flutter/flutter#44284
…r#165806) flutter/packages@6981639...c27d2fe 2025-03-24 [email protected] [google_maps_flutter] Add ability to animate camera with duration - platform impls (flutter/packages#8659) 2025-03-21 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump com.android.tools.build:gradle from 8.0.0 to 8.9.0 in /packages/interactive_media_ads/android (flutter/packages#8832) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This PR contains platform implementations for the ability to animate camera with duration (#7648).
Linked issue: flutter/flutter#39810
Linked issue: flutter/flutter#44284
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.