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

Commit e9a012c

Browse files
authored
Make all Android scenario_app activities full-screen, even on older Android versions. (#50666)
Work towards flutter/flutter#143471.
1 parent 76193cd commit e9a012c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/TestableFlutterActivity.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
package dev.flutter.scenarios;
66

7+
import android.os.Bundle;
8+
import android.view.WindowManager;
79
import androidx.annotation.NonNull;
10+
import androidx.annotation.Nullable;
811
import io.flutter.embedding.android.FlutterActivity;
912
import io.flutter.embedding.engine.FlutterEngine;
1013
import java.util.concurrent.atomic.AtomicBoolean;
@@ -22,6 +25,20 @@ public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
2225
.setMessageHandler("take_screenshot", (byteBuffer, binaryReply) -> notifyFlutterRendered());
2326
}
2427

28+
@Override
29+
protected void onCreate(@Nullable Bundle savedInstanceState) {
30+
super.onCreate(savedInstanceState);
31+
32+
// On newer versions of Android, this is the default. Because these tests are being used to take
33+
// screenshots on Skia Gold, we don't want any of the System UI to show up, even for older API
34+
// versions (i.e. 28).
35+
//
36+
// See also:
37+
// https://github.com/flutter/engine/blob/a9081cce1f0dd730577a36ee1ca6d7af5cdc5a9b/shell/platform/android/io/flutter/embedding/android/FlutterView.java#L696
38+
// https://github.com/flutter/flutter/issues/143471
39+
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
40+
}
41+
2542
protected void notifyFlutterRendered() {
2643
synchronized (flutterUiRenderedLock) {
2744
isScenarioReady.set(true);

0 commit comments

Comments
 (0)