aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/invalid/lena/scrcpy/Main.java
diff options
context:
space:
mode:
authorLena <lena@omega>2026-07-01 00:00:00 +0000
committerLena <lena@omega>2026-07-01 00:00:00 +0000
commitc03f0464c1f834c2f4d8642cbfad322033d368b7 (patch)
tree9b591265ba9800d520d3ea07c2d484879191e4c3 /app/src/main/java/invalid/lena/scrcpy/Main.java
parentbe7a012517905f0a36b2e68f0df7a311ca191fff (diff)
downloadscrcpy-android-c03f0464c1f834c2f4d8642cbfad322033d368b7.tar.gz
app: pad Main and Settings for system bar insets
targetSdk 35 makes every window edge-to-edge on Android 15. Neither activity handled insets, so Main drew its header under the status bar and the Settings ScrollView started at window y=0: the framework action bar covered its first 80dp and the navigation bar covered the last rows. Pad both roots by the system bar insets. Main adds the IME inset as well, since an edge-to-edge window is not resized when the keyboard opens. Settings drops the framework action bar and draws its own title like Main already does, which removes the action-bar-versus-inset interaction entirely. Reported on the F-Droid submission (fdroiddata!41394).
Diffstat (limited to 'app/src/main/java/invalid/lena/scrcpy/Main.java')
-rw-r--r--app/src/main/java/invalid/lena/scrcpy/Main.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/src/main/java/invalid/lena/scrcpy/Main.java b/app/src/main/java/invalid/lena/scrcpy/Main.java
index 2f95375..eb8d400 100644
--- a/app/src/main/java/invalid/lena/scrcpy/Main.java
+++ b/app/src/main/java/invalid/lena/scrcpy/Main.java
@@ -6,6 +6,7 @@ import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
+import android.view.WindowInsets;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
@@ -34,6 +35,12 @@ public final class Main extends Activity {
super.onCreate(saved);
setContentView(R.layout.main);
+ // The IME inset is in the mask too: the window is edge-to-edge, so
+ // nothing resizes it when the keyboard opens. Padding the root
+ // shrinks the weighted device list and keeps the form reachable.
+ Ui.padForInsets(findViewById(R.id.root),
+ WindowInsets.Type.systemBars() | WindowInsets.Type.ime());
+
EditText host = findViewById(R.id.host);
EditText pairPort = findViewById(R.id.pair_port);
EditText pairCode = findViewById(R.id.pair_code);