diff --git a/testing/scenario_app/README.md b/testing/scenario_app/README.md index 131f7186feaf5098ce196049249f892368a71ef3..23685c4dee8aec5cfbb642dde8a71b2c80b562f8 100644 --- a/testing/scenario_app/README.md +++ b/testing/scenario_app/README.md @@ -46,7 +46,7 @@ The test is run on a x86 emulator. To run the test locally, you must create an e ``` hw.lcd.density = 480 -hw.lcd.height = 1920 +hw.lcd.height = 1680 hw.lcd.width = 1080 lcd.depth = 16 ``` diff --git a/testing/scenario_app/android/android/gradle-home/.cache/daemon/5.6.4/registry.bin b/testing/scenario_app/android/android/gradle-home/.cache/daemon/5.6.4/registry.bin new file mode 100644 index 0000000000000000000000000000000000000000..0f3905597f5bd4e03874f3612dabc22511cc807f Binary files /dev/null and b/testing/scenario_app/android/android/gradle-home/.cache/daemon/5.6.4/registry.bin differ diff --git a/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/ScreenshotUtil.java b/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/ScreenshotUtil.java index d060bf6ccb907defef156a32bd170f875f6674a4..b3c16d9f517015870be02d1bb574b85d9236197e 100644 --- a/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/ScreenshotUtil.java +++ b/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/ScreenshotUtil.java @@ -4,8 +4,6 @@ package dev.flutter.scenariosui; -import android.app.Activity; -import android.content.Context; import android.graphics.Bitmap; import android.os.Bundle; import android.os.Handler; @@ -129,28 +127,6 @@ public class ScreenshotUtil { album = null; } - private static int getStatusBarHeight() { - final Context context = InstrumentationRegistry.getTargetContext(); - // Resource name defined in - // https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/dimens.xml#34 - final int resourceId = - context.getResources().getIdentifier("status_bar_height", "dimen", "android"); - int statusBarHeight = 0; - if (resourceId > 0) { - statusBarHeight = context.getResources().getDimensionPixelSize(resourceId); - } - return statusBarHeight; - } - - private static int getActionBarHeight(Activity activity) { - int actionBarHeight = 0; - final android.content.res.TypedArray styledAttributes = - activity.getTheme().obtainStyledAttributes(new int[] {android.R.attr.actionBarSize}); - actionBarHeight = (int) styledAttributes.getDimension(0, 0); - styledAttributes.recycle(); - return actionBarHeight; - } - /** * Captures a screenshot of {@code TestableFlutterActivity}. * @@ -182,13 +158,7 @@ public class ScreenshotUtil { Bitmap bitmap = InstrumentationRegistry.getInstrumentation().getUiAutomation().takeScreenshot(); // Remove the status and action bars from the screenshot capture. - bitmap = - Bitmap.createBitmap( - bitmap, - 0, - getStatusBarHeight(), - bitmap.getWidth(), - bitmap.getHeight() - getStatusBarHeight() - getActionBarHeight(activity)); + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight()); final String screenshotName = String.format("%s__%s", testClass, testName); // Write bitmap to the album. diff --git a/testing/scenario_app/android/app/src/main/AndroidManifest.xml b/testing/scenario_app/android/app/src/main/AndroidManifest.xml index 1ddceaf516d8baf6c1b1cce2c25d5622b91dcb21..d5a088de8c355552d02180ec5ff83090109229e5 100644 --- a/testing/scenario_app/android/app/src/main/AndroidManifest.xml +++ b/testing/scenario_app/android/app/src/main/AndroidManifest.xml @@ -14,7 +14,8 @@ android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:launchMode="singleTop" - android:windowSoftInputMode="adjustResize"> + android:windowSoftInputMode="adjustResize" + android:theme="@style/FullScreenScreenshot"> diff --git a/testing/scenario_app/android/app/src/main/res/values/styles.xml b/testing/scenario_app/android/app/src/main/res/values/styles.xml index 545b9c6d2c45df7938f8ffd5ac2d806dec36f122..26fb230141be63207f29b8125be88cb05262ecef 100644 --- a/testing/scenario_app/android/app/src/main/res/values/styles.xml +++ b/testing/scenario_app/android/app/src/main/res/values/styles.xml @@ -8,9 +8,11 @@ @color/colorAccent -