From 3d30fb560c073fe78adc2ada2563ea97bf0f5019 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 22 Oct 2026 11:15:10 +0200 Subject: 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 --- app/src/main/java/mygram/droid/SetupActivity.java | 7 ++++++- app/src/main/java/mygram/droid/TileAdapter.java | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) 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(); } diff --git a/app/src/main/java/mygram/droid/TileAdapter.java b/app/src/main/java/mygram/droid/TileAdapter.java index ee954b6..cf80f51 100644 --- a/app/src/main/java/mygram/droid/TileAdapter.java +++ b/app/src/main/java/mygram/droid/TileAdapter.java @@ -104,6 +104,8 @@ final class TileAdapter extends RecyclerView.Adapter { @Override public void onBindViewHolder(Holder h, int position) { Tile t = tiles.get(position); + h.itemView.setScaleX(1f); // a recycled tile may still carry the focus zoom + h.itemView.setScaleY(1f); if (t.image != null) { h.image.setScaleType(ImageView.ScaleType.CENTER_CROP); Glide.with(h.image).load(t.image).into(h.image); -- cgit v1.2.3