-
Notifications
You must be signed in to change notification settings - Fork 6k
Refactor FlutterActivity to be more composable #3748
Conversation
| * <p/> | ||
| * <h3>Usage:</h3> | ||
| * To wire this class up to your activity, simply forward the events defined | ||
| * in {@link ActivityEventDelegate} from your activity to an instance of this |
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.
should this be FlutterActivityEvents?
| return null; | ||
| } | ||
| public class FlutterActivity extends Activity implements FlutterView.Provider, PluginRegistry, ViewFactory { | ||
| private final FlutterActivityDelegate delegate = new FlutterActivityDelegate(this, this); |
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.
Would it make sense to declare this as the FlutterActivityEvents type?
Right now it looks like there's nothing that enforces that FlutterActivityEvents contains all activity overrides that are forwarded by FlutterActivity to the delegate.
FlutterActivity would also need FlutterView.Provider and PluginRegistry aliases for the delegate to call methods defined through those interfaces.
|
Is this a breaking change in any way? If so, please use these steps: |
No, it should be non-breaking. That's why I deprecated |
This factors the functionality that was in `FlutterActivity` to live in `FlutterActivityDelegate`. This will allow the creation of a `FlutterFragmentActivity` that has the same core functionality, which in turn unlocks certain Android plugins that choose to require the v4 support library (like Google Sign-In). flutter/flutter#10072
|
Comments addressed - PTAL |
|
LGTM |
|
Please announce the deprecation to the list and schedule a date in the future to remove it. Thanks! |
This factors the functionality that was in
FlutterActivityto live in
FlutterActivityDelegate. This will allow the creation of aFlutterFragmentActivitythat has the same core functionality, which inturn unlocks certain Android plugins that choose to require the v4
support library (like Google Sign-In).
flutter/flutter#10072