From 7c2b685bf8fe61a445034cfad646f24b7eaff843 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 22 Oct 2026 11:44:09 +0200 Subject: Back icon in folder view, softer focus, Back returns to Home From on-device testing: the folder grid had no visible way back, the white focus ring on icons was harsh, and Back on the Liked or Folders tab closed the app. Icon buttons now get a soft rounded highlight, tiles a thinner translucent ring, and Back leaves the app only from Home. Co-Authored-By: Claude Opus 5.5 --- app/src/main/java/mygram/droid/FolderActivity.java | 11 +++++++++-- app/src/main/java/mygram/droid/MainActivity.java | 10 ++++++++++ app/src/main/java/mygram/droid/Ui.java | 2 +- app/src/main/res/drawable/focus_glow.xml | 17 +++++++++++++++++ app/src/main/res/drawable/focus_ring.xml | 2 +- app/src/main/res/drawable/ic_arrow_back.xml | 6 ++++++ 6 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/focus_glow.xml create mode 100644 app/src/main/res/drawable/ic_arrow_back.xml diff --git a/app/src/main/java/mygram/droid/FolderActivity.java b/app/src/main/java/mygram/droid/FolderActivity.java index c7002c5..dd674c4 100644 --- a/app/src/main/java/mygram/droid/FolderActivity.java +++ b/app/src/main/java/mygram/droid/FolderActivity.java @@ -19,6 +19,7 @@ import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.view.Gravity; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.LinearLayout; @@ -51,9 +52,15 @@ public final class FolderActivity extends Activity { super.onCreate(state); LinearLayout column = new LinearLayout(this); column.setOrientation(LinearLayout.VERTICAL); + LinearLayout header = new LinearLayout(this); + header.setGravity(Gravity.CENTER_VERTICAL); + int p = Ui.dp(this, 16); + header.setPadding(p * 2, p, p * 2, 0); + header.addView(Ui.iconButton(this, R.drawable.ic_arrow_back, "Back", v -> finish())); TextView title = Ui.text(this, getIntent().getStringExtra("name"), 24); - title.setPadding(Ui.dp(this, 36), Ui.dp(this, 24), 0, 0); - column.addView(title); + title.setPadding(p, 0, 0, 0); + header.addView(title); + column.addView(header); content = new FrameLayout(this); column.addView(content, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, 1)); setContentView(column); diff --git a/app/src/main/java/mygram/droid/MainActivity.java b/app/src/main/java/mygram/droid/MainActivity.java index 3292f90..7c29e0a 100644 --- a/app/src/main/java/mygram/droid/MainActivity.java +++ b/app/src/main/java/mygram/droid/MainActivity.java @@ -220,6 +220,16 @@ public final class MainActivity extends Activity { handler.removeCallbacks(rotate); } + /** Back from Liked or Folders returns to Home; from Home it leaves the app. */ + @Override + @SuppressWarnings("deprecation") // no predictive back on this TV; onBackPressed still fires + public void onBackPressed() { + if (ready && tab != HOME) + show(HOME); + else + super.onBackPressed(); + } + @Override protected void onDestroy() { handler.removeCallbacks(rotate); diff --git a/app/src/main/java/mygram/droid/Ui.java b/app/src/main/java/mygram/droid/Ui.java index 65de7f8..586aa65 100644 --- a/app/src/main/java/mygram/droid/Ui.java +++ b/app/src/main/java/mygram/droid/Ui.java @@ -113,7 +113,7 @@ final class Ui { t.setVisibility(View.INVISIBLE); box.addView(t); box.setFocusable(true); - box.setForeground(c.getDrawable(R.drawable.focus_ring)); + box.setBackground(c.getDrawable(R.drawable.focus_glow)); box.setOnFocusChangeListener((v, has) -> { t.setVisibility(has ? View.VISIBLE : View.INVISIBLE); zoom(v, has); diff --git a/app/src/main/res/drawable/focus_glow.xml b/app/src/main/res/drawable/focus_glow.xml new file mode 100644 index 0000000..e90b268 --- /dev/null +++ b/app/src/main/res/drawable/focus_glow.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/focus_ring.xml b/app/src/main/res/drawable/focus_ring.xml index 1cab3f8..ed924f3 100644 --- a/app/src/main/res/drawable/focus_ring.xml +++ b/app/src/main/res/drawable/focus_ring.xml @@ -5,7 +5,7 @@ - + diff --git a/app/src/main/res/drawable/ic_arrow_back.xml b/app/src/main/res/drawable/ic_arrow_back.xml new file mode 100644 index 0000000..637f25c --- /dev/null +++ b/app/src/main/res/drawable/ic_arrow_back.xml @@ -0,0 +1,6 @@ + + + + -- cgit v1.2.3