500 Commits
Author SHA1 Message Date
Anthonyy232 df5985f3d6 chore: release v4.2.2 2026-11-10 23:44:16 -08:00
Anthonyy232 e41920b65f chore: drop the redundant v26 qualifier from the launcher icon folder
minSdk is 31, so the qualifier never selects anything.
2026-11-10 23:35:43 -08:00
Anthonyy232 c21f9d11df refactor: drop code the platform and libraries already provide
- decode wallpapers with ImageDecoder only; the BitmapFactory and manual EXIF fallback could not be needed at minSdk 31
- remove BootReceiver: WorkManager reschedules periodic work after reboot
- replace the in-process reload broadcast with a shared flow
- remove the Room enum converter; Room stores enums by name
- stop importing SVG, which neither apply path can decode, and drop coil-svg
- remove the unused special-use foreground service permission
2026-11-10 15:12:40 -08:00
Anthonyy232 d2ffa9745b refactor: merge duplicated dialogs, switch rows, comparators and settings lookups
One ConfirmDialog, SettingSwitchRow, launchBusy and sort comparator replace their copies. ScheduleSettings gains albumId(screen) and isRotating(mode). CreateAlbumUseCase is now the only owner of the duplicate-name rule (case-insensitive, as the user already saw); the unused name query is gone. TimeIntervalPicker splits durations with kotlin.time.
2026-11-10 15:12:40 -08:00
Anthonyy232 d6bd404add refactor: move test fixtures and test-only queries out of main
The empty() model factories and four DAO methods were only called by tests. Fixtures now live in a source dir shared by unit and instrumented tests.
2026-11-10 12:25:33 -08:00
Anthonyy232 b3c2264bd3 fix: hide shuffle and adaptive brightness descriptions whenever enabled
They depended on the unrelated individual scheduling switch; the other toggles hide the description when on.
2026-11-10 12:25:33 -08:00
Anthonyy232 11724d99d3 refactor: use the SliderState slider overload
The value overload is deprecated in material3 1.5; this is what it did internally.
2026-11-10 12:25:33 -08:00
Anthonyy232 4e05b62d6e fix: load one live wallpaper at start and redraw on theme change
The engine requested a wallpaper in onCreate and again on the first settings emission, consuming two queue items. Adaptive brightness now gets a new frame when dark mode changes while visible.

Also drops the reload throttle, which only the album switch used, the renderer teardown that could never run because the surface is destroyed before the engine, and the catch that silently ended settings observation.
2026-11-10 08:25:05 -08:00
Anthonyy232 2044748e20 fix: stop the library tab padding system bars twice
The nested Scaffold re-applied the insets the home Scaffold had already padded, on edge-to-edge devices.
2026-11-10 08:25:05 -08:00
Anthonyy232 97dc38bbfb test: cut tests that cannot fail and tighten weak ones
- Remove tests that repeat another test, only verify a one-line delegate,
  compare a helper with itself, or exercise the platform.
- Make the EXIF rotation, lock interval validation, partial import and
  render selection tests fail when the behaviour breaks.
- Round-trip every schedule setting through the settings repository.
2026-11-10 02:47:40 -08:00
Anthonyy232 d169b84430 refactor: untangle the UI, remove the dead sort screen and trim leftovers
Dead code
- Remove the manual sort screen, unreachable since sorting moved into the
  album screen, with its route, strings, reorder repository/DAO methods and
  the reorderable dependency.
- Remove unused parameters, defaults, typography styles and constants.

UI
- Share the settings card, selectable grid card, wallpaper grid, back top
  bar, album cover, snackbar effect and onboarding button instead of
  keeping copies per screen; move shared pieces to common/components.
- HomeViewModel owns the duplicate album name rule and exposes only the
  animate flag; WallpaperViewViewModel exposes its own route arguments.
- The wallpaper viewer title shows the decoded file name.
- The empty library uses the same empty state as albums and folders.

Data and services
- Keep document-provider scanning next to AndroidDocumentSource and return
  SourceImage directly.
- Define preference keys where they are used; query the current wallpaper
  once.
- Use runCatchingCancellable for the remaining hand-written rethrows.

Live wallpaper
- Draw the crossfade without the always-opaque alpha helper and drop
  redundant program binds, guards and dead stores.
- Stop checking GL errors after deletes, which threw stale errors from
  cleanup and leaked tiles.
