diff options
| author | 2024-04-11 12:52:02 +0000 | |
|---|---|---|
| committer | 2024-04-11 12:52:02 +0000 | |
| commit | 59b4e61a000ae2107e16ec630a4142e97c9be589 (patch) | |
| tree | 0af7c83a7b5966714d8462b30c3a89dc2569ee59 | |
| parent | e2601cb092df055296f3b9229278a45245471941 (diff) | |
| parent | f872f6922d36c88595e8fa78f42b53c50eada5d6 (diff) | |
Merge "Add proper padding to PerfTestActivity" into main
| -rw-r--r-- | apct-tests/perftests/inputmethod/AndroidManifest.xml | 3 | ||||
| -rw-r--r-- | apct-tests/perftests/utils/src/android/perftests/utils/PerfTestActivity.java | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/apct-tests/perftests/inputmethod/AndroidManifest.xml b/apct-tests/perftests/inputmethod/AndroidManifest.xml index 3eea418fe5c7..5dd6ccccfb1c 100644 --- a/apct-tests/perftests/inputmethod/AndroidManifest.xml +++ b/apct-tests/perftests/inputmethod/AndroidManifest.xml @@ -22,7 +22,8 @@ <application> <uses-library android:name="android.test.runner" /> <activity android:name="android.perftests.utils.PerfTestActivity" - android:exported="true"> + android:theme="@android:style/Theme.DeviceDefault.NoActionBar" + android:exported="true"> <intent-filter> <action android:name="com.android.perftests.core.PERFTEST" /> </intent-filter> diff --git a/apct-tests/perftests/utils/src/android/perftests/utils/PerfTestActivity.java b/apct-tests/perftests/utils/src/android/perftests/utils/PerfTestActivity.java index f3bea17b2f0d..0c2ee8cb238a 100644 --- a/apct-tests/perftests/utils/src/android/perftests/utils/PerfTestActivity.java +++ b/apct-tests/perftests/utils/src/android/perftests/utils/PerfTestActivity.java @@ -19,7 +19,9 @@ package android.perftests.utils; import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.graphics.Insets; import android.os.Bundle; +import android.view.WindowInsets; import android.view.WindowManager; import android.widget.EditText; import android.widget.LinearLayout; @@ -42,6 +44,11 @@ public class PerfTestActivity extends Activity { if (getIntent().getBooleanExtra(INTENT_EXTRA_ADD_EDIT_TEXT, false)) { final LinearLayout layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); + layout.setOnApplyWindowInsetsListener((v, w) -> { + final Insets insets = w.getSystemWindowInsets(); + v.setPadding(insets.left, insets.top, insets.right, insets.bottom); + return WindowInsets.CONSUMED; + }); final EditText editText = new EditText(this); editText.setId(ID_EDITOR); |