From 48b44a6e27b87ee8bf5340a8d7ff37afaf04b7f9 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 22 Oct 2026 12:04:10 +0200 Subject: Optional app PIN, settings header, pink selection ring - A PIN (4 to 8 digits, salted SHA-256 in prefs) set in Settings shows a logo splash with a PIN prompt at start and whenever the app returns after leaving the screen; Back there leaves the app. - Settings gets the back-arrow header shared with the folder grid (Ui.header) and scrolls, since the PIN fields overflow the screen. - Tile and list focus rings use the icon pink. Co-Authored-By: Claude Opus 5.5 --- app/src/main/java/mygram/droid/Ui.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/src/main/java/mygram/droid/Ui.java') diff --git a/app/src/main/java/mygram/droid/Ui.java b/app/src/main/java/mygram/droid/Ui.java index 234dad3..172fbff 100644 --- a/app/src/main/java/mygram/droid/Ui.java +++ b/app/src/main/java/mygram/droid/Ui.java @@ -14,6 +14,7 @@ package mygram.droid; +import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.graphics.RenderEffect; @@ -153,6 +154,19 @@ final class Ui { button.getChildAt(1).setVisibility(current ? View.VISIBLE : View.INVISIBLE); } + /** Back arrow and title, for screens outside the main view. */ + static LinearLayout header(Activity a, String title) { + LinearLayout header = new LinearLayout(a); + header.setGravity(Gravity.CENTER_VERTICAL); + int p = dp(a, 16); + header.setPadding(p * 2, p, p * 2, 0); + header.addView(iconButton(a, R.drawable.ic_arrow_back, "Back", v -> a.finish())); + TextView t = text(a, title, 24); + t.setPadding(p, 0, 0, 0); + header.addView(t); + return header; + } + static void blur(ImageView v, float radius) { v.setRenderEffect(RenderEffect.createBlurEffect(radius, radius, Shader.TileMode.CLAMP)); } -- cgit v1.2.3