- A crashed GL thread refuses queued events instead of holding them.
2026-11-10 02:47:40 -08:00
Anthonyy232 66766c7926 chore: release v4.2.1 2026-10-13 09:15:11 -07:00
Anthonyy232 3b85cdb822 refactor: strip release debug logs and drop hand-rolled catches
- Strip Log.d/Log.v in release via R8; remove the per-frame parallax log.
- Use runCatchingCancellable instead of manual cancellation rethrows.
- Remove an unreachable catch in AlbumViewViewModel.deleteSelected.
- Reduce AlbumRefreshWorker to the work itself; drop log-only counters.
- Replace a force-unwrap in HomeScreen with a local val.
2026-10-13 09:10:03 -07:00
Anthonyy232 7dc1171678 refactor: simplify architecture and remove dead and duplicated code
Error handling
- Replace the custom Result type with exceptions; callers catch at the
  edge via runCatchingCancellable so cancellation always propagates.
- Log live wallpaper queue failures that were previously ignored.

Architecture
- Add SettingsCoordinator to own settings edits and their scheduling side
  effects; ViewModels now only hold UI state.
- Add a domain WallpaperRenderer interface (Android implementation in
  data/source) and drop Context from use cases; the service maps
  exceptions to messages.
- Share queue dequeuing between static changes and the live wallpaper.
- Merge PreferencesManager into SettingsRepositoryImpl with generated
  effect keys (stored key names unchanged).
- Start WallpaperChangeService only through its helpers; merge the
  duplicate change actions and share one error path for all actions.
- Fold AlbumRefreshScheduler into WallpaperScheduler.
- Move WallpaperSorter, AppModule and design tokens to their owners.

Cleanup
- Remove unused constants, WorkManager tags, single-value enums and
  converters (Room schema unchanged), brand-based texture limits and
  single-use design tokens.
- Deduplicate effect controls, interval fields, sort events and
  StateFlow sharing.
- Cut trivial tests and comments that restated the code.
2026-10-13 00:59:21 -07:00
Anthonyy232 1ba3d10aa7 Improve wallpaper reliability and simplify app for v4.2.0 2026-09-26 10:58:04 -07:00
Anthonyy232 f8fa13d487 fix: make album imports and refreshes reliable
Add cancellable imports, preserve inaccessible sources, and update covers and queues atomically. Share folder refresh logic, improve collection controls and accessibility, and simplify repository and selection code.

