-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Platform view devicelab ad banner scroll list real ads #145239
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
da55c70
dummy benchmark for ad banner scroll
hellohuanlin a34b4ef
add admob dependency
hellohuanlin 03348d1
add admob test id
hellohuanlin 5ac97bb
pod install & use real ads in code
hellohuanlin 4f8de1b
rename file
hellohuanlin a50f665
clean up ad banners main
hellohuanlin 7e3418c
CI presubmit trick
hellohuanlin be377eb
do not force GC
hellohuanlin fd34fd6
clean up dart app
hellohuanlin 8403248
remove caret
hellohuanlin 06a0244
nit
hellohuanlin a9b0bae
remove ci presubmit trick
hellohuanlin 46f468e
run flutter update-packages --force-upgrade
hellohuanlin 768eed0
remove team
hellohuanlin 615eab9
revert nit
hellohuanlin 4f2f089
revert pubspec change
hellohuanlin 18e5f20
rerun checksum
hellohuanlin dd357fb
nit
hellohuanlin 1280553
regenerate lock files with dart dev/tools/bin/generate_gradle_lockfil…
hellohuanlin 4487b75
Add ads to AndroidManifest meta-data
jmagman 1f78af1
Run failing test in presubmit
jmagman 3c2ab41
platform_views_scroll_perf_ad_banners__timeline_summary
jmagman 413bde1
nm platform_views_scroll_perf_ad_banners__timeline_summary
jmagman 1203ccd
revert presubmit in .ci.yaml
jmagman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 76 additions & 22 deletions
98
dev/benchmarks/platform_views_layout/android/project-app.lockfile
Large diffs are not rendered by default.
Oops, something went wrong.
126 changes: 126 additions & 0 deletions
126
dev/benchmarks/platform_views_layout/android/project-google_mobile_ads.lockfile
Large diffs are not rendered by default.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
dev/benchmarks/platform_views_layout/android/project-webview_flutter_android.lockfile
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
dev/benchmarks/platform_views_layout/ios/Flutter/Debug.xcconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" | ||
#include "Generated.xcconfig" |
1 change: 1 addition & 0 deletions
1
dev/benchmarks/platform_views_layout/ios/Flutter/Release.xcconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
#include "Generated.xcconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Uncomment this line to define a global platform for your project | ||
# platform :ios, '12.0' | ||
|
||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. | ||
ENV['COCOAPODS_DISABLE_STATS'] = 'true' | ||
|
||
project 'Runner', { | ||
'Debug' => :debug, | ||
'Profile' => :release, | ||
'Release' => :release, | ||
} | ||
|
||
def flutter_root | ||
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) | ||
unless File.exist?(generated_xcode_build_settings_path) | ||
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" | ||
end | ||
|
||
File.foreach(generated_xcode_build_settings_path) do |line| | ||
matches = line.match(/FLUTTER_ROOT\=(.*)/) | ||
return matches[1].strip if matches | ||
end | ||
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" | ||
end | ||
|
||
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) | ||
|
||
flutter_ios_podfile_setup | ||
|
||
target 'Runner' do | ||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) | ||
end | ||
|
||
post_install do |installer| | ||
installer.pods_project.targets.each do |target| | ||
flutter_additional_ios_build_settings(target) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
dev/benchmarks/platform_views_layout/ios/Runner.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
dev/benchmarks/platform_views_layout/lib/main_ad_banners.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright 2014 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'dart:io'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:google_mobile_ads/google_mobile_ads.dart'; | ||
|
||
void main() { | ||
runApp( | ||
const PlatformViewApp() | ||
); | ||
} | ||
|
||
class PlatformViewApp extends StatefulWidget { | ||
const PlatformViewApp({ | ||
super.key, | ||
}); | ||
|
||
@override | ||
PlatformViewAppState createState() => PlatformViewAppState(); | ||
} | ||
|
||
class PlatformViewAppState extends State<PlatformViewApp> { | ||
|
||
AdWidget _getBannerWidget() { | ||
// Test IDs from Admob: | ||
// https://developers.google.com/admob/ios/test-ads | ||
// https://developers.google.com/admob/android/test-ads | ||
final String bannerId = Platform.isAndroid | ||
? 'ca-app-pub-3940256099942544/6300978111' | ||
: 'ca-app-pub-3940256099942544/2934735716'; | ||
final BannerAd bannerAd = BannerAd( | ||
adUnitId: bannerId, | ||
request: const AdRequest(), | ||
size: AdSize.banner, | ||
listener: const BannerAdListener(), | ||
); | ||
bannerAd.load(); | ||
return AdWidget(ad: bannerAd); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
theme: ThemeData.light(), | ||
title: 'Advanced Layout', | ||
home: Scaffold( | ||
appBar: AppBar(title: const Text('Platform View Ad Banners')), | ||
body: ListView.builder( | ||
key: const Key('platform-views-scroll'), // This key is used by the driver test. | ||
itemCount: 250, | ||
itemBuilder: (BuildContext context, int index) { | ||
return index.isEven | ||
// Use 320x50 Admob standard banner size. | ||
? SizedBox(width: 320, height: 50, child: _getBannerWidget()) | ||
// Adjust the height to control number of platform views on screen. | ||
// TODO(hellohuanlin): Having more than 5 banners on screen causes an unknown crash. | ||
// See: https://github.com/flutter/flutter/issues/144339 | ||
: const SizedBox(height: 150, child: ColoredBox(color: Colors.yellow)); | ||
}, | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is the only change on top of #145224