Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@cyanglaz
Copy link
Contributor

@cyanglaz cyanglaz commented Dec 18, 2019

flutter/flutter#41839

aside from migration, I also moved the code in onActivitySaveInstanceState to onStop to match with the DefaultLifecycleObserver.

I think onStop is enough for our needs in this plugin.

@cyanglaz cyanglaz marked this pull request as ready for review December 19, 2019 19:39
@cyanglaz cyanglaz changed the title [image_picker] support android V2 embedding [wip][image_picker] support android V2 embedding Dec 19, 2019
@cyanglaz cyanglaz requested a review from mklim December 23, 2019 16:57
@cyanglaz cyanglaz changed the title [wip][image_picker] support android V2 embedding [image_picker] support android V2 embedding Dec 23, 2019
Comment on lines +40 to +50
@Override
public void onCreate(@NonNull LifecycleOwner owner) {}

@Override
public void onStart(@NonNull LifecycleOwner owner) {}

@Override
public void onResume(@NonNull LifecycleOwner owner) {}

@Override
public void onPause(@NonNull LifecycleOwner owner) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why override these empty methods?

Copy link
Contributor

Choose a reason for hiding this comment

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

🤦‍♂️ because it's implements, not extends. My mistake. This class does need all these empty methods defined still, sorry.

private Application.ActivityLifecycleCallbacks activityLifecycleCallbacks;
private FlutterPluginBinding pluginBinding;
private ActivityPluginBinding activityBinding;
private Application applicationContext;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: An Application and an ApplicationContext are two separate things, so this naming is a little confusing. Do you really need this to be an Application, or are you just trying to get an ApplicationContext? If it's the latter I would just stick with a Context for the type here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need Application. I'll rename the variable as application

// V1 embedding setup for activity listeners.
observer = new LifeCycleObserver(activity);
applicationContext.registerActivityLifecycleCallbacks(
observer); // Use getApplicationContext() to avoid casting failures.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extra comment here

@noborder
Copy link

noborder commented Jan 7, 2020

Thank you cyanglaz. I tested it. It will solve the problem

Copy link
Contributor

@mklim mklim left a comment

Choose a reason for hiding this comment

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

LGTM minus the compile failure from the removed empty methods.

Comment on lines +40 to +50
@Override
public void onCreate(@NonNull LifecycleOwner owner) {}

@Override
public void onStart(@NonNull LifecycleOwner owner) {}

@Override
public void onResume(@NonNull LifecycleOwner owner) {}

@Override
public void onPause(@NonNull LifecycleOwner owner) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

🤦‍♂️ because it's implements, not extends. My mistake. This class does need all these empty methods defined still, sorry.

@cyanglaz cyanglaz merged commit 3595743 into flutter:master Jan 8, 2020
@xster
Copy link
Member

xster commented Jan 8, 2020

\o/

@cyanglaz cyanglaz deleted the migrate_image_picker branch January 8, 2020 00:20
hjc22 pushed a commit to hjc22/plugins that referenced this pull request Jan 8, 2020
…acheing-01-08

* flutterPlugin/master: (30 commits)
  Update Gradle version (flutter#2448)
  [image_picker] support android V2 embedding (flutter#2430)
  [webview_flutter] Setup XCTests (flutter#2445)
  [video_player] Fixes video initialization future stall. (flutter#2134)
  [ci] Upgrade to Xcode 11.3 (flutter#2435)
  [In_app_purchases] migrate to Play Billing Library 2.0. (flutter#2287)
  Migrate away from deprecated `BinaryMessages` (flutter#2444)
  [google_sign_in]Update google_sign_in_example name in pubspec.yaml (flutter#2335)
  [ios_platform_images] Removed android support from the pubspec. (flutter#2432)
  [google_sign_in] Expose network error (flutter#2398)
  [battery] cleanup for Android embedding post 1.12 (flutter#2400)
  [flutter_webview] Raise min Flutter SDK to stable (flutter#2425)
  re-enable stable CI (flutter#2402)
  [in_app_purchase]Change a comment. (flutter#2329)
  [google_sign_in] Pass the client id to the platform interface. (flutter#2427)
  [ios_platform_images] Made ios_platform_images set the correct image scale. (flutter#2414)
  [url_launcher_platform_interface] use non static token for platform interface (flutter#2418)
  [plugin_platform_interface] Don't use const Object as a token (flutter#2417)
  Update endorsed macos plugins readme and update others (flutter#2407)
  [webview_flutter] add gesture navigation for iOS (flutter#2339)
  ...

# Conflicts:
#	packages/video_player/video_player/CHANGELOG.md
#	packages/video_player/video_player/pubspec.yaml
FlutterSu pushed a commit to FlutterSu/flutter-plugins that referenced this pull request Nov 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants