Unverified Commit 788bb2d4 authored by xster's avatar xster Committed by GitHub

Add first frame reporting to gallery's Play Store Console logging (#22579)

parent 9c080269
...@@ -7,6 +7,7 @@ package io.flutter.demo.gallery; ...@@ -7,6 +7,7 @@ package io.flutter.demo.gallery;
import android.os.Bundle; import android.os.Bundle;
import io.flutter.app.FlutterActivity; import io.flutter.app.FlutterActivity;
import io.flutter.view.FlutterView;
import io.flutter.plugins.GeneratedPluginRegistrant; import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity { public class MainActivity extends FlutterActivity {
...@@ -23,5 +24,13 @@ public class MainActivity extends FlutterActivity { ...@@ -23,5 +24,13 @@ public class MainActivity extends FlutterActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this); GeneratedPluginRegistrant.registerWith(this);
instrumentation = new FlutterGalleryInstrumentation(this.getFlutterView()); instrumentation = new FlutterGalleryInstrumentation(this.getFlutterView());
getFlutterView().addFirstFrameListener(new FlutterView.FirstFrameListener() {
@Override
public void onFirstFrame() {
// Report fully drawn time for Play Store Console.
MainActivity.this.reportFullyDrawn();
MainActivity.this.getFlutterView().removeFirstFrameListener(this);
}
});
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment