diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-22 11:15:10 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-22 11:15:10 +0200 |
| commit | 3d30fb560c073fe78adc2ada2563ea97bf0f5019 (patch) | |
| tree | bb9fab0115e131a127bb9ce0d7e59b1b222a751b /app/src/main/java/mygram/droid/SetupActivity.java | |
| parent | 9afba17e880840b8d138d1f5906d65afeaf8d5a6 (diff) | |
| download | mygram-droid-3d30fb560c073fe78adc2ada2563ea97bf0f5019.tar.gz mygram-droid-3d30fb560c073fe78adc2ada2563ea97bf0f5019.zip | |
Focus the first action, ignore an empty URL, reset tile zoom on rebind
Review follow-ups: after a failed scan or connect nothing had focus, so
the first D-pad press was swallowed; an empty manual URL produced a
confusing "Cannot reach http://" error; a recycled tile could keep the
1.08 focus zoom.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'app/src/main/java/mygram/droid/SetupActivity.java')
| -rw-r--r-- | app/src/main/java/mygram/droid/SetupActivity.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/src/main/java/mygram/droid/SetupActivity.java b/app/src/main/java/mygram/droid/SetupActivity.java index 106ec9c..3f33d76 100644 --- a/app/src/main/java/mygram/droid/SetupActivity.java +++ b/app/src/main/java/mygram/droid/SetupActivity.java @@ -72,6 +72,7 @@ public final class SetupActivity extends Activity { row.addView(Ui.iconButton(this, R.drawable.ic_refresh, "Rescan", v -> scan())); row.addView(Ui.iconButton(this, R.drawable.ic_edit, "Enter URL", v -> manual())); box.addView(row); + row.getChildAt(0).requestFocus(); } private void manual() { @@ -80,7 +81,11 @@ public final class SetupActivity extends Activity { InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI); box.addView(url); box.addView(Ui.iconButton(this, R.drawable.ic_check, "Connect", - v -> choose(Api.normalize(url.getText().toString())))); + v -> { + String s = url.getText().toString().trim(); + if (!s.isEmpty()) + choose(Api.normalize(s)); + })); url.requestFocus(); } |