Validated with 299 unit tests, 29 device tests, lint, and a debug build.
2026-09-26 10:58:04 -07:00
Anthony La e18f3eceb9 fix: defer automatic rotation after manual changes
Preserve the full interval with an in-place next-run override and add request-level and real WorkManager regression coverage.
2026-09-12 12:06:19 -07:00
Anthony La 22cc66687e chore: prepare Paperize v4.1.1 (#606)
Bump the app to version 4.1.1 (56) and add release notes for Simplified Chinese support and corrected notification privacy text.
2026-09-12 11:26:44 -07:00
Anthonyy232 7fb0f8e824 fix(i18n): qualify Simplified Chinese and correct privacy copy 2026-09-12 11:13:18 -07:00
dsh 3fccae4273 feat(i18n): add Simplified Chinese (zh-CN) translation 2026-09-11 23:21:38 +08:00
Anthony La 65a2f66344 feat: prepare Paperize v4.1.0 (#598) 2026-08-30 09:42:54 -07:00
Anthony La e651cdc248 Fix static wallpaper rendering and scheduling regressions (#583)
Correct natural-orientation static rendering, make Fill scrolling opt-in, add persistent pause/resume scheduling controls, and remove the unused network-state permission.
2026-08-06 23:24:43 -07:00
Anthony La 15c9b47131 fix: harden wallpaper engines for v4.0.2 (#571)
* fix: harden wallpaper engines for v4.0.2

* fix: restore launcher wallpaper shortcut

* fix: keep launcher shortcut entry point private

* chore: remove unused legacy dependencies

* ci: validate final audited tree
2026-07-30 00:44:03 -07:00
Anthony La 87a69e748f fix: make notification intents explicitly targeted (#570)
Make notification destinations explicit in an analyzer-visible form while retaining immutable PendingIntent flags, resolving the high-severity CodeQL finding.
2026-07-29 23:16:40 -07:00
Anthony La 797a407f3c fix: harden wallpaper updates for v4.0.1 (#566) 2026-07-29 22:28:01 -07:00
Anthonyy232 153cdbe798 chore: prepare Paperize 4.0.0 release 2026-07-28 22:03:50 -07:00
malteish 063f05bdba feat: restore an in-app change-now action
Integrates the aligned portion of #537 while retaining platform-controlled home-screen sizing.
2026-07-28 22:03:50 -07:00
Anthonyy232 bc513d666e fix: stabilize synchronized changes and foldable rendering 2026-07-28 22:03:50 -07:00
malteishandClaude Opus 4.8 3793aaae65 fix: render current-wallpaper preview from URI instead of getDrawable
The preview read the live wallpaper via WallpaperManager.getDrawable(), which
is privacy-restricted on modern Android and returns null without the optional
all-files-access permission - leaving both previews blank/grey.

Render the wallpaper Paperize last recorded instead, loading its source URI
with Coil. A new reactive getCurrentWallpaperFlow (DAO + repository) drives
HomeViewModel.current{Home,Lock}WallpaperUri, so the preview updates whenever
the wallpaper changes and needs no extra permission. Falls back to the
BOTH-mode record when home/lock are synced.

Shows the source image rather than the exact cropped/effected result; a
pixel-exact cached-bitmap preview can follow later.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-28 22:03:50 -07:00
malteishandClaude Opus 4.8 ade1fd4673 feat: show live import progress when adding folders/wallpapers
Adding a large folder previously gave no feedback at all (the FAB's
isLoading hook was hardcoded false), so a long import looked frozen.

Surface an ImportProgress state from AlbumViewViewModel and show a modal
dialog with a live count: a counting-up 'Scanning... N found' during the
folder walk, then a determinate 'Saving X / total' bar while rows are
written. scanFolderImages now reports discovery progress (throttled), and
inserts run in chunks that report saved/total - which also avoids
materializing the full entity list at once.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-28 22:03:50 -07:00
malteishandClaude Opus 4.8 e2e9d6f4f9 perf: scan folders via DocumentsContract cursor instead of DocumentFile
Adding a folder walked the tree with DocumentFile.listFiles(), which issues
a separate ContentResolver IPC for every file and for every attribute access
(name, isDirectory, lastModified). For folders with tens of thousands of
images this dominates the add/refresh time and risks ANRs.

Replace it with a single DocumentsContract cursor query per directory that
returns document id, name, mime type and last-modified in one round-trip, and
traverse directories iteratively to avoid deep-recursion stack overflow. The
album-view add path additionally dropped its per-file getFileName() and
detectMediaType() lookups by reusing the name returned from the scan.

Returned URIs are built from the same tree document id as before, so existing
wallpaper URIs remain stable. Both folder-scan call sites now share one helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-28 22:03:50 -07:00
Malteish 8e8be164bd fix: restore compilation (#534)
Remove the stale navigation callback left behind after sorting moved into the album screen. This restores compilation on master and unblocks CI.
2026-07-28 21:38:04 -07:00
Anthonyy232 e7d5022d02 fix: throw prevents lock from rendering 2026-03-28 15:31:23 -07:00
Anthonyy232andClaude Opus 4.6 83d1bafcf8 perf: prevent OOM from oversized FILL bitmaps and BOTH-mode double allocation
Two memory optimizations:

1. ImageDecoder FILL path: use setCrop() to crop to canvas during decode
   instead of allocating the full fill-scale bitmap first. For a portrait
   2000x3000 image on a 4032x2992 parallax canvas, this avoids a ~97MB
   intermediate (4032x6048) — the output is directly 4032x2992 (~48MB).

2. BOTH mode: recycle the HOME bitmap before rendering the LOCK bitmap,
   so they are never in memory simultaneously. Removes the fallback that
   reused the HOME bitmap for LOCK (which kept it alive during LOCK
   rendering). If LOCK rendering fails, the lock screen retains its
   previous wallpaper rather than getting the oversized HOME bitmap.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:17:24 -07:00
Anthonyy232andClaude Opus 4.6 2abf5a1804 fix: BOTH mode renders lock screen separately at physical screen dimensions
In BOTH mode, the same HOME-sized bitmap (wide parallax canvas, e.g.
4032x2992) was reused for the lock screen via setBitmap(FLAG_LOCK).
The lock screen has no parallax, so Android center-cropped the wide
bitmap — defeating FIT/NONE modes which should letterbox, not crop.

Fix: after setting HOME, sync the LOCK queue, then re-render the same
wallpaper via reapplyEffectsUseCase(ScreenType.LOCK) at the physical
screen dimensions. Falls back to the old behavior if re-render fails.

Applied to both WallpaperChangeService and WallpaperChangeWorker.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:14:14 -07:00
Anthonyy232andClaude Sonnet 4.6 6884559b6b fix: all scaling modes now produce exact-canvas-sized bitmaps
retrieveBitmap previously returned bitmaps sized to the image content (e.g.
1994x2992 for FIT on a portrait image), leaving the launcher to scale/position
them — which silently broke the chosen scaling mode:

  FIT   → narrower than canvas → launcher scaled up → cropped height again
  FILL  → taller than canvas  → launcher behaviour undefined / distorted
  NONE  → smaller than canvas → launcher stretched it

New finalizeToCanvas() step ensures every path returns a bitmap of exactly
canvasW×canvasH pixels:
  FILL   → center-crop the fill-scaled source to canvas size;
           upscale first when BitmapFactory fallback returns a small source
  FIT    → center the fit-scaled source on a black canvas (letterbox/pillarbox)
  NONE   → center the original-size source on a black canvas
  STRETCH → source was decoded to exact canvas dimensions; no-op

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 15:06:05 -07:00
Anthonyy232andClaude Sonnet 4.6 8d805ad17d fix: FIT/FILL scaling broken on launchers with parallax scrolling (Pixel Launcher)
Wallpapers were rendered at physical screen size (e.g. 1344x2992) then passed
to WallpaperManager.setBitmap() with a null visibleCropHint. The Pixel Launcher
(and others) declare a desired minimum width ~3x the screen width for horizontal
parallax across home-screen pages. Android scales the bitmap up to fill that
canvas, which proportionally enlarges the height and crops the top/bottom --
making FIT indistinguishable from FILL and always cutting off portrait subjects.

Fix: introduce getWallpaperRenderSize() which uses WallpaperManager
.getDesiredMinimumWidth/Height for HOME/BOTH screen types. The bitmap is now
rendered to fill the full parallax canvas upfront, so Android has nothing to
scale and the user's chosen scaling mode is preserved. LOCK screen is unchanged
(no parallax, physical screen size is correct).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 14:59:39 -07:00
Anthonyy232andClaude Sonnet 4.6 5efb272dcb fix: scheduleWallpaperChanges fire-and-forget in BootReceiver
scheduleWallpaperChanges internally launched on schedulerScope and returned
immediately, so BootReceiver called pendingResult.finish() before WorkManager
enqueued the jobs — the process could be recycled before the scheduling ran.
Converted to a suspend function so callers await completion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 14:43:21 -07:00
Anthonyy232andClaude Sonnet 4.6 456fea3c17 fix: move settings debounce from composable-local state to HomeViewModel
pendingSettings was stored in WallpaperScreen's remember{} scope — navigating
away (e.g. to AlbumView) cancelled the LaunchedEffect and silently discarded
in-flight slider/interval changes. Moved the debounce Job to viewModelScope so
pending updates survive composition changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 14:29:48 -07:00
Anthonyy232andClaude Sonnet 4.6 8f357f8767 fix: reset wasCleared on each DataStore edit retry in clearAlbumSelectionsIfMatches
DataStore's edit lambda can be retried when a concurrent write conflict
is detected. wasCleared was captured from the outer scope and never reset
between retries, so a true from a failed first attempt could leak into the
final return value even if the condition no longer held on the retry.
Added wasCleared = false at the top of the lambda so each attempt starts
from a clean state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 14:06:12 -07:00
Anthonyy232andClaude Sonnet 4.6 73ca207301 fix: prevent GL texture leak when tile creation fails mid-array
If Bitmap.createBitmap() or loadTexture() threw (e.g. OutOfMemoryError)
while building the GLPicture tiles Array, any textures already uploaded
to the GPU in previous iterations were abandoned because the tiles field
was never assigned and recycle() could not be called. Switched from the
Array{} lambda (which only exposes partial state through the exception)
to an explicit loop that tracks created tiles in a List, and added a
catch-rethrow that deletes all partial textures before propagating.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 14:05:24 -07:00
Anthonyy232andClaude Sonnet 4.6 34031fe89d fix: stop foreground service immediately on null/unknown action
If onStartCommand received a null intent (possible when START_STICKY
restarts a killed service) or an unrecognized action, the service would
start foreground (showing a persistent notification) but never call
stopSelf(), leaving it running indefinitely. Added an else branch to
call stopSelf(startId) immediately in these cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 14:02:53 -07:00
Anthonyy232andClaude Sonnet 4.6 4e14adfc01 fix: recycle bitmaps on exception in wallpaper processing pipeline
ChangeWallpaperUseCase and ReapplyEffectsUseCase both leaked the
processedBitmap when processBitmap() or adaptiveBrightnessAdjustment()
threw an exception — the outer catch returned Result.Error without
recycling the allocated bitmap. Added an inner try-catch-rethrow that
recycles whichever bitmap is live at the point of failure before
re-throwing so the outer handler can record the skip.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 14:01:17 -07:00
Anthonyy232andClaude Sonnet 4.6 8e4b0771c8 perf: eliminate O(n²) queue merges, N+1 refresh queries, and dead schema columns
- QueueBuilder: convert List.contains to HashSet lookups in mergeWithExistingQueue
  and mergeWithExistingQueueDeterministic (O(n²) → O(n))
- AlbumRefreshWorker: load existing folder URIs once per folder with
  getExistingWallpaperUris() instead of one DB query per scanned wallpaper (N+1 → 1)
- WallpaperEntity: remove unused cropOffsetX/Y/Scale columns (always null, never read)
- DATABASE_VERSION bumped to 4; fallbackToDestructiveMigration handles upgrade

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 13:49:49 -07:00
Anthonyy232andClaude Sonnet 4.6 4565893787 refactor: rename shadowed local variable in addWallpapers
Local `val wallpapers` shadowed the `StateFlow<List<Wallpaper>> wallpapers`
class property, making it hard to tell which was being referenced.
Renamed to `newWallpapers` for clarity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 11:38:28 -07:00
Anthonyy232andClaude Sonnet 4.6 4ff25cad78 fix: skip-not-delete on invalid URI in live wallpaper; rename enableChangeOnScreenOn to enableChangeOnScreenOff
- PaperizeLiveWallpaperService: stop permanently deleting wallpapers when
  URI is transiently inaccessible; now skips the cycle like ChangeWallpaperUseCase does.
  AlbumRefreshWorker handles authoritative URI pruning on its daily run.
- WallpaperEffects/PreferencesManager/WallpaperScreen: rename enableChangeOnScreenOn
  → enableChangeOnScreenOff to match actual trigger (ACTION_SCREEN_OFF).
  DataStore key string is unchanged so existing user prefs are preserved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 11:33:55 -07:00
Anthonyy232andClaude Sonnet 4.6 6d8a9a9302 fix: remove dead deleteFirstQueueItem from WallpaperQueueDao
This position-based delete was superseded by deleteQueueItem (which
deletes by wallpaperId) and has zero call sites.  Removing it
eliminates confusion about which dequeue strategy is active.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 11:25:38 -07:00
Anthonyy232andClaude Sonnet 4.6 8d945a63a4 fix: validate homeAlbumId==lockAlbumId in Worker BOTH mode
WallpaperChangeService already guards against the case where home and
lock albums diverge in BOTH mode.  WallpaperChangeWorker was using
homeAlbumId unconditionally, silently applying the wrong album to the
lock screen during transient state transitions.  Add the same guard
and fall back to independent per-screen changes when albums differ.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 11:25:18 -07:00
Anthonyy232andClaude Sonnet 4.6 c72cdc39a8 fix: use integer division (floor) in calculateInSampleSize
fastRoundToInt() can round the inSampleSize ratio UP, causing the
decoded bitmap to be smaller than the target screen dimensions and
requiring upscaling.  Integer division always floors, guaranteeing
the decoded bitmap is at least as large as needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 11:24:09 -07:00
Anthonyy232andClaude Sonnet 4.6 c93e2f71f1 fix: share WallpaperChangeLock singleton between service and worker
WallpaperChangeService and WallpaperChangeWorker each had their own
private companion-object Mutex, so simultaneous runs (manual change +
scheduled worker) were not mutually excluded.  Extract a @Singleton
WallpaperChangeLock and inject it into both so the same Mutex is used
across all wallpaper-change entry points.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 11:23:41 -07:00