aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-22 11:15:10 +0200
committerDanilo M. <danix@danix.xyz>2026-10-22 11:15:10 +0200
commit3d30fb560c073fe78adc2ada2563ea97bf0f5019 (patch)
treebb9fab0115e131a127bb9ce0d7e59b1b222a751b
parent9afba17e880840b8d138d1f5906d65afeaf8d5a6 (diff)
downloadmygram-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>
-rw-r--r--app/src/main/java/mygram/droid/SetupActivity.java7
-rw-r--r--app/src/main/java/mygram/droid/TileAdapter.java2
2 files changed, 8 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();
}
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<TileAdapter.Holder> {
@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);