Watch de-duplication (per the plan review): FileObserver (inotify,
push) and MediaStore ContentObserver (URI push) are the ONLY change
detectors. Removed: the 100 ms recv_timeout tick, the fast_dir_sig
mtime-diff watcher, collect_watched_dirs, changed_dirs, dir_sig,
rescan_subtrees, and the 5-minute full-rescan timer thread.
watch_files now blocks on the push channel; on Android each wake
coalesces ~50 ms so a burst of N file events becomes one payload
batch, one SQLite connection, and ONE grid emit (verified on the
emulator: 20-file copy = 1-2 emits, 20-file delete = 1 emit,
single add still lands in ~75-95 ms).
FileObserver rewritten: recursive registration (Pictures/DCIM tree,
cap 5000 dirs) and self-extending — a CREATE/MOVED_TO on a directory
spawns a new observer for it, so new albums are watched too.
tif/tiff added to the image filter.
Dead code removed (the Tauri port never wired them): scan::walk,
walk_dir_nostats, walk_dir_into, mtime_ns, decode_jpeg (full-size),
images::thumb_png, db::set_thumb, db::list_entries, db::count,
db::delete_by_media_id; Thumb shrunk to {rgb,width,height} (the
grid is uniform squares; the viewer uses full-res). Tests now
compile (tempfile dev-dependency was missing — the test module
never built) and were fixed to match the current API.
Viewer: live swipe preview — while a horizontal drag is in flight at
fit scale, the picture being swiped in renders on the page strip
(second <img>, its grid thumb, a ~1 ms mem hit) and tracks the
finger, so there is no blank side. On commit the primary image takes
over from exactly where the preview was; on snap-back the preview
slides back with the tween. Verified on the emulator (two images
visible mid-drag, clean slide home).
Not re-verified: 120 Hz jank (per instruction — measure once when
settled). Desktop paths untouched (deferred).
42 lines
1.4 KiB
Bash
Executable File
42 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# ttimg build: Tauri v2 scroll-jank testbed (sltest port).
|
|
#
|
|
# ./scripts/build.sh # aarch64 (phone)
|
|
# ./scripts/build.sh x86_64 # emulator
|
|
# ADB_SERIAL=<s> ./scripts/build.sh # install target
|
|
#
|
|
# Output: /tmp/ttimg/<abi>-release.apk (signed with the debug keystore).
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
ABI="${1:-aarch64}"
|
|
case "$ABI" in
|
|
aarch64|x86_64|armv7|i686) ;;
|
|
*) echo "unknown ABI: $ABI" >&2; exit 2 ;;
|
|
esac
|
|
|
|
export ANDROID_HOME="${ANDROID_HOME:-$HOME/android-sdk}"
|
|
export ANDROID_SDK_ROOT="$ANDROID_HOME"
|
|
|
|
cargo tauri android build --target "$ABI"
|
|
|
|
SRC=gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk
|
|
[ -f "$SRC" ] || { echo "APK not found at $SRC" >&2; exit 1; }
|
|
|
|
OUT=/tmp/ttimg
|
|
mkdir -p "$OUT"
|
|
cp "$SRC" "$OUT/ttimg-$ABI-unsigned.apk"
|
|
|
|
KEYSTORE="${KEYSTORE:-$HOME/.android/debug.keystore}"
|
|
APKSIGNER="$ANDROID_HOME/build-tools/35.0.0/apksigner"
|
|
"$APKSIGNER" sign --ks "$KEYSTORE" --ks-key-alias androiddebugkey \
|
|
--ks-pass pass:android --key-pass pass:android \
|
|
--out "$OUT/ttimg-$ABI-release.apk" "$OUT/ttimg-$ABI-unsigned.apk"
|
|
echo "APK: $OUT/ttimg-$ABI-release.apk ($(du -h "$OUT/ttimg-$ABI-release.apk" | cut -f1))"
|
|
|
|
if [ -n "${ADB_SERIAL:-}" ]; then
|
|
adb -s "$ADB_SERIAL" install -r "$OUT/ttimg-$ABI-release.apk"
|
|
adb -s "$ADB_SERIAL" shell am force-stop wow.gmp.ttimg
|
|
adb -s "$ADB_SERIAL" shell am start -n wow.gmp.ttimg/.MainActivity
|
|
fi
|