diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-22 12:27:34 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-22 12:27:34 +0200 |
| commit | 899b1d9812c61a33554b67e3026850684e686ce1 (patch) | |
| tree | 415abc780daa5bd4cbb69d65bdb82157b44cf3ab /app/src/main/java/mygram/droid/LockActivity.java | |
| parent | 48b44a6e27b87ee8bf5340a8d7ff37afaf04b7f9 (diff) | |
| download | mygram-droid-899b1d9812c61a33554b67e3026850684e686ce1.tar.gz mygram-droid-899b1d9812c61a33554b67e3026850684e686ce1.zip | |
Splash gates the app while Foldergram indexes
Foldergram is unusably slow during a scan, so the splash (renamed from
LockActivity) now shows on every start and return to the app: PIN if
set, then it polls /api/scan-progress every 5 s and stays on "Library
is indexing" until the scan ends. Home connects only after the splash.
Builds and deploys; the indexing path is not yet tested on the TV.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'app/src/main/java/mygram/droid/LockActivity.java')
| -rw-r--r-- | app/src/main/java/mygram/droid/LockActivity.java | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/app/src/main/java/mygram/droid/LockActivity.java b/app/src/main/java/mygram/droid/LockActivity.java deleted file mode 100644 index dd95915..0000000 --- a/app/src/main/java/mygram/droid/LockActivity.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * mygram-droid: Android TV client for Foldergram. - * Copyright (C) 2026 Danilo M. <danix@danix.xyz> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -package mygram.droid; - -import android.app.Activity; -import android.os.Bundle; -import android.text.InputType; -import android.view.View; -import android.widget.EditText; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.Toast; - -/** Splash with the logo and a PIN prompt; App shows it while the app is locked. */ -public final class LockActivity extends Activity { - @Override - protected void onCreate(Bundle state) { - super.onCreate(state); - LinearLayout box = Ui.column(this); - ImageView logo = new ImageView(this); - logo.setImageResource(R.drawable.ic_launcher); - logo.setContentDescription("mygram"); - int s = Ui.dp(this, 96); - LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(s, s); - lp.bottomMargin = Ui.dp(this, 24); - box.addView(logo, lp); - EditText pin = Ui.field(this, "PIN", InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD); - box.addView(pin); - View ok = Ui.iconButton(this, R.drawable.ic_check, "Unlock", v -> { - if (Prefs.checkPin(pin.getText().toString())) { - App.locked = false; - finish(); - } else { - pin.setText(""); - Toast.makeText(this, "Wrong PIN", Toast.LENGTH_SHORT).show(); - } - }); - box.addView(ok); - // The keyboard's done key unlocks; the D-pad cannot leave the keyboard. - pin.setOnEditorActionListener((v, action, event) -> ok.performClick()); - setContentView(box); - pin.requestFocus(); - } - - /** Back leaves the app instead of revealing the screen underneath. */ - @Override - @SuppressWarnings("deprecation") // no predictive back on this TV; onBackPressed still fires - public void onBackPressed() { - finishAffinity(); - } -} |
