Skip to content

Conversation

@jokerttu
Copy link
Contributor

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

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Contributor

@reidbaker reidbaker left a 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?

@jokerttu jokerttu force-pushed the feature/animate-camera-duration-platform-impls branch from 24d7e9f to aee7fd1 Compare March 5, 2025 08:26
@jokerttu
Copy link
Contributor Author

jokerttu commented Mar 5, 2025

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?

@reidbaker this is addressed on latest commit:
aee7fd1

@jokerttu jokerttu force-pushed the feature/animate-camera-duration-platform-impls branch from aee7fd1 to 58f08cc Compare March 17, 2025 09:14
@jokerttu jokerttu requested a review from stuartmorgan-g March 17, 2025 09:57
@jokerttu jokerttu force-pushed the feature/animate-camera-duration-platform-impls branch from 58f08cc to ff6ad17 Compare March 20, 2025 07:51
@jokerttu
Copy link
Contributor Author

Rebased and fixed conflicts causes by the 297d5a1

@jokerttu jokerttu requested a review from reidbaker March 20, 2025 09:55
Copy link
Contributor

@reidbaker reidbaker left a 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;
Copy link
Collaborator

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.

Copy link
Collaborator

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.)

Copy link
Contributor Author

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);
Copy link
Collaborator

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.

Copy link
Contributor Author

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);
Copy link
Collaborator

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.

Copy link
Contributor Author

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
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@jokerttu jokerttu requested a review from stuartmorgan-g March 21, 2025 14:06
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a 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>
Copy link
Collaborator

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.

@jokerttu jokerttu added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 24, 2025
@auto-submit auto-submit bot merged commit c27d2fe into flutter:main Mar 24, 2025
83 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 24, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Mar 24, 2025
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
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
…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
zhangyuang pushed a commit to zhangyuang/flutter-fork that referenced this pull request Jun 9, 2025
…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
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
…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
romanejaquez pushed a commit to romanejaquez/flutter that referenced this pull request Aug 14, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: google_maps_flutter platform-android platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants