Compare commits

..
801 Commits
Author SHA1 Message Date
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
renovate[bot] 4175b09196 fix(deps): update Hilt to 2.60.1 (#576)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-06 22:28:28 -07:00
renovate[bot] 1edfcfd837 fix(deps): update kotlinx-coroutines-test to 1.11.0 (#575)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-06 22:28:25 -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 3b746ad354 ci: add Android-aware CodeQL analysis (#567)
Add pinned CodeQL analysis for GitHub Actions and Android Java/Kotlin builds, and restrict the release workflow token to read-only by default.
2026-07-29 23:04:12 -07:00
Anthony La 797a407f3c fix: harden wallpaper updates for v4.0.1 (#566) 2026-07-29 22:28:01 -07:00
renovate[bot] 145899d9a6 chore(deps): update github artifact actions (#563)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-29 22:20:18 -07:00
renovate[bot] af72b78a7b fix(deps): update dependency androidx.hilt:hilt-work to v1.4.0 (#562)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-29 22:19:34 -07:00
renovate[bot] 13367165e6 fix(deps): update dependency androidx.hilt:hilt-compiler to v1.4.0 (#560)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-29 22:15:10 -07:00
renovate[bot] b5f4b52f60 chore(deps): update gradle to v9.6.1 (#551)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-29 22:07:38 -07:00
renovate[bot] 434830cfdd chore(deps): pin dependencies (#548)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-29 22:01:30 -07:00
renovate[bot] 7c426d5d63 fix(deps): update dependency io.mockk:mockk to v1.14.11 (#550)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-29 14:29:24 +00:00
Anthonyy232 d940d9e112 docs: align v4.0.0 release notes 2026-07-28 22:32:48 -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
renovate[bot] 9c8fbaf1cc fix(deps): update dependency androidx.navigation:navigation-compose to v2.9.8 (#527)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-29 05:00:22 +00: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
Anthonyy232 bc26d3c75f fix: more bug fixes 2026-03-25 22:19:21 -07:00
renovate[bot] eadd1952fe fix(deps): update dependency androidx.compose.animation:animation to v1.10.6 (#517)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-26 01:56:04 +00:00
renovate[bot] fd7e69f43a fix(deps): update dependency com.lazygeniouz:dfc to v1.5 (#514)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-25 05:05:47 +00:00
Anthonyy232 26a13bdeb2 Merge branch 'master' of https://github.com/Anthonyy232/Paperize 2026-03-24 21:06:43 -07:00
Anthonyy232 89dc845f1b fix: bug hunt 2026-03-24 21:05:37 -07:00
renovate[bot] d0cda6cc36 fix(deps): update dependency androidx.core:core-ktx to v1.18.0 (#513)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-21 13:06:30 +00:00
renovate[bot] bedfbe7afd fix(deps): update dependency androidx.datastore:datastore-preferences to v1.2.1 (#511)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-21 08:47:20 +00:00
renovate[bot] 6f2cb0b995 fix(deps): update dependency androidx.datastore:datastore to v1.2.1 (#510)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-21 05:27:31 +00:00
renovate[bot] a6aaf55c3c fix(deps): update dependency androidx.activity:activity-compose to v1.13.0 (#512)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-21 00:39:52 +00:00
renovate[bot] f2aa714b17 fix(deps): update dependency androidx.compose.ui:ui-tooling-preview to v1.10.5 (#509)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-20 20:52:04 +00:00
renovate[bot] 2464907a9c fix(deps): update dependency androidx.compose.ui:ui-tooling to v1.10.5 (#507)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-20 18:13:00 +00:00
renovate[bot] 304a384cd0 fix(deps): update dependency androidx.compose.ui:ui to v1.10.5 (#503)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-20 13:43:03 +00:00
renovate[bot] 5dfb1c6a6c fix(deps): update dependency androidx.compose.ui:ui-test-junit4 to v1.10.5 (#505)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-20 08:57:11 +00:00
renovate[bot] 9e84837a68 fix(deps): update dependency androidx.compose.ui:ui-graphics to v1.10.5 (#504)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-20 05:25:26 +00:00
renovate[bot] 600db80998 chore(deps): update kotlin monorepo to v2.3.20 (#508)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-20 01:09:52 +00:00
renovate[bot] e6a0a607d2 fix(deps): update dependency androidx.compose.ui:ui-test-manifest to v1.10.5 (#506)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-19 21:40:30 +00:00
renovate[bot] 0cff2f3a0a chore(deps): update gradle to v9.4.1 (#499)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-19 17:14:58 +00:00
renovate[bot] 2e9768c3b5 fix(deps): update dependency androidx.compose.material:material to v1.10.5 (#502)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-15 05:23:09 +00:00
renovate[bot] 1df9368330 fix(deps): update dependency androidx.compose.foundation:foundation to v1.10.5 (#501)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-15 01:21:59 +00:00
renovate[bot] 7014fc06fe fix(deps): update dependency androidx.compose.animation:animation to v1.10.5 (#500)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-12 01:37:32 +00:00
renovate[bot] 464ea59a4c fix(deps): update dependency androidx.compose.ui:ui-tooling-preview to v1.10.4 (#493)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-27 20:50:13 +00:00
renovate[bot] dba8d9199d fix(deps): update dependency net.engawapg.lib:zoomable to v2.11.1 (#483)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-27 18:08:20 +00:00
renovate[bot] 9358348549 fix(deps): update dependency androidx.compose.ui:ui-tooling to v1.10.4 (#492)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-27 14:08:00 +00:00
renovate[bot] 1764f092ae fix(deps): update dependency androidx.compose.ui:ui-test-junit4 to v1.10.4 (#490)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-27 09:00:58 +00:00
renovate[bot] 8c25786a1c fix(deps): update dependency androidx.compose.ui:ui to v1.10.4 (#494)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-27 04:35:16 +00:00
renovate[bot] f358478355 fix(deps): update dependency androidx.compose.foundation:foundation to v1.10.4 (#486)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-27 02:02:06 +00:00
renovate[bot] e6ec42c015 fix(deps): update dependency androidx.compose.ui:ui-test-manifest to v1.10.4 (#491)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-26 21:14:10 +00:00
renovate[bot] 9e7aabe7a7 fix(deps): update dependency androidx.compose.ui:ui-graphics to v1.10.4 (#489)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-26 17:43:17 +00:00
renovate[bot] 6396857b66 fix(deps): update dependency androidx.compose.material3:material3 to v1.5.0-alpha15 (#488)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-26 13:43:00 +00:00
renovate[bot] 51e498e8e7 fix(deps): update dependency androidx.compose.animation:animation to v1.10.4 (#485)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-26 08:36:26 +00:00
renovate[bot] 85a39183f0 fix(deps): update dependency androidx.compose.material:material to v1.10.4 (#487)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-26 05:01:12 +00:00
renovate[bot] 09ce9e83b4 fix(deps): update dependency androidx.compose.ui:ui-tooling-preview to v1.10.3 (#480)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-25 04:43:50 +00:00
renovate[bot] 63b0e15a9f fix(deps): update coil to v3.4.0 (#484)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-25 01:04:30 +00:00
renovate[bot] 4013e5e2ac chore(deps): update dependency com.google.devtools.ksp to v2.3.6 (#481)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-18 02:04:34 +00:00
renovate[bot] 69988fa0cc fix(deps): update dependency com.lazygeniouz:dfc to v1.3 (#469)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-13 18:34:18 +00:00
renovate[bot] fcf92878a3 fix(deps): update dependency androidx.compose.ui:ui-tooling to v1.10.3 (#479)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-13 14:15:21 +00:00
renovate[bot] 9fa1536c78 fix(deps): update dependency androidx.compose.ui:ui-test-manifest to v1.10.3 (#478)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-13 09:34:50 +00:00
renovate[bot] 8a4f6b429d fix(deps): update dependency androidx.compose.material3:material3 to v1.5.0-alpha14 (#474)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-13 05:39:07 +00:00
renovate[bot] 53c5e87dca fix(deps): update dependency androidx.compose.ui:ui-test-junit4 to v1.10.3 (#477)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-13 02:50:22 +00:00
renovate[bot] 9737dd70b6 fix(deps): update dependency androidx.compose.ui:ui to v1.10.3 (#475)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-12 20:50:51 +00:00
renovate[bot] 57794f6588 fix(deps): update dependency androidx.compose.ui:ui-graphics to v1.10.3 (#476)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-12 19:07:34 +00:00
renovate[bot] dd79170859 fix(deps): update dependency androidx.activity:activity-compose to v1.12.4 (#470)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-12 14:51:25 +00:00
renovate[bot] 6f972ef2d5 fix(deps): update dependency androidx.compose.material:material to v1.10.3 (#473)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-12 08:49:35 +00:00
renovate[bot] 8ec4baac6d fix(deps): update dependency androidx.compose.foundation:foundation to v1.10.3 (#472)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-12 05:52:40 +00:00
renovate[bot] 9bf160f379 fix(deps): update dependency androidx.compose.animation:animation to v1.10.3 (#471)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-12 02:46:27 +00:00
renovate[bot] aaf533535b fix(deps): update dependency net.engawapg.lib:zoomable to v2.11.0 (#466)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-07 13:26:57 +00:00
renovate[bot] 508c5bfd23 fix(deps): update dependency io.mockk:mockk to v1.14.9 (#449)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-05 22:26:04 +00:00
renovate[bot] 63e224aa5b fix(deps): update dependency androidx.work:work-runtime-ktx to v2.11.1 (#465)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-05 18:08:02 +00:00
renovate[bot] 46d051ab8a chore(deps): update kotlin monorepo to v2.3.10 (#467)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-05 13:00:52 +00:00
renovate[bot] 53659c73f0 fix(deps): update dependency androidx.navigation:navigation-compose to v2.9.7 (#464)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-31 12:53:13 +00:00
renovate[bot] 226260def4 fix(deps): update dependency androidx.compose.ui:ui-tooling to v1.10.2 (#461)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-31 09:35:38 +00:00
renovate[bot] cb24374230 fix(deps): update dependency androidx.compose.ui:ui-tooling-preview to v1.10.2 (#463)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-31 05:48:09 +00:00
renovate[bot] 2db01c9906 fix(deps): update dependency androidx.compose.ui:ui to v1.10.2 (#456)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-31 01:13:47 +00:00
renovate[bot] 55f07becd0 fix(deps): update dependency androidx.compose.ui:ui-test-manifest to v1.10.2 (#460)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 20:59:50 +00:00
renovate[bot] 3740431e96 fix(deps): update dependency androidx.compose.ui:ui-test-junit4 to v1.10.2 (#458)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 16:25:50 +00:00
renovate[bot] 26ef5b63ff fix(deps): update dependency androidx.activity:activity-compose to v1.12.3 (#462)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 12:52:19 +00:00
renovate[bot] 33360a3e1e fix(deps): update dependency androidx.compose.ui:ui-graphics to v1.10.2 (#457)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 10:33:46 +00:00
renovate[bot] 859d42a7fa fix(deps): update dependency androidx.compose.foundation:foundation to v1.10.2 (#453)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 04:49:55 +00:00
renovate[bot] eac9ba5f7e chore(deps): update gradle to v9.3.1 (#459)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-30 00:24:20 +00:00
renovate[bot] 0b7da6f2a9 fix(deps): update dependency androidx.compose.material3:material3 to v1.5.0-alpha13 (#455)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-29 21:59:43 +00:00
renovate[bot] 1c725a611f fix(deps): update dependency androidx.compose.animation:animation to v1.10.2 (#452)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-29 18:38:00 +00:00
renovate[bot] 763291c5ba chore(deps): update dependency com.google.devtools.ksp to v2.3.5 (#451)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-29 14:06:11 +00:00
renovate[bot] d0de92a019 fix(deps): update dependency androidx.compose.material:material to v1.10.2 (#454)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-29 09:13:33 +00:00
renovate[bot] 4acd6fd56f fix(deps): update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.10.0 (#446)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-25 12:45:08 +00:00
renovate[bot] 3c23179842 fix(deps): update dependency net.engawapg.lib:zoomable to v2.9.1-test01 (#448)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-25 08:24:40 +00:00
renovate[bot] c6be577be3 chore(deps): update gradle to v9.3.0 (#443)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-17 05:35:45 +00:00
renovate[bot] db3a7972a4 fix(deps): update hilt to v2.58 (#442)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-17 00:24:50 +00:00
renovate[bot] dc44eebbac fix(deps): update dependency androidx.compose.ui:ui-tooling to v1.10.1 (#438)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-16 21:28:07 +00:00
renovate[bot] 88b0ffa95c fix(deps): update dependency androidx.compose.ui:ui-tooling-preview to v1.10.1 (#439)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-16 19:11:22 +00:00
renovate[bot] 55150e58db fix(deps): update dependency androidx.compose.ui:ui-graphics to v1.10.1 (#435)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-16 15:43:05 +00:00
renovate[bot] a02cb73e75 fix(deps): update dependency androidx.compose.ui:ui-test-manifest to v1.10.1 (#437)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-16 11:37:23 +00:00
renovate[bot] 7801f06252 fix(deps): update dependency androidx.compose.ui:ui to v1.10.1 (#434)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-16 06:04:04 +00:00
renovate[bot] ce3234f0c2 fix(deps): update dependency androidx.compose.material3:material3 to v1.5.0-alpha12 (#433)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-16 02:32:34 +00:00
renovate[bot] 42422b4a48 fix(deps): update dependency androidx.compose.material:material to v1.10.1 (#432)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-15 21:11:45 +00:00
renovate[bot] 54ffe54d73 fix(deps): update dependency androidx.compose.animation:animation to v1.10.1 (#430)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-15 18:51:06 +00:00
renovate[bot] 14651c1cc4 fix(deps): update dependency androidx.compose.ui:ui-test-junit4 to v1.10.1 (#436)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-15 12:46:37 +00:00
renovate[bot] f428647995 fix(deps): update dependency androidx.compose.foundation:foundation to v1.10.1 (#431)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-15 02:13:36 +00:00
Anthonyy232 be482fefbc fix: fix adaptive icons 2026-01-08 20:48:54 -08:00
Anthonyy232 0f1db0fb22 fix: onboarding screens invalid layout and reseting 2025-12-31 18:00:55 -08:00
Anthonyy232 a292bddbe8 fix: notification icons 2025-12-26 23:18:57 -08:00
Anthonyy232 2aa4e6960d fix: fix app icon bad format 2025-12-26 23:00:04 -08:00
Anthonyy232 c947b6fc6f fix: various bugs 2025-12-26 22:19:56 -08:00
Anthonyy232 0385acd539 fix: hide select album row if neither home or lock is enabled 2025-12-25 20:35:55 -08:00
Anthonyy232 c92f7e5e03 fix: added write permission for making release 2025-12-21 22:17:13 -08:00
Anthonyy232 c49ddf85cb fix(actions): fixed cached test not working 2025-12-21 21:31:54 -08:00
Anthonyy232 da02d23032 Merge branch 'master' of https://github.com/Anthonyy232/Paperize 2025-12-21 21:17:27 -08:00
Anthonyy232 f977687b27 chore: update readme and docs 2025-12-21 21:16:53 -08:00
renovate[bot] 31077727e1 chore(deps): update github artifact actions 2025-12-21 21:00:29 -08:00
renovate[bot] 6a783a701c chore(deps): update actions/checkout action to v6 2025-12-21 21:00:27 -08:00
Anthonyy232 8a5db6b89e feat(test): added unit testing and added to cicd 2025-12-21 20:55:46 -08:00
renovate[bot] c46006858f Update dependency com.google.devtools.ksp to v2.3.4 2025-12-21 18:33:09 -08:00
renovate[bot] 0e5366a81a Update actions/checkout action to v6 2025-12-21 18:32:43 -08:00
Anthonyy232 318ba07ed5 continue rewrite 2025-12-21 18:30:23 -08:00
Anthonyy232 391bbb6bc0 add live wallpaper 2025-12-21 18:30:23 -08:00
Anthonyy232 572252b187 fix some bugs 2025-12-21 18:30:23 -08:00
Anthonyy232andClaude 894b86cd14 Clear album selections when toggling home or lock screens
When user changes which screens are enabled (homeEnabled/lockEnabled),
clear all album selections to ensure clean state:

**Scenarios where albums are cleared:**
- Lock only → Both screens enabled
- Home only → Both screens enabled
- Both screens → Lock only
- Both screens → Home only
- Lock only → Home only (both toggles change)

**Why this is needed:**
- Album requirements change when switching between single/dual screen modes
- Both screens enabled requires TWO albums selected
- Single screen requires ONE album selected
- Clearing prevents invalid state where old selections don't match new requirements

**Implementation:**
- Detect when homeEnabled or lockEnabled changes in updateScheduleSettings()
- If screen toggles changed, clear both homeAlbumId and lockAlbumId
- Apply validation to cleared settings
- Auto-toggle logic will disable changer (no albums selected)
- User must select appropriate albums for new screen configuration

**User flow:**
1. User toggles screen on/off
2. Albums automatically cleared
3. Changer disabled (no albums)
4. User selects new albums
5. Changer re-enabled with correct albums

This ensures users always have the correct album setup for their
chosen screen configuration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-21 18:30:23 -08:00
Anthonyy232andClaude 1006902d07 Add check to prevent unnecessary rescheduling on app startup
Prevent redundant WorkManager job rescheduling when app starts:

**Problem:**
- Every time app starts, wallpaper change workers were being rescheduled
- Same with album refresh worker
- This caused unnecessary database writes and WorkManager operations
- Even when jobs were already correctly scheduled

**Solution:**
Added `onlyIfNotScheduled` parameter throughout the scheduling chain:

1. **WallpaperScheduler:**
   - Added `isWorkScheduled()` and `isAlbumRefreshScheduled()` helpers
   - Check WorkInfo state (ENQUEUED or RUNNING) before scheduling
   - Skip scheduling if work already exists and `onlyIfNotScheduled = true`

2. **HomeViewModel:**
   - Added `onlyIfNotScheduled` parameter to `toggleWallpaperChanger()`
   - Added `onlyIfNotScheduled` parameter to `scheduleAlarms()`
   - Skip immediate wallpaper change when checking if scheduled
   - Propagate parameter through scheduling chain

3. **BootReceiver:**
   - Use `onlyIfNotScheduled = true` on device boot
   - Prevents rescheduling if jobs survived device restart

4. **HomeScreen:**
   - Auto-toggle uses `onlyIfNotScheduled = true`
   - Prevents rescheduling on every app startup
   - User actions still always reschedule (parameter defaults to false)

**Behavior:**
- App startup: Only schedule if not already scheduled
- Device boot: Only schedule if not already scheduled
- User actions (album selection, settings changes): Always reschedule
- Album refresh: Only schedule if not already scheduled

This improves app startup performance and reduces unnecessary
WorkManager operations while maintaining correct scheduling behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-21 18:30:23 -08:00
Anthonyy232andClaude 49fecf56af Fix queue handling when running out of wallpapers during validation
Improve robustness of wallpaper queue management:

**Problem:**
When the queue runs out DURING the validation loop (all remaining
wallpapers are invalid), the code returned an error without trying
to rebuild the queue. This could happen when:
- Album has both valid and invalid wallpapers
- Queue contains only invalid wallpapers after valid ones are used
- Validation loop dequeues all invalid wallpapers
- Queue becomes empty but is never rebuilt

**Solution:**
When getAndDequeueWallpaper returns null during validation loop:
1. Try rebuilding the queue (up to 2 attempts)
2. Continue validation loop to get wallpaper from rebuilt queue
3. Only return "no wallpapers" error after 2 rebuild attempts fail

**Edge Cases Handled:**
- Queue runs out due to invalid wallpapers being removed: rebuild and retry
- Album truly has no valid wallpapers: error after 2 rebuild attempts
- Shuffle mode: queue rebuilt with correct shuffle order
- Sequential mode: queue rebuilt with correct display order

This ensures the wallpaper changer continues working even when
encountering invalid wallpapers, and properly cycles through the
album whether shuffle is enabled or not.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-21 18:30:23 -08:00
Anthonyy232andClaude ca59cd8155 Hide toggle effect descriptions when enabled in non-individual scheduling
When wallpaper effects are toggled on and individual scheduling is off,
hide the description text for a cleaner UI:
- Grayscale effect
- Adaptive brightness
- Shuffle

Changes:
- Make SettingSwitch description parameter nullable
- Conditionally hide description when:
  - Effect is enabled (checked = true)
  - AND individual scheduling is OFF (separateSchedules = false)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-21 18:30:23 -08:00
Anthonyy232andClaude 9820581723 Fix wallpaper scheduling and effects handling bugs
Multiple fixes for scheduling logic and UI behavior:

**Scheduling Fixes:**
- Add required albums validation before scheduling WorkManager jobs
- Only schedule when all required albums are selected based on enabled screens
- Prevent scheduling with incomplete album selection (both screens enabled requires both albums)
- Add hasRequiredAlbums check in HomeViewModel, WallpaperScreen, and BootReceiver

**Race Condition Fixes:**
- Fix toggleWallpaperChanger race condition with atomic updateEnableChanger()
- Prevent phantom album selections by using atomic DataStore updates
- Fix startup race condition - only cleanup stale album IDs after albums load

**Display Settings:**
- Separate scheduling changes from display changes (ScheduleSettings.kt)
- Add hasSchedulingChanges() - intervals, screen enable/disable, separate schedules
- Add hasDisplayChanges() - scaling, effects, adaptive brightness
- Reapply wallpaper immediately when display settings change (no reschedule needed)
- Prevent unnecessary WorkManager rescheduling for display-only changes

**Effect Sliders:**
- Fix effect sliders to respect separateSchedules setting
- Show synchronized slider when individual scheduling OFF
- Show separate sliders when individual scheduling ON
- Applies to brightness/darken, blur, and vignette sliders

**AlbumRefreshWorker:**
- Fix duplicate detection to check both direct and folder wallpapers
- Fix failure counting (increment failedCount on addWallpaper errors)
- Prevent false error logs and database constraint violations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-21 18:30:23 -08:00
Anthonyy232 9079306f8f Rewrite initial commit 2025-12-21 18:30:23 -08:00
Gian 3b2f739254 Fix switch position on long text 2025-11-13 17:38:18 -08:00
Gian c6c841f7c0 Unify switch components into two generic implementations 2025-11-13 17:38:18 -08:00
Anthonyy232 66c3a4bb2e Bump version 2025-09-15 12:47:15 -07:00
Anthonyy232 1b317798a4 fix effects not applying to lock when singular
https://github.com/Anthonyy232/Paperize/issues/393
2025-09-15 12:46:18 -07:00
Anthonyy232 95feb975ea Bump version code 2025-09-13 16:06:10 -07:00
renovate[bot] bf1d2d4793 Update dependency com.google.devtools.ksp to v2.2.20-2.0.3 2025-09-13 14:29:01 -07:00
Anthonyy232 1f66b1c616 Updated dependencies and localization 2025-09-13 14:08:17 -07:00
renovate[bot] 8cee52fcd6 Update dependency androidx.compose.ui:ui-test-manifest to v1.9.1 2025-09-13 10:56:58 -07:00
renovate[bot] 44692cde8e Update dependency androidx.compose.ui:ui to v1.9.1 2025-09-13 10:55:00 -07:00
renovate[bot] 23359ee714 Update dependency androidx.compose.material3:material3 to v1.4.0-rc01 2025-09-13 10:54:50 -07:00
renovate[bot] 25004356b5 Update dependency androidx.compose.material:material to v1.9.1 2025-09-13 10:54:44 -07:00
renovate[bot] 7e4e5ff452 Update dependency androidx.compose.foundation:foundation to v1.9.1 2025-09-13 10:54:36 -07:00
renovate[bot] d63c1005b7 Update dependency androidx.compose.animation:animation to v1.9.1 2025-09-13 10:54:15 -07:00
renovate[bot] bf71bca11a Update kotlin monorepo to v2.2.20 2025-09-13 10:54:02 -07:00
Anthonyy232 c35b87a1da Updated localization 2025-09-13 10:53:42 -07:00
malteish afa520a68a enable large collections through larger cursor window 2025-09-12 11:43:08 -07:00
Anthonyy232 b67734b8e1 Fix file picker not limiting user for large image imports 2025-09-12 11:42:30 -07:00
Anthonyy232 d124da717d Fix crash on launch during db changes 2025-09-12 11:21:22 -07:00
Anthonyy232 40417b99b1 fix crash on adding through image virtual directory
https://github.com/Anthonyy232/Paperize/issues/374
2025-09-12 11:18:48 -07:00
Anthony La ba7d29990c Merge pull request #352 from Anthonyy232/renovate/androidx.lifecycle-lifecycle-runtime-compose-2.x
Update dependency androidx.lifecycle:lifecycle-runtime-compose to v2.9.3
2025-08-28 11:31:36 -07:00
renovate[bot] b18c5bdb1e Update dependency androidx.lifecycle:lifecycle-runtime-compose to v2.9.3 2025-08-28 18:31:17 +00:00
Anthony La 1191872b3e Merge pull request #351 from Anthonyy232/renovate/androidx.compose.material3-material3-1.x
Update dependency androidx.compose.material3:material3 to v1.4.0-beta03
2025-08-28 11:30:59 -07:00
Anthony La ae5a533baf Merge pull request #350 from Anthonyy232/renovate/androidx.compose-compose-bom-2025.x
Update dependency androidx.compose:compose-bom to v2025.08.01
2025-08-28 11:30:51 -07:00
renovate[bot] 9cc7c0e26a Update dependency androidx.compose.material3:material3 to v1.4.0-beta03 2025-08-28 18:30:44 +00:00
renovate[bot] 7ca5e2bac4 Update dependency androidx.compose:compose-bom to v2025.08.01 2025-08-28 18:30:41 +00:00
Anthony La e064c31175 Merge pull request #353 from Anthonyy232/renovate/androidx.lifecycle-lifecycle-runtime-ktx-2.x
Update dependency androidx.lifecycle:lifecycle-runtime-ktx to v2.9.3
2025-08-28 11:30:36 -07:00
Anthony La 8959e239fe Merge pull request #354 from Anthonyy232/renovate/actions-checkout-5.x
Update actions/checkout action to v5
2025-08-28 11:30:28 -07:00
Anthony La 06c9566df4 Merge pull request #355 from Anthonyy232/renovate/actions-setup-java-5.x
Update actions/setup-java action to v5
2025-08-28 11:30:22 -07:00
Anthony La 108f5cd9c1 Merge pull request #356 from Anthonyy232/renovate/major-github-artifact-actions
Update actions/download-artifact action to v5
2025-08-28 11:30:14 -07:00
renovate[bot] 9b86b54ae1 Update actions/setup-java action to v5 2025-08-28 18:26:05 +00:00
renovate[bot] 40e0884ee7 Update actions/download-artifact action to v5 2025-08-28 18:26:02 +00:00
renovate[bot] e1fa4e7890 Update actions/checkout action to v5 2025-08-28 18:25:59 +00:00
renovate[bot] 4161b8817b Update dependency androidx.lifecycle:lifecycle-runtime-ktx to v2.9.3 2025-08-28 18:25:53 +00:00
Anthony La 4554190912 Refactor CI/CD pipeline by removing lint job 2025-08-28 11:24:57 -07:00
Anthony La b714ad8eb6 Change branch reference from 'main' to 'master' 2025-08-28 11:19:29 -07:00
Anthony La 6cd5c1eed3 Change default branch to 'main' and enhance artifact management 2025-08-28 11:19:14 -07:00
Anthony La 6784e2a2de Change CI/CD branch from 'main' to 'master' 2025-08-28 11:09:36 -07:00
Anthony La 7f69debe1d Update CI/CD workflow for Android release process 2025-08-28 11:01:37 -07:00
Anthonyy232 f8df7c2a6a Fix master branch naming 2025-08-28 10:54:04 -07:00
Anthonyy232 b3fb2b82f2 Update CI/CD 2025-08-28 10:53:11 -07:00
Anthony La 04d0c57cb0 Add CI workflow for Android release 2025-08-28 10:48:57 -07:00
Anthonyy232 27b0fe62c8 Bump version code 2025-08-28 10:38:50 -07:00
Anthonyy232 096beb22d7 Bump version to 3.1.2 2025-08-28 10:37:50 -07:00
Anthonyy232 21766a5dc6 Fix app losing permission after some time https://github.com/Anthonyy232/Paperize/issues/349 2025-08-28 10:36:29 -07:00
Anthonyy232 fd5e8b63b2 Revert AGP
https://github.com/Anthonyy232/Paperize/issues/310#issuecomment-3226685236
2025-08-26 22:31:49 -07:00
Anthonyy232 2f514e6464 Remove unused AAR dependency
https://github.com/Anthonyy232/Paperize/issues/310#issuecomment-3226539843
2025-08-26 19:45:54 -07:00
Anthonyy232 74d2c614fd Update version code 2025-08-26 18:31:55 -07:00
Anthonyy232 da0d8c45e6 Fixed bad decompressing of URi 2025-08-26 18:11:07 -07:00
Anthony La e87d8116a6 Merge pull request #344 from Anthonyy232/renovate/hilt
Update hilt to v2.57.1
2025-08-26 18:04:42 -07:00
renovate[bot] 8aaff066b3 Update hilt to v2.57.1 2025-08-27 01:04:32 +00:00
Anthony La 685c9d1981 Merge pull request #346 from Anthonyy232/renovate/actions-upload-pages-artifact-4.x
Update actions/upload-pages-artifact action to v4
2025-08-26 18:04:25 -07:00
Anthony La 81ae25035e Merge pull request #347 from OasisAkari/skip_non-interactive
add skip in non-interactive state setting
2025-08-26 18:04:07 -07:00
yzhh 530ff36a16 add skip in non-interactive state setting 2025-08-25 22:18:15 +08:00
renovate[bot] 9fd52e7bc4 Update actions/upload-pages-artifact action to v4 2025-08-22 17:58:36 +00:00
Anthonyy232 0c2ca68dcd Fixed last change time not updating from initial 2025-08-20 11:09:33 -07:00
Anthony La e7c92eae71 Merge pull request #338 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-preview-1.x
Update dependency androidx.compose.ui:ui-tooling-preview to v1.9.0
2025-08-19 16:55:26 -07:00
Anthony La 7b26e323ac Merge pull request #339 from Anthonyy232/renovate/androidx.core-core-ktx-1.x
Update dependency androidx.core:core-ktx to v1.17.0
2025-08-19 16:55:19 -07:00
Anthony La b0069e3bc9 Merge pull request #340 from Anthonyy232/renovate/actions-checkout-5.x
Update actions/checkout action to v5
2025-08-19 16:55:13 -07:00
Anthony La 8582bc903b Merge pull request #341 from Anthonyy232/renovate/gradle-9.x
Update dependency gradle to v9
2025-08-19 16:55:07 -07:00
Anthony La 8690284ac2 Merge pull request #342 from Anthonyy232/renovate/sh.calvin.reorderable-reorderable-3.x
Update dependency sh.calvin.reorderable:reorderable to v3
2025-08-19 16:55:02 -07:00
Anthonyy232 c9e485ac88 Fixed time drift issue when setting wallpaper https://github.com/Anthonyy232/Paperize/issues/343 2025-08-19 16:49:28 -07:00
renovate[bot] 9d577880e0 Update dependency sh.calvin.reorderable:reorderable to v3 2025-08-19 22:26:59 +00:00
renovate[bot] 09bacfb3e5 Update dependency gradle to v9 2025-08-19 22:26:56 +00:00
renovate[bot] 3fd9cec67d Update actions/checkout action to v5 2025-08-19 22:23:59 +00:00
renovate[bot] ac7a1e0cb0 Update dependency androidx.core:core-ktx to v1.17.0 2025-08-19 22:23:56 +00:00
renovate[bot] 53ba0a2347 Update dependency androidx.compose.ui:ui-tooling-preview to v1.9.0 2025-08-19 22:23:54 +00:00
Anthonyy232 83cc89e1b3 Updated gradle version 2025-08-19 15:22:58 -07:00
Anthony La 655c4a91e5 Merge pull request #336 from Anthonyy232/renovate/androidx.compose.ui-ui-test-manifest-1.x
Update dependency androidx.compose.ui:ui-test-manifest to v1.9.0
2025-08-18 09:32:18 -07:00
renovate[bot] 083f269605 Update dependency androidx.compose.ui:ui-test-manifest to v1.9.0 2025-08-18 16:32:08 +00:00
Anthony La 9880bac0c6 Merge pull request #309 from Anthonyy232/renovate/ksp-monorepo
Update dependency com.google.devtools.ksp to v2.2.10-2.0.2
2025-08-18 09:31:46 -07:00
Anthony La 0f87776d16 Merge pull request #337 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-1.x
Update dependency androidx.compose.ui:ui-tooling to v1.9.0
2025-08-18 09:31:37 -07:00
renovate[bot] ed291459d1 Update dependency com.google.devtools.ksp to v2.2.10-2.0.2 2025-08-18 16:31:29 +00:00
Anthony La bc1eb7f996 Merge pull request #334 from Anthonyy232/renovate/androidx.compose.ui-ui-graphics-1.x
Update dependency androidx.compose.ui:ui-graphics to v1.9.0
2025-08-18 09:31:22 -07:00
Anthony La 8366965a03 Merge pull request #330 from Anthonyy232/renovate/androidx.compose.animation-animation-1.x
Update dependency androidx.compose.animation:animation to v1.9.0
2025-08-18 09:31:08 -07:00
Anthony La 904f77191c Merge pull request #315 from Anthonyy232/renovate/com.github.skydoves-landscapist-glide-2.x
Update dependency com.github.skydoves:landscapist-glide to v2.5.2
2025-08-18 09:31:01 -07:00
renovate[bot] ec9f56cf1e Update dependency androidx.compose.ui:ui-tooling to v1.9.0 2025-08-18 16:30:49 +00:00
renovate[bot] 980527cdde Update dependency androidx.compose.ui:ui-graphics to v1.9.0 2025-08-18 16:30:42 +00:00
renovate[bot] efe794c63f Update dependency androidx.compose.animation:animation to v1.9.0 2025-08-18 16:30:38 +00:00
renovate[bot] 65a677ea91 Update dependency com.github.skydoves:landscapist-glide to v2.5.2 2025-08-18 16:30:29 +00:00
Anthony La dabf63fc58 Merge pull request #331 from Anthonyy232/renovate/androidx.compose.foundation-foundation-1.x
Update dependency androidx.compose.foundation:foundation to v1.9.0
2025-08-18 09:28:28 -07:00
Anthony La 1da95e09b5 Merge pull request #332 from Anthonyy232/renovate/androidx.compose.material-material-1.x
Update dependency androidx.compose.material:material to v1.9.0
2025-08-18 09:28:19 -07:00
Anthony La ad195a985e Merge pull request #333 from Anthonyy232/renovate/androidx.compose.ui-ui-1.x
Update dependency androidx.compose.ui:ui to v1.9.0
2025-08-18 09:28:11 -07:00
Anthony La 0e06584780 Merge pull request #335 from Anthonyy232/renovate/androidx.compose.ui-ui-test-junit4-1.x
Update dependency androidx.compose.ui:ui-test-junit4 to v1.9.0
2025-08-18 09:27:47 -07:00
Anthony La a6f44ecad5 Merge pull request #329 from Anthonyy232/renovate/androidx.compose-compose-bom-2025.x
Update dependency androidx.compose:compose-bom to v2025.08.00
2025-08-18 09:27:36 -07:00
Anthony La d527fa9a80 Merge pull request #320 from Anthonyy232/renovate/gradle-8.x
Update dependency gradle to v8.14.3
2025-08-18 09:26:52 -07:00
Anthony La ffe360ee80 Merge pull request #316 from Anthonyy232/renovate/androidx.compose.material3-material3-1.x
Update dependency androidx.compose.material3:material3 to v1.4.0-beta02
2025-08-18 09:26:25 -07:00
renovate[bot] 8fd9c9b80e Update dependency androidx.compose.material3:material3 to v1.4.0-beta02 2025-08-18 16:26:17 +00:00
Anthony La d77f2fe8df Merge pull request #308 from Anthonyy232/renovate/kotlin-monorepo
Update kotlin monorepo to v2.2.10
2025-08-18 09:25:51 -07:00
renovate[bot] 86c44825d9 Update dependency androidx.compose.ui:ui-test-junit4 to v1.9.0 2025-08-15 18:37:57 +00:00
renovate[bot] b5d8bb5548 Update dependency androidx.compose.ui:ui to v1.9.0 2025-08-15 18:37:51 +00:00
renovate[bot] 9000be1951 Update dependency androidx.compose.material:material to v1.9.0 2025-08-15 18:37:48 +00:00
renovate[bot] 38ba5154f9 Update dependency androidx.compose.foundation:foundation to v1.9.0 2025-08-15 18:37:45 +00:00
renovate[bot] 9f670031b1 Update dependency androidx.compose:compose-bom to v2025.08.00 2025-08-15 18:37:40 +00:00
renovate[bot] c0dd7baeaa Update kotlin monorepo to v2.2.10 2025-08-15 18:37:37 +00:00
renovate[bot] 1c96dcfc4a Update dependency gradle to v8.14.3 2025-08-15 18:37:34 +00:00
Anthonyy232 2a3821e1e7 Improved robustness of image picker for album view screen 2025-08-15 09:40:03 -07:00
Anthonyy232 8b61b1d719 Improved robustness of image picker 2025-08-15 09:38:46 -07:00
Anthonyy232 431df5c334 Fixed next and last time label swapped based on temporal locality https://github.com/Anthonyy232/Paperize/issues/327 2025-08-15 09:35:46 -07:00
Anthonyy232 2b49a01eb4 Added setting to prevent changing wallpaper during landscape mode https://github.com/Anthonyy232/Paperize/issues/328 2025-08-14 23:33:40 -07:00
Anthonyy232 3bc438a06d Migrated blur to rendereffect and min version to 31 2025-08-13 19:50:49 -07:00
Anthonyy232 57d6b7dc8e Fixed broken blur effect using home percentage for all cases https://github.com/Anthonyy232/Paperize/issues/322 2025-08-12 17:05:12 -07:00
Anthonyy232 5d87257516 Fixed scanning for new wallpapers/folders https://github.com/Anthonyy232/Paperize/issues/326 2025-08-11 11:28:29 -07:00
Anthonyy232 cb9ab7d1af Fixed crash due to interpreting string as int without cast https://github.com/Anthonyy232/Paperize/issues/323 2025-08-07 11:28:23 -07:00
Anthony La 598f00c536 Merge pull request #305 from Anthonyy232/renovate/gradle-8.x
Update dependency gradle to v8.14.2
2025-06-24 10:39:51 -07:00
renovate[bot] 426dbf1457 Update dependency gradle to v8.14.2 2025-06-24 17:38:34 +00:00
Anthony La ba1b139f40 Merge pull request #304 from Anthonyy232/renovate/ksp-monorepo
Update dependency com.google.devtools.ksp to v2.1.21-2.0.2
2025-06-24 10:31:17 -07:00
renovate[bot] 40dc4b788d Update dependency com.google.devtools.ksp to v2.1.21-2.0.2 2025-06-24 17:30:04 +00:00
Anthony La 69d5ec6477 Updated dependencies 2025-06-24 10:29:13 -07:00
Anthony La 96cb5538da Updated localization 2025-06-24 10:07:02 -07:00
Anthony La c3101ea5f6 Update in sample calculation for None scaling 2025-06-24 10:06:21 -07:00
Anthony La 493e6559df Major refactor and localization update 2025-06-07 14:02:49 -07:00
Anthony La 8945002652 Updated WallpaperManager usage 2025-05-15 17:00:51 -07:00
Anthony La 8f30f3558a Update renderscript dependency and refactored wallpaper alarm code 2025-05-15 15:30:19 -07:00
Anthony La 15ba07198d Merge pull request #288 from Anthonyy232/renovate/ksp-monorepo
Update dependency com.google.devtools.ksp to v2.1.21-2.0.1
2025-05-14 18:21:18 -07:00
Anthony La 39fff2bfc9 Merge pull request #267 from Anthonyy232/renovate/com.google.dagger-hilt-android-2.x
Update dependency com.google.dagger:hilt-android to v2.56.2
2025-05-14 18:21:06 -07:00
Anthony La 8339c2d86b Merge pull request #287 from Anthonyy232/renovate/com.google.code.gson-gson-2.x
Update dependency com.google.code.gson:gson to v2.13.1
2025-05-14 18:20:54 -07:00
renovate[bot] 29ca2d1c50 Update dependency com.google.devtools.ksp to v2.1.21-2.0.1 2025-05-15 01:20:40 +00:00
renovate[bot] 8b2cd301c9 Update dependency com.google.dagger:hilt-android to v2.56.2 2025-05-15 01:20:38 +00:00
renovate[bot] 5240320d99 Update dependency com.google.code.gson:gson to v2.13.1 2025-05-15 01:20:34 +00:00
Anthony La 25205d579b Merge pull request #268 from Anthonyy232/renovate/com.google.dagger-hilt-android-compiler-2.x
Update dependency com.google.dagger:hilt-android-compiler to v2.56.2
2025-05-14 18:19:26 -07:00
Anthony La 32c904f504 Merge pull request #285 from Anthonyy232/renovate/com.github.skydoves-landscapist-glide-2.x
Update dependency com.github.skydoves:landscapist-glide to v2.4.8
2025-05-14 18:19:15 -07:00
Anthony La 9e3a62a283 Merge pull request #286 from Anthonyy232/renovate/com.google.accompanist-accompanist-permissions-0.x
Update dependency com.google.accompanist:accompanist-permissions to v0.37.3
2025-05-14 18:19:07 -07:00
Anthony La 050e172949 Merge pull request #266 from Anthonyy232/renovate/hilt
Update dependency com.google.dagger.hilt.android to v2.56.2
2025-05-14 18:18:55 -07:00
renovate[bot] b231fe8f4e Update dependency com.google.dagger.hilt.android to v2.56.2 2025-05-15 00:30:23 +00:00
renovate[bot] 14c2fd8aed Update dependency com.google.dagger:hilt-android-compiler to v2.56.2 2025-05-15 00:30:20 +00:00
renovate[bot] 27ac32648c Update dependency com.google.accompanist:accompanist-permissions to v0.37.3 2025-05-15 00:30:13 +00:00
renovate[bot] f6c3a4b34a Update dependency com.github.skydoves:landscapist-glide to v2.4.8 2025-05-15 00:30:08 +00:00
Anthony La fcf0513356 Updated dependencies 2025-05-14 17:29:18 -07:00
Anthony La 26f51acc0c Merge pull request #277 from Nikster3k/master
Add scrollable Column to AlbumBottomSheet
2025-04-28 19:14:37 -07:00
Nikster3k 9a36ad35e4 Fix album selection taking up too much space 2025-04-27 17:15:20 +00:00
Anthony La 4771eaaa7e Merge pull request #278 from Anthonyy232/docFileCompat_test
Improve reliability of alarm manager
2025-04-25 23:30:07 -07:00
Anthony La 170a642858 Fix alarm manager handler crash 2025-04-25 23:29:29 -07:00
Nikster3k 2dd4fb9e58 Add scrollable Column to AlbumBottomSheet
When you had more than 10 albums they would be hidden
2025-04-25 15:01:10 +00:00
Anthony La 77c95ed14a Fix test code 2025-04-14 13:43:38 -07:00
Anthony La 75b3467f89 Remove unused imports 2025-04-14 13:41:22 -07:00
Anthony La 7c77f4a75e Merge pull request #204 from Anthonyy232/renovate/gradle-8.x
Update dependency gradle to v8.14-rc-1
2025-04-12 00:51:24 -07:00
Anthony La a36403ee14 Merge pull request #257 from Anthonyy232/renovate/ksp-monorepo
Update dependency com.google.devtools.ksp to v2.1.20-2.0.0
2025-04-12 00:51:13 -07:00
Anthony La 31c99f3e6e Remove unused imports 2025-04-12 00:31:56 -07:00
Anthony La fdd85b2df3 Removed unused marker 2025-04-12 00:31:00 -07:00
Anthony La 1e971d4ec3 Implemented toggle for wallpaper refresh 2025-04-12 00:20:17 -07:00
renovate[bot] 1274349fc9 Update dependency gradle to v8.14-rc-1 2025-04-12 06:10:59 +00:00
renovate[bot] f2065c3ec8 Update dependency com.google.devtools.ksp to v2.1.20-2.0.0 2025-04-12 06:07:51 +00:00
Anthony La bb34c1e02f Updated dependencies and reset database and app version 2025-04-11 23:07:10 -07:00
Anthony La 41ac2482d8 Update zoomable dependency 2025-04-06 23:13:15 -07:00
Anthony La 9baacea029 Fixed a bug where using only folders would cause album to self-delete 2025-04-05 01:07:21 -07:00
Anthony La 1d87208dca Localization fix 2025-04-02 22:20:13 -07:00
Anthony La af315b7775 Localization fix 2025-04-02 22:15:36 -07:00
Anthony La 212d21761b Localization update 2025-04-02 22:04:20 -07:00
Anthony La eb48200149 Implemented wallpaper changer widget (1x1 icon) 2025-04-01 13:46:23 -07:00
Anthony La 814db9020a Fix wallpaper changing time not accurate 2025-04-01 12:04:00 -07:00
Anthony La 893a729093 Fix wallpaper changing time not accurate 2025-04-01 12:03:46 -07:00
Anthony La 43b06d11eb Fix wallpaper color banding 2025-03-31 22:52:21 -07:00
Anthony La 3e9e8ca299 Fixed service not starting 2025-03-07 18:01:56 -08:00
Anthony La 0a6ce5bf07 Improved memory usage 2025-02-16 14:07:55 -08:00
Anthony La 813eb7fb32 Refactored wallpaper service 2025-02-16 11:45:11 -08:00
Anthony La e30056eb5d Implement non-shuffle setting 2025-01-25 15:32:15 -08:00
Anthony La 7f039fa2b4 Refactored app flow and album logic 2025-01-24 12:07:59 -08:00
Anthony La 9be3a9c6d3 Refactored app flow and album logic 2025-01-24 12:07:59 -08:00
Anthony La a8989b0810 Merge pull request #238 from DevBhalavat/master
Update CurrentAndNextChange.kt
2025-01-22 18:03:34 -08:00
bhalavatdev c9f27e3157 Update CurrentAndNextChange.kt 2025-01-03 00:03:53 +05:30
Anthony La 26f1e17b7c Refactored album view and album logic 2024-11-14 22:18:23 -08:00
Anthony La 47fa7563c0 Refactored folder view 2024-11-13 22:06:59 -08:00
Anthony La f2fc197df7 Added sorting 2024-11-13 21:30:14 -08:00
Anthony La 647ebea95b Fixed scoping for service 2024-11-04 11:06:43 -08:00
Anthony La eebc4d4ee4 Fixed slow updates when wallpaper changing 2024-11-04 11:02:11 -08:00
Anthony La e1ff89d3d9 chore/Refactor WallpaperScreenViewModel.kt and selected album for flow usage 2024-11-04 10:48:13 -08:00
Anthony La 11d72a2336 chore/Refactor usage of flow for settings viewmodel 2024-11-04 10:34:53 -08:00
Anthony La 68e6544da8 chore/Refactor code 2024-11-03 16:53:14 -08:00
Anthony La a26f7e30a4 Fixed staggered alarms 2024-11-03 16:53:14 -08:00
Anthony La b989a47b9e Fixed staggered alarms 2024-11-03 16:53:14 -08:00
Anthony La a7f98989b3 Merge pull request #220 from Anthonyy232/renovate/composebom
Update dependency androidx.compose:compose-bom to v2024.10.01
2024-10-31 12:22:16 -07:00
renovate[bot] 4aaded50ac Update dependency androidx.compose:compose-bom to v2024.10.01 2024-10-31 19:04:20 +00:00
Anthony La 3089841a05 Merge pull request #212 from Anthonyy232/renovate/animation
Update dependency androidx.compose.animation:animation to v1.7.5
2024-10-31 12:01:30 -07:00
Anthony La eeabdd24fd Merge pull request #213 from Anthonyy232/renovate/foundation
Update dependency androidx.compose.foundation:foundation to v1.7.5
2024-10-31 12:01:23 -07:00
Anthony La 8c82ed7d8c Merge pull request #214 from Anthonyy232/renovate/material3
Update dependency androidx.compose.material3:material3 to v1.3.1
2024-10-31 12:01:16 -07:00
renovate[bot] 5fd289afb5 Update dependency androidx.compose.material3:material3 to v1.3.1 2024-10-31 19:01:00 +00:00
renovate[bot] 8d0213c7bb Update dependency androidx.compose.foundation:foundation to v1.7.5 2024-10-31 19:00:57 +00:00
renovate[bot] 7e8b83aefe Update dependency androidx.compose.animation:animation to v1.7.5 2024-10-31 19:00:54 +00:00
Anthony La 136432b97b Merge pull request #215 from Anthonyy232/renovate/workruntimektx
Update dependency androidx.work:work-runtime-ktx to v2.10.0
2024-10-31 11:58:24 -07:00
renovate[bot] cbcf71da8a Update dependency androidx.work:work-runtime-ktx to v2.10.0 2024-10-31 18:58:18 +00:00
Anthony La 9bc58aa9fe Merge pull request #216 from Anthonyy232/renovate/lifecycleruntimektx
Update lifecycleRuntimeKtx to v2.8.7
2024-10-31 11:58:17 -07:00
Anthony La 74e3fd8878 Merge pull request #217 from Anthonyy232/renovate/material
Update material to v1.7.5
2024-10-31 11:58:02 -07:00
Anthony La c857f4a1e7 Merge pull request #218 from Anthonyy232/renovate/ui
Update ui to v1.7.5
2024-10-31 11:57:53 -07:00
Anthony La fb853086e6 Merge pull request #219 from Anthonyy232/renovate/corektx
Update dependency androidx.core:core-ktx to v1.15.0
2024-10-31 11:57:47 -07:00
renovate[bot] 54f4130bab Update dependency androidx.core:core-ktx to v1.15.0 2024-10-31 04:42:07 +00:00
renovate[bot] 2acc11875b Update ui to v1.7.5 2024-10-31 04:42:03 +00:00
renovate[bot] 0c1b341ce9 Update material to v1.7.5 2024-10-31 01:32:48 +00:00
renovate[bot] b4d89a54e3 Update lifecycleRuntimeKtx to v2.8.7 2024-10-31 01:32:45 +00:00
Anthony La c7d3ae137f Merge pull request #211 from Anthonyy232/renovate/lottiecompose
Update dependency com.airbnb.android:lottie-compose to v6.6.0
2024-10-28 00:39:51 -07:00
renovate[bot] e71ae4fda1 Update dependency com.airbnb.android:lottie-compose to v6.6.0 2024-10-27 21:52:59 +00:00
Anthony La 8c111ffaf2 Merge pull request #208 from Anthonyy232/renovate/ksp
Update dependency com.google.devtools.ksp to v2.0.21-1.0.26
2024-10-24 13:04:06 -07:00
Anthony La 238c7b512a Merge pull request #210 from Anthonyy232/renovate/workruntimektx
Update dependency androidx.work:work-runtime-ktx to v2.10.0-rc01
2024-10-24 13:03:57 -07:00
renovate[bot] 68e5be5214 Update dependency androidx.work:work-runtime-ktx to v2.10.0-rc01 2024-10-24 18:02:57 +00:00
renovate[bot] b417da22a2 Update dependency com.google.devtools.ksp to v2.0.21-1.0.26 2024-10-23 21:05:36 +00:00
Anthony La 3758363dd3 Downgraded Gradle to 8.10
Upgraded AGP to 8.7.1
Updated dependencies
2024-10-17 22:04:13 -07:00
Anthony La b7587e419b Downgraded AGP to 8.6.0 2024-10-14 10:50:16 -07:00
Anthony La 4decb78017 Revert baseline profiles due to reproducible build error 2024-10-14 01:09:57 -07:00
Anthony La 129e0c36fa Merge pull request #193 from Anthonyy232/renovate/landscapistglide
Update dependency com.github.skydoves:landscapist-glide to v2.4.1
2024-10-13 12:29:58 -07:00
renovate[bot] a784ff2cd8 Update dependency com.github.skydoves:landscapist-glide to v2.4.1 2024-10-13 19:26:51 +00:00
Anthony La 52badae681 Updated version code 2024-10-13 12:26:25 -07:00
Anthony La 2bfd46d5f5 Updated baseline profile dependencies 2024-10-13 01:40:51 -07:00
Anthony La 10240aaa4e Remove duplicate line 2024-10-13 01:34:52 -07:00
Anthony La 4855d59e99 Revert NDK version upgrade 2024-10-13 01:27:28 -07:00
Anthony La 59594878ab Downgraded NDK version to LTS 2024-10-12 01:27:29 -07:00
Anthony La 7fc552ab67 Updated apk naming 2024-10-12 00:47:15 -07:00
Anthony La 5197800b55 Updated apk naming 2024-10-11 11:59:18 -07:00
Anthony La 6fe29dfe53 Updated apk naming 2024-10-11 11:58:59 -07:00
Anthony La ea84410eb6 Migrated to libs.versions.toml 2024-10-11 11:53:38 -07:00
Anthony La 0a8a52ea3c Merge pull request #189 from Anthonyy232/renovate/androidx.baselineprofile-1.x
Update plugin androidx.baselineprofile to v1.3.2
2024-10-11 10:22:35 -07:00
Anthony La d115339a99 Merge pull request #191 from Anthonyy232/renovate/com.google.devtools.ksp-2.x
Update plugin com.google.devtools.ksp to v2.0.21-1.0.25
2024-10-11 10:22:28 -07:00
Anthony La 0c01f0dba2 Merge pull request #188 from Anthonyy232/renovate/kotlin-monorepo
Update kotlin monorepo to v2.0.21
2024-10-11 10:22:21 -07:00
Anthony La 7b35b2eb80 Updated version code 2024-10-11 10:21:50 -07:00
renovate[bot] 3508205328 Update plugin com.google.devtools.ksp to v2.0.21-1.0.25 2024-10-11 06:59:26 +00:00
renovate[bot] 0c7ec55414 Update plugin androidx.baselineprofile to v1.3.2 2024-10-11 03:05:00 +00:00
renovate[bot] 8cf43373c8 Update kotlin monorepo to v2.0.21 2024-10-11 03:04:56 +00:00
Anthony La e14e402c2f Added baseline profile for app and UI tests 2024-10-10 20:04:18 -07:00
Anthony La 84e93a652b Changed refresh alarm to be inexact to improve battery 2024-10-09 22:13:32 -07:00
Anthony La 23a9f10939 Updated README.md 2024-10-08 23:16:24 -07:00
Anthony La 8c485c6157 Updated localization 2024-10-08 22:59:23 -07:00
Anthony La 618e896393 Added ability to change starting time
Added settings item for notification permission access
Fixed UI elements being out of frame in certain languages
2024-10-08 22:36:19 -07:00
Anthony La 18ca6283ee Added grayscale filter 2024-10-02 19:30:57 -07:00
Anthony La 9b7f9c9217 Update README.md 2024-10-02 18:16:01 -07:00
Anthony La 7f32f76da9 Refactored collapsable top bar for settings page
Updated permission to USE_EXACT_ALARM
Updated dependencies
2024-10-02 18:14:26 -07:00
Anthony La 9a31467584 Merge pull request #185 from Anthonyy232/renovate/androidx.compose.ui-ui-1.x
Update dependency androidx.compose.ui:ui to v1.7.3
2024-10-02 17:37:51 -07:00
renovate[bot] 23884b53a7 Update dependency androidx.compose.ui:ui to v1.7.3 2024-10-03 00:37:40 +00:00
Anthony La 497860369c Merge pull request #186 from Anthonyy232/renovate/androidx.compose.ui-ui-graphics-1.x
Update dependency androidx.compose.ui:ui-graphics to v1.7.3
2024-10-02 17:37:02 -07:00
Anthony La 6800830280 Merge pull request #181 from Anthonyy232/renovate/androidx.compose.animation-animation-1.x
Update dependency androidx.compose.animation:animation to v1.7.3
2024-10-02 17:36:49 -07:00
renovate[bot] 6111913de4 Update dependency androidx.compose.ui:ui-graphics to v1.7.3 2024-10-03 00:36:44 +00:00
renovate[bot] 5c9994940d Update dependency androidx.compose.animation:animation to v1.7.3 2024-10-03 00:36:35 +00:00
Anthony La b399dae19d Merge pull request #182 from Anthonyy232/renovate/androidx.compose.foundation-foundation-1.x
Update dependency androidx.compose.foundation:foundation to v1.7.3
2024-10-02 17:36:29 -07:00
Anthony La f2921a8069 Merge pull request #183 from Anthonyy232/renovate/androidx.compose.material-material-1.x
Update dependency androidx.compose.material:material to v1.7.3
2024-10-02 17:36:20 -07:00
Anthony La 344e5b6e8c Merge pull request #184 from Anthonyy232/renovate/androidx.compose.material-material-icons-extended-1.x
Update dependency androidx.compose.material:material-icons-extended to v1.7.3
2024-10-02 17:36:10 -07:00
renovate[bot] efbecd2a56 Update dependency androidx.compose.material:material-icons-extended to v1.7.3 2024-10-02 21:04:48 +00:00
renovate[bot] 650b12460a Update dependency androidx.compose.material:material to v1.7.3 2024-10-02 21:04:44 +00:00
renovate[bot] cb3f19a5d0 Update dependency androidx.compose.foundation:foundation to v1.7.3 2024-10-02 19:55:31 +00:00
Anthony La 5b6768723d Merge pull request #178 from Anthonyy232/renovate/com.android.library-8.x
Update plugin com.android.library to v8.7.0
2024-10-01 13:36:42 -07:00
renovate[bot] 326dda6662 Update plugin com.android.library to v8.7.0 2024-10-01 20:36:23 +00:00
Anthony La f73939ed2c Merge pull request #177 from Anthonyy232/renovate/com.android.application-8.x
Update plugin com.android.application to v8.7.0
2024-10-01 13:36:00 -07:00
renovate[bot] 0684b03b5e Update plugin com.android.application to v8.7.0 2024-10-01 19:46:43 +00:00
Anthony La 1127ff86d9 Merge pull request #175 from Anthonyy232/renovate/com.github.skydoves-landscapist-glide-2.x
Update dependency com.github.skydoves:landscapist-glide to v2.4.0
2024-09-26 10:35:30 -07:00
Anthony La 4e8160496b Merge pull request #174 from Anthonyy232/renovate/gradle-8.x
Update dependency gradle to v8.10.2
2024-09-26 10:35:21 -07:00
renovate[bot] e18cb0c75c Update dependency com.github.skydoves:landscapist-glide to v2.4.0 2024-09-25 17:30:22 +00:00
renovate[bot] d11d7a1b9b Update dependency gradle to v8.10.2 2024-09-25 17:30:19 +00:00
Anthony La aa3ce3bbd5 Added support for Tasker event trigger when wallpaper changes 2024-09-25 10:27:19 -07:00
Anthony La 1c7ae9771a Merge pull request #171 from Anthonyy232/renovate/androidx.work-work-runtime-ktx-2.x
Update dependency androidx.work:work-runtime-ktx to v2.10.0-alpha04
2024-09-21 10:54:12 -07:00
Anthony La f1c6f3e36f Merge pull request #172 from Anthonyy232/renovate/org.jetbrains.kotlinx-kotlinx-serialization-json-1.x
Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.7.3
2024-09-21 10:54:00 -07:00
renovate[bot] a04da0801a Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.7.3 2024-09-21 00:57:21 +00:00
renovate[bot] 9ef38cb086 Update dependency androidx.work:work-runtime-ktx to v2.10.0-alpha04 2024-09-21 00:57:18 +00:00
Anthony La 3fe29db05b Merge pull request #169 from Anthonyy232/renovate/androidx.lifecycle-lifecycle-runtime-ktx-2.x
Update dependency androidx.lifecycle:lifecycle-runtime-ktx to v2.8.6
2024-09-20 17:56:59 -07:00
Anthony La 09626a9226 Merge pull request #170 from Anthonyy232/renovate/androidx.navigation-navigation-compose-2.x
Update dependency androidx.navigation:navigation-compose to v2.8.1
2024-09-20 17:56:54 -07:00
renovate[bot] e822b18624 Update dependency androidx.navigation:navigation-compose to v2.8.1 2024-09-20 22:22:35 +00:00
renovate[bot] 5bb7ba9399 Update dependency androidx.lifecycle:lifecycle-runtime-ktx to v2.8.6 2024-09-20 22:22:31 +00:00
Anthony La c794ea0b60 Merge pull request #167 from Anthonyy232/renovate/androidx.compose-compose-bom-2024.x
Update dependency androidx.compose:compose-bom to v2024.09.02
2024-09-20 12:10:38 -07:00
Anthony La 4a72f8dbc0 Merge pull request #168 from Anthonyy232/renovate/androidx.lifecycle-lifecycle-runtime-compose-2.x
Update dependency androidx.lifecycle:lifecycle-runtime-compose to v2.8.6
2024-09-20 12:10:31 -07:00
renovate[bot] ef61d3b028 Update dependency androidx.lifecycle:lifecycle-runtime-compose to v2.8.6 2024-09-20 19:09:57 +00:00
renovate[bot] ead7bd36fe Update dependency androidx.compose:compose-bom to v2024.09.02 2024-09-20 19:09:54 +00:00
Anthony La 240f30b187 Merge pull request #165 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-1.x
Update dependency androidx.compose.ui:ui-tooling to v1.7.2
2024-09-20 12:09:13 -07:00
renovate[bot] 24eb0bc20c Update dependency androidx.compose.ui:ui-tooling to v1.7.2 2024-09-20 19:09:03 +00:00
Anthony La b0bf5d875a Merge pull request #162 from Anthonyy232/renovate/androidx.compose.ui-ui-graphics-1.x
Update dependency androidx.compose.ui:ui-graphics to v1.7.2
2024-09-20 12:08:28 -07:00
Anthony La cea07a185b Merge pull request #164 from Anthonyy232/renovate/androidx.compose.ui-ui-test-manifest-1.x
Update dependency androidx.compose.ui:ui-test-manifest to v1.7.2
2024-09-20 12:08:15 -07:00
renovate[bot] 2db9a330ad Update dependency androidx.compose.ui:ui-graphics to v1.7.2 2024-09-20 19:08:12 +00:00
Anthony La 3f952796a3 Merge pull request #163 from Anthonyy232/renovate/androidx.compose.ui-ui-test-junit4-1.x
Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.2
2024-09-20 12:08:02 -07:00
Anthony La 350addbefa Merge pull request #161 from Anthonyy232/renovate/androidx.compose.ui-ui-1.x
Update dependency androidx.compose.ui:ui to v1.7.2
2024-09-20 12:07:49 -07:00
renovate[bot] 23c8a82390 Update dependency androidx.compose.ui:ui-test-manifest to v1.7.2 2024-09-20 19:07:41 +00:00
renovate[bot] c063814b93 Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.2 2024-09-20 19:07:39 +00:00
Anthony La 3c4fa741c6 Merge pull request #160 from Anthonyy232/renovate/androidx.compose.material-material-icons-extended-1.x
Update dependency androidx.compose.material:material-icons-extended to v1.7.2
2024-09-20 12:07:36 -07:00
renovate[bot] 49da709574 Update dependency androidx.compose.ui:ui to v1.7.2 2024-09-20 19:07:33 +00:00
renovate[bot] 177f3e21bf Update dependency androidx.compose.material:material-icons-extended to v1.7.2 2024-09-20 19:07:30 +00:00
Anthony La 82ce78fc0e Merge pull request #159 from Anthonyy232/renovate/androidx.compose.material-material-1.x
Update dependency androidx.compose.material:material to v1.7.2
2024-09-20 12:07:23 -07:00
Anthony La 346a4640c1 Merge pull request #158 from Anthonyy232/renovate/androidx.compose.foundation-foundation-1.x
Update dependency androidx.compose.foundation:foundation to v1.7.2
2024-09-20 12:07:13 -07:00
Anthony La d9998715cb Merge pull request #157 from Anthonyy232/renovate/androidx.compose.animation-animation-1.x
Update dependency androidx.compose.animation:animation to v1.7.2
2024-09-20 12:07:04 -07:00
renovate[bot] 842a77b8c5 Update dependency androidx.compose.material:material to v1.7.2 2024-09-20 19:05:48 +00:00
renovate[bot] 4b235d07ba Update dependency androidx.compose.foundation:foundation to v1.7.2 2024-09-20 19:05:45 +00:00
renovate[bot] f615dfe527 Update dependency androidx.compose.animation:animation to v1.7.2 2024-09-20 19:05:43 +00:00
Anthony La 92e530432f Merge pull request #166 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-preview-1.x
Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.2
2024-09-20 12:05:19 -07:00
renovate[bot] 4a0f0f371a Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.2 2024-09-19 06:05:23 +00:00
Anthony La 333d0692e8 Merge pull request #155 from Anthonyy232/renovate/com.android.application-8.x
Update plugin com.android.application to v8.6.1
2024-09-17 19:10:42 -07:00
renovate[bot] 241d0ce861 Update plugin com.android.application to v8.6.1 2024-09-18 02:10:28 +00:00
Anthony La 77d2deae0c Merge pull request #156 from Anthonyy232/renovate/com.android.library-8.x
Update plugin com.android.library to v8.6.1
2024-09-17 19:09:51 -07:00
renovate[bot] 7cc31f43b1 Update plugin com.android.library to v8.6.1 2024-09-17 21:45:34 +00:00
Anthony La bdd89a27b9 Added support for disabling auto-wallpaper changing while still allowing manual changes 2024-09-12 21:08:35 -07:00
Anthony La 77481770a6 Merge pull request #151 from Anthonyy232/renovate/com.github.skydoves-landscapist-glide-2.x
Update dependency com.github.skydoves:landscapist-glide to v2.3.8
2024-09-12 13:53:28 -07:00
renovate[bot] c9f616e1c0 Update dependency com.github.skydoves:landscapist-glide to v2.3.8 2024-09-12 06:20:37 +00:00
Anthony La 167f82edea Merge pull request #150 from Anthonyy232/renovate/androidx.compose-compose-bom-2024.x
Update dependency androidx.compose:compose-bom to v2024.09.01
2024-09-11 21:08:47 -07:00
renovate[bot] 8032f13f0e Update dependency androidx.compose:compose-bom to v2024.09.01 2024-09-12 04:08:42 +00:00
Anthony La 71fe478d54 Merge pull request #149 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-preview-1.x
Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.1
2024-09-11 21:08:07 -07:00
Anthony La e3af22bbeb Merge pull request #144 from Anthonyy232/renovate/androidx.compose.ui-ui-1.x
Update dependency androidx.compose.ui:ui to v1.7.1
2024-09-11 21:07:50 -07:00
renovate[bot] 87ee6b7041 Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.1 2024-09-12 04:07:30 +00:00
renovate[bot] b6b26f6732 Update dependency androidx.compose.ui:ui to v1.7.1 2024-09-12 04:07:28 +00:00
Anthony La ab1a9ab5af Merge pull request #146 from Anthonyy232/renovate/androidx.compose.ui-ui-test-junit4-1.x
Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.1
2024-09-11 21:05:34 -07:00
Anthony La 0fe8dc724e Merge pull request #147 from Anthonyy232/renovate/androidx.compose.ui-ui-test-manifest-1.x
Update dependency androidx.compose.ui:ui-test-manifest to v1.7.1
2024-09-11 21:05:26 -07:00
Anthony La b5836bea95 Merge pull request #139 from Anthonyy232/renovate/gradle-8.x
Update dependency gradle to v8.10.1
2024-09-11 21:05:12 -07:00
Anthony La 3fd427afc1 Merge pull request #140 from Anthonyy232/renovate/androidx.compose.animation-animation-1.x
Update dependency androidx.compose.animation:animation to v1.7.1
2024-09-11 21:05:01 -07:00
renovate[bot] d2bd26ba38 Update dependency androidx.compose.ui:ui-test-manifest to v1.7.1 2024-09-12 04:04:54 +00:00
Anthony La 6ffeebb6a2 Merge pull request #141 from Anthonyy232/renovate/androidx.compose.foundation-foundation-1.x
Update dependency androidx.compose.foundation:foundation to v1.7.1
2024-09-11 21:04:54 -07:00
renovate[bot] ccd4bab93d Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.1 2024-09-12 04:04:50 +00:00
Anthony La bbaa0cf9ee Merge pull request #142 from Anthonyy232/renovate/androidx.compose.material-material-1.x
Update dependency androidx.compose.material:material to v1.7.1
2024-09-11 21:04:48 -07:00
Anthony La 19b65999fd Merge pull request #143 from Anthonyy232/renovate/androidx.compose.material-material-icons-extended-1.x
Update dependency androidx.compose.material:material-icons-extended to v1.7.1
2024-09-11 21:04:41 -07:00
renovate[bot] 04ef14e5f1 Update dependency androidx.compose.material:material to v1.7.1 2024-09-12 04:04:39 +00:00
renovate[bot] c500fb773e Update dependency androidx.compose.foundation:foundation to v1.7.1 2024-09-12 04:04:36 +00:00
renovate[bot] 8c325ed5de Update dependency androidx.compose.animation:animation to v1.7.1 2024-09-12 04:04:32 +00:00
Anthony La 4fde150bbe Merge pull request #145 from Anthonyy232/renovate/androidx.compose.ui-ui-graphics-1.x
Update dependency androidx.compose.ui:ui-graphics to v1.7.1
2024-09-11 21:04:25 -07:00
Anthony La cebb14e60b Merge pull request #148 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-1.x
Update dependency androidx.compose.ui:ui-tooling to v1.7.1
2024-09-11 21:04:11 -07:00
renovate[bot] 0fc6a38b12 Update dependency androidx.compose.ui:ui-tooling to v1.7.1 2024-09-11 06:01:20 +00:00
renovate[bot] 17340fb74e Update dependency androidx.compose.ui:ui-graphics to v1.7.1 2024-09-11 01:39:28 +00:00
renovate[bot] 9ec4c5d20b Update dependency gradle to v8.10.1 2024-09-10 21:28:06 +00:00
renovate[bot] a8164da137 Update dependency androidx.compose.material:material-icons-extended to v1.7.1 2024-09-10 21:24:57 +00:00
Anthony La 886b7cb27e Update README.md 2024-09-10 13:22:35 -07:00
Anthony La 9f67243f0d Added None scaling option 2024-09-09 14:42:50 -07:00
Anthony La 78d7e0972b Merge pull request #135 from Anthonyy232/renovate/com.google.devtools.ksp-2.x
Update plugin com.google.devtools.ksp to v2.0.20-1.0.25
2024-09-05 19:14:32 -07:00
renovate[bot] 683f434030 Update plugin com.google.devtools.ksp to v2.0.20-1.0.25 2024-09-06 02:09:58 +00:00
Anthony La df0ac6191f Updated version code 2024-09-05 19:08:38 -07:00
Anthony La 1d3ad86341 Merge pull request #133 from Anthonyy232/renovate/androidx.compose.ui-ui-test-manifest-1.x
Update dependency androidx.compose.ui:ui-test-manifest to v1.7.0
2024-09-05 18:34:43 -07:00
renovate[bot] bac5c662ef Update dependency androidx.compose.ui:ui-test-manifest to v1.7.0 2024-09-06 01:34:34 +00:00
Anthony La 8d447f0068 Merge pull request #134 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-1.x
Update dependency androidx.compose.ui:ui-tooling to v1.7.0
2024-09-05 18:33:59 -07:00
renovate[bot] 7a2b67ed57 Update dependency androidx.compose.ui:ui-tooling to v1.7.0 2024-09-06 01:33:50 +00:00
Anthony La c55b8f44f0 Merge pull request #120 from Anthonyy232/renovate/com.airbnb.android-lottie-compose-6.x
Update dependency com.airbnb.android:lottie-compose to v6.5.2
2024-09-05 18:33:48 -07:00
Anthony La 43806aa694 Merge pull request #122 from Anthonyy232/renovate/androidx.activity-activity-compose-1.x
Update dependency androidx.activity:activity-compose to v1.9.2
2024-09-05 18:33:35 -07:00
Anthony La 90efcaaae1 Merge pull request #123 from Anthonyy232/renovate/androidx.compose.animation-animation-1.x
Update dependency androidx.compose.animation:animation to v1.7.0
2024-09-05 18:33:23 -07:00
Anthony La 8fdb0920e6 Merge pull request #124 from Anthonyy232/renovate/androidx.compose.foundation-foundation-1.x
Update dependency androidx.compose.foundation:foundation to v1.7.0
2024-09-05 18:33:17 -07:00
renovate[bot] e74f6a258a Update dependency com.airbnb.android:lottie-compose to v6.5.2 2024-09-06 01:33:07 +00:00
Anthony La 54e8b1816f Merge pull request #129 from Anthonyy232/renovate/androidx.compose.ui-ui-1.x
Update dependency androidx.compose.ui:ui to v1.7.0
2024-09-05 18:33:05 -07:00
Anthony La efa3cbc6e1 Merge pull request #125 from Anthonyy232/renovate/androidx.compose.material3-material3-1.x
Update dependency androidx.compose.material3:material3 to v1.3.0
2024-09-05 18:32:59 -07:00
renovate[bot] 12165d41c2 Update dependency androidx.compose.ui:ui to v1.7.0 2024-09-06 01:32:58 +00:00
renovate[bot] fe3aa1bda8 Update dependency androidx.compose.material3:material3 to v1.3.0 2024-09-06 01:32:53 +00:00
renovate[bot] 83ae1c721e Update dependency androidx.compose.foundation:foundation to v1.7.0 2024-09-06 01:32:49 +00:00
renovate[bot] 50cae3e04e Update dependency androidx.compose.animation:animation to v1.7.0 2024-09-06 01:32:47 +00:00
Anthony La e6b2a2af18 Merge pull request #127 from Anthonyy232/renovate/androidx.compose.material-material-1.x
Update dependency androidx.compose.material:material to v1.7.0
2024-09-05 18:32:46 -07:00
renovate[bot] 02671c0804 Update dependency androidx.activity:activity-compose to v1.9.2 2024-09-06 01:32:44 +00:00
Anthony La a3c57bf6ef Merge pull request #128 from Anthonyy232/renovate/androidx.compose.material-material-icons-extended-1.x
Update dependency androidx.compose.material:material-icons-extended to v1.7.0
2024-09-05 18:32:34 -07:00
Anthony La 72c8d1313f Merge pull request #130 from Anthonyy232/renovate/androidx.compose.ui-ui-graphics-1.x
Update dependency androidx.compose.ui:ui-graphics to v1.7.0
2024-09-05 18:32:21 -07:00
renovate[bot] 89ca480c0c Update dependency androidx.compose.ui:ui-graphics to v1.7.0 2024-09-06 01:30:41 +00:00
renovate[bot] b2a6b17c5a Update dependency androidx.compose.material:material-icons-extended to v1.7.0 2024-09-06 01:30:34 +00:00
renovate[bot] a6926f25bc Update dependency androidx.compose.material:material to v1.7.0 2024-09-06 01:30:31 +00:00
Anthony La 335a3f7084 Merge pull request #132 from Anthonyy232/renovate/androidx.compose.ui-ui-test-junit4-1.x
Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.0
2024-09-05 18:29:09 -07:00
Anthony La 58c35c1bbb Fixed tasker plugin integration 2024-09-05 18:27:52 -07:00
renovate[bot] 27000d9fa2 Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.0 2024-09-05 16:48:08 +00:00
Anthony La c5ed7684cf Update README.md 2024-09-03 22:13:46 -07:00
Anthony La d8b92d5cdb Update issue templates 2024-09-03 18:59:42 -07:00
Anthony La c7989db3c7 Update issue templates 2024-09-02 14:45:40 -07:00
Anthony La 353e3c3610 Update issue templates 2024-09-02 14:43:18 -07:00
Anthony La 2d35dc0620 Updated localization 2024-09-02 12:58:38 -07:00
Anthony La 5a1f11ba4f Fixed wallpaper having incorrect dimensions when in landscape mode
Updated version code
2024-09-02 11:54:29 -07:00
Anthonyy232 c1de9ec1a9 Updated FAB animations 2024-09-01 14:19:57 -07:00
Anthony La b02bb044a3 Merge pull request #116 from Anthonyy232/renovate/com.android.application-8.x
Update plugin com.android.application to v8.6.0
2024-08-29 19:24:50 -07:00
renovate[bot] 002ad6e4f9 Update plugin com.android.application to v8.6.0 2024-08-30 02:24:42 +00:00
Anthony La c05ea1ced5 Merge pull request #117 from Anthonyy232/renovate/com.android.library-8.x
Update plugin com.android.library to v8.6.0
2024-08-29 19:24:19 -07:00
renovate[bot] 6537ecfac7 Update plugin com.android.library to v8.6.0 2024-08-30 02:00:07 +00:00
Anthonyy232 0d8fee5929 Added vignette effect 2024-08-29 16:22:50 -07:00
Anthonyy232 9563bf2057 Updated blur strength factor 2024-08-28 13:54:01 -07:00
Anthony La 7b75db3437 Merge pull request #110 from Anthonyy232/renovate/kotlin-monorepo
Update kotlin monorepo to v2.0.20
2024-08-28 13:49:08 -07:00
Anthony La 6273412d9e Merge pull request #111 from Anthonyy232/renovate/com.google.devtools.ksp-2.x
Update plugin com.google.devtools.ksp to v2.0.20-1.0.24
2024-08-28 13:49:00 -07:00
Anthony La 87f71c599c Merge pull request #108 from Anthonyy232/renovate/com.mikepenz-aboutlibraries-compose-m3-11.x
Update dependency com.mikepenz:aboutlibraries-compose-m3 to v11.2.3
2024-08-28 13:48:49 -07:00
renovate[bot] 3261862c7d Update plugin com.google.devtools.ksp to v2.0.20-1.0.24 2024-08-28 20:48:49 +00:00
renovate[bot] afadfc0d2d Update kotlin monorepo to v2.0.20 2024-08-28 20:48:46 +00:00
renovate[bot] f6fdaf1673 Update dependency com.mikepenz:aboutlibraries-compose-m3 to v11.2.3 2024-08-28 20:48:43 +00:00
Anthony La 7e21d6c564 Merge pull request #106 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-preview-1.x
Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.0-rc01
2024-08-28 13:47:59 -07:00
Anthony La 89c0bb3b1b Merge pull request #107 from Anthonyy232/renovate/androidx.navigation-navigation-compose-2.x
Update dependency androidx.navigation:navigation-compose to v2.8.0-rc01
2024-08-28 13:47:49 -07:00
renovate[bot] f18b751714 Update dependency androidx.navigation:navigation-compose to v2.8.0-rc01 2024-08-28 20:47:34 +00:00
Anthony La 250817ffbf Merge pull request #109 from Anthonyy232/renovate/com.mikepenz-aboutlibraries-core-11.x
Update dependency com.mikepenz:aboutlibraries-core to v11.2.3
2024-08-28 13:47:32 -07:00
renovate[bot] 5e52b7098d Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.0-rc01 2024-08-28 20:47:31 +00:00
Anthony La ffdbf54561 Merge pull request #112 from Anthonyy232/renovate/com.mikepenz.aboutlibraries.plugin-11.x
Update plugin com.mikepenz.aboutlibraries.plugin to v11.2.3
2024-08-28 13:47:11 -07:00
Anthony La b11d89ceda Merge pull request #113 from Anthonyy232/renovate/androidx.compose-compose-bom-2024.x
Update dependency androidx.compose:compose-bom to v2024.08.00
2024-08-28 13:47:02 -07:00
Anthony La 045ee268e1 Merge pull request #114 from Anthonyy232/renovate/com.airbnb.android-lottie-compose-6.x
Update dependency com.airbnb.android:lottie-compose to v6.5.1
2024-08-28 13:46:51 -07:00
Anthony La f5915bff31 Merge pull request #115 from Anthonyy232/renovate/org.jetbrains.kotlinx-kotlinx-serialization-json-1.x
Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.7.2
2024-08-28 13:46:44 -07:00
renovate[bot] d153ec969e Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.7.2 2024-08-28 20:10:42 +00:00
renovate[bot] bfcabe29c0 Update dependency com.airbnb.android:lottie-compose to v6.5.1 2024-08-28 20:10:37 +00:00
renovate[bot] 08c71e275e Update dependency androidx.compose:compose-bom to v2024.08.00 2024-08-26 09:35:57 +00:00
renovate[bot] d211b6416c Update plugin com.mikepenz.aboutlibraries.plugin to v11.2.3 2024-08-26 09:35:54 +00:00
renovate[bot] 010a197b94 Update dependency com.mikepenz:aboutlibraries-core to v11.2.3 2024-08-26 04:41:52 +00:00
Anthony La bd4a809cac Merge pull request #100 from Anthonyy232/renovate/androidx.compose.ui-ui-1.x
Update dependency androidx.compose.ui:ui to v1.7.0-rc01
2024-08-25 19:11:59 -07:00
Anthony La cd5c53a662 Merge pull request #102 from Anthonyy232/renovate/androidx.compose.ui-ui-test-junit4-1.x
Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.0-rc01
2024-08-25 19:11:52 -07:00
Anthony La 5e6211035c Merge pull request #104 from Anthonyy232/renovate/androidx.compose.ui-ui-test-manifest-1.x
Update dependency androidx.compose.ui:ui-test-manifest to v1.7.0-rc01
2024-08-25 19:11:46 -07:00
renovate[bot] 2260f7032c Update dependency androidx.compose.ui:ui-test-manifest to v1.7.0-rc01 2024-08-26 02:11:36 +00:00
renovate[bot] 1cab7cca82 Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.0-rc01 2024-08-26 02:11:33 +00:00
renovate[bot] 018aa9d3a9 Update dependency androidx.compose.ui:ui to v1.7.0-rc01 2024-08-26 02:11:30 +00:00
Anthony La 423e65990f Merge pull request #95 from Anthonyy232/renovate/androidx.compose.animation-animation-1.x
Update dependency androidx.compose.animation:animation to v1.7.0-rc01
2024-08-25 19:11:06 -07:00
Anthony La 644e2ace3c Merge pull request #96 from Anthonyy232/renovate/androidx.compose.material-material-1.x
Update dependency androidx.compose.material:material to v1.7.0-rc01
2024-08-25 19:10:59 -07:00
Anthony La e61a1dc7f4 Merge pull request #97 from Anthonyy232/renovate/androidx.compose.foundation-foundation-1.x
Update dependency androidx.compose.foundation:foundation to v1.7.0-rc01
2024-08-25 19:10:52 -07:00
Anthony La 03378e6947 Merge pull request #98 from Anthonyy232/renovate/androidx.compose.material3-material3-1.x
Update dependency androidx.compose.material3:material3 to v1.3.0-rc01
2024-08-25 19:10:46 -07:00
Anthony La 0d22efa21b Merge pull request #99 from Anthonyy232/renovate/androidx.compose.material-material-icons-extended-1.x
Update dependency androidx.compose.material:material-icons-extended to v1.7.0-rc01
2024-08-25 19:10:39 -07:00
Anthony La 72175fd7b2 Merge pull request #101 from Anthonyy232/renovate/androidx.compose.ui-ui-graphics-1.x
Update dependency androidx.compose.ui:ui-graphics to v1.7.0-rc01
2024-08-25 19:10:27 -07:00
Anthony La 94576238c4 Merge pull request #105 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-1.x
Update dependency androidx.compose.ui:ui-tooling to v1.7.0-rc01
2024-08-25 19:10:12 -07:00
renovate[bot] 6dda721a0b Update dependency androidx.compose.ui:ui-tooling to v1.7.0-rc01 2024-08-22 05:22:13 +00:00
renovate[bot] 9db120bce9 Update dependency androidx.compose.ui:ui-graphics to v1.7.0-rc01 2024-08-22 00:31:41 +00:00
renovate[bot] 1c48dcd01d Update dependency androidx.compose.material:material-icons-extended to v1.7.0-rc01 2024-08-21 21:56:50 +00:00
renovate[bot] 62b296a293 Update dependency androidx.compose.material3:material3 to v1.3.0-rc01 2024-08-21 18:34:08 +00:00
renovate[bot] 5ad27fd477 Update dependency androidx.compose.foundation:foundation to v1.7.0-rc01 2024-08-21 18:34:04 +00:00
renovate[bot] d846384bdc Update dependency androidx.compose.material:material to v1.7.0-rc01 2024-08-21 17:14:03 +00:00
renovate[bot] 5c18fa1074 Update dependency androidx.compose.animation:animation to v1.7.0-rc01 2024-08-21 17:13:59 +00:00
Anthony La 9b13a2158a Update README.md 2024-08-16 21:13:24 -07:00
Anthony La 6edbc2560f Update README.md 2024-08-16 21:00:24 -07:00
Anthony La 3a1f53b7fc Update README.md 2024-08-16 20:58:49 -07:00
Anthony La cad7839a36 Update README.md 2024-08-16 20:54:31 -07:00
Anthony La 219121f400 Merge pull request #88 from Anthonyy232/2.0
Version 2.0
2024-08-16 20:48:51 -07:00
Anthonyy232 3afbb1dbe0 Updated localization 2024-08-16 20:48:04 -07:00
Anthonyy232 d39a670e4d Updated metadata images 2024-08-16 18:17:45 -07:00
Anthonyy232 7036b17b93 Merge branch 'refs/heads/master' into 2.0 2024-08-16 16:26:33 -07:00
Anthonyy232 624c9c3dbb Refactored wallpaper changer code 2024-08-16 16:23:57 -07:00
Anthony La 99cc362fdb Merge pull request #87 from Anthonyy232/renovate/gradle-8.x
Update dependency gradle to v8.10
2024-08-15 22:04:16 -07:00
Anthonyy232 92563b84ec Refactored wallpaper changer code 2024-08-15 20:30:35 -07:00
renovate[bot] 873d68a715 Update dependency gradle to v8.10 2024-08-14 12:59:29 +00:00
Anthonyy232 7c3c64149a Fixed album of size 1 not working properly 2024-08-14 01:29:51 -07:00
Anthonyy232 7615d7786a Added separate screen settings for blur and brightness
Replaced GPlay link with IzzyOnDroid
2024-08-12 17:26:14 -07:00
Anthonyy232 064237bed4 Fixed wallpaper alarm not properly rescheduling
Fixed out of bounds array access
Added tasker shortcut
2024-08-12 15:33:41 -07:00
Anthonyy232 e8f8a145ea Fixed wallpaper setting with the wrong dimensions 2024-08-11 00:03:08 -07:00
Anthonyy232 b03e860dee Fixed wallpaper setting with the wrong dimensions 2024-08-10 00:56:19 -07:00
Anthony La 359c4b40e9 Update README.md 2024-08-09 17:33:12 -07:00
Anthony La c4852b3830 Update README.md 2024-08-09 16:07:20 -07:00
Anthony La e006bea84e Update README.md 2024-08-09 14:17:52 -07:00
Anthony La 766d54cc13 Update README.md 2024-08-09 14:16:38 -07:00
Anthonyy232 f9b6a96fc5 Changed from LazyStaggeredVerticalGrid to LazyVerticalGrid and added support for scrollbar 2024-08-09 14:06:31 -07:00
Anthonyy232 4467aa9085 Added change wallpaper button to notification 2024-08-09 00:59:09 -07:00
Anthonyy232 9240a89663 Updated DAO version 2024-08-08 23:22:34 -07:00
Anthonyy232 c15bea8b37 Updated auto-restart alarm manager
Fixed large list of string navigation crashing
2024-08-08 23:21:41 -07:00
Anthonyy232 e58de859cd Merge branch 'refs/heads/master' into 2.0 2024-08-08 23:00:11 -07:00
Anthony La 22a219e985 Merge pull request #85 from Anthonyy232/renovate/com.android.application-8.x
Update plugin com.android.application to v8.5.2
2024-08-08 22:59:53 -07:00
Anthonyy232 7823fe0327 Updated auto-restart alarm manager 2024-08-08 22:59:05 -07:00
renovate[bot] d0d48f4ad1 Update plugin com.android.application to v8.5.2 2024-08-09 05:18:29 +00:00
Anthonyy232 cd1ed25ba1 Merge branch 'refs/heads/master' into 2.0 2024-08-08 22:18:11 -07:00
Anthony La 9e864858c0 Merge pull request #84 from Anthonyy232/renovate/com.android.library-8.x
Update plugin com.android.library to v8.5.2
2024-08-08 22:17:51 -07:00
Anthonyy232 d72596f3a0 Fixed notification not appearing when only setting lock screen 2024-08-08 22:16:52 -07:00
renovate[bot] f56d0c7d1b Update plugin com.android.library to v8.5.2 2024-08-09 01:12:25 +00:00
Anthonyy232 98e0b4ae2f Fixed selected album not showing up in bottom sheet as selected 2024-08-08 12:03:46 -07:00
Anthony La 8cb643b8c9 Merge pull request #83 from Anthonyy232/renovate/composeoptions-1.x
Update dependency composeOptions to v1.5.15
2024-08-08 10:47:52 -07:00
renovate[bot] 0df52203be Update dependency composeOptions to v1.5.15 2024-08-08 13:33:23 +00:00
Anthonyy232 7cf4f85b0d Updated version code 2024-08-08 01:53:11 -07:00
Anthonyy232 e89403dff3 Merge branch 'refs/heads/master' into 2.0
# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/com/anthonyla/paperize/data/settings/SettingsDataStoreImpl.kt
2024-08-08 01:52:39 -07:00
Anthony La 9a63bffca9 Update README.md 2024-08-08 01:50:38 -07:00
Anthonyy232 b8a14332c5 Updated compileSDK to 35
Updated dependencies
2024-08-08 01:50:03 -07:00
Anthonyy232 65342ed8f5 Removed unused parameters 2024-08-08 01:20:09 -07:00
Anthonyy232 f76313b998 Major refactor of wallpaper changer functionality to allow different albums for lock screen and home screen 2024-08-08 01:17:36 -07:00
Anthony La 6e821e9db4 Merge pull request #72 from Anthonyy232/renovate/com.google.dagger-hilt-android-2.x
Update dependency com.google.dagger:hilt-android to v2.52
2024-08-08 01:12:45 -07:00
renovate[bot] 696ec185bf Update dependency com.google.dagger:hilt-android to v2.52 2024-08-08 08:12:32 +00:00
Anthony La 3f7cfcd079 Merge pull request #69 from Anthonyy232/renovate/com.airbnb.android-lottie-compose-6.x
Update dependency com.airbnb.android:lottie-compose to v6.5.0
2024-08-08 01:12:18 -07:00
Anthony La 38c5b91eb2 Merge pull request #81 from Anthonyy232/renovate/androidx.compose.ui-ui-1.x
Update dependency androidx.compose.ui:ui to v1.7.0-beta07
2024-08-08 01:12:03 -07:00
renovate[bot] 2138c0b22c Update dependency com.airbnb.android:lottie-compose to v6.5.0 2024-08-08 08:11:48 +00:00
renovate[bot] c32ffbae68 Update dependency androidx.compose.ui:ui to v1.7.0-beta07 2024-08-08 08:11:45 +00:00
Anthony La 100422fc63 Merge pull request #73 from Anthonyy232/renovate/com.google.dagger-hilt-android-compiler-2.x
Update dependency com.google.dagger:hilt-android-compiler to v2.52
2024-08-08 01:11:43 -07:00
Anthony La 3f7984808c Merge pull request #74 from Anthonyy232/renovate/com.google.dagger.hilt.android-2.x
Update plugin com.google.dagger.hilt.android to v2.52
2024-08-08 01:11:34 -07:00
Anthony La 524baa1271 Merge pull request #82 from Anthonyy232/renovate/androidx.compose.ui-ui-graphics-1.x
Update dependency androidx.compose.ui:ui-graphics to v1.7.0-beta07
2024-08-08 01:11:19 -07:00
renovate[bot] b0fe869954 Update plugin com.google.dagger.hilt.android to v2.52 2024-08-08 08:10:26 +00:00
renovate[bot] e88f83dd15 Update dependency com.google.dagger:hilt-android-compiler to v2.52 2024-08-08 08:10:22 +00:00
renovate[bot] 2b9ed09211 Update dependency androidx.compose.ui:ui-graphics to v1.7.0-beta07 2024-08-08 08:10:12 +00:00
Anthony La 9278dd1e76 Merge pull request #75 from Anthonyy232/renovate/kotlin-monorepo
Update kotlin monorepo to v2.0.10
2024-08-08 01:08:59 -07:00
Anthony La a2f66c29be Merge pull request #76 from Anthonyy232/renovate/com.google.devtools.ksp-2.x
Update plugin com.google.devtools.ksp to v2.0.10-1.0.24
2024-08-08 01:08:50 -07:00
Anthony La 086ca2e049 Merge pull request #77 from Anthonyy232/renovate/androidx.compose.animation-animation-1.x
Update dependency androidx.compose.animation:animation to v1.7.0-beta07
2024-08-08 01:08:37 -07:00
Anthony La 6a8648728b Merge pull request #78 from Anthonyy232/renovate/androidx.compose.foundation-foundation-1.x
Update dependency androidx.compose.foundation:foundation to v1.7.0-beta07
2024-08-08 01:08:17 -07:00
renovate[bot] 5e796605be Update plugin com.google.devtools.ksp to v2.0.10-1.0.24 2024-08-08 08:08:11 +00:00
Anthony La abe1d10440 Merge pull request #79 from Anthonyy232/renovate/androidx.compose.material-material-1.x
Update dependency androidx.compose.material:material to v1.7.0-beta07
2024-08-08 01:08:09 -07:00
renovate[bot] adddb21fbf Update kotlin monorepo to v2.0.10 2024-08-08 08:08:08 +00:00
renovate[bot] 67ad5f3bad Update dependency androidx.compose.material:material to v1.7.0-beta07 2024-08-08 08:08:01 +00:00
renovate[bot] 0cf2302d00 Update dependency androidx.compose.foundation:foundation to v1.7.0-beta07 2024-08-08 08:07:58 +00:00
renovate[bot] e23b95b514 Update dependency androidx.compose.animation:animation to v1.7.0-beta07 2024-08-08 08:07:54 +00:00
Anthony La ba8fe59bf0 Merge pull request #80 from Anthonyy232/renovate/androidx.compose.material-material-icons-extended-1.x
Update dependency androidx.compose.material:material-icons-extended to v1.7.0-beta07
2024-08-08 01:07:45 -07:00
Anthony La 380328b401 Merge pull request #70 from navneetpal01/master
Updated the SettingsDataStoreImpl injection
2024-08-08 01:07:15 -07:00
renovate[bot] 15fc31b131 Update dependency androidx.compose.material:material-icons-extended to v1.7.0-beta07 2024-08-07 22:02:33 +00:00
Anthonyy232 65972a9ae6 Baseline code refactor for home/lock separate album functionality
Added F-Droid Link
2024-08-05 21:44:27 -07:00
navneet 5351f95cf4 Updated the SettingsDataStoreImpl 2024-08-04 11:35:08 +05:30
Anthonyy232 e0bc6ccb22 Refactored WallpaperScreen and added F-Droid link 2024-07-31 18:45:40 -07:00
Anthony La 58b82e87be Update README.md 2024-07-31 18:43:44 -07:00
Anthony La 54c7066a4a Merge pull request #68 from Anthonyy232/renovate/com.google.devtools.ksp-2.x
Update plugin com.google.devtools.ksp to v2.0.0-1.0.24
2024-07-31 09:26:08 -07:00
renovate[bot] da2e085e7b Update plugin com.google.devtools.ksp to v2.0.0-1.0.24 2024-07-30 01:09:38 +00:00
Anthonyy232 69e9f91814 Fixed navigation bug due to passing large list of strings (reverted to JSON convert instead of type-safe for FolderView screen) 2024-07-28 23:27:02 -07:00
Anthony La edfc942a6d Update README.md 2024-07-25 11:00:46 -07:00
Anthony La 71f8ee26de Create sponsorship button on GitHub website 2024-07-25 10:59:26 -07:00
Anthony La 02ac267c27 Update README.md 2024-07-25 09:37:52 -07:00
Anthonyy232 8ae92ef552 Updated app document and gradle dependency information 2024-07-25 09:34:59 -07:00
Anthonyy232 4006671f99 Remove unnecessary permission (ACCESS_NETWORK_STATE) 2024-07-25 09:27:00 -07:00
Anthonyy232 a19ac36801 Fixed memory usage for setting wallpaper 2024-07-24 23:12:46 -07:00
Anthonyy232 86d718b5f5 Updated icon for app shortcut 2024-07-24 22:45:30 -07:00
Anthonyy232 e95c923a6a Added app shortcut for changing wallpaper
Updated localization
2024-07-24 22:32:47 -07:00
Anthonyy232 ee0a04bf09 Updated .gitignore 2024-07-24 21:25:32 -07:00
Anthonyy232 4f7129f5f4 Fixed high-res images having blurry/low-res applied wallpapers
Updated dependencies
Updated localization
2024-07-24 21:20:50 -07:00
Anthony La 4e5f0d63cc Delete .idea directory 2024-07-24 19:46:25 -07:00
Anthony La c40e70d18e Merge pull request #41 from Anthonyy232/renovate/androidx.compose.ui-ui-graphics-1.x
Update dependency androidx.compose.ui:ui-graphics to v1.7.0-beta06
2024-07-24 14:12:46 -07:00
renovate[bot] b3ca913921 Update dependency androidx.compose.ui:ui-graphics to v1.7.0-beta06 2024-07-24 21:12:40 +00:00
Anthony La 99bdcf6637 Merge pull request #43 from Anthonyy232/renovate/androidx.compose.ui-ui-test-manifest-1.x
Update dependency androidx.compose.ui:ui-test-manifest to v1.7.0-beta06
2024-07-24 14:12:39 -07:00
Anthony La 8f8650ef7c Merge pull request #42 from Anthonyy232/renovate/androidx.compose.ui-ui-test-junit4-1.x
Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.0-beta06
2024-07-24 14:12:29 -07:00
renovate[bot] da2747306b Update dependency androidx.compose.ui:ui-test-manifest to v1.7.0-beta06 2024-07-24 21:12:11 +00:00
renovate[bot] bb7dc87027 Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.0-beta06 2024-07-24 21:12:08 +00:00
Anthony La 4464cbf7f0 Merge pull request #40 from Anthonyy232/renovate/androidx.compose.ui-ui-1.x
Update dependency androidx.compose.ui:ui to v1.7.0-beta06
2024-07-24 14:12:05 -07:00
renovate[bot] c33d567a6a Update dependency androidx.compose.ui:ui to v1.7.0-beta06 2024-07-24 21:11:58 +00:00
Anthony La 2c626db54f Merge pull request #39 from Anthonyy232/renovate/androidx.compose.material-material-icons-extended-1.x
Update dependency androidx.compose.material:material-icons-extended to v1.7.0-beta06
2024-07-24 14:11:53 -07:00
Anthony La fec52ca412 Merge pull request #38 from Anthonyy232/renovate/androidx.compose.material-material-1.x
Update dependency androidx.compose.material:material to v1.7.0-beta06
2024-07-24 14:11:43 -07:00
Anthony La 2cece3dc05 Merge pull request #37 from Anthonyy232/renovate/androidx.compose.foundation-foundation-1.x
Update dependency androidx.compose.foundation:foundation to v1.7.0-beta06
2024-07-24 14:11:34 -07:00
Anthony La 37e85c4a6b Merge pull request #36 from Anthonyy232/renovate/androidx.compose.animation-animation-1.x
Update dependency androidx.compose.animation:animation to v1.7.0-beta06
2024-07-24 14:11:23 -07:00
renovate[bot] b9f3f158b0 Update dependency androidx.compose.material:material-icons-extended to v1.7.0-beta06 2024-07-24 21:11:19 +00:00
renovate[bot] e9c4c41d3e Update dependency androidx.compose.material:material to v1.7.0-beta06 2024-07-24 21:11:15 +00:00
renovate[bot] f2b87a5e0e Update dependency androidx.compose.foundation:foundation to v1.7.0-beta06 2024-07-24 21:11:13 +00:00
Anthony La 6175338b99 Merge pull request #35 from Anthonyy232/renovate/androidx.activity-activity-compose-1.x
Update dependency androidx.activity:activity-compose to v1.9.1
2024-07-24 14:11:13 -07:00
renovate[bot] 729b5bd45a Update dependency androidx.compose.animation:animation to v1.7.0-beta06 2024-07-24 21:11:10 +00:00
renovate[bot] 5139692f2c Update dependency androidx.activity:activity-compose to v1.9.1 2024-07-24 21:11:07 +00:00
Anthony La d6bd048012 Merge pull request #44 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-1.x
Update dependency androidx.compose.ui:ui-tooling to v1.7.0-beta06
2024-07-24 14:10:30 -07:00
Anthony La ca839b2e1f Merge pull request #45 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-preview-1.x
Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.0-beta06
2024-07-24 14:10:20 -07:00
Anthony La 02ba6f986b Merge pull request #46 from Anthonyy232/renovate/androidx.lifecycle-lifecycle-runtime-compose-2.x
Update dependency androidx.lifecycle:lifecycle-runtime-compose to v2.8.4
2024-07-24 14:10:07 -07:00
Anthony La 417cabcaeb Merge pull request #47 from Anthonyy232/renovate/androidx.lifecycle-lifecycle-runtime-ktx-2.x
Update dependency androidx.lifecycle:lifecycle-runtime-ktx to v2.8.4
2024-07-24 14:09:47 -07:00
Anthony La 5218dd4174 Merge pull request #48 from Anthonyy232/renovate/androidx.navigation-navigation-compose-2.x
Update dependency androidx.navigation:navigation-compose to v2.8.0-beta06
2024-07-24 14:09:36 -07:00
renovate[bot] 35836d7778 Update dependency androidx.navigation:navigation-compose to v2.8.0-beta06 2024-07-24 19:58:45 +00:00
renovate[bot] be9cb13971 Update dependency androidx.lifecycle:lifecycle-runtime-ktx to v2.8.4 2024-07-24 19:58:42 +00:00
renovate[bot] 2a7191b7be Update dependency androidx.lifecycle:lifecycle-runtime-compose to v2.8.4 2024-07-24 19:58:38 +00:00
renovate[bot] 4b930308f8 Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.0-beta06 2024-07-24 19:58:35 +00:00
renovate[bot] 2567781e63 Update dependency androidx.compose.ui:ui-tooling to v1.7.0-beta06 2024-07-24 19:58:33 +00:00
Anthony La 13485cb19c Update renovate.json 2024-07-24 12:55:22 -07:00
Anthony La eae4e344b6 Update renovate.json 2024-07-24 12:35:01 -07:00
Anthonyy232 e5fab5cb5e Updated version code 2024-07-23 09:52:07 -07:00
Anthonyy232 5fd233e790 Added AMOLED dark mode setting
Reverted lazy column back to column due to stutter
2024-07-22 18:25:02 -07:00
Anthonyy232 48a730e4a9 Fixed WallpaperBootAndChangeReceiver not changing wallpaper immediately
Refactored WallpaperAlarmSchedulerImpl.kt name
2024-07-19 20:28:29 -07:00
Anthonyy232 4c3d5af7f7 Removed FAB animation when scrolling due to recomposition inefficiency
Refactored viewmodel injection code
Changed column to lazy column on WallpaperScreen.kt
2024-07-17 22:42:10 -07:00
Anthonyy232 829d982d23 Refactored albums viewmodel injecting 2024-07-16 23:34:34 -07:00
Anthonyy232 b01b9a87d6 Updated version code 2024-07-12 10:38:18 -07:00
Anthony La c4395b364c Merge pull request #31 from Anthonyy232/renovate/com.android.application-8.x
Update plugin com.android.application to v8.5.1
2024-07-12 10:33:05 -07:00
renovate[bot] dc1f8b9802 Update plugin com.android.application to v8.5.1 2024-07-12 17:32:59 +00:00
Anthony La 4279dd3be7 Merge pull request #30 from Anthonyy232/renovate/gradle-8.x
Update dependency gradle to v8.9
2024-07-12 10:32:34 -07:00
Anthony La 373f784fb6 Merge pull request #32 from Anthonyy232/renovate/com.google.devtools.ksp-2.x
Update plugin com.google.devtools.ksp to v2.0.0-1.0.23
2024-07-12 10:32:13 -07:00
Anthony La fe12b2116c Merge pull request #33 from Anthonyy232/renovate/com.android.library-8.x
Update plugin com.android.library to v8.5.1
2024-07-12 10:32:03 -07:00
renovate[bot] 9f906aa11c Update plugin com.android.library to v8.5.1 2024-07-12 00:30:16 +00:00
renovate[bot] e20b3c7c49 Update plugin com.google.devtools.ksp to v2.0.0-1.0.23 2024-07-11 21:48:28 +00:00
renovate[bot] 9bab8ad4b6 Update dependency gradle to v8.9 2024-07-11 15:33:27 +00:00
Anthonyy232 31b976c258 Updated localizations 2024-07-10 18:49:51 -07:00
Anthonyy232 660116fb60 Remove lint for broadcast receiver 2024-07-10 18:41:40 -07:00
Anthonyy232 984e34f425 Added quick-setting tile for changing wallpaper 2024-07-10 18:40:17 -07:00
Anthonyy232 cd06c87263 Updated localization 2024-07-10 18:40:05 -07:00
Anthony La 633ae66a80 Merge pull request #27 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-1.x
Update dependency androidx.compose.ui:ui-tooling to v1.7.0-beta05
2024-07-10 12:31:25 -07:00
renovate[bot] 005843ec00 Update dependency androidx.compose.ui:ui-tooling to v1.7.0-beta05 2024-07-10 19:30:56 +00:00
Anthony La 4327a94c14 Merge pull request #26 from Anthonyy232/renovate/androidx.compose.ui-ui-test-manifest-1.x
Update dependency androidx.compose.ui:ui-test-manifest to v1.7.0-beta05
2024-07-10 12:30:06 -07:00
Anthony La fb4ffea292 Merge pull request #25 from Anthonyy232/renovate/androidx.compose.ui-ui-test-junit4-1.x
Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.0-beta05
2024-07-10 12:29:58 -07:00
Anthony La 7570ab5405 Merge pull request #24 from Anthonyy232/renovate/androidx.compose.ui-ui-graphics-1.x
Update dependency androidx.compose.ui:ui-graphics to v1.7.0-beta05
2024-07-10 12:29:50 -07:00
renovate[bot] 8899c5c743 Update dependency androidx.compose.ui:ui-graphics to v1.7.0-beta05 2024-07-10 19:29:46 +00:00
Anthony La cc69b4b63b Merge pull request #23 from Anthonyy232/renovate/androidx.compose.ui-ui-1.x
Update dependency androidx.compose.ui:ui to v1.7.0-beta05
2024-07-10 12:29:04 -07:00
Anthony La 0f77761380 Merge pull request #22 from Anthonyy232/renovate/androidx.compose.material-material-icons-extended-1.x
Update dependency androidx.compose.material:material-icons-extended to v1.7.0-beta05
2024-07-10 12:28:55 -07:00
Anthony La cdf124319f Merge pull request #21 from Anthonyy232/renovate/androidx.compose.material-material-1.x
Update dependency androidx.compose.material:material to v1.7.0-beta05
2024-07-10 12:28:43 -07:00
Anthony La 63fe703a6d Merge pull request #20 from Anthonyy232/renovate/androidx.compose.foundation-foundation-1.x
Update dependency androidx.compose.foundation:foundation to v1.7.0-beta05
2024-07-10 12:28:27 -07:00
Anthony La 84043b06e7 Merge pull request #19 from Anthonyy232/renovate/androidx.compose.animation-animation-1.x
Update dependency androidx.compose.animation:animation to v1.7.0-beta05
2024-07-10 12:28:17 -07:00
Anthony La bf35b34ce2 Merge pull request #28 from Anthonyy232/renovate/androidx.compose.ui-ui-tooling-preview-1.x
Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.0-beta05
2024-07-10 12:27:43 -07:00
renovate[bot] 1cde08bef6 Update dependency androidx.compose.material:material to v1.7.0-beta05 2024-07-10 19:27:20 +00:00
Anthony La e37f7e36db Merge pull request #29 from Anthonyy232/renovate/androidx.navigation-navigation-compose-2.x
Update dependency androidx.navigation:navigation-compose to v2.8.0-beta05
2024-07-10 12:26:43 -07:00
renovate[bot] e6c6184c9d Update dependency androidx.navigation:navigation-compose to v2.8.0-beta05 2024-07-10 19:25:45 +00:00
renovate[bot] 512637b23c Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.0-beta05 2024-07-10 19:25:42 +00:00
renovate[bot] 398e43469f Update dependency androidx.compose.ui:ui-test-manifest to v1.7.0-beta05 2024-07-10 19:25:36 +00:00
renovate[bot] 1f5cab1d5b Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.0-beta05 2024-07-10 19:25:33 +00:00
renovate[bot] a185c727a2 Update dependency androidx.compose.ui:ui to v1.7.0-beta05 2024-07-10 19:25:27 +00:00
renovate[bot] 28b9a74c3d Update dependency androidx.compose.material:material-icons-extended to v1.7.0-beta05 2024-07-10 19:25:23 +00:00
renovate[bot] 2e8d8b8603 Update dependency androidx.compose.foundation:foundation to v1.7.0-beta05 2024-07-10 19:14:35 +00:00
renovate[bot] a0a4bc9e4e Update dependency androidx.compose.animation:animation to v1.7.0-beta05 2024-07-10 19:14:31 +00:00
Anthony La 97c23f9d44 Update README.md 2024-07-09 10:19:15 -07:00
Anthonyy232 bde2f7dd1f Removed unused imports 2024-07-09 10:17:45 -07:00
Anthonyy232 d005102716 Fixed device dynamic theming issue not correctly sourcing from the home screen wallpaper 2024-07-09 10:17:45 -07:00
Anthony La 953dc65428 Merge pull request #15 from Anthonyy232/renovate/composeoptions-1.x
Update dependency composeOptions to v1.5.14
2024-07-09 10:15:21 -07:00
Anthony La 69f8a09ceb Merge pull request #16 from Anthonyy232/renovate/com.google.devtools.ksp-2.x
Update plugin com.google.devtools.ksp to v2.0.0-1.0.22
2024-07-09 10:14:41 -07:00
renovate[bot] bf56df28fa Update plugin com.google.devtools.ksp to v2.0.0-1.0.22 2024-07-09 17:14:18 +00:00
Anthony La 3e49bc1836 Merge pull request #18 from Anthonyy232/renovate/com.mikepenz.aboutlibraries.plugin-11.x
Update plugin com.mikepenz.aboutlibraries.plugin to v11.2.2
2024-07-09 10:13:51 -07:00
renovate[bot] ad069e5e9f Update plugin com.mikepenz.aboutlibraries.plugin to v11.2.2 2024-07-08 23:48:32 +00:00
renovate[bot] 5adfac4db2 Update dependency composeOptions to v1.5.14 2024-07-07 16:13:24 +00:00
Anthony La 1ecfa1566f Merge pull request #14 from Anthonyy232/renovate/configure
Configure Renovate
2024-07-07 09:12:46 -07:00
renovate[bot] 724cb5e9f5 Add renovate.json 2024-07-07 16:11:33 +00:00
Anthony La 69a9f36100 Update README.md 2024-07-06 18:27:31 -07:00
Anthonyy232 450dfed0a3 Updated Chinese simplified and Arabic translations 2024-07-06 18:25:52 -07:00
Anthonyy232 c1404ec522 Updated dependencies
Updated navigation for FolderView to type-safe navigation
Updated error checking for tab navigation
2024-07-05 11:19:22 -07:00
Anthony La bcff2f338f Updated version code for F-Droid release 2024-06-18 16:48:03 -07:00
Anthony La 5582a5851f Update README.md 2024-06-15 18:20:49 -07:00
Anthony La 1d0794d135 Updated Serialization version to 2.0.0
Updated Dagger Hilt to 2.51.1
Updated Accompanist to 0.35.1-alpha-03
Updated Zoomable to 2.0.0-beta-03
2024-06-15 18:19:28 -07:00
Anthonyy232 0e20f211f2 Removed android.permission.USE_EXACT_ALARM 2024-06-14 09:07:34 -07:00
Anthonyy232 6f4a2bec97 Push gradle-wrapper.jar 2024-06-13 02:16:47 -07:00
Anthonyy232 85e5e3007b Removed delay notification on first set as it no longer applies due to shift from foreground service to alarm approach
Changed wallpaper scaling 4x->1x to reduce required RAM usage and optimize computation time. Verified that the difference is marginal
2024-06-13 02:15:54 -07:00
Anthonyy232 4760ab01d5 Added additional error catching
Updated Kotlin to 2.0.0
Updated KSP to 2.0.0
Updated AboutLibraries to 11.2.1
2024-06-11 12:18:22 -07:00
Anthonyy232 d8fc106a89 Refactored refreshing album method to separate service call 2024-06-11 02:00:32 -07:00
Anthonyy232 f4bf2786de Updated version code 2024-06-07 23:25:56 -07:00
Anthonyy232 c2e7e38f97 Updated localization
Credit to Jesse205 for Simplified Chinese
Credit to abdalmoniem for Egyptian Arabic
2024-06-07 23:16:04 -07:00
Anthonyy232 343d358d22 Refactored code to be more readable 2024-06-07 12:10:13 -07:00
Anthonyy232 c219aa2b30 Merge remote-tracking branch 'origin/master' 2024-06-06 17:48:28 -07:00
Anthonyy232 5ba325b93f Fixed default behavior to not restore app data when reinstalled
Fixed proguard-rules.pro making stack trace difficult to interpret
Updated version code
2024-06-06 17:48:17 -07:00
Anthony La dc1a65f234 Update README.md 2024-06-05 10:43:30 -07:00
Anthonyy232 48a198091e Updated NDK version and removed generated timestamps from AboutLibraries 2024-06-05 10:22:25 -07:00
Anthonyy232 81020c9ba0 Updated full description metadata
Fixed gradle wrapper version
2024-06-04 20:43:30 -07:00
Anthonyy232 c47f3957bf Updated ShaSum for Gradle wrapper 2024-06-04 19:39:31 -07:00
Anthonyy232 68e94fe284 Updated metadata for FDroid release 2024-06-04 19:00:21 -07:00
Anthonyy232 265edf8f63 Enable auto restart for alarm manager when opening the app 2024-06-04 18:32:26 -07:00
Anthonyy232 322a10bf0c Fixed users adding empty folder 2024-06-04 14:51:18 -07:00
Anthonyy232 f6688c84ab Fix checking permission for schedule exact alarm on Android 14 2024-06-04 12:46:13 -07:00
Anthony La 62a5934220 Update README.md 2024-06-04 11:20:38 -07:00
Anthony La 64dedae516 Merge pull request #12 from Anthonyy232/fix-schedule
Migrate wallpaper changer functionality from foreground service to alarm manager
2024-06-04 11:10:26 -07:00
Anthonyy232 1ff2539574 Updated version code 2024-06-04 10:54:22 -07:00
Anthonyy232 219a4cdb52 Changed gradle to include debug symbols automatically 2024-06-04 10:51:42 -07:00
Anthonyy232 322e6907ab Updated gradle to 8.8
Fixed ImageDecoder error on API 26
2024-06-04 10:39:38 -07:00
Anthonyy232 c39527b3b5 Reduced delay for delaying album
Fixed an issue where DocumentFileCompat would cause a crash on API 26
Fixed an issue where a folder with no name or protected folders like Downloads folder would cause a crash
2024-06-02 22:49:03 -07:00
Anthonyy232 068f78f86c Fixed album wallpapers not being refreshed before changing wallpapers
Fixed album cover art not being refreshed
2024-06-02 16:09:17 -07:00
Anthonyy232 87ef7ebaf0 Fixed notifications showing wrong time 2024-06-02 12:43:46 -07:00
Anthonyy232 996208b03d Migrated wallpaper changer functionality to alarm manager-service approach to improve reliability for long intervals
Fixed navigation bug when resetting from settings or going from notifications page to home page navigating twice
2024-06-02 02:08:27 -07:00
Anthonyy232 ec54bbb8c5 Fixed navigation bug when going to home screen 2024-05-31 01:29:58 -07:00
Anthonyy232 b52a47770d Fixed album not deleting when it is empty 2024-05-27 18:48:38 -07:00
Anthonyy232 61e3144de4 Merge remote-tracking branch 'origin/master' 2024-05-27 14:51:28 -07:00
Anthonyy232 895af4f865 Fixed service to check for folder updates if last ran over 24 hours ago
Replaced DocumentFileCompat.fromSingleUri with DocumentFIle.fromSingleUri due to bug in library when calling null URIs
Refactored code for updating album
2024-05-27 14:50:55 -07:00
Anthony La c956f6a3e3 Update README.md 2024-05-27 11:29:26 -07:00
Anthonyy232 d52effa343 Updated code for displaying delay notice
Removed unused imports
Updated machine translations
2024-05-27 01:29:59 -07:00
Anthonyy232 4313e4a442 Fixed schedule not showing properly for certain devices due to OEM differences
Fixed notification displaying the wrong time
Added a notice when selecting an album for the first time to let users know of potential delays
2024-05-27 01:19:17 -07:00
Anthonyy232 9ecc96e92b Fixed schedule not showing properly for certain devices due to OEM differences
Fixed notification displaying the wrong time
2024-05-27 00:51:13 -07:00
Anthonyy232 3df28a3a9a Updated play-store link click 2024-05-26 20:57:51 -07:00
Anthonyy232 fff8b241c0 Remove unused imports 2024-05-26 20:55:06 -07:00
Anthonyy232 46d1284550 Added play-store link
Fixed settings page appearing wrong on Pixel devices
Fixed bottom sheet on SDK less than 28
Updated project to Kotlin compiler 2.0
Updated AGP to 8.4.1
2024-05-26 20:45:49 -07:00
Anthonyy232 25717d83fd Fixed next set time retrieval selecting the wrong time
Updated machine translations
2024-05-24 15:13:25 -07:00
Anthonyy232 bca711a50d Changed key for lazy column to URI since there won't be duplicates
Removed unused imports
2024-05-23 20:24:56 -07:00
Anthonyy232 0449a93b31 Updated notifications screen 2024-05-23 12:17:45 -07:00
Anthonyy232 58b24e50ff Added separate scheduling for lock screen
Added option to allow only changing lock screen
Updated wallpaper screen UI to match options selected
Updated wallpaper retrieval method to support lock and home screen separation in scheduling
Fixed issue where pressing back would sometimes freeze up
2024-05-23 01:57:54 -07:00
Anthonyy232 0cc477b7e8 Fixed "Add images" text on FAB disappearing at the end of animation
Fixed scheduling wrong time for wallpaper changing on startup
2024-05-18 19:13:37 -07:00
Anthony La 4117ffb90a Update README.md 2024-05-18 01:26:41 -07:00
Anthony La a8302ff3e2 Update README.md 2024-05-18 01:26:22 -07:00
Anthonyy232 5d9e87ff63 Added wallpaper brightness feature and wallpaper scaling options (fill, stretch, fit)
Enable compiler strong skipping
Updated compose dependencies to 1.7.0-beta01
Added detection for live wallpaper causing wallpaper not to change
Fixed restarting service when opening the app
Fixed content scaling of wallpaper item
Fixed orientation change causing a black screen due to splash screen
Updated translations
2024-05-17 22:52:44 -07:00
Anthonyy232 9a5b40ba7f Added additional machine translation 2024-05-17 22:52:44 -07:00
Anthonyy232 dab5e4fe97 Added larger notification icon
Added date localization for strings
Added additional machine translation
2024-05-17 22:52:44 -07:00
Anthony La a635595ade Update README.md 2024-05-16 15:06:19 -07:00
Anthonyy232 f6fb087104 Added screenshots and fixed fetching version number in settings 2024-05-14 19:06:40 -07:00
Anthony La e3f56445d8 Update README.md 2024-05-14 18:57:35 -07:00
Anthonyy232 d8d6d4897d Updated translations 2024-05-14 14:24:02 -07:00
Anthonyy232 626b0a4de5 Fixed animations
Fixed an issue where selecting an album and then canceling it immediately would sometimes occur out of order due to async nature
2024-05-13 23:47:57 -07:00
Anthonyy232 742d14ae3b Fixed machine translation
Added translations link in settings page
2024-05-13 16:11:08 -07:00
Anthonyy232 a58a0c1e9a Fixed machine translation
Added translations link in settings page
2024-05-13 16:11:07 -07:00
Anthony La 7b216d5534 Update README.md 2024-05-13 15:25:11 -07:00
Anthonyy232 65e4f38f83 Added machine translation for jv 2024-05-13 15:09:56 -07:00
Anthonyy232 fe43b4f631 Fixed settings back navigation crashing
Replaced prior machine translation with better ones
2024-05-13 15:09:22 -07:00
Anthonyy232 7aab2a39d9 Fixed string formatting 2024-05-12 23:36:23 -07:00
Anthony La 162d73e4e0 Update README.md 2024-05-12 23:36:07 -07:00
Anthony La 0f49241d7b Update README.md 2024-05-12 22:50:22 -07:00
Anthonyy232 df1bc642fc Added per-app language support with Google-translated strings.xml
Removed unused imports
Refactored code for adding and removing wallpapers and folders
2024-05-12 22:46:00 -07:00
Anthonyy232 8eb9cb2aaa Fixed adding folder issue to already created album
Removed predictive back gestures due to unstable crashing
Refactored viewmodel code for adding and removing wallpaper and folders
Changed string literals to string resources
2024-05-12 15:11:15 -07:00
Anthonyy232 3f412f4724 Fixed an issue where the app crashes on API 30 due to splash screen animation 2024-05-12 11:26:07 -07:00
Anthonyy232 047d519e80 Added changelog 2024-05-11 00:40:13 -07:00
Anthonyy232 b4041cc8ea Removed unnecessary files
Added adaptive icon for app icon
Refactored some viewmodel code to use Dispatchers IO thread
Updated splashscreen waiting and initial data loading
2024-05-11 00:29:00 -07:00
Anthonyy232 fc57f14d2a Added toggle for enabling wallpaper changer
Refactored code for adding album
Removed redundant code in WallpaperScreen
Fixed wallpaper service handling when wallpaper is inaccessible
Fixed issue where users could select albums with no valid wallpapers
Updated version to 1.1.0
Updated album model to include current set wallpaper. Added database migration accordingly
Added function to change wallpaper on home/lock preview depending on latest wallpaper set
2024-05-10 20:34:25 -07:00
Anthonyy232 4fd1e06b8e Changed some instance of DocumentFile to DocumentFileCompat
Fixed pressing back on settings page would sometimes close the app
2024-05-10 18:24:30 -07:00
Anthonyy232 6a08e0eff9 Updated extension support for uppercase 2024-05-10 18:24:30 -07:00
Anthonyy232 d7edb40a9b Added visual cue for album being set to indicate what to press
Changed the shape of snackbar in notifications screen
2024-05-10 18:24:29 -07:00
Anthonyy232 ac889ed7b1 Fixed issue with incorrect feature in AndroidManifest.xml 2024-05-09 15:09:07 -07:00
Anthonyy232 c97f9f7e3d Fixed crash due to importing folder caused by type-safe navigation compose bug
Updated version number and version code for 1.0.1
2024-05-09 12:53:37 -07:00
Anthonyy232 4429355a1e Added metadata information to project 2024-05-08 22:28:24 -07:00
Anthony La 00fbdf1e42 Update README.md 2024-05-04 14:14:43 -07:00
Anthonyy232 48aefd2aaa Fixed clearing content URIs on first launch would always remove due to syncing issue 2024-05-04 13:59:29 -07:00
Anthonyy232 2c3330742e Fixed issue where decoding aspect ratio would crash due to division by 0 because ExifInterface doesn't support other image formats other than JPG 2024-05-03 20:59:19 -07:00
Anthonyy232 8022aa0f01 Updated color for reset button 2024-05-03 11:20:12 -07:00
Anthonyy232 10397bbbbf Added reset button to settings to reset all data
Fixed back gesture not operating intuitively
Added reset events to all viewmodels to allow resetting data
Added delete all dao method for albums
Added check to revoke persistent URIs when reset
2024-05-03 01:00:50 -07:00
Anthonyy232 379d6b21be Hoisted settings state up to PaperizeApp.kt for WallpaperScreen.kt
Fixed disabling animation for WallpaperScreen.kt
Updated color for AlbumBottomSheet
Rounded corners for snackbars
2024-05-02 23:38:21 -07:00
Anthonyy232 41b32f3154 Reverted version number back to 1.0.0 (previously skipped) and bumped version code to 4 2024-05-02 14:14:11 -07:00
Anthonyy232 1906a3f170 Updated dependencies
Updated Kotlin 1.9.22
Updated Compose compiler to 1.5.10
Refactored navigation and implemented type-safe navigation from navigation-compose:2.8.0-alpha08
Updated the version code to 1.1.0
Updated SetLockScreen component to show a fixed aspect ratio of 9:19.5 and disable clicking splash
Updated FAB color due to dependencies update breaking visual design
Added option to disable loading animation for images in the app
Added option to disable grid change animation
2024-05-02 14:09:15 -07:00
Anthony La f9207309a8 Rename main.html to index.html 2024-05-02 09:53:50 -07:00
Anthony La ca31e655ac Update README.md 2024-05-02 09:49:30 -07:00
Anthony La 047b2197e0 Update README.md 2024-05-01 16:50:43 -07:00
Anthonyy232 685168b0a6 Merge remote-tracking branch 'origin/master' 2024-05-01 16:19:36 -07:00
Anthonyy232 d0fd31cf8c Add privacy policy to HTML page for Github page 2024-05-01 16:19:30 -07:00
Anthony La 30783c6806 Create static.yml 2024-05-01 16:10:22 -07:00
Anthony La 96f2a1337e Update README.md 2024-05-01 15:25:56 -07:00
Anthonyy232 e0c0fee8f0 Updated version name and version code 2024-05-01 15:17:34 -07:00
Anthonyy232 060e1b8a07 Added app icon, github icon, f-droid icon, play-store icon, and notification icon.
Added item to settings page with links for app
2024-05-01 15:11:57 -07:00
Anthonyy232 19fc3a34e3 Updated android gradle to 8.4.0
Updated gradle to 8.7.0
Updated phrasing in privacy screen
2024-04-30 13:48:32 -07:00
Anthonyy232 18582c2291 Updated privacy policy and changed privacy screen to be more friendly and approachable. 2024-04-30 10:54:15 -07:00
Anthonyy232 ea9977c511 Update dependencies compose 1.7.0-alpha07 2024-04-30 10:43:32 -07:00
Anthonyy232 c84b1c47ea Added credit for startup screen as comment and updated version number 2024-04-30 00:56:31 -07:00
Anthonyy232 902be61924 Merge remote-tracking branch 'origin/master' 2024-04-30 00:10:51 -07:00
Anthonyy232 e9f6861d60 Refactored code in AddAlbumViewModel for adding wallpapers and folders.
Added functionality to add wallpapers and folders to already created albums in AlbumViewScreen.
Added restart service functionality when selected album changes state.
2024-04-30 00:09:23 -07:00
Anthonyy232 8f0c5aa309 Updated dependencies and added animation for LazyStaggeredVerticalGrid when reordering 2024-04-29 22:22:22 -07:00
Anthony La a32ca75126 Update README.md 2024-04-29 21:20:26 -07:00
317 changed files with 23655 additions and 8570 deletions

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
# These are supported funding model platforms
github: Anthonyy232
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+32
View File
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug] <BUG_NAME>"
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Smartphone (please complete the following information):**
- Device: [e.g. Pixel 32 Pro]
- OS: [e.g. OneUI 21]
- Version [e.g. v2.1.0]
**Additional context**
Add any other context about the problem here.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature request] <FEATURE_NAME>"
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+162
View File
@@ -0,0 +1,162 @@
# ===================================================================
# Paperize CI/CD Pipeline
#
# Automates the testing, building and release process for the Paperize Android application.
#
# Workflow Architecture:
# 1. Test: Runs unit tests to ensure code quality.
# 2. Build: Compiles and signs the release APK (depends on test passing).
# 3. Release: Publishes the APK to a draft GitHub Release, but only for version tags.
#
# Triggering Conditions:
# - On push to `master`:
# - Executes the `test` and `build` jobs.
# - Produces a versioned build artifact for testing and internal distribution.
# - On push of a tag (e.g., `v1.2.3`):
# - Executes all jobs: `test`, `build` and `release`.
# - Creates a formal, versioned draft release on GitHub with the signed APK attached.
# - On pull requests to `master`:
# - Executes only the `test` job to validate changes before merge.
# ===================================================================
name: Paperize CI/CD Pipeline
on:
push:
branches: [ "master" ]
tags: [ 'v*' ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
# ===================================================================
# JOB: test
#
# Runs unit tests to ensure code quality before building.
# ===================================================================
test:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository source code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Set up JDK 17
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run unit tests
run: ./gradlew clean test
# ===================================================================
# JOB: build
#
# Compiles, signs, and packages the release APK. This job produces a
# versioned artifact that is used for both internal testing and the final release.
# Only runs after tests pass.
# ===================================================================
build:
name: Build Signed APK
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push'
steps:
- name: Checkout repository source code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Set up JDK 17
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
# The gradlew wrapper requires execute permissions to run on the Linux-based runner.
run: chmod +x gradlew
- name: Decode Base64 Keystore
# Reconstructs the binary .jks keystore file from the Base64 encoded secret.
env:
SIGNING_KEYSTORE_BASE64: ${{ secrets.SIGNING_KEYSTORE_BASE64 }}
run: |
echo $SIGNING_KEYSTORE_BASE64 | base64 --decode > ${{ github.workspace }}/keystore.jks
- name: Build Release APK
env:
SIGNING_KEYSTORE_PATH: ${{ github.workspace }}/keystore.jks
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
run: ./gradlew assembleRelease
- name: Get Version Name
# Determines the application version for artifact naming.
# - For tag pushes (e.g., 'v1.2.3'), it uses the tag name directly.
# - For master branch pushes, it parses the `versionName` from the app's build.gradle.kts file.
id: get_version
shell: bash
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
VERSION_NAME=${GITHUB_REF_NAME}
else
RAW_VERSION=$(grep "versionName =" app/build.gradle.kts | awk -F'"' '{print $2}')
VERSION_NAME="v${RAW_VERSION}"
fi
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_OUTPUT
- name: Name APK for distribution
shell: bash
run: |
mv app/build/outputs/apk/release/app-release.apk \
"app/build/outputs/apk/release/paperize-${{ steps.get_version.outputs.VERSION_NAME }}.apk"
- name: Upload APK as a build artifact
# Archives the generated APK with a dynamic, versioned name. This artifact is essential
# for passing the APK file to the subsequent `release` job.
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: paperize-${{ steps.get_version.outputs.VERSION_NAME }}
path: app/build/outputs/apk/release/paperize-${{ steps.get_version.outputs.VERSION_NAME }}.apk
if-no-files-found: error
# ===================================================================
# JOB: release
#
# Creates a draft GitHub Release and attaches the signed APK. This job is
# conditional and will only execute for pushes that include a version tag.
# ===================================================================
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download signed APK artifact
# Downloads the versioned artifact produced by the `build` job. The pattern ensures
# it finds the correct artifact regardless of the specific version number.
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
pattern: paperize-v*
path: ./apk-artifact
merge-multiple: true
- name: Create Draft Release
# Publishes a new release to GitHub. `draft: true` ensures the release is not made
# public until it has been manually reviewed and published.
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3
with:
files: ./apk-artifact/paperize-v*.apk
draft: true
generate_release_notes: true
+59
View File
@@ -0,0 +1,59 @@
name: CodeQL
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "24 6 * * 3"
permissions:
contents: read
security-events: write
jobs:
analyze-actions:
name: Analyze GitHub Actions
runs-on: ubuntu-latest
steps:
- name: Checkout repository source code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Initialize CodeQL
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4
with:
languages: actions
build-mode: none
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4
analyze-java-kotlin:
name: Analyze Java and Kotlin
runs-on: ubuntu-latest
steps:
- name: Checkout repository source code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Set up JDK 17
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5
with:
java-version: "17"
distribution: temurin
cache: gradle
- name: Initialize CodeQL
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4
with:
languages: java-kotlin
build-mode: manual
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build application for analysis
run: ./gradlew assembleDebug
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4
+6
View File
@@ -1,5 +1,6 @@
*.iml
.gradle
.idea
/local.properties
/.idea/caches
/.idea/libraries
@@ -13,3 +14,8 @@
.externalNativeBuild
.cxx
local.properties
/app/build
/app/release
/app/schemas
.kotlin
/.kotlin/sessions
-3
View File
@@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
Generated
-1
View File
@@ -1 +0,0 @@
Paperize
-26
View File
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AppInsightsSettings">
<option name="tabSettings">
<map>
<entry key="Firebase Crashlytics">
<value>
<InsightsFilterSettings>
<option name="connection">
<ConnectionSetting>
<option name="appId" value="PLACEHOLDER" />
<option name="mobileSdkAppId" value="" />
<option name="projectId" value="" />
<option name="projectNumber" value="" />
</ConnectionSetting>
</option>
<option name="signal" value="SIGNAL_UNSPECIFIED" />
<option name="timeIntervalDays" value="THIRTY_DAYS" />
<option name="visibilityType" value="ALL" />
</InsightsFilterSettings>
</value>
</entry>
</map>
</option>
</component>
</project>
-123
View File
@@ -1,123 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>
-5
View File
@@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>
-23
View File
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="Paperize">
<State>
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="SERIAL_NUMBER" />
<value value="RFCTA1MRS4H" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2024-04-24T06:32:43.708081Z" />
</State>
</entry>
</value>
</component>
</project>
-19
View File
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="jbr-17" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
-32
View File
@@ -1,32 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
</profile>
</component>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.0" />
</component>
</project>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>
-54
View File
@@ -1,54 +0,0 @@
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="androidx.annotation.Nullable" />
<option name="myDefaultNotNull" value="androidx.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="15">
<item index="0" class="java.lang.String" itemvalue="org.jspecify.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
<item index="2" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="3" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="4" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
<item index="7" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="8" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="9" class="java.lang.String" itemvalue="jakarta.annotation.Nullable" />
<item index="10" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="11" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="12" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="13" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
<item index="14" class="java.lang.String" itemvalue="android.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="14">
<item index="0" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="1" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="2" class="java.lang.String" itemvalue="org.jspecify.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="jakarta.annotation.Nonnull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
<item index="6" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="7" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
<item index="8" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="10" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="11" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="12" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
<item index="13" class="java.lang.String" itemvalue="android.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
Generated
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
+81
View File
@@ -0,0 +1,81 @@
## v4.0.3
- Kept scheduled static changes in the device's natural orientation, even when a
landscape game or app is in the foreground.
- Rendered FIT, FILL, STRETCH, and NONE against one physical display panel to fix
black canvases, excessive stretching, zoom, and inconsistent home/lock alignment.
- Restored centered static FILL behavior by default and added an explicit horizontal
scrolling option for users who want wide wallpapers to move across home pages.
- Added a persistent pause/resume control that keeps selected albums intact, while
leaving manual static and live wallpaper changes available when paused.
- Removed the unnecessary network-state permission and unused network image loader.
- Updated Hilt and the coroutine test library and expanded rotation, scaling,
scrolling, pause/resume, static-effect, live-renderer, and scheduler verification.
**Full Changelog**: https://github.com/Anthonyy232/Paperize/compare/v4.0.2...v4.0.3
## v4.0.2
- Reloaded the current live wallpaper at native resolution after fold, unfold,
surface-size, and scaling changes without advancing the wallpaper queue.
- Made adaptive brightness update the wallpaper already on screen and removed
the brightness dip that could occur halfway through live crossfades.
- Kept live vignette shading continuous across large images split into multiple
GPU texture tiles.
- Prevented a delayed effect-slider save from overwriting a switch or other
setting changed immediately afterward.
- Restored the launcher app shortcut for gesture apps and other launchers, with
automatic routing to the configured static or live wallpaper engine.
- Added the missing daily album refresh to live schedules and hardened boot
recovery so valid jobs are restored without duplicates and stale jobs are removed.
- Removed two unused legacy serialization and document-file dependencies from
the release package.
- Expanded device coverage for every static effect and verified synchronized,
independent, manual, live, and reboot scheduling paths.
**Full Changelog**: https://github.com/Anthonyy232/Paperize/compare/v4.0.1...v4.0.2
## v4.0.1
- Restored native static FILL scrolling so wide wallpapers move between their real
left and right edges without synthetic launcher-sized overflow.
- Added independent brightness, blur, vignette, and grayscale controls for home
and lock screens, including when both screens share one album and schedule.
- Refreshed folder-backed albums whenever Paperize returns to the foreground so
added and removed files appear without restarting the app.
- Improved foldable sizing on Android 17 by including inactive built-in panels
while excluding external displays.
- Made wallpaper changes commit queue and current-wallpaper state only after
Android accepts the bitmap, with rejected changes restored for retry.
- Corrected live wallpaper parallax enablement, intensity, edge traversal, and
launcher-offset clamping, and clarified that it responds to home-page swipes.
- Added device regressions for EXIF rotation, static FILL overflow, and folded
display sizing, plus focused queue and live-renderer unit coverage.
**Full Changelog**: https://github.com/Anthonyy232/Paperize/compare/v4.0.0...v4.0.1
## v4.0.0
- Completely rewrote Paperize for Android 12 and newer with a modern Compose interface.
- Added static and live wallpaper modes with independent home and lock screen settings.
- Added scaling, blur, darken, vignette, grayscale, adaptive brightness, parallax,
double-tap, shuffle, interval, and manual wallpaper controls.
- Added current-wallpaper previews, Quick Settings support, and progress indicators
for large wallpaper and folder imports.
- Improved folder scanning, queue refreshes, bitmap memory usage, scheduling, and
wallpaper rendering reliability.
- Fixed home and lock screen synchronization, foldable display sizing, EXIF rotation,
and FIT, FILL, STRETCH, and NONE scaling behavior.
- Removed the obsolete all-files storage permission in favor of Android's scoped
document access.
- Updated dependencies and repaired the release workflow for signed, versioned APKs.
**Upgrade note:** Updating from Paperize 3 resets local albums and settings once
because Paperize 4 uses a new storage model. Users of the 4.0.0 alpha are not reset
again.
## New Contributors
* @gpunto made their first contribution in https://github.com/Anthonyy232/Paperize/pull/415
**Full Changelog**: https://github.com/Anthonyy232/Paperize/compare/v3.2.1...v4.0.0
+92 -50
View File
@@ -1,74 +1,116 @@
<div align="center">
<h1>Paperize</h1>
<p align="center">
</p>
</p>
<p>Paperize is a dynamic wallpaper changer application designed to keep your device's aesthetic fresh and exciting</p>
</div>
<img style="display: block" src="https://github.com/user-attachments/assets/e8fb14f5-ec8e-440e-a2ac-8065322b0e28" alt="">
<h1>Paperize</h1>
<p><strong>A dynamic wallpaper changer that keeps your device's aesthetic fresh and exciting</strong></p>
## Features
- **Dynamic Wallpaper Changer**: Set your wallpaper to change at specific time intervals
- **Supports Various Image Types**: Paperize can handle a wide range of image types, offering you flexibility in your wallpaper choices
- **Folder Support**: Organize your wallpapers into folders for auto-updating
- **Home and Lock Screen Wallpaper**: Choose to change either your home screen, lock screen, or both
- **On-Device Storage**: All your wallpapers and settings are stored on your device
<div align="center">
<br/>
<img src="https://github.com/Anthonyy232/Paperize/assets/60626873/eebec922-70a6-4d54-97d9-ab02cbfb7a36" width="30%" alt="onboarding" />
<img src="https://github.com/Anthonyy232/Paperize/assets/60626873/60a4d68d-5e19-49f2-8822-e702d02651c6" width="30%" alt="wallpaper" />
<img src="https://github.com/Anthonyy232/Paperize/assets/60626873/e106c0dc-23ff-4f4a-adfc-5ebe93219ae0" width="30%" alt="album" />
<img src="https://github.com/Anthonyy232/Paperize/assets/60626873/7093a1ea-91ab-4da8-a82b-43e24d88d376" width="30%" alt="settings" />
<img src="https://github.com/Anthonyy232/Paperize/assets/60626873/54ebd285-8da4-4446-83f1-ba0e7ee9476d" width="30%" alt="adding" />
<br/>
[![GitHub Downloads](https://img.shields.io/github/downloads/Anthonyy232/Paperize/total?style=flat&logo=github&label=Downloads)](https://github.com/Anthonyy232/Paperize/releases)
[![GitHub Release](https://img.shields.io/github/v/release/Anthonyy232/Paperize?style=flat&logo=github)](https://github.com/Anthonyy232/Paperize/releases/latest)
[![License](https://img.shields.io/github/license/Anthonyy232/Paperize?style=flat)](LICENSE)
[![F-Droid](https://img.shields.io/f-droid/v/com.anthonyla.paperize?style=flat&logo=fdroid)](https://f-droid.org/en/packages/com.anthonyla.paperize/)
[![Crowdin](https://badges.crowdin.net/paperize/localized.svg)](https://crowdin.com/project/paperize)
</div>
---
## Features
- **Dynamic Wallpaper Changer** — Set your wallpaper to change at specific time intervals
- **Static & Live Wallpapers** — Choose between traditional static wallpapers or smooth live wallpaper transitions
- **Multiple Image Formats** — Supports JPG, PNG, WEBP, AVIF, HEIC/HEIF, BMP, GIF, TIFF, and SVG
- **Folder Support** — Organize wallpapers into folders for auto-updating
- **Dual Screen Support** — Choose the same or separate albums for home and lock screen
- **Wallpaper Effects** — Apply various effects including brightness, blur, scaling, vignette, and more
- **On-Device Storage** — All wallpapers and settings stored locally on your device
---
## Download
[<img src="https://github.com/Anthonyy232/Paperize/assets/60626873/1c034414-21cd-4a0a-838d-89fe7bd56910" alt="Download app from GitHub" height="80">](https://github.com/Anthonyy232/Paperize/releases)
[<img src="https://github.com/Anthonyy232/Paperize/assets/60626873/1c034414-21cd-4a0a-838d-89fe7bd56910" alt="Download from GitHub" height="60">](https://github.com/Anthonyy232/Paperize/releases)
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="60">](https://f-droid.org/en/packages/com.anthonyla.paperize/)
[<img src="https://gitlab.com/IzzyOnDroid/repo/-/raw/master/assets/IzzyOnDroid.png" alt="Get it on IzzyOnDroid" height="60">](https://apt.izzysoft.de/fdroid/index/apk/com.anthonyla.paperize)
Playstore and F-Droid will be added soon
---
## Technologies
## Localization
- [Kotlin]([https://kotlinlang.org/) - A programming language that is used for Android app development
- [Jetpack Compose](https://developer.android.com/develop/ui/compose) - A declarative UI toolkit for building native Android UI
- [Material 3](https://m3.material.io/) - A UI design system git for modern UI guidelines
- [Dagger Hilt](https://dagger.dev/hilt/) - A dependency injection library
- [Room](https://developer.android.com/training/data-storage/room) - A persistence library that provides an abstraction layer over SQLite interfacing with Kotlin
- [AboutLibraries](https://github.com/mikepenz/AboutLibraries) - A library to offer some information of libraries
- [Lottie Compose](https://github.com/airbnb/lottie) - A library that provides Lottie animation support for Jetpack Compose
- [Landscapist](https://github.com/skydoves/landscapist) - A Compose and KPP image loading library that streamlines Glide, Coil, and Fresco
- [Zoomable](https://github.com/usuiat/Zoomable) - A library that provides a zoomable and pannable view, which can be used with any view you want
Help translate Paperize into your language! Currently, most translations are provided using machine translation — contributions from native speakers are greatly appreciated.
Thanks to the creators and maintainers of the open-source libraries used in this project.
**[Contribute on Crowdin →](https://crowdin.com/project/paperize/invite?h=d8d7a7513d2beb0c96ba9b2a5f85473e2084922)**
---
## Build
## Tech Stack
This project is built using Kotlin, Java, and Gradle. Here are the steps to build the project:
| Category | Technology |
|----------|------------|
| **Language** | [Kotlin](https://kotlinlang.org/) |
| **UI Framework** | [Jetpack Compose](https://developer.android.com/develop/ui/compose) |
| **Design System** | [Material 3](https://m3.material.io/) |
| **Dependency Injection** | [Dagger Hilt](https://dagger.dev/hilt/) |
| **Database** | [Room](https://developer.android.com/training/data-storage/room) |
| **Image Loading** | [Coil](https://coil-kt.github.io/coil/) |
| **Animations** | [Lottie](https://github.com/airbnb/lottie) |
<details>
<summary><b>View all dependencies</b></summary>
- [Zoomable](https://github.com/usuiat/Zoomable) — Zoomable and pannable views
- [DocumentFileCompat](https://github.com/ItzNotABug/DocumentFileCompat) — Efficient DocumentFile wrapper
- [LazyColumnScrollbar](https://github.com/nanihadesuka/LazyColumnScrollbar) — Compose scrollbar library
- [compose-collapsing-toolbar](https://github.com/onebone/compose-collapsing-toolbar) — Collapsing toolbar for Compose
</details>
---
## Building from Source
### Prerequisites
- Java 8 (1.8)
- Android Studio Iguana | 2023.2.1 or later
- Gradle 8.3.2 or later
- Minimum SDK 26
### Steps
- Open a terminal and run the following git command: <pre>git clone https://github.com/Anthonyy232/Paperize.git </pre>
- Launch Android Studio and choose Open an existing Android Studio project. Navigate to the cloned repository and select the root folder of the project.
- In Android Studio, click on Build -> Generate Signed Bundle / APK and follow the instructions to generate an APK
- Alternatively, click `▶ Run` and build the app and run it immediately
| Requirement | Version |
|-------------|---------|
| Java | 17 |
| Android Gradle Plugin | 9.1.0 |
| Gradle | 9.4.1 |
| Minimum SDK | 31 (Android 12) |
| Target SDK | 36 |
### Build Steps
## Contributions
1. **Clone the repository**
```bash
git clone https://github.com/Anthonyy232/Paperize.git
cd Paperize
```
All contributions to the app is welcome. Feel free to report any issues and create pull requests for any issues or pull requests.
2. **Open in Android Studio**
- Launch Android Studio
- Select `File > Open` and navigate to the cloned repository
3. **Build and Run**
- Click `▶ Run` to build and install on a connected device, or
- Select `Build > Generate Signed Bundle / APK` to create a signed release
---
## Contributing
Contributions are welcome! Feel free to:
- Report bugs by opening an issue
- Suggest features or improvements
- Submit pull requests
---
## Support
If you find Paperize useful, consider supporting development through [GitHub Sponsors](https://github.com/sponsors/Anthonyy232) (one-time or monthly). Thank you!
---
## License
Contact on my GitHub profile
Paperize © GNU GPL v3.0
This project is licensed under the **GNU General Public License v3.0** — see the [LICENSE](LICENSE) file for details.
+97 -61
View File
@@ -1,23 +1,39 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp")
id("com.google.dagger.hilt.android")
id ("com.mikepenz.aboutlibraries.plugin")
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinCompose)
alias(libs.plugins.hiltAndroid)
alias(libs.plugins.ksp)
alias(libs.plugins.kotlinSerialization)
}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
android {
namespace = "com.anthonyla.paperize"
compileSdk = 34
compileSdk = 36
signingConfigs {
create("release") {
val storeFilePath = System.getenv("SIGNING_KEYSTORE_PATH")
if (storeFilePath != null) {
storeFile = file(storeFilePath)
storePassword = System.getenv("SIGNING_STORE_PASSWORD")
keyAlias = System.getenv("SIGNING_KEY_ALIAS")
keyPassword = System.getenv("SIGNING_KEY_PASSWORD")
}
}
}
defaultConfig {
applicationId = "com.anthonyla.paperize"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.0"
minSdk = 31
targetSdk = 36
versionCode = 54
versionName = "4.0.3"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
@@ -28,73 +44,93 @@ android {
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("release")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
compose = true
viewBinding = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
androidResources {
@Suppress("UnstableApiUsage")
generateLocaleConfig = true
}
dependenciesInfo {
includeInApk = false
includeInBundle = false
}
}
androidComponents {
onVariants(selector().withBuildType("release")) {
it.packaging.resources.excludes.add("META-INF/**")
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
dependencies {
implementation("androidx.core:core-ktx:1.13.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.9.0")
implementation(platform("androidx.compose:compose-bom:2024.04.01"))
implementation("androidx.compose.ui:ui:1.6.6")
implementation("androidx.compose.ui:ui-graphics:1.6.6")
implementation("androidx.compose.ui:ui-tooling-preview:1.6.6")
implementation("androidx.compose.material3:material3:1.2.1")
implementation("androidx.navigation:navigation-compose:2.8.0-alpha07")
implementation("androidx.compose.material:material:1.6.6")
implementation("androidx.datastore:datastore:1.1.0")
implementation("androidx.datastore:datastore-preferences:1.1.0")
implementation("androidx.compose.material:material-icons-extended:1.6.6")
implementation("com.google.accompanist:accompanist-adaptive:0.34.0")
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
implementation("androidx.compose.animation:animation:1.7.0-alpha07")
implementation("androidx.core:core-splashscreen:1.1.0-rc01")
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.7.0")
implementation("com.google.code.gson:gson:2.10.1")
implementation("androidx.documentfile:documentfile:1.1.0-alpha01")
implementation("net.engawapg.lib:zoomable:1.7.0-beta02")
implementation("com.github.skydoves:landscapist-glide:2.3.3")
implementation("androidx.work:work-runtime-ktx:2.10.0-alpha02")
implementation("androidx.hilt:hilt-work:1.2.0")
implementation("com.airbnb.android:lottie-compose:6.4.0")
implementation("com.google.accompanist:accompanist-permissions:0.35.0-alpha")
implementation("com.mikepenz:aboutlibraries-core:11.1.3")
implementation("com.mikepenz:aboutlibraries-compose-m3:11.1.3")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.0-alpha03")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.6.6")
debugImplementation("androidx.compose.ui:ui-tooling:1.6.6")
debugImplementation("androidx.compose.ui:ui-test-manifest:1.6.6")
implementation("com.google.dagger:hilt-android:2.51.1")
ksp("com.google.dagger:hilt-android-compiler:2.51.1")
implementation("androidx.room:room-runtime:2.6.1")
ksp("androidx.room:room-compiler:2.6.1")
implementation("androidx.room:room-ktx:2.6.1")
implementation("com.lazygeniouz:dfc:1.0.8")
}
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.lifecycle.process)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.google.material)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.material)
implementation(libs.coil.compose)
implementation(libs.coil.gif)
implementation(libs.coil.svg)
implementation(libs.androidx.datastore)
implementation(libs.androidx.datastore.preferences)
implementation(libs.androidx.material.icons.extended)
implementation(libs.androidx.hilt.navigation.compose)
implementation(libs.androidx.animation)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.documentfile)
implementation(libs.androidx.exifinterface)
implementation(libs.zoomable)
implementation(libs.androidx.work.runtime.ktx)
implementation(libs.androidx.hilt.work)
implementation(libs.lottie.compose)
implementation(libs.accompanist.permissions)
implementation(libs.androidx.foundation)
implementation(libs.lazycolumnscrollbar)
implementation(libs.androidx.profileinstaller)
implementation(libs.reorderable)
testImplementation(libs.junit)
testImplementation(libs.mockk)
testImplementation(libs.kotlinx.coroutines.test)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(platform(libs.androidx.compose.bom))
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
implementation(libs.hilt.android)
ksp(libs.hilt.android.compiler)
ksp(libs.androidx.hilt.compiler)
implementation(libs.androidx.room.runtime)
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.room.ktx)
implementation (libs.kotlinx.serialization.json)
implementation(libs.toolbar.compose)
}
+34 -9
View File
@@ -14,24 +14,49 @@
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keepattributes Signature
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken
-keep class kotlin.coroutines.Continuation
-keepclassmembers class com.anthonyla.paperize.feature.wallpaper.domain.model.Album {
-keep class androidx.datastore.*.** {*;}
# Keep domain models for serialization
-keepclassmembers class com.anthonyla.paperize.domain.model.Album {
!transient <fields>;
}
-keepclassmembers class com.anthonyla.paperize.feature.wallpaper.domain.model.AlbumWithWallpaper {
-keepclassmembers class com.anthonyla.paperize.domain.model.Wallpaper {
!transient <fields>;
}
-keepclassmembers class com.anthonyla.paperize.feature.wallpaper.domain.model.Wallpaper {
!transient <fields>;
}
-keepclassmembers class com.anthonyla.paperize.feature.wallpaper.domain.model.Folder {
-keepclassmembers class com.anthonyla.paperize.domain.model.Folder {
!transient <fields>;
}
# Keep database entities
-keep class com.anthonyla.paperize.data.database.entities.** { *; }
# Keep wallpaper service
-keep class com.anthonyla.paperize.service.wallpaper.WallpaperChangeService { *; }
-keep class com.anthonyla.paperize.service.wallpaper.WallpaperChangeService$* { *; }
# Keep enums
-keep class com.anthonyla.paperize.core.WallpaperSourceType { *; }
-keep class com.anthonyla.paperize.core.ScreenType { *; }
-keep class com.anthonyla.paperize.core.ScalingType { *; }
# Keep navigation routes for serialization
-keep class com.anthonyla.paperize.presentation.common.navigation.** { *; }
# Keep Hilt generated classes (more specific to avoid overly broad rules)
-keep,allowobfuscation,allowshrinking @dagger.hilt.android.lifecycle.HiltViewModel class *
-keep,allowobfuscation,allowshrinking class * extends androidx.lifecycle.ViewModel
-keep class dagger.hilt.android.** { *; }
-keep class dagger.hilt.internal.** { *; }
-keep class javax.inject.** { *; }
# Keep Room database
-keep class * extends androidx.room.RoomDatabase
-keep @androidx.room.Entity class *
-dontwarn androidx.room.paging.**
@@ -0,0 +1,244 @@
package com.anthonyla.paperize.core.util
import android.graphics.Bitmap
import android.graphics.Color
import android.hardware.display.DisplayManager
import android.net.Uri
import android.os.Build
import android.content.res.Configuration
import androidx.exifinterface.media.ExifInterface
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.anthonyla.paperize.core.ScalingType
import java.io.File
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertSame
import org.junit.Assert.assertTrue
import org.junit.Assume.assumeTrue
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class WallpaperUtilInstrumentedTest {
private val context = ApplicationProvider.getApplicationContext<android.content.Context>()
private val files = mutableListOf<File>()
@After
fun cleanUp() {
files.forEach(File::delete)
}
@Test
fun imageDecoderAppliesExifRotation() {
val image = createJpeg(width = 40, height = 20)
ExifInterface(image).apply {
setAttribute(
ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_ROTATE_90.toString()
)
saveAttributes()
}
val result = retrieveBitmap(
context = context,
wallpaperUri = Uri.fromFile(image),
width = 20,
height = 40,
scaling = ScalingType.STRETCH
)
assertNotNull(result)
assertEquals(20, result?.width)
assertEquals(40, result?.height)
result?.recycle()
}
@Test
fun staticFillRetainsWideSourceOverflow() {
val image = createJpeg(width = 400, height = 200)
val scrolling = retrieveBitmap(
context = context,
wallpaperUri = Uri.fromFile(image),
width = 100,
height = 200,
scaling = ScalingType.FILL,
preserveSourceOverflow = true
)
val exactCanvas = retrieveBitmap(
context = context,
wallpaperUri = Uri.fromFile(image),
width = 100,
height = 200,
scaling = ScalingType.FILL,
preserveSourceOverflow = false
)
assertEquals(400, scrolling?.width)
assertEquals(200, scrolling?.height)
assertEquals(100, exactCanvas?.width)
assertEquals(200, exactCanvas?.height)
scrolling?.recycle()
exactCanvas?.recycle()
}
@Test
fun everyStaticScalingModeProducesOneExactScreenCanvas() {
val image = createJpeg(width = 160, height = 90)
ScalingType.entries.forEach { scaling ->
val result = retrieveBitmap(
context = context,
wallpaperUri = Uri.fromFile(image),
width = 120,
height = 200,
scaling = scaling,
preserveSourceOverflow = false
)
assertNotNull("Expected a bitmap for $scaling", result)
assertEquals("Unexpected width for $scaling", 120, result?.width)
assertEquals("Unexpected height for $scaling", 200, result?.height)
result?.recycle()
}
}
@Test
fun android17FoldableSizingIncludesInactiveBuiltInPanel() {
assumeTrue(Build.VERSION.SDK_INT >= 37)
val displayManager = context.getSystemService(DisplayManager::class.java)
val builtInDisplays = displayManager.getDisplays(
"android.hardware.display.category.BUILT_IN_DISPLAYS"
)
assertTrue("Expected both foldable panels", builtInDisplays.size >= 2)
val expected = selectLargestDisplayDimensions(
builtInDisplays.flatMap { display ->
display.supportedModes.map { mode ->
mode.physicalWidth to mode.physicalHeight
}
}
)
val actual = ScreenMetricsCompat.getScreenSize(context)
assertNotNull(expected)
assertEquals(expected?.first, actual.width)
assertEquals(expected?.second, actual.height)
}
@Test
fun staticRenderSizeDoesNotRotateWithForegroundAppConfiguration() {
val landscapeConfiguration = Configuration(context.resources.configuration).apply {
orientation = Configuration.ORIENTATION_LANDSCAPE
}
val landscapeContext = context.createConfigurationContext(landscapeConfiguration)
val naturalPanel = ScreenMetricsCompat.getScreenSize(context)
val renderSize = getDeviceScreenSize(landscapeContext)
assertEquals(naturalPanel.width, renderSize.width)
assertEquals(naturalPanel.height, renderSize.height)
}
@Test
fun disabledStaticEffectsLeaveBitmapUntouched() {
val source = mutableBitmap(32, 32, Color.rgb(240, 80, 20))
val result = processBitmap(
source = source,
enableDarken = false,
darkenPercent = 100,
enableBlur = false,
blurPercent = 100,
enableVignette = false,
vignettePercent = 100,
enableGrayscale = false,
grayscalePercent = 100
)
assertSame(source, result)
assertEquals(Color.rgb(240, 80, 20), result.getPixel(16, 16))
result.recycle()
}
@Test
fun staticDarkenAndGrayscaleEffectsChangePixels() {
val white = mutableBitmap(32, 32, Color.WHITE)
val darkened = processBitmap(
source = white,
enableDarken = true,
darkenPercent = 100
)
assertTrue(Color.red(darkened.getPixel(16, 16)) <= 2)
if (darkened !== white) white.recycle()
darkened.recycle()
val red = mutableBitmap(32, 32, Color.RED)
val grayscale = processBitmap(
source = red,
enableGrayscale = true,
grayscalePercent = 100
)
val grayPixel = grayscale.getPixel(16, 16)
assertTrue(kotlin.math.abs(Color.red(grayPixel) - Color.green(grayPixel)) <= 2)
assertTrue(kotlin.math.abs(Color.green(grayPixel) - Color.blue(grayPixel)) <= 2)
if (grayscale !== red) red.recycle()
grayscale.recycle()
}
@Test
fun staticVignetteDarkensEdgesMoreThanCenter() {
val source = mutableBitmap(96, 96, Color.WHITE)
val result = processBitmap(
source = source,
enableVignette = true,
vignettePercent = 75
)
val center = Color.red(result.getPixel(48, 48))
val corner = Color.red(result.getPixel(0, 0))
assertTrue("Expected vignette corner ($corner) below center ($center)", corner < center)
if (result !== source) source.recycle()
result.recycle()
}
@Test
fun staticBlurSoftensSharpBoundary() {
val source = Bitmap.createBitmap(96, 96, Bitmap.Config.ARGB_8888)
for (y in 0 until source.height) {
for (x in 0 until source.width) {
source.setPixel(x, y, if (x < 48) Color.BLACK else Color.WHITE)
}
}
val result = processBitmap(
source = source,
enableBlur = true,
blurPercent = 60
)
val boundary = Color.red(result.getPixel(48, 48))
assertTrue("Expected blurred boundary, got $boundary", boundary in 2..253)
if (result !== source) source.recycle()
result.recycle()
}
private fun mutableBitmap(width: Int, height: Int, color: Int): Bitmap =
Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888).apply {
eraseColor(color)
}
private fun createJpeg(width: Int, height: Int): File {
val file = File.createTempFile("paperize-test-", ".jpg", context.cacheDir)
files += file
val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
bitmap.eraseColor(Color.MAGENTA)
file.outputStream().use { output ->
check(bitmap.compress(Bitmap.CompressFormat.JPEG, 95, output))
}
bitmap.recycle()
return file
}
}
+91 -19
View File
@@ -2,43 +2,115 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-feature
android:name="android.software.paperize"
android:required="true" />
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!-- Permissions -->
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<!-- WorkManager contributes this permission for optional network constraints. Paperize never
schedules network-constrained work, so keep it out of the final manifest. -->
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"
tools:node="remove" />
<!-- Features -->
<uses-feature
android:name="android.software.wallpaper"
android:required="false" />
<application
android:allowBackup="true"
android:name=".App"
android:persistent="true"
android:name=".PaperizeApplication"
android:allowBackup="false"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Paperize"
android:enableOnBackInvokedCallback="true"
tools:targetApi="tiramisu">
android:theme="@style/Theme.Paperize">
<!-- Disable default WorkManager initialization (using custom Configuration.Provider) -->
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<meta-data
android:name="androidx.work.WorkManagerInitializer"
android:value="androidx.startup"
tools:node="remove" />
</provider>
<!-- Main Activity -->
<activity
android:name=".feature.wallpaper.presentation.MainActivity"
android:name=".presentation.MainActivity"
android:exported="true"
android:theme="@style/Theme.Paperize">
android:configChanges="uiMode|density|orientation|screenSize|screenLayout|keyboardHidden|keyboard"
android:theme="@style/Theme.App.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<service android:name=".feature.wallpaper.wallpaperservice.WallpaperService" android:foregroundServiceType="mediaPlayback"/>
<receiver android:name=".feature.wallpaper.wallpaperservice.WallpaperBootReceiver"
<activity
android:name=".service.shortcut.WallpaperShortcutActivity"
android:excludeFromRecents="true"
android:exported="false"
android:noHistory="true"
android:taskAffinity=""
android:theme="@android:style/Theme.NoDisplay" />
<service
android:name=".service.wallpaper.WallpaperChangeService"
android:enabled="true"
android:exported="false"
android:foregroundServiceType="dataSync" />
<!-- Broadcast Receivers -->
<receiver
android:name=".service.alarm.BootReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>
<!-- Quick Settings Tile -->
<service
android:name=".service.tile.WallpaperTileService"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
<!-- Live Wallpaper Service -->
<service
android:name=".service.livewallpaper.PaperizeLiveWallpaperService"
android:enabled="true"
android:exported="true"
android:label="@string/live_wallpaper_name"
android:permission="android.permission.BIND_WALLPAPER">
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/wallpaper" />
</service>
</application>
</manifest>
</manifest>
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

@@ -1,21 +0,0 @@
package com.anthonyla.paperize
import android.app.Application
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.os.Build
import dagger.hilt.android.HiltAndroidApp
/**
* Application class for Hilt
*/
@HiltAndroidApp
class App: Application() {
override fun onCreate() {
super.onCreate()
val channel = NotificationChannel("wallpaper_service_channel", "Paperize", NotificationManager.IMPORTANCE_LOW)
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(channel)
}
}
@@ -0,0 +1,66 @@
package com.anthonyla.paperize
import android.app.Application
import android.app.NotificationChannel
import android.app.NotificationManager
import androidx.hilt.work.HiltWorkerFactory
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ProcessLifecycleOwner
import androidx.work.Configuration
import com.anthonyla.paperize.core.constants.Constants
import com.anthonyla.paperize.core.util.DataResetManager
import com.anthonyla.paperize.service.worker.AlbumRefreshScheduler
import dagger.hilt.android.HiltAndroidApp
import javax.inject.Inject
/**
* Application class for Paperize
*
* Annotated with @HiltAndroidApp to enable dependency injection
* Implements Configuration.Provider for WorkManager with Hilt support
*/
@HiltAndroidApp
class PaperizeApplication : Application(), Configuration.Provider, DefaultLifecycleObserver {
@Inject
lateinit var workerFactory: HiltWorkerFactory
override fun onCreate() {
super<Application>.onCreate()
// Perform one-time data reset for major version upgrades (e.g., v3 -> v4)
// Must run before any other initialization that accesses DB/preferences
DataResetManager.performResetIfNeeded(this)
// Create notification channel (minSdk is 31, so always supported)
createNotificationChannel()
// Process lifecycle distinguishes real background/foreground transitions from activity
// recreation, so folder-backed albums are refreshed whenever the user returns to the app.
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
}
override val workManagerConfiguration: Configuration
get() = Configuration.Builder()
.setWorkerFactory(workerFactory)
.build()
private fun createNotificationChannel() {
val channel = NotificationChannel(
Constants.NOTIFICATION_CHANNEL_ID,
getString(R.string.app_name),
NotificationManager.IMPORTANCE_LOW
).apply {
description = getString(R.string.notification_channel_description)
setShowBadge(false)
}
val notificationManager = getSystemService(NotificationManager::class.java)
notificationManager.createNotificationChannel(channel)
}
override fun onStart(owner: LifecycleOwner) {
AlbumRefreshScheduler.enqueue(this)
}
}
@@ -0,0 +1,59 @@
package com.anthonyla.paperize.core
/**
* A generic class that holds a value or an error
*/
sealed class Result<out T> {
data class Success<T>(val data: T) : Result<T>()
data class Error(val exception: Throwable, val message: String? = exception.message) : Result<Nothing>()
data object Loading : Result<Nothing>()
val isSuccess: Boolean get() = this is Success
val isError: Boolean get() = this is Error
val isLoading: Boolean get() = this is Loading
fun getOrNull(): T? = if (this is Success) data else null
fun exceptionOrNull(): Throwable? = if (this is Error) exception else null
inline fun onSuccess(action: (T) -> Unit): Result<T> {
if (this is Success) action(data)
return this
}
inline fun onError(action: (Throwable) -> Unit): Result<T> {
if (this is Error) action(exception)
return this
}
companion object {
inline fun <T> runCatching(block: () -> T): Result<T> {
return try {
Success(block())
} catch (e: Exception) {
Error(e)
}
}
}
}
/**
* Map a Result to another type
*/
inline fun <T, R> Result<T>.map(transform: (T) -> R): Result<R> {
return when (this) {
is Result.Success -> Result.Success(transform(data))
is Result.Error -> Result.Error(exception, message)
is Result.Loading -> Result.Loading
}
}
/**
* Flat map a Result
*/
inline fun <T, R> Result<T>.flatMap(transform: (T) -> Result<R>): Result<R> {
return when (this) {
is Result.Success -> transform(data)
is Result.Error -> Result.Error(exception, message)
is Result.Loading -> Result.Loading
}
}
@@ -0,0 +1,32 @@
package com.anthonyla.paperize.core
/**
* Wallpaper scaling options
*/
enum class ScalingType {
/**
* Fill the screen, cropping if necessary
*/
FILL,
/**
* Fit the entire image, adding letterboxing/pillarboxing if necessary
*/
FIT,
/**
* Stretch the image to fill the screen
*/
STRETCH,
/**
* Display at original size
*/
NONE;
companion object {
fun fromString(value: String?): ScalingType {
return entries.find { it.name.equals(value, ignoreCase = true) } ?: FILL
}
}
}
@@ -0,0 +1,17 @@
package com.anthonyla.paperize.core
/**
* Screen types for wallpaper setting
*/
enum class ScreenType {
HOME,
LOCK,
BOTH,
LIVE;
companion object {
fun fromString(value: String?): ScreenType {
return entries.find { it.name.equals(value, ignoreCase = true) } ?: BOTH
}
}
}
@@ -1,17 +0,0 @@
package com.anthonyla.paperize.core
/**
* Constants for application settings
*/
object SettingsConstants {
const val SETTINGS_DATASTORE = "settings_datastore"
const val DARK_MODE_TYPE = "dark_mode_type"
const val DYNAMIC_THEME_TYPE = "dynamic_theme_type"
const val ANIMATE_TYPE = "animate_type"
const val WALLPAPER_CHANGE_INTERVAL = "wallpaper_change_interval"
const val WALLPAPER_CHANGE_INTERVAL_DEFAULT = 15
const val SET_LOCK_WITH_HOME = "set_lock_with_home"
const val FIRST_LAUNCH = "first_launch"
const val LAST_SET_TIME = "last_set_time"
const val NEXT_SET_TIME = "next_set_time"
}
@@ -0,0 +1,11 @@
package com.anthonyla.paperize.core
/**
* Exception thrown when an album has no wallpapers available
*/
class EmptyAlbumException(message: String) : Exception(message)
/**
* Exception thrown when no valid wallpaper can be found after retries
*/
class NoValidWallpaperException(message: String) : Exception(message)
@@ -0,0 +1,61 @@
package com.anthonyla.paperize.core
/**
* Media type for wallpapers
*
* Determines what type of media the wallpaper file is, which affects
* how it's rendered in live wallpaper mode.
*
* Note: Currently only IMAGE type is supported.
*/
enum class WallpaperMediaType {
/**
* Image files: JPEG, PNG, WEBP, AVIF, HEIC, HEIF, BMP, GIF, TIFF
* Supported in both static and live wallpaper modes
*/
IMAGE;
/**
* Supported file extensions for this media type
*/
val supportedExtensions: Set<String>
get() = when (this) {
IMAGE -> setOf(
"jpg", "jpeg", "png", "webp", "avif",
"heic", "heif", // HEIC/HEIF - Apple's high efficiency format
"bmp", // Bitmap - legacy but still used
"gif", // GIF - mostly for static images (first frame used)
"tiff", "tif", // TIFF - high quality archival format
"svg" // SVG - vector graphics (rasterized for wallpaper)
)
}
/**
* Whether this media type is supported in static wallpaper mode
*/
val supportedInStaticMode: Boolean
get() = this == IMAGE
/**
* Whether this media type is supported in live wallpaper mode
*/
val supportedInLiveMode: Boolean
get() = true // All types supported in live mode
companion object {
/**
* Detect media type from file extension
*/
fun fromExtension(extension: String): WallpaperMediaType? {
val ext = extension.lowercase()
return entries.find { ext in it.supportedExtensions }
}
/**
* Convert string to WallpaperMediaType
*/
fun fromString(value: String?): WallpaperMediaType? {
return entries.find { it.name.equals(value, ignoreCase = true) }
}
}
}
@@ -0,0 +1,40 @@
package com.anthonyla.paperize.core
/**
* Wallpaper mode enum
*
* Determines whether the app uses static wallpaper (WallpaperManager.setBitmap)
* or live wallpaper (WallpaperService) for applying wallpapers.
*
* Users choose their preferred mode during onboarding and can switch later
* with full data reset.
*/
enum class WallpaperMode {
/**
* Static wallpaper mode
* - Uses WallpaperManager.setBitmap() to apply wallpapers
* - Supports images only
* - Lower battery usage
* - No interactive effects
*/
STATIC,
/**
* Live wallpaper mode
* - Uses WallpaperService for continuous rendering
* - Supports images only (with effects)
* - Interactive effects (double-tap, parallax)
* - Higher battery usage
*/
LIVE;
companion object {
/**
* Convert string to WallpaperMode
* Defaults to STATIC if string is null or doesn't match any mode
*/
fun fromString(value: String?): WallpaperMode {
return entries.find { it.name.equals(value, ignoreCase = true) } ?: STATIC
}
}
}
@@ -0,0 +1,16 @@
package com.anthonyla.paperize.core
/**
* Source type for wallpapers
*/
enum class WallpaperSourceType {
/**
* Directly selected wallpaper files
*/
DIRECT,
/**
* Wallpapers from monitored folders
*/
FOLDER
}
@@ -0,0 +1,208 @@
package com.anthonyla.paperize.core.constants
/**
* Application-wide constants
*/
object Constants {
// Database
const val DATABASE_NAME = "paperize_database"
const val DATABASE_VERSION = 4 // v4: Removed unused cropOffsetX/Y/Scale columns from wallpapers table
// DataStore
const val PREFERENCES_NAME = "paperize_preferences"
// Notifications
const val NOTIFICATION_CHANNEL_ID = "paperize_channel"
const val NOTIFICATION_ID = 1
// Services
const val ACTION_CHANGE_WALLPAPER = "com.anthonyla.paperize.ACTION_CHANGE_WALLPAPER"
const val ACTION_REAPPLY_EFFECTS = "com.anthonyla.paperize.ACTION_REAPPLY_EFFECTS"
const val ACTION_RELOAD_WALLPAPER = "com.anthonyla.paperize.ACTION_RELOAD_WALLPAPER"
// WorkManager
const val WORK_NAME_HOME = "wallpaper_change_home"
const val WORK_NAME_LOCK = "wallpaper_change_lock"
const val WORK_NAME_BOTH = "wallpaper_change_both"
const val WORK_NAME_LIVE = "wallpaper_change_live"
const val WORK_NAME_REFRESH = "album_refresh"
const val WORK_TAG_HOME = "wallpaper_change_home_tag"
const val WORK_TAG_LOCK = "wallpaper_change_lock_tag"
const val WORK_TAG_BOTH = "wallpaper_change_both_tag"
const val WORK_TAG_LIVE = "wallpaper_change_live_tag"
const val WORK_TAG_REFRESH = "album_refresh_tag"
const val MAX_WORK_RETRY_ATTEMPTS = 3
// Intents
const val EXTRA_SCREEN_TYPE = "screen_type"
// Wallpaper
const val DEFAULT_BLUR_PERCENTAGE = 0
const val DEFAULT_DARKEN_PERCENTAGE = 0
const val DEFAULT_VIGNETTE_PERCENTAGE = 0
const val DEFAULT_PARALLAX_INTENSITY = 50
const val DEFAULT_GRAYSCALE_PERCENTAGE = 0
const val MAX_EFFECT_PERCENTAGE = 100
const val SLIDER_EFFECT_STEPS = 99
const val DIALOG_MESSAGE_MAX_LINES = 10
const val MIN_EFFECT_PERCENTAGE = 0
const val FLOW_SUBSCRIPTION_TIMEOUT_MS = 5000L
// Scheduling
const val MIN_INTERVAL_MINUTES = 15
const val MAX_INTERVAL_MINUTES = 43200 // 30 days in minutes
const val DEFAULT_INTERVAL_MINUTES = 60
// UI
const val ANIMATION_DURATION_LONG_MS = 800 // For item reordering animations
const val DEBOUNCE_DELAY_MS = 500L
const val PERMISSION_SCREEN_TRANSITION_DELAY_MS = 300L // Brief delay for permission screen transitions
const val SETTINGS_DEBOUNCE_MS = 2000L // Debounce for settings changes before persisting
const val WALLPAPER_CHANGE_DEBOUNCE_MS = 2000L
const val WALLPAPER_ASPECT_RATIO = 9f / 16f // Standard phone aspect ratio
const val GRID_THUMBNAIL_WIDTH = 300
const val GRID_THUMBNAIL_HEIGHT = 500
const val LIST_THUMBNAIL_SIZE = 150
const val PREVIEW_THUMBNAIL_WIDTH = 600
const val PREVIEW_THUMBNAIL_HEIGHT = 1200
// Time conversion
const val MINUTES_PER_HOUR = 60
const val MINUTES_PER_DAY = 1440
// Image processing
const val MAX_BLUR_RADIUS = 25.0f
const val BRIGHTNESS_SAMPLE_SIZE = 10 // Pixel sample size for brightness calculation
const val DEFAULT_BRIGHTNESS = 0.5f // Default brightness fallback
// Luminance coefficients (ITU-R BT.709 standard)
const val LUMINANCE_RED = 0.2126
const val LUMINANCE_GREEN = 0.7152
const val LUMINANCE_BLUE = 0.0722
// Adaptive brightness thresholds (based on WallYou implementation)
const val LIGHT_BRIGHTNESS_MIN = 0.8f // Threshold for bright images in dark mode
const val DARK_BRIGHTNESS_MAX = 0.3f // Threshold for dark images in light mode
const val TARGET_BRIGHTNESS_DARK = 0.7f // Target brightness in dark mode
const val TARGET_BRIGHTNESS_LIGHT = 0.4f // Target brightness in light mode
// Vignette effect
const val VIGNETTE_DIVISOR = 150f // Radius calculation divisor
const val VIGNETTE_MIN_RADIUS = 1f // Minimum vignette radius (guards against zero-radius RadialGradient crash)
const val VIGNETTE_INNER_ALPHA = 0.1f // Inner alpha for vignette gradient
const val VIGNETTE_OUTER_ALPHA = 0.8f // Outer alpha for vignette gradient
val VIGNETTE_GRADIENT_POSITIONS = floatArrayOf(0f, 0.7f, 1f) // Vignette gradient positions
// Wallpaper loading retry
const val WALLPAPER_READ_INITIAL_DELAY_MS = 500L // Initial retry delay (with linear backoff)
// Input validation
const val MAX_DAYS_INPUT_LENGTH = 3
const val MAX_HOURS_MINUTES_INPUT_LENGTH = 2
// File types
val SUPPORTED_IMAGE_EXTENSIONS = setOf(
"jpg", "jpeg", "png", "webp", "avif",
"heic", "heif", // HEIC/HEIF - Apple's high efficiency format
"bmp", // Bitmap - legacy but still used
"gif", // GIF - mostly for static images (first frame used)
"tiff", "tif", // TIFF - high quality archival format
"svg" // SVG - vector graphics (rasterized for wallpaper)
)
// Renderer
/** Crossfade animation duration in milliseconds - consistent across all refresh rates */
const val CROSSFADE_DURATION_MS = 750f
const val RELOAD_THROTTLE_MS = 250L
const val BLUR_MIN_THRESHOLD = 0.01f
const val PERCENTAGE_DIVISOR = 100f
const val GL_ES_VERSION = 2
const val SURFACE_POLL_INTERVAL_MS = 50L
const val SURFACE_WAIT_TIMEOUT_MS = 1000L // Max wait for GL surface dimensions before falling back to display metrics
// Wallpaper loading
const val MAX_WALLPAPER_LOAD_RETRIES = 10
const val MAX_QUEUE_REBUILD_ATTEMPTS = 2
}
/**
* Preference keys for DataStore
*/
object PreferenceKeys {
// Theme
const val DARK_MODE = "dark_mode"
const val DYNAMIC_THEMING = "dynamic_theming"
const val ANIMATE = "animate"
// Scheduling
const val ENABLE_CHANGER = "enable_changer"
const val SEPARATE_SCHEDULES = "separate_schedules"
const val SHUFFLE_ENABLED = "shuffle_enabled"
const val HOME_ENABLED = "home_enabled"
const val LOCK_ENABLED = "lock_enabled"
const val HOME_ALBUM_ID = "home_album_id"
const val LOCK_ALBUM_ID = "lock_album_id"
const val HOME_INTERVAL_MINUTES = "home_interval_minutes"
const val LOCK_INTERVAL_MINUTES = "lock_interval_minutes"
// Effects - Home
const val HOME_ENABLE_BLUR = "home_enable_blur"
const val HOME_BLUR = "home_blur"
const val HOME_ENABLE_DARKEN = "home_enable_darken"
const val HOME_DARKEN = "home_darken"
const val HOME_ENABLE_VIGNETTE = "home_enable_vignette"
const val HOME_VIGNETTE = "home_vignette"
const val HOME_ENABLE_GRAYSCALE = "home_enable_grayscale"
const val HOME_GRAYSCALE = "home_grayscale"
// Effects - Lock
const val LOCK_ENABLE_BLUR = "lock_enable_blur"
const val LOCK_BLUR = "lock_blur"
const val LOCK_ENABLE_DARKEN = "lock_enable_darken"
const val LOCK_DARKEN = "lock_darken"
const val LOCK_ENABLE_VIGNETTE = "lock_enable_vignette"
const val LOCK_VIGNETTE = "lock_vignette"
const val LOCK_ENABLE_GRAYSCALE = "lock_enable_grayscale"
const val LOCK_GRAYSCALE = "lock_grayscale"
// Interactive Effects - Home (live wallpaper mode only)
const val HOME_ENABLE_DOUBLE_TAP = "home_enable_double_tap"
const val HOME_ENABLE_PARALLAX = "home_enable_parallax"
const val HOME_PARALLAX_INTENSITY = "home_parallax_intensity"
// Interactive Effects - Lock (live wallpaper mode only)
const val LOCK_ENABLE_DOUBLE_TAP = "lock_enable_double_tap"
const val LOCK_ENABLE_PARALLAX = "lock_enable_parallax"
const val LOCK_PARALLAX_INTENSITY = "lock_parallax_intensity"
// Live Wallpaper Mode Settings
const val LIVE_ALBUM_ID = "live_album_id"
const val LIVE_INTERVAL_MINUTES = "live_interval_minutes"
const val LIVE_ENABLE_BLUR = "live_enable_blur"
const val LIVE_BLUR = "live_blur"
const val LIVE_ENABLE_DARKEN = "live_enable_darken"
const val LIVE_DARKEN = "live_darken"
const val LIVE_ENABLE_VIGNETTE = "live_enable_vignette"
const val LIVE_VIGNETTE = "live_vignette"
const val LIVE_ENABLE_GRAYSCALE = "live_enable_grayscale"
const val LIVE_GRAYSCALE = "live_grayscale"
const val LIVE_ENABLE_DOUBLE_TAP = "live_enable_double_tap"
const val LIVE_ENABLE_CHANGE_ON_SCREEN_OFF = "live_enable_change_on_screen_off"
const val LIVE_ENABLE_PARALLAX = "live_enable_parallax"
const val LIVE_PARALLAX_INTENSITY = "live_parallax_intensity"
// Scaling
const val HOME_SCALING_TYPE = "home_scaling_type"
const val LOCK_SCALING_TYPE = "lock_scaling_type"
const val LIVE_SCALING_TYPE = "live_scaling_type"
const val HOME_SCROLLING_ENABLED = "home_scrolling_enabled"
// Behavior
const val ADAPTIVE_BRIGHTNESS = "adaptive_brightness"
// First launch
const val FIRST_LAUNCH = "first_launch"
// Wallpaper mode
const val WALLPAPER_MODE = "wallpaper_mode"
}
@@ -0,0 +1,115 @@
package com.anthonyla.paperize.core.di
import android.app.Application
import android.content.Context
import androidx.room.Room
import com.anthonyla.paperize.core.constants.Constants
import com.anthonyla.paperize.data.database.PaperizeDatabase
import com.anthonyla.paperize.data.database.dao.AlbumDao
import com.anthonyla.paperize.data.database.dao.FolderDao
import com.anthonyla.paperize.data.database.dao.WallpaperCurrentDao
import com.anthonyla.paperize.data.database.dao.WallpaperDao
import com.anthonyla.paperize.data.database.dao.WallpaperQueueDao
import com.anthonyla.paperize.data.datastore.PreferencesManager
import com.anthonyla.paperize.data.repository.AlbumRepositoryImpl
import com.anthonyla.paperize.data.repository.SettingsRepositoryImpl
import com.anthonyla.paperize.data.repository.WallpaperRepositoryImpl
import com.anthonyla.paperize.domain.repository.AlbumRepository
import com.anthonyla.paperize.domain.repository.SettingsRepository
import com.anthonyla.paperize.domain.repository.WallpaperRepository
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
/**
* Hilt dependency injection module
*
* Provides all application-wide dependencies
*/
@Module
@InstallIn(SingletonComponent::class)
object AppModule {
/**
* Provide Room database
*/
@Provides
@Singleton
fun providePaperizeDatabase(app: Application): PaperizeDatabase {
return Room.databaseBuilder(
app,
PaperizeDatabase::class.java,
Constants.DATABASE_NAME
)
.fallbackToDestructiveMigration(dropAllTables = true)
.build()
}
/**
* Provide DAOs
*/
@Provides
@Singleton
fun provideAlbumDao(database: PaperizeDatabase): AlbumDao =
database.albumDao()
@Provides
@Singleton
fun provideWallpaperDao(database: PaperizeDatabase): WallpaperDao =
database.wallpaperDao()
@Provides
@Singleton
fun provideFolderDao(database: PaperizeDatabase): FolderDao =
database.folderDao()
@Provides
@Singleton
fun provideWallpaperQueueDao(database: PaperizeDatabase): WallpaperQueueDao =
database.wallpaperQueueDao()
@Provides
@Singleton
fun provideWallpaperCurrentDao(database: PaperizeDatabase): WallpaperCurrentDao =
database.wallpaperCurrentDao()
/**
* Provide PreferencesManager
*/
@Provides
@Singleton
fun providePreferencesManager(@ApplicationContext context: Context): PreferencesManager =
PreferencesManager(context)
/**
* Provide Repositories
*/
@Provides
@Singleton
fun provideAlbumRepository(
@ApplicationContext context: Context,
database: PaperizeDatabase,
albumDao: AlbumDao,
wallpaperDao: WallpaperDao,
folderDao: FolderDao,
wallpaperRepository: dagger.Lazy<WallpaperRepository>
): AlbumRepository = AlbumRepositoryImpl(context, database, albumDao, wallpaperDao, folderDao, wallpaperRepository)
@Provides
@Singleton
fun provideWallpaperRepository(
@ApplicationContext context: Context,
wallpaperDao: WallpaperDao,
wallpaperQueueDao: WallpaperQueueDao,
wallpaperCurrentDao: WallpaperCurrentDao
): WallpaperRepository = WallpaperRepositoryImpl(context, wallpaperDao, wallpaperQueueDao, wallpaperCurrentDao)
@Provides
@Singleton
fun provideSettingsRepository(
preferencesManager: PreferencesManager
): SettingsRepository = SettingsRepositoryImpl(preferencesManager)
}
@@ -0,0 +1,48 @@
package com.anthonyla.paperize.core.util
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.PowerManager
import android.provider.Settings
import android.util.Log
/**
* Utility for handling battery optimization (Doze mode) exclusion
*/
object BatteryOptimizationUtil {
private const val TAG = "BatteryOptimizationUtil"
/**
* Check if the app is currently excluded from battery optimizations
*/
fun isIgnoringBatteryOptimizations(context: Context): Boolean {
val powerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
return powerManager.isIgnoringBatteryOptimizations(context.packageName)
}
/**
* Request the user to exclude the app from battery optimizations
* Opens the system battery optimization settings page
*/
fun requestIgnoreBatteryOptimizations(context: Context) {
try {
val intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS).apply {
data = Uri.parse("package:${context.packageName}")
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(intent)
} catch (e: Exception) {
Log.e(TAG, "Error requesting battery optimization exclusion", e)
// Fallback: open general battery optimization settings
try {
val fallbackIntent = Intent(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(fallbackIntent)
} catch (e2: Exception) {
Log.e(TAG, "Error opening battery optimization settings", e2)
}
}
}
}
@@ -0,0 +1,82 @@
package com.anthonyla.paperize.core.util
import android.graphics.Bitmap
import com.anthonyla.paperize.core.constants.Constants
/**
* Utility class for brightness calculations and adaptive adjustments.
* Extracted from WallpaperUtil for better testability.
*/
object BrightnessCalculator {
/**
* Calculate relative luminance of a single pixel using ITU-R BT.709 standard.
* Use bitwise operations to avoid dependency on android.graphics.Color in core logic tests.
*/
fun calculateLuminance(pixel: Int): Double {
val r = ((pixel shr 16) and 0xFF) / 255.0
val g = ((pixel shr 8) and 0xFF) / 255.0
val b = (pixel and 0xFF) / 255.0
return Constants.LUMINANCE_RED * r + Constants.LUMINANCE_GREEN * g + Constants.LUMINANCE_BLUE * b
}
/**
* Calculate brightness estimate of bitmap (0.0 - 1.0).
*
* Reads one sampled row at a time using [Bitmap.getPixels] so the entire
* sample set is fetched with (height / sampleSize) JNI calls instead of
* (width / sampleSize) × (height / sampleSize) individual pixel lookups.
* A reusable row buffer keeps allocations to one IntArray(width).
*/
fun calculateBitmapBrightness(bitmap: Bitmap): Float {
val sampleSize = Constants.BRIGHTNESS_SAMPLE_SIZE
val w = bitmap.width
val h = bitmap.height
if (w <= 0 || h <= 0) return Constants.DEFAULT_BRIGHTNESS
val rowBuffer = IntArray(w)
var totalLuminance = 0.0
var pixelCount = 0
for (y in 0 until h step sampleSize) {
bitmap.getPixels(rowBuffer, 0, w, 0, y, w, 1)
for (x in 0 until w step sampleSize) {
totalLuminance += calculateLuminance(rowBuffer[x])
pixelCount++
}
}
return if (pixelCount > 0) {
(totalLuminance / pixelCount).toFloat()
} else {
Constants.DEFAULT_BRIGHTNESS
}
}
/**
* Get adaptive brightness multiplier factor based on system dark/light mode.
*
* @param isDarkMode Whether the system is in dark mode
* @param brightness Current image brightness (0.0 to 1.0)
* @return Multiplier factor to apply to colors
*/
fun getAdaptiveMultiplier(isDarkMode: Boolean, brightness: Float): Float {
val lightBrightnessMin = Constants.LIGHT_BRIGHTNESS_MIN
val darkBrightnessMax = Constants.DARK_BRIGHTNESS_MAX
val targetBrightnessDark = Constants.TARGET_BRIGHTNESS_DARK
val targetBrightnessLight = Constants.TARGET_BRIGHTNESS_LIGHT
// Avoid issues with very dark items or division by zero
if (brightness < 0.01f) return 1.0f
return when {
// In dark mode with very bright image: darken it
isDarkMode && brightness > lightBrightnessMin -> targetBrightnessDark / brightness
// In light mode with very dark image: brighten it
!isDarkMode && brightness < darkBrightnessMax -> targetBrightnessLight / brightness
// No adjustment needed
else -> 1.0f
}
}
}
@@ -0,0 +1,130 @@
package com.anthonyla.paperize.core.util
import android.content.Context
import android.util.Log
import java.io.File
/**
* Manages one-time data reset for major version upgrades.
*
* Uses a separate preferences file (version_prefs) to track reset status,
* ensuring the flag survives the data wipe itself.
*/
object DataResetManager {
private const val TAG = "DataResetManager"
/**
* Version tracking preferences - stored separately from main app prefs
* so it survives the data wipe.
*/
private const val VERSION_PREFS_NAME = "version_prefs"
private const val KEY_LAST_RESET_VERSION = "last_reset_version"
/**
* Target reset version - increment this for future major version upgrades
* that require a complete data wipe.
*
* Version 4 = v4.0.0 release (complete app rewrite)
*/
private const val TARGET_RESET_VERSION = 4
/**
* Database and DataStore names to clear (must match Constants)
*/
private const val DATABASE_NAME = "paperize_database"
private const val DATASTORE_NAME = "paperize_preferences.preferences_pb"
/**
* Performs a complete data reset if needed for the current app version.
*
* This should be called at the very start of Application.onCreate(),
* before any other initialization occurs.
*
* @return true if a reset was performed, false otherwise
*/
fun performResetIfNeeded(context: Context): Boolean {
val versionPrefs = context.getSharedPreferences(VERSION_PREFS_NAME, Context.MODE_PRIVATE)
val lastResetVersion = versionPrefs.getInt(KEY_LAST_RESET_VERSION, 0)
if (lastResetVersion >= TARGET_RESET_VERSION) {
Log.d(TAG, "No reset needed (last=$lastResetVersion, target=$TARGET_RESET_VERSION)")
return false
}
Log.w(TAG, "Performing data reset: upgrading from version $lastResetVersion to $TARGET_RESET_VERSION")
try {
// 1. Delete Room database files
deleteDatabase(context)
// 2. Delete DataStore file
deleteDataStore(context)
// 3. Update version after successful wipe
versionPrefs.edit()
.putInt(KEY_LAST_RESET_VERSION, TARGET_RESET_VERSION)
.apply()
Log.i(TAG, "Data reset completed successfully")
return true
} catch (e: Exception) {
Log.e(TAG, "Error during data reset", e)
// Still mark as reset to avoid infinite reset loops on corrupted data
versionPrefs.edit()
.putInt(KEY_LAST_RESET_VERSION, TARGET_RESET_VERSION)
.apply()
return false
}
}
/**
* Deletes Room database and all related files (WAL, SHM, journal)
*/
private fun deleteDatabase(context: Context) {
val dbPath = context.getDatabasePath(DATABASE_NAME)
val dbDir = dbPath.parentFile
if (dbDir != null && dbDir.exists()) {
// Delete main database file and all related files
val filesToDelete = listOf(
DATABASE_NAME,
"$DATABASE_NAME-wal",
"$DATABASE_NAME-shm",
"$DATABASE_NAME-journal"
)
for (fileName in filesToDelete) {
val file = File(dbDir, fileName)
if (file.exists()) {
val deleted = file.delete()
Log.d(TAG, "Deleted $fileName: $deleted")
}
}
}
// Also use Context.deleteDatabase for good measure
val deleted = context.deleteDatabase(DATABASE_NAME)
Log.d(TAG, "Context.deleteDatabase result: $deleted")
}
/**
* Deletes DataStore preferences file
*/
private fun deleteDataStore(context: Context) {
val dataStoreFile = File(context.filesDir, "datastore/$DATASTORE_NAME")
if (dataStoreFile.exists()) {
val deleted = dataStoreFile.delete()
Log.d(TAG, "Deleted DataStore file: $deleted")
}
// Also delete the datastore directory if empty
val dataStoreDir = File(context.filesDir, "datastore")
if (dataStoreDir.exists() && dataStoreDir.isDirectory) {
val files = dataStoreDir.listFiles()
if (files.isNullOrEmpty()) {
dataStoreDir.delete()
}
}
}
}
@@ -0,0 +1,131 @@
package com.anthonyla.paperize.core.util
import android.content.ContentResolver
import android.content.Context
import android.net.Uri
import android.provider.DocumentsContract
import androidx.documentfile.provider.DocumentFile
import com.anthonyla.paperize.core.constants.Constants
import java.util.UUID
/**
* URI extensions
*/
fun Uri.isValid(contentResolver: ContentResolver): Boolean {
// Basic scheme check - we only handle content URIs
if (scheme != "content") return false
return try {
// Optimization: Use query to check existence/accessibility without opening the file
// This is significantly faster and less likely to hang on slow cloud providers
contentResolver.query(this, arrayOf(android.provider.OpenableColumns.DISPLAY_NAME), null, null, null)?.use { cursor ->
cursor.moveToFirst()
} ?: false
} catch (_: Exception) {
// Fallback to opening the stream if the provider doesn't support the specific query
try {
contentResolver.openFileDescriptor(this, "r")?.use { true } ?: false
} catch (_: Exception) {
false
}
}
}
fun Uri.getFileName(context: Context): String? {
return DocumentFile.fromSingleUri(context, this)?.name
}
/**
* One image file discovered while scanning a folder tree.
*
* [name] and [lastModified] are read from the same cursor row as [uri], so callers
* do not need a follow-up per-file query to obtain them.
*/
data class ScannedImage(
val uri: Uri,
val name: String,
val lastModified: Long
)
/**
* Recursively scan a tree [Uri] for image files.
*
* Uses a single [DocumentsContract] cursor query per directory instead of
* [DocumentFile.listFiles], which issues a separate IPC round-trip for every file and
* for every attribute access (name, isDirectory, lastModified). For folders with tens of
* thousands of files that difference is the dominant cost. Directories are traversed
* iteratively to avoid deep-recursion stack overflow on heavily nested trees.
*
* Returned URIs are built from the same tree document id used by [DocumentFile], so they
* are byte-for-byte identical to the previous implementation and remain stable across the app.
*
* [onProgress] is invoked with the running number of images found, throttled to roughly once
* per [PROGRESS_REPORT_INTERVAL] discoveries so callers can show a live count without flooding.
*/
fun Uri.scanFolderImages(context: Context, onProgress: ((found: Int) -> Unit)? = null): List<ScannedImage> {
val rootDocumentId = try {
DocumentsContract.getTreeDocumentId(this)
} catch (_: IllegalArgumentException) {
return emptyList() // Not a tree URI
}
val projection = arrayOf(
DocumentsContract.Document.COLUMN_DOCUMENT_ID,
DocumentsContract.Document.COLUMN_DISPLAY_NAME,
DocumentsContract.Document.COLUMN_MIME_TYPE,
DocumentsContract.Document.COLUMN_LAST_MODIFIED
)
val results = mutableListOf<ScannedImage>()
var lastReported = 0
val pendingDirs = ArrayDeque<String>()
pendingDirs.addLast(rootDocumentId)
while (pendingDirs.isNotEmpty()) {
val parentDocumentId = pendingDirs.removeLast()
val childrenUri = DocumentsContract.buildChildDocumentsUriUsingTree(this, parentDocumentId)
try {
context.contentResolver.query(childrenUri, projection, null, null, null)?.use { cursor ->
val idColumn = cursor.getColumnIndexOrThrow(DocumentsContract.Document.COLUMN_DOCUMENT_ID)
val nameColumn = cursor.getColumnIndexOrThrow(DocumentsContract.Document.COLUMN_DISPLAY_NAME)
val mimeColumn = cursor.getColumnIndexOrThrow(DocumentsContract.Document.COLUMN_MIME_TYPE)
val modifiedColumn = cursor.getColumnIndexOrThrow(DocumentsContract.Document.COLUMN_LAST_MODIFIED)
while (cursor.moveToNext()) {
val documentId = cursor.getString(idColumn) ?: continue
if (cursor.getString(mimeColumn) == DocumentsContract.Document.MIME_TYPE_DIR) {
pendingDirs.addLast(documentId)
} else {
val name = cursor.getString(nameColumn) ?: continue
val extension = name.substringAfterLast('.', "").lowercase()
if (extension in Constants.SUPPORTED_IMAGE_EXTENSIONS) {
results.add(
ScannedImage(
uri = DocumentsContract.buildDocumentUriUsingTree(this, documentId),
name = name,
lastModified = if (cursor.isNull(modifiedColumn)) 0L else cursor.getLong(modifiedColumn)
)
)
if (onProgress != null && results.size - lastReported >= PROGRESS_REPORT_INTERVAL) {
lastReported = results.size
onProgress(results.size)
}
}
}
}
}
} catch (_: Exception) {
// Skip directories that can't be read and continue with the rest of the tree.
}
}
onProgress?.invoke(results.size)
return results
}
/** Report scan progress at most once per this many discovered images. */
private const val PROGRESS_REPORT_INTERVAL = 512
/**
* UUID generation
*/
fun generateId(): String = UUID.randomUUID().toString()
@@ -0,0 +1,22 @@
package com.anthonyla.paperize.core.util
import android.Manifest
import android.content.Context
import android.content.pm.PackageManager
import android.os.Build
import androidx.core.content.ContextCompat
object PermissionUtil {
fun hasNotificationPermission(context: Context): Boolean {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
ContextCompat.checkSelfPermission(
context,
Manifest.permission.POST_NOTIFICATIONS
) == PackageManager.PERMISSION_GRANTED
} else {
true
}
}
}
@@ -0,0 +1,88 @@
package com.anthonyla.paperize.core.util
/**
* Utility object for building and managing wallpaper queues
* Extracted from WallpaperRepositoryImpl for testability
*
* Note: The DAO-specific operations remain in the repository,
* but the pure logic functions are extracted here for testing.
*/
object QueueBuilder {
/**
* Build a queue of wallpaper IDs based on display order (sequential mode)
* @param wallpaperIds List of wallpaper IDs with their display orders
* @return List of IDs sorted by display order
*/
fun buildSequentialQueue(wallpaperIds: List<Pair<String, Int>>): List<String> {
return wallpaperIds.sortedBy { it.second }.map { it.first }
}
/**
* Build a shuffled queue of wallpaper IDs
* @param wallpaperIds List of wallpaper IDs to shuffle
* @return Shuffled list of IDs
*/
fun buildShuffledQueue(wallpaperIds: List<String>): List<String> {
return wallpaperIds.shuffled()
}
/**
* Merge existing queue with new wallpapers while preserving existing order
* Used when new wallpapers are added to an album during shuffle mode
* @param existingQueueIds Current queue order (filtered to valid IDs)
* @param allWallpaperIds All current wallpaper IDs in the album
* @return Combined list with existing order preserved, new IDs shuffled at end
*/
fun mergeWithExistingQueue(
existingQueueIds: List<String>,
allWallpaperIds: List<String>
): List<String> {
val allSet = allWallpaperIds.toHashSet()
val existingSet = existingQueueIds.toHashSet()
val existingValid = existingQueueIds.filter { it in allSet }
val newWallpaperIds = allWallpaperIds.filter { it !in existingSet }
return existingValid + newWallpaperIds.shuffled()
}
/**
* Deterministic version of mergeWithExistingQueue for testing
* New wallpapers are appended in their original order instead of shuffled
*/
fun mergeWithExistingQueueDeterministic(
existingQueueIds: List<String>,
allWallpaperIds: List<String>
): List<String> {
val allSet = allWallpaperIds.toHashSet()
val existingSet = existingQueueIds.toHashSet()
val existingValid = existingQueueIds.filter { it in allSet }
val newWallpaperIds = allWallpaperIds.filter { it !in existingSet }
return existingValid + newWallpaperIds
}
/**
* Build a wallpaper queue based on shuffle and existing queues
* @param wallpapers Current list of wallpapers in the album
* @param shuffle Whether shuffle is enabled
* @param otherScreenQueue Optional existing queue for another screen type to synchronize with
* @return List of wallpaper IDs for the new queue
*/
fun buildQueue(
wallpapers: List<com.anthonyla.paperize.domain.model.Wallpaper>,
shuffle: Boolean,
otherScreenQueue: List<String>? = null
): List<String> {
return if (shuffle) {
if (otherScreenQueue != null && otherScreenQueue.isNotEmpty()) {
// Synchronize with existing queue from another screen
mergeWithExistingQueue(otherScreenQueue, wallpapers.map { it.id })
} else {
// New shuffled order
buildShuffledQueue(wallpapers.map { it.id })
}
} else {
// Sequential order by displayOrder
buildSequentialQueue(wallpapers.map { it.id to it.displayOrder })
}
}
}
@@ -0,0 +1,25 @@
package com.anthonyla.paperize.core.util
import android.app.WallpaperManager
import android.graphics.Bitmap
import java.io.IOException
/**
* Apply a bitmap and treat WallpaperManager's documented zero return value as a failure.
*/
fun WallpaperManager.setBitmapChecked(bitmap: Bitmap, which: Int): Int {
check(bitmap.width > 0 && bitmap.height > 0) {
"Invalid bitmap dimensions: ${bitmap.width}x${bitmap.height}"
}
check(!bitmap.isRecycled) { "Bitmap has been recycled" }
val wallpaperId = setBitmap(bitmap, null, true, which)
requireWallpaperSetSucceeded(wallpaperId)
return wallpaperId
}
internal fun requireWallpaperSetSucceeded(wallpaperId: Int) {
if (wallpaperId == 0) {
throw IOException("WallpaperManager rejected the wallpaper")
}
}
@@ -0,0 +1,249 @@
package com.anthonyla.paperize.core.util
import com.anthonyla.paperize.domain.model.Folder
import com.anthonyla.paperize.domain.model.Wallpaper
/**
* Utility object for sorting wallpapers and folders
* Extracted from ViewModels for testability
*/
object WallpaperSorter {
/**
* Sort wallpapers by filename (alphabetically)
* @param wallpapers List of wallpapers to sort
* @param ascending True for A-Z, false for Z-A
* @return New sorted list preserving original list
*/
fun sortWallpapersByName(
wallpapers: List<Wallpaper>,
ascending: Boolean = true
): List<Wallpaper> {
return if (ascending) {
wallpapers.sortedBy { it.fileName.lowercase() }
} else {
wallpapers.sortedByDescending { it.fileName.lowercase() }
}
}
/**
* Sort wallpapers by date added (addedAt timestamp)
* @param wallpapers List of wallpapers to sort
* @param ascending True for oldest first, false for newest first
* @return New sorted list preserving original list
*/
fun sortWallpapersByDateAdded(
wallpapers: List<Wallpaper>,
ascending: Boolean = true
): List<Wallpaper> {
return if (ascending) {
wallpapers.sortedBy { it.addedAt }
} else {
wallpapers.sortedByDescending { it.addedAt }
}
}
/**
* Sort wallpapers by date modified (dateModified timestamp)
* @param wallpapers List of wallpapers to sort
* @param ascending True for oldest first, false for newest first
* @return New sorted list preserving original list
*/
fun sortWallpapersByDateModified(
wallpapers: List<Wallpaper>,
ascending: Boolean = true
): List<Wallpaper> {
return if (ascending) {
wallpapers.sortedBy { it.dateModified }
} else {
wallpapers.sortedByDescending { it.dateModified }
}
}
/**
* Sort folders by name (alphabetically)
*/
fun sortFoldersByName(
folders: List<Folder>,
ascending: Boolean = true
): List<Folder> {
return if (ascending) {
folders.sortedBy { it.name.lowercase() }
} else {
folders.sortedByDescending { it.name.lowercase() }
}
}
/**
* Sort folders by date modified
*/
fun sortFoldersByDateModified(
folders: List<Folder>,
ascending: Boolean = true
): List<Folder> {
return if (ascending) {
folders.sortedBy { it.dateModified }
} else {
folders.sortedByDescending { it.dateModified }
}
}
/**
* Shift a wallpaper within a list (drag and drop)
* @param wallpapers Current list of wallpapers
* @param fromUri URI of the wallpaper being moved
* @param toUri URI of the target position
* @return New list with wallpaper moved and display orders updated
*/
fun shiftWallpaper(
wallpapers: List<Wallpaper>,
fromUri: String,
toUri: String
): List<Wallpaper> {
val mutableList = wallpapers.toMutableList()
val fromIndex = mutableList.indexOfFirst { it.uri == fromUri }
val toIndex = mutableList.indexOfFirst { it.uri == toUri }
if (fromIndex == -1 || toIndex == -1) return wallpapers
val movedItem = mutableList.removeAt(fromIndex)
mutableList.add(toIndex, movedItem)
return applyDisplayOrder(mutableList)
}
/**
* Shift a folder within a list (drag and drop)
* @param folders Current list of folders
* @param fromUri URI of the folder being moved
* @param toUri URI of the target position
* @return New list with folder moved and display orders updated
*/
fun shiftFolder(
folders: List<Folder>,
fromUri: String,
toUri: String
): List<Folder> {
val mutableList = folders.toMutableList()
val fromIndex = mutableList.indexOfFirst { it.uri == fromUri }
val toIndex = mutableList.indexOfFirst { it.uri == toUri }
if (fromIndex == -1 || toIndex == -1) return folders
val movedItem = mutableList.removeAt(fromIndex)
mutableList.add(toIndex, movedItem)
return applyFolderDisplayOrder(mutableList)
}
/**
* Shift a wallpaper within a folder's wallpaper list
* @param folders List of all folders
* @param folderId ID of the folder containing the wallpaper
* @param fromUri URI of the wallpaper being moved
* @param toUri URI of the target position
* @return Pair of updated folders list and the new cover URI for the folder
*/
fun shiftWallpaperInFolder(
folders: List<Folder>,
folderId: String,
fromUri: String,
toUri: String
): List<Folder> {
return folders.map { folder ->
if (folder.id == folderId) {
val updatedWallpapers = shiftWallpaper(folder.wallpapers, fromUri, toUri)
folder.copy(
wallpapers = updatedWallpapers,
coverUri = updatedWallpapers.firstOrNull()?.uri ?: folder.coverUri
)
} else {
folder
}
}
}
/**
* Sort all folders and wallpapers alphabetically
*/
fun sortAllAlphabetically(
folders: List<Folder>,
wallpapers: List<Wallpaper>,
ascending: Boolean = true
): Pair<List<Folder>, List<Wallpaper>> {
val sortedFolders = folders.map { folder ->
val sortedWallpapers = sortWallpapersByName(folder.wallpapers, ascending)
val orderedWallpapers = applyDisplayOrder(sortedWallpapers)
folder.copy(
wallpapers = orderedWallpapers,
coverUri = orderedWallpapers.firstOrNull()?.uri ?: folder.coverUri
)
}
val finalFolders = if (ascending) {
sortedFolders.sortedBy { it.name.lowercase() }
} else {
sortedFolders.sortedByDescending { it.name.lowercase() }
}
val finalWallpapers = sortWallpapersByName(wallpapers, ascending)
return Pair(
applyFolderDisplayOrder(finalFolders),
applyDisplayOrder(finalWallpapers)
)
}
/**
* Sort all folders and wallpapers by date modified
*/
fun sortAllByDateModified(
folders: List<Folder>,
wallpapers: List<Wallpaper>,
ascending: Boolean = true
): Pair<List<Folder>, List<Wallpaper>> {
val sortedFolders = folders.map { folder ->
val sortedWallpapers = sortWallpapersByDateModified(folder.wallpapers, ascending)
val orderedWallpapers = applyDisplayOrder(sortedWallpapers)
folder.copy(
wallpapers = orderedWallpapers,
coverUri = orderedWallpapers.firstOrNull()?.uri ?: folder.coverUri
)
}
val finalFolders = if (ascending) {
sortedFolders.sortedBy { it.dateModified }
} else {
sortedFolders.sortedByDescending { it.dateModified }
}
val finalWallpapers = sortWallpapersByDateModified(wallpapers, ascending)
return Pair(
applyFolderDisplayOrder(finalFolders),
applyDisplayOrder(finalWallpapers)
)
}
/**
* Apply displayOrder indices to sorted wallpapers
* @param wallpapers Sorted list of wallpapers
* @return New list with displayOrder updated to match list position
*/
fun applyDisplayOrder(wallpapers: List<Wallpaper>): List<Wallpaper> {
return wallpapers.mapIndexed { index, wallpaper ->
wallpaper.copy(displayOrder = index)
}
}
/**
* Apply displayOrder indices to sorted folders
* @param folders Sorted list of folders
* @return New list with folder moved and display orders updated
*/
fun applyFolderDisplayOrder(folders: List<Folder>): List<Folder> {
return folders.mapIndexed { index, folder ->
folder.copy(displayOrder = index)
}
}
}
@@ -0,0 +1,995 @@
package com.anthonyla.paperize.core.util
import com.anthonyla.paperize.core.constants.Constants
import android.app.WallpaperManager
import android.content.Context
import android.content.res.Configuration
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.ColorMatrix
import android.graphics.ColorMatrixColorFilter
import android.graphics.HardwareRenderer
import android.graphics.ImageDecoder
import android.graphics.Matrix
import android.graphics.Paint
import android.graphics.PixelFormat
import android.graphics.PorterDuff
import android.graphics.PorterDuffXfermode
import android.graphics.RadialGradient
import android.graphics.RenderEffect
import android.graphics.RenderNode
import android.graphics.Shader
import android.hardware.display.DisplayManager
import android.hardware.HardwareBuffer
import android.media.ImageReader
import android.net.Uri
import android.util.Log
import android.util.Size
import android.view.Display
import android.view.WindowManager
import android.view.WindowMetrics
import androidx.compose.ui.util.fastRoundToInt
import androidx.core.graphics.scale
import androidx.exifinterface.media.ExifInterface
import com.anthonyla.paperize.core.ScalingType
import com.anthonyla.paperize.core.WallpaperMediaType
/**
* Wallpaper utility functions for bitmap processing and effects
*
* Improvements:
* - Added EXIF orientation handling
* - API-safe blur with fallback for Android < S
* - Memory management with bitmap recycling
* - Effect enable flags respected
* - Quality optimization options
*/
private const val TAG = "WallpaperUtil"
private const val BUILT_IN_DISPLAY_CATEGORY =
"android.hardware.display.category.BUILT_IN_DISPLAYS"
/**
* Get EXIF orientation from URI
*/
fun Uri.getExifOrientation(context: Context): Int {
return try {
context.contentResolver.openInputStream(this)?.use { inputStream ->
val exif = ExifInterface(inputStream)
exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED)
} ?: ExifInterface.ORIENTATION_UNDEFINED
} catch (e: Exception) {
Log.w(TAG, "Error reading EXIF orientation: $e")
ExifInterface.ORIENTATION_UNDEFINED
}
}
/**
* Create transformation matrix for EXIF orientation
*/
fun getExifTransformationMatrix(orientation: Int, width: Int, height: Int): Matrix {
val matrix = Matrix()
when (orientation) {
ExifInterface.ORIENTATION_FLIP_HORIZONTAL -> {
matrix.setScale(-1f, 1f)
matrix.postTranslate(width.toFloat(), 0f)
}
ExifInterface.ORIENTATION_ROTATE_180 -> {
matrix.setRotate(180f)
matrix.postTranslate(width.toFloat(), height.toFloat())
}
ExifInterface.ORIENTATION_FLIP_VERTICAL -> {
matrix.setScale(1f, -1f)
matrix.postTranslate(0f, height.toFloat())
}
ExifInterface.ORIENTATION_TRANSPOSE -> {
matrix.setRotate(90f)
matrix.postScale(-1f, 1f)
}
ExifInterface.ORIENTATION_ROTATE_90 -> {
matrix.setRotate(90f)
matrix.postTranslate(height.toFloat(), 0f)
}
ExifInterface.ORIENTATION_TRANSVERSE -> {
matrix.setRotate(-90f)
matrix.postScale(-1f, 1f)
}
ExifInterface.ORIENTATION_ROTATE_270 -> {
matrix.setRotate(-90f)
matrix.postTranslate(0f, width.toFloat())
}
}
return matrix
}
/**
* Calculate the inSampleSize for the image
*/
fun calculateInSampleSize(imageSize: Size, width: Int, height: Int): Int {
if (imageSize.width == 0 || imageSize.height == 0) return 1
if (width == 0 || height == 0) return 1
if (imageSize.width > width || imageSize.height > height) {
// Integer division (floor) ensures inSampleSize is never larger than needed,
// guaranteeing the decoded bitmap is at least as wide/tall as the target.
// fastRoundToInt() can round UP, producing a bitmap smaller than the target.
val heightRatio = imageSize.height / height
val widthRatio = imageSize.width / width
return minOf(heightRatio, widthRatio).coerceAtLeast(1)
}
return 1
}
/**
* Get device screen size without orientation
*/
object ScreenMetricsCompat {
fun getScreenSize(context: Context): Size {
val windowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
val metrics: WindowMetrics = windowManager.currentWindowMetrics
val currentWindow = metrics.bounds.width() to metrics.bounds.height()
// Display.Mode dimensions are reported in the panel's natural orientation. Prefer them
// over currentWindowMetrics so a scheduled change while a landscape game is foregrounded
// cannot permanently rotate and over-crop the wallpaper bitmap.
val displayManager = context.getSystemService(DisplayManager::class.java)
val builtInDisplays = displayManager
?.getDisplays(BUILT_IN_DISPLAY_CATEGORY)
.orEmpty()
val candidateDisplays = if (builtInDisplays.isNotEmpty()) {
// Android 17+ returns all built-in panels, including currently inactive panels.
builtInDisplays.asSequence()
} else {
// Compatibility fallback for releases where the built-in category is unknown.
// Exclude presentation and app-owned virtual displays.
displayManager?.displays
?.asSequence()
?.filter { display ->
display.flags and Display.FLAG_PRESENTATION == 0 &&
display.flags and Display.FLAG_PRIVATE == 0
}
.orEmpty()
}
val supportedModes = candidateDisplays
.flatMap { display ->
display.supportedModes.asSequence().map { mode ->
mode.physicalWidth to mode.physicalHeight
}
}
.toList()
val selected = selectWallpaperDisplayDimensions(currentWindow, supportedModes)
return Size(selected.first, selected.second)
}
}
/** Prefer stable natural-orientation panel modes, falling back to the current window if needed. */
internal fun selectWallpaperDisplayDimensions(
currentWindow: Pair<Int, Int>,
supportedModes: Iterable<Pair<Int, Int>>
): Pair<Int, Int> = selectLargestDisplayDimensions(supportedModes)
?: currentWindow.takeIf { (width, height) -> width > 0 && height > 0 }
?: (1 to 1)
/**
* Select the highest-resolution display dimensions.
*
* Kept platform-independent so foldable sizing behavior is covered by local unit tests.
*/
internal fun selectLargestDisplayDimensions(
candidates: Iterable<Pair<Int, Int>>
): Pair<Int, Int>? = candidates
.filter { (width, height) -> width > 0 && height > 0 }
.maxWithOrNull(
compareBy<Pair<Int, Int>>(
{ (width, height) -> width.toLong() * height.toLong() },
{ (width, height) -> maxOf(width, height) },
{ (width, height) -> minOf(width, height) }
)
)
/**
* Get the stable natural-orientation size of the largest built-in display panel.
*/
fun getDeviceScreenSize(context: Context): Size = ScreenMetricsCompat.getScreenSize(context)
/**
* Get the target render size for a wallpaper bitmap.
*
* Every static scaling mode is rendered against one physical panel. A launcher's desired
* wallpaper canvas may be much wider than the display; using it for FIT/NONE creates black-only
* viewports and using it for STRETCH distorts the image. Optional FILL scrolling retains real
* source overflow after decoding instead of inflating the target canvas.
*/
fun getWallpaperRenderSize(
context: Context,
screenType: com.anthonyla.paperize.core.ScreenType,
scaling: ScalingType = ScalingType.FIT
): Size = getDeviceScreenSize(context)
/**
* Whether a static wallpaper should retain source overflow for launcher-managed scrolling.
*
* FIT/STRETCH/NONE use an exact launcher canvas so Android cannot rescale them into FILL.
*/
internal fun usesLauncherManagedScrolling(
screenType: com.anthonyla.paperize.core.ScreenType,
scaling: ScalingType,
scrollingEnabled: Boolean
): Boolean =
scrollingEnabled &&
(screenType == com.anthonyla.paperize.core.ScreenType.HOME ||
screenType == com.anthonyla.paperize.core.ScreenType.BOTH) &&
scaling == ScalingType.FILL
/**
* Retrieve a bitmap from a URI that is scaled down to the device's screen size.
*
* ImageDecoder is the primary path: it auto-applies EXIF orientation and exposes
* post-EXIF dimensions in the callback via info.size, so we no longer need a
* separate getImageDimensions() pre-read. The BitmapFactory fallback computes its
* own inSampleSize inline to avoid an extra stream open on the happy path.
*/
fun retrieveBitmap(
context: Context,
wallpaperUri: Uri,
width: Int,
height: Int,
scaling: ScalingType = ScalingType.FIT,
preserveSourceOverflow: Boolean = false
): Bitmap? {
// ImageDecoder auto-applies EXIF orientation; info.size is the post-EXIF display size.
// No separate getImageDimensions() call needed — saves 1-2 stream opens per wallpaper.
var decodedWithImageDecoder = false
val bitmap = try {
val source = ImageDecoder.createSource(context.contentResolver, wallpaperUri)
val result = ImageDecoder.decodeBitmap(source) { decoder, info, _ ->
val srcWidth = info.size.width
val srcHeight = info.size.height
when (scaling) {
ScalingType.FILL -> {
// Scale to fill, then crop to canvas during decode.
// setCrop avoids allocating the full fill-scale bitmap (which can be
// much taller/wider than the canvas) — major OOM prevention.
val scale = maxOf(width.toFloat() / srcWidth, height.toFloat() / srcHeight)
val targetW = (srcWidth * scale).fastRoundToInt()
val targetH = (srcHeight * scale).fastRoundToInt()
decoder.setTargetSize(targetW, targetH)
if (!preserveSourceOverflow && (targetW > width || targetH > height)) {
val cropX = ((targetW - width) / 2).coerceAtLeast(0)
val cropY = ((targetH - height) / 2).coerceAtLeast(0)
decoder.setCrop(android.graphics.Rect(
cropX, cropY, cropX + width, cropY + height
))
}
}
ScalingType.FIT -> {
val scale = minOf(width.toFloat() / srcWidth, height.toFloat() / srcHeight)
decoder.setTargetSize(
(srcWidth * scale).fastRoundToInt(),
(srcHeight * scale).fastRoundToInt()
)
}
ScalingType.STRETCH -> decoder.setTargetSize(width, height)
ScalingType.NONE -> {
val maxWidth = width * 2
val maxHeight = height * 2
if (srcWidth > maxWidth || srcHeight > maxHeight) {
val scale = minOf(maxWidth.toFloat() / srcWidth, maxHeight.toFloat() / srcHeight)
decoder.setTargetSize(
(srcWidth * scale).fastRoundToInt(),
(srcHeight * scale).fastRoundToInt()
)
}
// else: decode at original resolution
}
}
decoder.isMutableRequired = true
decoder.allocator = ImageDecoder.ALLOCATOR_SOFTWARE
}
decodedWithImageDecoder = true
result
} catch (e: Exception) {
Log.w(TAG, "ImageDecoder failed, falling back to BitmapFactory: $e")
try {
// Compute inSampleSize from a bounds-only pass, then decode in a second pass.
// Two opens only on the rare fallback path — the primary ImageDecoder path is free.
val sampleSize = context.contentResolver.openInputStream(wallpaperUri)?.use { stream ->
val opts = BitmapFactory.Options().apply { inJustDecodeBounds = true }
BitmapFactory.decodeStream(stream, null, opts)
if (scaling == ScalingType.NONE || opts.outWidth <= 0 || opts.outHeight <= 0) 1
else calculateInSampleSize(Size(opts.outWidth, opts.outHeight), width, height)
} ?: 1
context.contentResolver.openInputStream(wallpaperUri)?.use { stream ->
BitmapFactory.decodeStream(stream, null, BitmapFactory.Options().apply {
inSampleSize = sampleSize
inMutable = true
inPreferredConfig = Bitmap.Config.ARGB_8888
})
}
} catch (oom: OutOfMemoryError) {
Log.e(TAG, "OOM during BitmapFactory fallback for $wallpaperUri: $oom")
null
}
} catch (e: OutOfMemoryError) {
Log.e(TAG, "OOM during retrieveBitmap for $wallpaperUri: $e")
null
}
// Only apply EXIF orientation for the BitmapFactory path — ImageDecoder already handles it
val oriented = if (decodedWithImageDecoder) bitmap else bitmap?.let { applyExifOrientation(it, wallpaperUri, context) }
// Composite onto an exact (width × height) canvas so WallpaperManager.setBitmap() receives
// a bitmap that already matches the desired canvas dimensions. Without this step the launcher
// still has to scale/position the bitmap, which undoes the scaling mode the user chose:
// FILL → decoded bitmap may be taller than canvas; center-crop to canvas size.
// FIT → decoded bitmap may be narrower/shorter than canvas; center on black canvas.
// NONE → original-size image may be smaller than canvas; center on black canvas.
// STRETCH → decoder was told the exact canvas size; no-op.
return oriented?.let {
if (preserveSourceOverflow && scaling == ScalingType.FILL) {
scaleToFillPreservingOverflow(it, width, height)
} else {
finalizeToCanvas(it, width, height, scaling)
}
}
}
/**
* Scale [source] just enough to cover one screen while retaining any overflow.
*
* The returned bitmap may be wider than [width] or taller than [height]. That overflow is what a
* launcher uses to scroll a static wallpaper without moving past the source image's real edge.
*/
private fun scaleToFillPreservingOverflow(
source: Bitmap,
width: Int,
height: Int
): Bitmap {
val scale = maxOf(
width.toFloat() / source.width,
height.toFloat() / source.height
)
val targetW = (source.width * scale).fastRoundToInt()
val targetH = (source.height * scale).fastRoundToInt()
if (targetW == source.width && targetH == source.height) return source
val scaled = source.scale(targetW, targetH)
if (scaled !== source) source.recycle()
return scaled
}
/**
* Produce a bitmap of exactly [canvasW] × [canvasH] pixels according to [scaling]:
*
* - FILL: the source already fills (or overflows) the canvas because [retrieveBitmap]
* decoded it at fill-scale. Center-crop any overflow.
* - FIT: the source fits within the canvas but may leave empty margins.
* Draw it centered on a black [canvasW]×[canvasH] bitmap.
* - STRETCH: [retrieveBitmap] decoded to the exact canvas size; nothing to do.
* - NONE: the source is at most canvas-sized (possibly smaller).
* Draw it centered on a black [canvasW]×[canvasH] bitmap.
*/
private fun finalizeToCanvas(source: Bitmap, canvasW: Int, canvasH: Int, scaling: ScalingType): Bitmap {
val sw = source.width
val sh = source.height
return when (scaling) {
ScalingType.FILL -> {
// Primary path (ImageDecoder): source was decoded at fill-scale so it is
// >= canvasW wide AND >= canvasH tall. Center-crop to exact canvas size.
// Fallback path (BitmapFactory): source may be smaller if the image needed
// upscaling — scale up first, then center-crop.
val fillSrc = if (sw < canvasW || sh < canvasH) {
val scale = maxOf(canvasW.toFloat() / sw, canvasH.toFloat() / sh)
val scaledW = (sw * scale).fastRoundToInt()
val scaledH = (sh * scale).fastRoundToInt()
val scaled = Bitmap.createScaledBitmap(source, scaledW, scaledH, true)
if (scaled !== source) source.recycle()
scaled
} else source
val fsw = fillSrc.width
val fsh = fillSrc.height
if (fsw == canvasW && fsh == canvasH) return fillSrc
val x = ((fsw - canvasW) / 2).coerceAtLeast(0)
val y = ((fsh - canvasH) / 2).coerceAtLeast(0)
val cropped = Bitmap.createBitmap(fillSrc, x, y, canvasW, canvasH)
if (cropped !== fillSrc) fillSrc.recycle()
cropped
}
ScalingType.FIT, ScalingType.NONE -> {
// FIT / NONE: source fits within the canvas; center it on a black background.
if (sw == canvasW && sh == canvasH) return source
compositeCenter(source, canvasW, canvasH)
}
ScalingType.STRETCH -> source // decoder was given exact canvas dimensions
}
}
/**
* Draw [source] centered on a new [canvasW]×[canvasH] black bitmap and return the result.
* [source] is recycled unless it is the same object as the returned bitmap.
*/
private fun compositeCenter(source: Bitmap, canvasW: Int, canvasH: Int): Bitmap {
val canvas = Bitmap.createBitmap(canvasW, canvasH, Bitmap.Config.ARGB_8888)
val c = Canvas(canvas)
c.drawColor(Color.BLACK)
val offsetX = ((canvasW - source.width) / 2f).coerceAtLeast(0f)
val offsetY = ((canvasH - source.height) / 2f).coerceAtLeast(0f)
c.drawBitmap(source, offsetX, offsetY, null)
source.recycle()
return canvas
}
/**
* Apply EXIF orientation to bitmap
*/
private fun applyExifOrientation(source: Bitmap, uri: Uri, context: Context): Bitmap {
val orientation = uri.getExifOrientation(context)
if (orientation == ExifInterface.ORIENTATION_UNDEFINED || orientation == ExifInterface.ORIENTATION_NORMAL) {
return source
}
return try {
val matrix = getExifTransformationMatrix(orientation, source.width, source.height)
val rotated = Bitmap.createBitmap(source, 0, 0, source.width, source.height, matrix, true)
if (rotated != source) {
source.recycle() // Recycle old bitmap to free memory
}
rotated
} catch (e: Exception) {
Log.e(TAG, "Error applying EXIF orientation: $e")
source
} catch (e: OutOfMemoryError) {
Log.e(TAG, "OOM applying EXIF orientation: $e")
source
}
}
/**
* Darken the bitmap by a certain percentage
* @param darkenPercent 0-100 (0 is original brightness, 100 is completely dark/black)
*/
fun darkenBitmap(source: Bitmap, darkenPercent: Int): Bitmap {
if (!source.isMutable) {
Log.w(TAG, "darkenBitmap received an immutable bitmap. Creating a mutable copy.")
val mutableCopy = source.copy(source.config ?: Bitmap.Config.ARGB_8888, true)
// Do not recycle source here — caller owns the lifecycle and handles recycling
return darkenBitmap(mutableCopy, darkenPercent)
}
// Convert darkenPercent to brightness factor (invert)
val targetBrightnessFactor = (100 - darkenPercent.coerceIn(0, 100)) / 100f
if (targetBrightnessFactor >= 1.0f) {
return source
}
val paint = Paint().apply {
colorFilter = ColorMatrixColorFilter(ColorMatrix().apply {
setScale(targetBrightnessFactor, targetBrightnessFactor, targetBrightnessFactor, 1f)
})
xfermode = PorterDuffXfermode(PorterDuff.Mode.SRC)
}
Canvas(source).drawBitmap(source, 0f, 0f, paint)
return source
}
/**
* Blur the bitmap using GPU acceleration
* @param percent 0-100
*/
fun blurBitmapHardware(source: Bitmap, percent: Int): Bitmap {
val clampedPercent = percent.coerceIn(0, 100)
if (clampedPercent == 0) {
return source
}
val maxBlurRadius = Constants.MAX_BLUR_RADIUS
val radius = (clampedPercent / 100.0f) * maxBlurRadius
val imageReader = ImageReader.newInstance(
source.width, source.height,
PixelFormat.RGBA_8888, 1,
HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE or HardwareBuffer.USAGE_GPU_COLOR_OUTPUT
)
val renderNode = RenderNode("BlurEffect")
val hardwareRenderer = HardwareRenderer()
var resultBitmap: Bitmap?
try {
hardwareRenderer.setSurface(imageReader.surface)
hardwareRenderer.setContentRoot(renderNode)
renderNode.setPosition(0, 0, source.width, source.height)
val blurEffect = RenderEffect.createBlurEffect(radius, radius, Shader.TileMode.CLAMP)
renderNode.setRenderEffect(blurEffect)
val canvas = renderNode.beginRecording()
canvas.drawBitmap(source, 0f, 0f, null)
renderNode.endRecording()
hardwareRenderer.createRenderRequest()
.setWaitForPresent(true)
.syncAndDraw()
val image = imageReader.acquireNextImage()
?: throw IllegalStateException("Failed to acquire blurred image")
try {
val hardwareBuffer = image.hardwareBuffer
?: throw IllegalStateException("Failed to acquire hardware buffer")
try {
val hardwareBitmap = Bitmap.wrapHardwareBuffer(hardwareBuffer, null)
?: throw IllegalStateException("Failed to create bitmap from hardware buffer")
// Convert hardware bitmap to regular bitmap for further processing
// Use mutable=true to allow subsequent effects to modify in-place
resultBitmap = hardwareBitmap.copy(Bitmap.Config.ARGB_8888, true)
?: throw IllegalStateException("Failed to copy hardware bitmap to software bitmap")
hardwareBitmap.recycle()
} finally {
hardwareBuffer.close()
}
} finally {
image.close()
}
} catch (e: Exception) {
Log.e(TAG, "Error blurring bitmap: $e")
return source
} catch (e: OutOfMemoryError) {
Log.e(TAG, "OOM blurring bitmap: $e")
return source
} finally {
hardwareRenderer.destroy()
renderNode.discardDisplayList()
imageReader.close()
}
return resultBitmap
}
/**
* Blur bitmap using GPU acceleration
*/
fun blurBitmap(source: Bitmap, percent: Int): Bitmap {
return blurBitmapHardware(source, percent)
}
/**
* Apply a vignette effect to the bitmap
* @param percent 0-100
*/
fun vignetteBitmap(source: Bitmap, percent: Int): Bitmap {
if (percent <= 0) return source
if (!source.isMutable) {
Log.w(TAG, "vignetteBitmap received an immutable bitmap. Creating a mutable copy.")
val mutableCopy = source.copy(source.config ?: Bitmap.Config.ARGB_8888, true)
// Do not recycle source here — caller owns the lifecycle and handles recycling
return vignetteBitmap(mutableCopy, percent)
}
return try {
val canvas = Canvas(source)
// Use corner-to-center diagonal so the vignette darkens uniformly in all directions
val halfW = source.width / 2f
val halfH = source.height / 2f
val diagonal = kotlin.math.sqrt(halfW * halfW + halfH * halfH)
val rad = (diagonal * (1 - (percent.coerceIn(0, 100) / Constants.VIGNETTE_DIVISOR))).coerceAtLeast(Constants.VIGNETTE_MIN_RADIUS)
val centerX = source.width / 2f
val centerY = source.height / 2f
val colors = intArrayOf(
Color.TRANSPARENT,
Color.argb((Constants.VIGNETTE_INNER_ALPHA * 255).toInt(), 0, 0, 0),
Color.argb((Constants.VIGNETTE_OUTER_ALPHA * 255).toInt(), 0, 0, 0)
)
val pos = Constants.VIGNETTE_GRADIENT_POSITIONS
val vignettePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
shader = RadialGradient(
centerX, centerY, rad,
colors, pos, Shader.TileMode.CLAMP
)
}
canvas.drawRect(0f, 0f, source.width.toFloat(), source.height.toFloat(), vignettePaint)
source
} catch (e: Exception) {
Log.e(TAG, "Error applying vignette: $e")
source
} catch (e: OutOfMemoryError) {
Log.e(TAG, "OOM applying vignette: $e")
source
}
}
/**
* Apply a grayscale filter to the bitmap
* @param percent 0-100 (0 is original, 100 is full grayscale)
*/
fun grayscaleBitmap(source: Bitmap, percent: Int): Bitmap {
if (percent <= 0) return source
if (!source.isMutable) {
Log.w(TAG, "grayscaleBitmap received an immutable bitmap. Creating a mutable copy.")
val mutableCopy = source.copy(source.config ?: Bitmap.Config.ARGB_8888, true)
// Do not recycle source here — caller owns the lifecycle and handles recycling
return grayscaleBitmap(mutableCopy, percent)
}
val factor = percent.coerceIn(0, 100) / 100f
if (factor <= 0f) return source
val colorMatrix = ColorMatrix().apply { setSaturation(1 - factor) }
val paint = Paint().apply {
colorFilter = ColorMatrixColorFilter(colorMatrix)
xfermode = PorterDuffXfermode(PorterDuff.Mode.SRC)
}
Canvas(source).drawBitmap(source, 0f, 0f, paint)
return source
}
/**
* Calculate brightness estimate of bitmap (0.0 - 1.0)
* Uses luminance calculation based on RGB values
*/
fun calculateBitmapBrightness(bitmap: Bitmap): Float {
return BrightnessCalculator.calculateBitmapBrightness(bitmap)
}
/**
* Adjust bitmap brightness by a multiplier
* @param brightnessFactor Brightness multiplier (e.g., 0.7 to darken, 1.5 to brighten)
*/
fun adjustBitmapBrightness(source: Bitmap, brightnessFactor: Float): Bitmap {
if (brightnessFactor == 1.0f) return source
if (!source.isMutable) {
Log.w(TAG, "adjustBitmapBrightness received an immutable bitmap. Returning a copy.")
val mutableCopy = source.copy(source.config ?: Bitmap.Config.ARGB_8888, true)
// Do not recycle source here — caller owns the lifecycle and handles recycling
return adjustBitmapBrightness(mutableCopy, brightnessFactor)
}
val paint = Paint().apply {
colorFilter = ColorMatrixColorFilter(ColorMatrix().apply {
setScale(brightnessFactor, brightnessFactor, brightnessFactor, 1f)
})
xfermode = PorterDuffXfermode(PorterDuff.Mode.SRC)
}
Canvas(source).drawBitmap(source, 0f, 0f, paint)
return source
}
/**
* Get adaptive brightness multiplier factor based on system dark/light mode
*
* @param context Application context
* @param brightness Current image brightness (0.0 to 1.0)
* @return Multiplier factor to apply to colors
*/
fun getAdaptiveBrightnessMultiplier(context: Context, brightness: Float): Float {
val isDarkMode = (context.resources.configuration.uiMode and
Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
return BrightnessCalculator.getAdaptiveMultiplier(isDarkMode, brightness)
}
fun adaptiveBrightnessAdjustment(context: Context, source: Bitmap): Bitmap {
val isDarkMode = (context.resources.configuration.uiMode and
Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
val currentBrightness = BrightnessCalculator.calculateBitmapBrightness(source)
val adjustmentFactor = BrightnessCalculator.getAdaptiveMultiplier(isDarkMode, currentBrightness)
return if (adjustmentFactor != 1.0f) {
Log.d(TAG, "Adaptive brightness adjustment factor: $adjustmentFactor (brightness: $currentBrightness, dark mode: $isDarkMode)")
adjustBitmapBrightness(source, adjustmentFactor)
} else {
Log.d(TAG, "No adaptive brightness adjustment needed (brightness: $currentBrightness, dark mode: $isDarkMode)")
source
}
}
/**
* Process bitmap with all effects - now respects enable flags
* Properly manages bitmap lifecycle by recycling intermediate results
*
* Uses a GPU-accelerated pipeline via [RenderEffect] chaining when possible (API 31+).
* All colour-filter effects (darken, grayscale) and blur are composed into a single
* RenderNode draw call so there is only **one** GPU→CPU copy at the end.
* Vignette is drawn on the same RenderNode canvas before read-back.
* Falls back to the sequential CPU path on error.
*/
fun processBitmap(
source: Bitmap,
enableDarken: Boolean = false,
darkenPercent: Int = 0,
enableBlur: Boolean = false,
blurPercent: Int = 0,
enableVignette: Boolean = false,
vignettePercent: Int = 0,
enableGrayscale: Boolean = false,
grayscalePercent: Int = 0
): Bitmap {
// Fast path – nothing to do
val hasDarken = enableDarken && darkenPercent > 0
val hasBlur = enableBlur && blurPercent > 0
val hasVignette = enableVignette && vignettePercent > 0
val hasGrayscale = enableGrayscale && grayscalePercent > 0
if (!hasDarken && !hasBlur && !hasVignette && !hasGrayscale) return source
// Try GPU-chained path
try {
return processBitmapGpu(
source,
hasDarken, darkenPercent,
hasBlur, blurPercent,
hasVignette, vignettePercent,
hasGrayscale, grayscalePercent
)
} catch (e: Exception) {
Log.w(TAG, "GPU effects pipeline failed, falling back to CPU: $e")
} catch (e: OutOfMemoryError) {
Log.w(TAG, "OOM in GPU effects pipeline, falling back to CPU: $e")
}
// CPU fallback
return processBitmapCpu(
source,
hasDarken, darkenPercent,
hasBlur, blurPercent,
hasVignette, vignettePercent,
hasGrayscale, grayscalePercent
)
}
/**
* GPU-accelerated effects pipeline.
*
* Chains darken, blur, and grayscale as [RenderEffect]s on a single [RenderNode],
* draws the vignette overlay on the same canvas, and reads back the result once.
*/
private fun processBitmapGpu(
source: Bitmap,
hasDarken: Boolean, darkenPercent: Int,
hasBlur: Boolean, blurPercent: Int,
hasVignette: Boolean, vignettePercent: Int,
hasGrayscale: Boolean, grayscalePercent: Int
): Bitmap {
val w = source.width
val h = source.height
val imageReader = ImageReader.newInstance(
w, h, PixelFormat.RGBA_8888, 1,
HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE or HardwareBuffer.USAGE_GPU_COLOR_OUTPUT
)
val renderNode = RenderNode("EffectsChain")
val hardwareRenderer = HardwareRenderer()
try {
hardwareRenderer.setSurface(imageReader.surface)
hardwareRenderer.setContentRoot(renderNode)
renderNode.setPosition(0, 0, w, h)
// --- Build chained RenderEffect (darken → blur → grayscale) ---
var effect: RenderEffect? = null
if (hasDarken) {
val factor = (100 - darkenPercent.coerceIn(0, 100)) / 100f
val cm = ColorMatrix().apply { setScale(factor, factor, factor, 1f) }
val darkenEffect = RenderEffect.createColorFilterEffect(ColorMatrixColorFilter(cm))
effect = darkenEffect
}
if (hasBlur) {
val radius = (blurPercent.coerceIn(0, 100) / 100f) * Constants.MAX_BLUR_RADIUS
val blurEffect = RenderEffect.createBlurEffect(radius, radius, Shader.TileMode.CLAMP)
effect = if (effect != null) {
RenderEffect.createChainEffect(blurEffect, effect)
} else {
blurEffect
}
}
if (hasGrayscale) {
val factor = grayscalePercent.coerceIn(0, 100) / 100f
val cm = ColorMatrix().apply { setSaturation(1 - factor) }
val gsEffect = RenderEffect.createColorFilterEffect(ColorMatrixColorFilter(cm))
effect = if (effect != null) {
RenderEffect.createChainEffect(gsEffect, effect)
} else {
gsEffect
}
}
if (effect != null) {
renderNode.setRenderEffect(effect)
}
// --- Record canvas commands ---
val canvas = renderNode.beginRecording()
canvas.drawBitmap(source, 0f, 0f, null)
// Vignette is an overlay drawn on top of the source in the same pass
if (hasVignette) {
val halfW = w / 2f
val halfH = h / 2f
val diagonal = kotlin.math.sqrt(halfW * halfW + halfH * halfH)
val rad = (diagonal * (1 - (vignettePercent.coerceIn(0, 100) / Constants.VIGNETTE_DIVISOR)))
.coerceAtLeast(Constants.VIGNETTE_MIN_RADIUS)
val colors = intArrayOf(
Color.TRANSPARENT,
Color.argb((Constants.VIGNETTE_INNER_ALPHA * 255).toInt(), 0, 0, 0),
Color.argb((Constants.VIGNETTE_OUTER_ALPHA * 255).toInt(), 0, 0, 0)
)
val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
shader = RadialGradient(
halfW, halfH, rad,
colors, Constants.VIGNETTE_GRADIENT_POSITIONS, Shader.TileMode.CLAMP
)
}
canvas.drawRect(0f, 0f, w.toFloat(), h.toFloat(), paint)
}
renderNode.endRecording()
// --- Single GPU render + single read-back ---
hardwareRenderer.createRenderRequest()
.setWaitForPresent(true)
.syncAndDraw()
val image = imageReader.acquireNextImage()
?: throw IllegalStateException("Failed to acquire image after GPU render")
try {
val hwBuffer = image.hardwareBuffer
?: throw IllegalStateException("Failed to acquire hardware buffer")
try {
val hwBitmap = Bitmap.wrapHardwareBuffer(hwBuffer, null)
?: throw IllegalStateException("Failed to wrap hardware buffer")
val result = hwBitmap.copy(Bitmap.Config.ARGB_8888, true)
?: throw IllegalStateException("Failed to copy hardware bitmap")
hwBitmap.recycle()
return result
} finally {
hwBuffer.close()
}
} finally {
image.close()
}
} finally {
hardwareRenderer.destroy()
renderNode.discardDisplayList()
imageReader.close()
}
}
/**
* CPU fallback: applies effects sequentially (original implementation).
*/
private fun processBitmapCpu(
source: Bitmap,
hasDarken: Boolean, darkenPercent: Int,
hasBlur: Boolean, blurPercent: Int,
hasVignette: Boolean, vignettePercent: Int,
hasGrayscale: Boolean, grayscalePercent: Int
): Bitmap {
var result = source
if (hasDarken) {
result = darkenBitmap(result, darkenPercent)
}
if (hasBlur) {
val previous = result
result = blurBitmap(result, blurPercent)
if (result !== previous && previous !== source) {
previous.recycle()
}
}
if (hasVignette) {
val previous = result
result = vignetteBitmap(result, vignettePercent)
if (result !== previous && previous !== source) {
previous.recycle()
}
}
if (hasGrayscale) {
val previous = result
result = grayscaleBitmap(result, grayscalePercent)
if (result !== previous && previous !== source) {
previous.recycle()
}
}
return result
}
/**
* Detect media type from URI
*
* Examines the file extension and MIME type to determine the media type.
* Returns null if the media type cannot be determined or is unsupported.
*/
fun Uri.detectMediaType(context: Context): WallpaperMediaType? {
try {
// First try to get file extension from path
val path = this.path
if (path != null) {
val extension = path.substringAfterLast('.', "")
if (extension.isNotEmpty()) {
val mediaType = WallpaperMediaType.fromExtension(extension)
if (mediaType != null) {
return mediaType
}
}
}
// Fallback: Try to get MIME type from content resolver
val mimeType = context.contentResolver.getType(this)
if (mimeType != null) {
return when {
mimeType.startsWith("image/") -> WallpaperMediaType.IMAGE
else -> null
}
}
// If all else fails, assume IMAGE for backward compatibility
return WallpaperMediaType.IMAGE
} catch (e: Exception) {
Log.e(TAG, "Error detecting media type for URI: $this", e)
return WallpaperMediaType.IMAGE // Default to IMAGE on error
}
}
/**
* Check if Paperize live wallpaper is currently active/selected
* Returns true if the Paperize live wallpaper service is the current wallpaper
*/
fun isPaperizeLiveWallpaperActive(context: Context): Boolean {
return try {
// If we are checking from within the service itself (e.g. preview mode), we are active
if (context is com.anthonyla.paperize.service.livewallpaper.PaperizeLiveWallpaperService) {
Log.d(TAG, "isPaperizeLiveWallpaperActive: called from service context, returning true")
return true
}
val wallpaperManager = WallpaperManager.getInstance(context)
val wallpaperInfo = wallpaperManager.wallpaperInfo
// If wallpaperInfo is null, user has a static wallpaper (not a live wallpaper)
if (wallpaperInfo == null) {
Log.d(TAG, "isPaperizeLiveWallpaperActive: wallpaperInfo is null (static wallpaper), returning false")
return false
}
// Check if the service component matches Paperize live wallpaper
val expectedComponent = android.content.ComponentName(
context.packageName,
"com.anthonyla.paperize.service.livewallpaper.PaperizeLiveWallpaperService"
)
val isPaperize = wallpaperInfo.component == expectedComponent
Log.d(TAG, "isPaperizeLiveWallpaperActive: current=${wallpaperInfo.component}, expected=$expectedComponent, match=$isPaperize")
isPaperize
} catch (e: Exception) {
Log.e(TAG, "Error checking live wallpaper status", e)
false
}
}
@@ -1,26 +0,0 @@
package com.anthonyla.paperize.data
import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.compose.runtime.Composable
import androidx.core.content.ContextCompat.startActivity
/**
* Opens an email intent to contact the developer.
*/
@Composable
fun Contact(context: Context) {
val authorEmail = "anthonyyla.dev@gmail.com"
val cc = ""
val subject = "[Support] Paperize"
val bodyText = "This is regarding the Paperize app for Android:\n"
val mailto = "mailto:" + Uri.encode(authorEmail) +
"?cc=" + Uri.encode(cc) +
"&subject=" + Uri.encode(subject) +
"&body=" + Uri.encode(bodyText)
val emailIntent = Intent(Intent.ACTION_SENDTO)
emailIntent.setData(Uri.parse(mailto))
startActivity(context, emailIntent, null)
}
@@ -0,0 +1,50 @@
package com.anthonyla.paperize.data.database
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.anthonyla.paperize.data.database.converters.TypeConverters as PaperizeTypeConverters
import com.anthonyla.paperize.data.database.dao.AlbumDao
import com.anthonyla.paperize.data.database.dao.FolderDao
import com.anthonyla.paperize.data.database.dao.WallpaperCurrentDao
import com.anthonyla.paperize.data.database.dao.WallpaperDao
import com.anthonyla.paperize.data.database.dao.WallpaperQueueDao
import com.anthonyla.paperize.data.database.entities.AlbumEntity
import com.anthonyla.paperize.data.database.entities.FolderEntity
import com.anthonyla.paperize.data.database.entities.WallpaperCurrentEntity
import com.anthonyla.paperize.data.database.entities.WallpaperEntity
import com.anthonyla.paperize.data.database.entities.WallpaperQueueEntity
import com.anthonyla.paperize.core.constants.Constants
/**
* Paperize Room Database
*
* **MAJOR ARCHITECTURAL IMPROVEMENT:**
* - Properly normalized schema (no nested collections in entities)
* - NO CursorWindow reflection hack needed!
* - Proper foreign keys with cascade delete
* - Indexed columns for performance
* - Separate queue management table
* - Room migrations support (no destructive migrations!)
*
* Version: 1
*/
@Database(
entities = [
AlbumEntity::class,
WallpaperEntity::class,
FolderEntity::class,
WallpaperQueueEntity::class,
WallpaperCurrentEntity::class
],
version = Constants.DATABASE_VERSION,
exportSchema = true
)
@TypeConverters(PaperizeTypeConverters::class)
abstract class PaperizeDatabase : RoomDatabase() {
abstract fun albumDao(): AlbumDao
abstract fun wallpaperDao(): WallpaperDao
abstract fun folderDao(): FolderDao
abstract fun wallpaperQueueDao(): WallpaperQueueDao
abstract fun wallpaperCurrentDao(): WallpaperCurrentDao
}
@@ -0,0 +1,38 @@
package com.anthonyla.paperize.data.database.converters
import androidx.room.TypeConverter
import com.anthonyla.paperize.core.ScreenType
import com.anthonyla.paperize.core.ScalingType
import com.anthonyla.paperize.core.WallpaperMediaType
import com.anthonyla.paperize.core.WallpaperSourceType
/**
* Room type converters for enum types
*/
class TypeConverters {
@TypeConverter
fun fromScreenType(value: ScreenType): String = value.name
@TypeConverter
fun toScreenType(value: String): ScreenType = ScreenType.fromString(value)
@TypeConverter
fun fromScalingType(value: ScalingType): String = value.name
@TypeConverter
fun toScalingType(value: String): ScalingType = ScalingType.fromString(value)
@TypeConverter
fun fromWallpaperSourceType(value: WallpaperSourceType): String = value.name
@TypeConverter
fun toWallpaperSourceType(value: String): WallpaperSourceType =
WallpaperSourceType.entries.find { it.name == value } ?: WallpaperSourceType.DIRECT
@TypeConverter
fun fromWallpaperMediaType(value: WallpaperMediaType): String = value.name
@TypeConverter
fun toWallpaperMediaType(value: String): WallpaperMediaType =
WallpaperMediaType.fromString(value) ?: WallpaperMediaType.IMAGE
}
@@ -0,0 +1,123 @@
package com.anthonyla.paperize.data.database.dao
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import androidx.room.Update
import com.anthonyla.paperize.data.database.entities.AlbumEntity
import com.anthonyla.paperize.data.database.entities.AlbumSummaryEntity
import com.anthonyla.paperize.data.database.relations.AlbumWithDetails
import kotlinx.coroutines.flow.Flow
/**
* Data Access Object for Album operations
*/
@Dao
interface AlbumDao {
/**
* Get all album summaries (lightweight metadata + counts)
* Efficiently handles large libraries by avoiding loading all wallpaper objects
*/
@Query("""
SELECT
a.id,
a.name,
a.coverUri,
a.createdAt,
a.modifiedAt,
(SELECT COUNT(*) FROM wallpapers w WHERE w.albumId = a.id) as wallpaperCount,
(SELECT COUNT(*) FROM folders f WHERE f.albumId = a.id) as folderCount
FROM albums a
ORDER BY a.modifiedAt DESC
""")
fun getAlbumSummaries(): Flow<List<AlbumSummaryEntity>>
/**
* Get all albums with their wallpapers and folders
*/
@Transaction
@Query("SELECT * FROM albums ORDER BY modifiedAt DESC")
fun getAllAlbumsWithDetails(): Flow<List<AlbumWithDetails>>
/**
* Get a specific album by ID with details
*/
@Transaction
@Query("SELECT * FROM albums WHERE id = :albumId")
fun getAlbumWithDetails(albumId: String): Flow<AlbumWithDetails?>
/**
* Get all albums (without relations)
*/
@Query("SELECT * FROM albums ORDER BY modifiedAt DESC")
fun getAllAlbums(): Flow<List<AlbumEntity>>
/**
* Get a specific album by ID
*/
@Query("SELECT * FROM albums WHERE id = :albumId")
suspend fun getAlbumById(albumId: String): AlbumEntity?
/**
* Get a specific album by name
*/
@Query("SELECT * FROM albums WHERE name = :name LIMIT 1")
suspend fun getAlbumByName(name: String): AlbumEntity?
/**
* Get album count
*/
@Query("SELECT COUNT(*) FROM albums")
suspend fun getAlbumCount(): Int
/**
* Insert album
*/
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertAlbum(album: AlbumEntity)
/**
* Update album
*/
@Update
suspend fun updateAlbum(album: AlbumEntity)
/**
* Delete album
*/
@Delete
suspend fun deleteAlbum(album: AlbumEntity)
/**
* Delete album by ID
*/
@Query("DELETE FROM albums WHERE id = :albumId")
suspend fun deleteAlbumById(albumId: String)
/**
* Update album name
*/
@Query("UPDATE albums SET name = :name, modifiedAt = :modifiedAt WHERE id = :albumId")
suspend fun updateAlbumName(albumId: String, name: String, modifiedAt: Long)
/**
* Update album cover
*/
@Query("UPDATE albums SET coverUri = :coverUri, modifiedAt = :modifiedAt WHERE id = :albumId")
suspend fun updateAlbumCover(albumId: String, coverUri: String?, modifiedAt: Long)
/**
* Update album modified time
*/
@Query("UPDATE albums SET modifiedAt = :modifiedAt WHERE id = :albumId")
suspend fun updateAlbumModifiedTime(albumId: String, modifiedAt: Long)
/**
* Delete all albums
*/
@Query("DELETE FROM albums")
suspend fun deleteAllAlbums()
}
@@ -0,0 +1,68 @@
package com.anthonyla.paperize.data.database.dao
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import androidx.room.Update
import com.anthonyla.paperize.data.database.entities.FolderEntity
import com.anthonyla.paperize.data.database.relations.FolderWithWallpapers
import kotlinx.coroutines.flow.Flow
/**
* Data Access Object for Folder operations
*/
@Dao
interface FolderDao {
/**
* Get all folders for an album with their wallpapers
*/
@Transaction
@Query("SELECT * FROM folders WHERE albumId = :albumId ORDER BY displayOrder ASC")
fun getFoldersWithWallpapersByAlbum(albumId: String): Flow<List<FolderWithWallpapers>>
/**
* Get a specific folder by ID with wallpapers
*/
@Transaction
@Query("SELECT * FROM folders WHERE id = :folderId")
fun getFolderWithWallpapers(folderId: String): Flow<FolderWithWallpapers?>
/**
* Get a specific folder by ID
*/
@Query("SELECT * FROM folders WHERE id = :folderId")
suspend fun getFolderById(folderId: String): FolderEntity?
/**
* Get folder by URI
*/
@Query("SELECT * FROM folders WHERE uri = :uri LIMIT 1")
suspend fun getFolderByUri(uri: String): FolderEntity?
/**
* Insert folder
*/
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertFolder(folder: FolderEntity)
/**
* Update folder
*/
@Update
suspend fun updateFolder(folder: FolderEntity)
/**
* Update folder cover
*/
@Query("UPDATE folders SET coverUri = :coverUri WHERE id = :folderId")
suspend fun updateFolderCover(folderId: String, coverUri: String?)
/**
* Delete folder by ID
*/
@Query("DELETE FROM folders WHERE id = :folderId")
suspend fun deleteFolderById(folderId: String)
}
@@ -0,0 +1,39 @@
package com.anthonyla.paperize.data.database.dao
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.anthonyla.paperize.core.ScreenType
import com.anthonyla.paperize.data.database.entities.WallpaperCurrentEntity
import com.anthonyla.paperize.data.database.entities.WallpaperEntity
import kotlinx.coroutines.flow.Flow
@Dao
interface WallpaperCurrentDao {
/**
* Return the wallpaper entity that was last applied for this album/screen,
* or null if none has been recorded yet (or if it was deleted via CASCADE).
*/
@Query("""
SELECT w.* FROM wallpapers w
INNER JOIN wallpaper_current wc ON w.id = wc.wallpaperId
WHERE wc.albumId = :albumId AND wc.screenType = :screenType
LIMIT 1
""")
suspend fun getCurrentWallpaper(albumId: String, screenType: ScreenType): WallpaperEntity?
/** Reactive variant of [getCurrentWallpaper]; re-emits when the recorded wallpaper changes. */
@Query("""
SELECT w.* FROM wallpapers w
INNER JOIN wallpaper_current wc ON w.id = wc.wallpaperId
WHERE wc.albumId = :albumId AND wc.screenType = :screenType
LIMIT 1
""")
fun getCurrentWallpaperFlow(albumId: String, screenType: ScreenType): Flow<WallpaperEntity?>
/** Record (or overwrite) the current wallpaper for an album/screen pair. */
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun upsertCurrentWallpaper(entity: WallpaperCurrentEntity)
}
@@ -0,0 +1,150 @@
package com.anthonyla.paperize.data.database.dao
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.anthonyla.paperize.data.database.entities.WallpaperEntity
import kotlinx.coroutines.flow.Flow
/**
* Data Access Object for Wallpaper operations
*/
@Dao
interface WallpaperDao {
/**
* Get all wallpapers for an album
*/
@Query("SELECT * FROM wallpapers WHERE albumId = :albumId ORDER BY displayOrder ASC")
fun getWallpapersByAlbum(albumId: String): Flow<List<WallpaperEntity>>
/**
* Get direct wallpapers for an album (not from folders)
*/
@Query("SELECT * FROM wallpapers WHERE albumId = :albumId AND folderId IS NULL ORDER BY displayOrder ASC")
fun getDirectWallpapersByAlbum(albumId: String): Flow<List<WallpaperEntity>>
/**
* Get all wallpapers for an album (synchronous for transactions)
*/
@Query("SELECT * FROM wallpapers WHERE albumId = :albumId ORDER BY displayOrder ASC")
suspend fun getWallpapersByAlbumSync(albumId: String): List<WallpaperEntity>
/**
* Get wallpapers for an album (paginated for memory-intensive operations)
*/
@Query("SELECT * FROM wallpapers WHERE albumId = :albumId ORDER BY displayOrder ASC LIMIT :limit OFFSET :offset")
suspend fun getWallpapersByAlbumPaged(albumId: String, limit: Int, offset: Int): List<WallpaperEntity>
/**
* Get direct wallpapers for an album (synchronous for transactions)
*/
@Query("SELECT * FROM wallpapers WHERE albumId = :albumId AND folderId IS NULL ORDER BY displayOrder ASC")
suspend fun getDirectWallpapersByAlbumSync(albumId: String): List<WallpaperEntity>
/**
* Get wallpapers for a folder
*/
@Query("SELECT * FROM wallpapers WHERE folderId = :folderId ORDER BY displayOrder ASC")
fun getWallpapersByFolder(folderId: String): Flow<List<WallpaperEntity>>
/**
* Get a specific wallpaper by ID
*/
@Query("SELECT * FROM wallpapers WHERE id = :wallpaperId")
suspend fun getWallpaperById(wallpaperId: String): WallpaperEntity?
/**
* Get wallpaper by URI
*/
@Query("SELECT * FROM wallpapers WHERE uri = :uri LIMIT 1")
suspend fun getWallpaperByUri(uri: String): WallpaperEntity?
/**
* Insert wallpaper
*/
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertWallpaper(wallpaper: WallpaperEntity)
/**
* Insert multiple wallpapers
*/
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertWallpapers(wallpapers: List<WallpaperEntity>)
/**
* Update wallpaper
*/
@Update
suspend fun updateWallpaper(wallpaper: WallpaperEntity)
/**
* Update wallpaper display order
*/
@Query("UPDATE wallpapers SET displayOrder = :order WHERE id = :wallpaperId")
suspend fun updateWallpaperOrder(wallpaperId: String, order: Int)
/**
* Delete wallpaper
*/
@Delete
suspend fun deleteWallpaper(wallpaper: WallpaperEntity)
/**
* Delete wallpaper by ID
*/
@Query("DELETE FROM wallpapers WHERE id = :wallpaperId")
suspend fun deleteWallpaperById(wallpaperId: String)
/**
* Delete wallpapers by IDs (batch operation)
*/
@Query("DELETE FROM wallpapers WHERE id IN (:wallpaperIds)")
suspend fun deleteWallpapersByIds(wallpaperIds: List<String>)
/**
* Delete all wallpapers for a folder
*/
@Query("DELETE FROM wallpapers WHERE folderId = :folderId")
suspend fun deleteWallpapersByFolder(folderId: String)
/**
* Delete wallpapers by URIs
*/
@Query("DELETE FROM wallpapers WHERE uri IN (:uris)")
suspend fun deleteWallpapersByUris(uris: List<String>)
/**
* Get total wallpaper count for an album
*/
@Query("SELECT COUNT(*) FROM wallpapers WHERE albumId = :albumId")
suspend fun getWallpaperCountByAlbum(albumId: String): Int
/**
* Get all URIs for wallpapers in a folder — used for duplicate detection during folder rescan.
*/
@Query("SELECT uri FROM wallpapers WHERE albumId = :albumId AND folderId = :folderId")
suspend fun getWallpaperUrisByAlbumAndFolder(albumId: String, folderId: String): List<String>
/**
* Get wallpaper IDs only for queue building (shuffle mode).
* Avoids loading full entities when only IDs are needed.
*/
@Query("SELECT id FROM wallpapers WHERE albumId = :albumId")
suspend fun getWallpaperIdsByAlbum(albumId: String): List<String>
/**
* Get wallpaper IDs with display order for queue building (sequential mode).
* Avoids loading full entities when only ID + order are needed.
*/
@Query("SELECT id, displayOrder FROM wallpapers WHERE albumId = :albumId ORDER BY displayOrder ASC")
suspend fun getWallpaperIdsAndOrderByAlbum(albumId: String): List<WallpaperIdAndOrder>
}
/** Lightweight projection used for queue building — avoids loading full WallpaperEntity. */
data class WallpaperIdAndOrder(
val id: String,
val displayOrder: Int
)
@@ -0,0 +1,138 @@
package com.anthonyla.paperize.data.database.dao
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import com.anthonyla.paperize.core.ScreenType
import com.anthonyla.paperize.data.database.entities.WallpaperEntity
import com.anthonyla.paperize.data.database.entities.WallpaperQueueEntity
/**
* Data Access Object for Wallpaper Queue operations
*
* This replaces the manual queue management in the old Album entity
*/
@Dao
interface WallpaperQueueDao {
/**
* Get next wallpaper in queue
*/
@Query("""
SELECT w.* FROM wallpapers w
INNER JOIN wallpaper_queue wq ON w.id = wq.wallpaperId
WHERE wq.albumId = :albumId AND wq.screenType = :screenType
ORDER BY wq.queuePosition ASC
LIMIT 1
""")
suspend fun getNextWallpaperInQueue(albumId: String, screenType: ScreenType): WallpaperEntity?
/**
* Atomically get and remove next wallpaper from queue
* This prevents race conditions when multiple services try to get wallpapers simultaneously
*/
@Transaction
suspend fun getAndDequeueWallpaper(albumId: String, screenType: ScreenType): WallpaperEntity? {
val wallpaper = getNextWallpaperInQueue(albumId, screenType)
if (wallpaper != null) {
// Delete specifically the item we just retrieved to ensure atomicity
deleteQueueItem(albumId, screenType, wallpaper.id)
}
return wallpaper
}
/**
* Get queue items for album and screen type
*/
@Query("SELECT * FROM wallpaper_queue WHERE albumId = :albumId AND screenType = :screenType ORDER BY queuePosition ASC")
suspend fun getQueueItems(albumId: String, screenType: ScreenType): List<WallpaperQueueEntity>
/**
* Insert multiple queue items
*/
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertQueueItems(items: List<WallpaperQueueEntity>)
/**
* Delete a specific queue item by wallpaperId.
*
* The MIN() subquery was removed because [getAndDequeueWallpaper] already retrieves
* the item at the minimum position before calling this, so the subquery is redundant.
* The [wallpaperId] index makes this O(log n) instead of O(n) with the subquery.
*/
@Query("""
DELETE FROM wallpaper_queue
WHERE albumId = :albumId AND screenType = :screenType
AND wallpaperId = :wallpaperId
""")
suspend fun deleteQueueItem(albumId: String, screenType: ScreenType, wallpaperId: String)
@Query("""
SELECT MIN(queuePosition) FROM wallpaper_queue
WHERE albumId = :albumId AND screenType = :screenType
""")
suspend fun getFirstQueuePosition(albumId: String, screenType: ScreenType): Int?
/**
* Restore a dequeued wallpaper to the front after the platform rejected the change.
*/
@Transaction
suspend fun restoreQueueItem(
albumId: String,
screenType: ScreenType,
wallpaperId: String
) {
deleteQueueItem(albumId, screenType, wallpaperId)
val firstPosition = getFirstQueuePosition(albumId, screenType) ?: 0
insertQueueItems(
listOf(
WallpaperQueueEntity(
albumId = albumId,
wallpaperId = wallpaperId,
screenType = screenType,
queuePosition = firstPosition - 1
)
)
)
}
/**
* Clear queue for album and screen type
*/
@Query("DELETE FROM wallpaper_queue WHERE albumId = :albumId AND screenType = :screenType")
suspend fun clearQueue(albumId: String, screenType: ScreenType)
/**
* Clear all queues for an album
*/
@Query("DELETE FROM wallpaper_queue WHERE albumId = :albumId")
suspend fun clearAllQueues(albumId: String)
/**
* Delete all queue items
*/
@Query("DELETE FROM wallpaper_queue")
suspend fun deleteAllQueueItems()
/**
* Rebuild queue with wallpaper IDs
*/
@Transaction
suspend fun rebuildQueue(
albumId: String,
screenType: ScreenType,
wallpaperIds: List<String>
) {
clearQueue(albumId, screenType)
val items = wallpaperIds.mapIndexed { index, wallpaperId ->
WallpaperQueueEntity(
albumId = albumId,
wallpaperId = wallpaperId,
screenType = screenType,
queuePosition = index
)
}
insertQueueItems(items)
}
}
@@ -0,0 +1,19 @@
package com.anthonyla.paperize.data.database.entities
import androidx.room.Entity
import androidx.room.PrimaryKey
/**
* Room entity for Album
*
* Stores album metadata without nested collections to avoid CursorWindow issues
*/
@Entity(tableName = "albums")
data class AlbumEntity(
@PrimaryKey
val id: String,
val name: String,
val coverUri: String?,
val createdAt: Long = System.currentTimeMillis(),
val modifiedAt: Long = System.currentTimeMillis()
)
@@ -0,0 +1,14 @@
package com.anthonyla.paperize.data.database.entities
/**
* Entity for holding lightweight album summary query results
*/
data class AlbumSummaryEntity(
val id: String,
val name: String,
val coverUri: String?,
val wallpaperCount: Int,
val folderCount: Int,
val createdAt: Long,
val modifiedAt: Long
)
@@ -0,0 +1,42 @@
package com.anthonyla.paperize.data.database.entities
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey
/**
* Room entity for Folder
*
* No longer stores nested wallpapers - they're separate entities with foreign keys
*/
@Entity(
tableName = "folders",
foreignKeys = [
ForeignKey(
entity = AlbumEntity::class,
parentColumns = ["id"],
childColumns = ["albumId"],
onDelete = ForeignKey.CASCADE
)
],
indices = [
Index(value = ["albumId"]),
Index(value = ["uri"])
]
)
data class FolderEntity(
@PrimaryKey
val id: String,
@ColumnInfo(name = "albumId")
val albumId: String,
val name: String,
val uri: String,
val coverUri: String?,
val dateModified: Long,
val displayOrder: Int = 0,
val addedAt: Long = System.currentTimeMillis()
)
@@ -0,0 +1,45 @@
package com.anthonyla.paperize.data.database.entities
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import com.anthonyla.paperize.core.ScreenType
/**
* Room entity tracking the last-applied wallpaper per (album, screen).
*
* A CASCADE on both FKs means: if the album or wallpaper is deleted the entry
* disappears automatically — the service will then fall back to a normal queue
* advance instead of reapplying a stale URI.
*/
@Entity(
tableName = "wallpaper_current",
primaryKeys = ["albumId", "screenType"],
foreignKeys = [
ForeignKey(
entity = AlbumEntity::class,
parentColumns = ["id"],
childColumns = ["albumId"],
onDelete = ForeignKey.CASCADE
),
ForeignKey(
entity = WallpaperEntity::class,
parentColumns = ["id"],
childColumns = ["wallpaperId"],
onDelete = ForeignKey.CASCADE
)
],
indices = [Index(value = ["wallpaperId"])]
)
data class WallpaperCurrentEntity(
@ColumnInfo(name = "albumId")
val albumId: String,
val screenType: ScreenType,
@ColumnInfo(name = "wallpaperId")
val wallpaperId: String,
val appliedAt: Long = System.currentTimeMillis()
)
@@ -0,0 +1,56 @@
package com.anthonyla.paperize.data.database.entities
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey
import com.anthonyla.paperize.core.WallpaperMediaType
import com.anthonyla.paperize.core.WallpaperSourceType
/**
* Room entity for Wallpaper
*
* Properly indexed foreign key to Album and optional foreign key to Folder
*/
@Entity(
tableName = "wallpapers",
foreignKeys = [
ForeignKey(
entity = AlbumEntity::class,
parentColumns = ["id"],
childColumns = ["albumId"],
onDelete = ForeignKey.CASCADE
),
ForeignKey(
entity = FolderEntity::class,
parentColumns = ["id"],
childColumns = ["folderId"],
onDelete = ForeignKey.CASCADE
)
],
indices = [
Index(value = ["albumId"]),
Index(value = ["folderId"]),
Index(value = ["uri"])
]
)
data class WallpaperEntity(
@PrimaryKey
val id: String,
@ColumnInfo(name = "albumId")
val albumId: String,
@ColumnInfo(name = "folderId")
val folderId: String? = null,
val uri: String,
val fileName: String,
val dateModified: Long,
val displayOrder: Int = 0,
val sourceType: WallpaperSourceType = WallpaperSourceType.DIRECT,
val addedAt: Long = System.currentTimeMillis(),
val mediaType: WallpaperMediaType = WallpaperMediaType.IMAGE,
)
@@ -0,0 +1,51 @@
package com.anthonyla.paperize.data.database.entities
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey
import com.anthonyla.paperize.core.ScreenType
/**
* Room entity for Wallpaper Queue
*
* Properly manages wallpaper queues instead of storing them as JSON lists in Album
* Separate queues for HOME and LOCK screens
*/
@Entity(
tableName = "wallpaper_queue",
foreignKeys = [
ForeignKey(
entity = AlbumEntity::class,
parentColumns = ["id"],
childColumns = ["albumId"],
onDelete = ForeignKey.CASCADE
),
ForeignKey(
entity = WallpaperEntity::class,
parentColumns = ["id"],
childColumns = ["wallpaperId"],
onDelete = ForeignKey.CASCADE
)
],
indices = [
Index(value = ["albumId", "screenType"]),
Index(value = ["wallpaperId"]),
Index(value = ["queuePosition"])
]
)
data class WallpaperQueueEntity(
@PrimaryKey(autoGenerate = true)
val id: Long = 0,
@ColumnInfo(name = "albumId")
val albumId: String,
@ColumnInfo(name = "wallpaperId")
val wallpaperId: String,
val screenType: ScreenType,
val queuePosition: Int,
val addedAt: Long = System.currentTimeMillis()
)
@@ -0,0 +1,47 @@
package com.anthonyla.paperize.data.database.relations
import androidx.room.Embedded
import androidx.room.Relation
import com.anthonyla.paperize.data.database.entities.AlbumEntity
import com.anthonyla.paperize.data.database.entities.FolderEntity
import com.anthonyla.paperize.data.database.entities.WallpaperEntity
/**
* Room relation combining Album with its Wallpapers and Folders
*
* This replaces the old AlbumWithWallpaperAndFolder but with proper foreign keys
* No nested collections in entities - avoiding CursorWindow issues!
*/
data class AlbumWithDetails(
@Embedded
val album: AlbumEntity,
@Relation(
parentColumn = "id",
entityColumn = "albumId",
entity = WallpaperEntity::class
)
val wallpapers: List<WallpaperEntity> = emptyList(),
@Relation(
parentColumn = "id",
entityColumn = "albumId",
entity = FolderEntity::class
)
val folders: List<FolderEntity> = emptyList()
) {
/**
* Get direct wallpapers (not from folders)
*/
val directWallpapers: List<WallpaperEntity>
get() = wallpapers.filter { it.folderId == null }
/**
* Get total count including folder wallpapers
*/
fun getTotalWallpaperCount(folderWallpapers: Map<String, Int>): Int {
val directCount = directWallpapers.size
val folderCount = folders.sumOf { folderWallpapers[it.id] ?: 0 }
return directCount + folderCount
}
}
@@ -0,0 +1,21 @@
package com.anthonyla.paperize.data.database.relations
import androidx.room.Embedded
import androidx.room.Relation
import com.anthonyla.paperize.data.database.entities.FolderEntity
import com.anthonyla.paperize.data.database.entities.WallpaperEntity
/**
* Room relation combining Folder with its Wallpapers
*/
data class FolderWithWallpapers(
@Embedded
val folder: FolderEntity,
@Relation(
parentColumn = "id",
entityColumn = "folderId",
entity = WallpaperEntity::class
)
val wallpapers: List<WallpaperEntity> = emptyList()
)
@@ -0,0 +1,540 @@
package com.anthonyla.paperize.data.datastore
import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.intPreferencesKey
import androidx.datastore.preferences.core.longPreferencesKey
import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.datastore.preferences.preferencesDataStore
import com.anthonyla.paperize.core.ScalingType
import com.anthonyla.paperize.core.WallpaperMode
import com.anthonyla.paperize.core.constants.Constants
import com.anthonyla.paperize.core.constants.PreferenceKeys
import com.anthonyla.paperize.domain.model.AppSettings
import com.anthonyla.paperize.domain.model.ScheduleSettings
import com.anthonyla.paperize.domain.model.WallpaperEffects
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import javax.inject.Inject
import javax.inject.Singleton
/**
* Context extension for DataStore
*/
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(
name = Constants.PREFERENCES_NAME
)
/**
* PreferencesManager - Clean interface for DataStore operations
*
* Replaces the old SettingsDataStore with better organization and type safety
*/
@Singleton
class PreferencesManager @Inject constructor(
context: Context
) {
private val dataStore = context.dataStore
// ============ App Settings ============
suspend fun getAppSettings(): AppSettings {
val prefs = dataStore.data.first()
return AppSettings(
darkMode = prefs[booleanPreferencesKey(PreferenceKeys.DARK_MODE)],
dynamicTheming = prefs[booleanPreferencesKey(PreferenceKeys.DYNAMIC_THEMING)] ?: false,
animate = prefs[booleanPreferencesKey(PreferenceKeys.ANIMATE)] ?: true,
firstLaunch = prefs[booleanPreferencesKey(PreferenceKeys.FIRST_LAUNCH)] ?: true
)
}
fun getAppSettingsFlow(): Flow<AppSettings> = dataStore.data.map { prefs ->
AppSettings(
darkMode = prefs[booleanPreferencesKey(PreferenceKeys.DARK_MODE)],
dynamicTheming = prefs[booleanPreferencesKey(PreferenceKeys.DYNAMIC_THEMING)] ?: false,
animate = prefs[booleanPreferencesKey(PreferenceKeys.ANIMATE)] ?: true,
firstLaunch = prefs[booleanPreferencesKey(PreferenceKeys.FIRST_LAUNCH)] ?: true
)
}
suspend fun updateAppSettings(settings: AppSettings) {
dataStore.edit { prefs ->
if (settings.darkMode != null) {
prefs[booleanPreferencesKey(PreferenceKeys.DARK_MODE)] = settings.darkMode
} else {
prefs.remove(booleanPreferencesKey(PreferenceKeys.DARK_MODE))
}
prefs[booleanPreferencesKey(PreferenceKeys.DYNAMIC_THEMING)] = settings.dynamicTheming
prefs[booleanPreferencesKey(PreferenceKeys.ANIMATE)] = settings.animate
prefs[booleanPreferencesKey(PreferenceKeys.FIRST_LAUNCH)] = settings.firstLaunch
}
}
// ============ Wallpaper Mode ============
/**
* Get current wallpaper mode (STATIC or LIVE)
* Defaults to STATIC for new installations and backward compatibility
*/
suspend fun getWallpaperMode(): WallpaperMode {
val prefs = dataStore.data.first()
val modeString = prefs[stringPreferencesKey(PreferenceKeys.WALLPAPER_MODE)]
return WallpaperMode.fromString(modeString)
}
/**
* Get wallpaper mode as a Flow for reactive updates
*/
fun getWallpaperModeFlow(): Flow<WallpaperMode> = dataStore.data.map { prefs ->
val modeString = prefs[stringPreferencesKey(PreferenceKeys.WALLPAPER_MODE)]
WallpaperMode.fromString(modeString)
}
/**
* Update wallpaper mode
* IMPORTANT: Caller should handle data reset when switching modes
*/
suspend fun updateWallpaperMode(mode: WallpaperMode) {
dataStore.edit { prefs ->
prefs[stringPreferencesKey(PreferenceKeys.WALLPAPER_MODE)] = mode.name
}
}
// ============ Schedule Settings ============
suspend fun getScheduleSettings(): ScheduleSettings {
val prefs = dataStore.data.first()
return ScheduleSettings(
enableChanger = prefs[booleanPreferencesKey(PreferenceKeys.ENABLE_CHANGER)] ?: false,
separateSchedules = prefs[booleanPreferencesKey(PreferenceKeys.SEPARATE_SCHEDULES)] ?: false,
shuffleEnabled = prefs[booleanPreferencesKey(PreferenceKeys.SHUFFLE_ENABLED)] ?: false,
homeEnabled = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLED)] ?: false,
lockEnabled = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLED)] ?: false,
homeAlbumId = prefs[stringPreferencesKey(PreferenceKeys.HOME_ALBUM_ID)],
lockAlbumId = prefs[stringPreferencesKey(PreferenceKeys.LOCK_ALBUM_ID)],
liveAlbumId = prefs[stringPreferencesKey(PreferenceKeys.LIVE_ALBUM_ID)],
homeIntervalMinutes = prefs[intPreferencesKey(PreferenceKeys.HOME_INTERVAL_MINUTES)]
?: Constants.DEFAULT_INTERVAL_MINUTES,
lockIntervalMinutes = prefs[intPreferencesKey(PreferenceKeys.LOCK_INTERVAL_MINUTES)]
?: Constants.DEFAULT_INTERVAL_MINUTES,
liveIntervalMinutes = prefs[intPreferencesKey(PreferenceKeys.LIVE_INTERVAL_MINUTES)]
?: Constants.DEFAULT_INTERVAL_MINUTES,
homeScalingType = ScalingType.fromString(prefs[stringPreferencesKey(PreferenceKeys.HOME_SCALING_TYPE)]),
lockScalingType = ScalingType.fromString(prefs[stringPreferencesKey(PreferenceKeys.LOCK_SCALING_TYPE)]),
liveScalingType = ScalingType.fromString(prefs[stringPreferencesKey(PreferenceKeys.LIVE_SCALING_TYPE)]),
homeScrollingEnabled = prefs[booleanPreferencesKey(PreferenceKeys.HOME_SCROLLING_ENABLED)] ?: false,
homeEffects = WallpaperEffects(
enableBlur = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_BLUR)] ?: false,
blurPercentage = prefs[intPreferencesKey(PreferenceKeys.HOME_BLUR)] ?: 0,
enableDarken = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_DARKEN)] ?: false,
darkenPercentage = prefs[intPreferencesKey(PreferenceKeys.HOME_DARKEN)] ?: 0,
enableVignette = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_VIGNETTE)] ?: false,
vignettePercentage = prefs[intPreferencesKey(PreferenceKeys.HOME_VIGNETTE)] ?: 0,
enableGrayscale = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_GRAYSCALE)] ?: false,
grayscalePercentage = prefs[intPreferencesKey(PreferenceKeys.HOME_GRAYSCALE)] ?: 0,
enableDoubleTap = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_DOUBLE_TAP)] ?: false,
enableParallax = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_PARALLAX)] ?: false,
parallaxIntensity = prefs[intPreferencesKey(PreferenceKeys.HOME_PARALLAX_INTENSITY)] ?: Constants.DEFAULT_PARALLAX_INTENSITY
),
lockEffects = WallpaperEffects(
enableBlur = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_BLUR)] ?: false,
blurPercentage = prefs[intPreferencesKey(PreferenceKeys.LOCK_BLUR)] ?: 0,
enableDarken = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_DARKEN)] ?: false,
darkenPercentage = prefs[intPreferencesKey(PreferenceKeys.LOCK_DARKEN)] ?: 0,
enableVignette = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_VIGNETTE)] ?: false,
vignettePercentage = prefs[intPreferencesKey(PreferenceKeys.LOCK_VIGNETTE)] ?: 0,
enableGrayscale = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_GRAYSCALE)] ?: false,
grayscalePercentage = prefs[intPreferencesKey(PreferenceKeys.LOCK_GRAYSCALE)] ?: 0,
enableDoubleTap = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_DOUBLE_TAP)] ?: false,
enableParallax = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_PARALLAX)] ?: false,
parallaxIntensity = prefs[intPreferencesKey(PreferenceKeys.LOCK_PARALLAX_INTENSITY)] ?: Constants.DEFAULT_PARALLAX_INTENSITY
),
liveEffects = WallpaperEffects(
enableBlur = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_BLUR)] ?: false,
blurPercentage = prefs[intPreferencesKey(PreferenceKeys.LIVE_BLUR)] ?: 0,
enableDarken = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_DARKEN)] ?: false,
darkenPercentage = prefs[intPreferencesKey(PreferenceKeys.LIVE_DARKEN)] ?: 0,
enableVignette = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_VIGNETTE)] ?: false,
vignettePercentage = prefs[intPreferencesKey(PreferenceKeys.LIVE_VIGNETTE)] ?: 0,
enableGrayscale = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_GRAYSCALE)] ?: false,
grayscalePercentage = prefs[intPreferencesKey(PreferenceKeys.LIVE_GRAYSCALE)] ?: 0,
enableDoubleTap = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_DOUBLE_TAP)] ?: false,
enableChangeOnScreenOff = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_CHANGE_ON_SCREEN_OFF)] ?: false,
enableParallax = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_PARALLAX)] ?: false,
parallaxIntensity = prefs[intPreferencesKey(PreferenceKeys.LIVE_PARALLAX_INTENSITY)] ?: Constants.DEFAULT_PARALLAX_INTENSITY
),
adaptiveBrightness = prefs[booleanPreferencesKey(PreferenceKeys.ADAPTIVE_BRIGHTNESS)] ?: false
)
}
fun getScheduleSettingsFlow(): Flow<ScheduleSettings> = dataStore.data.map { prefs ->
ScheduleSettings(
enableChanger = prefs[booleanPreferencesKey(PreferenceKeys.ENABLE_CHANGER)] ?: false,
separateSchedules = prefs[booleanPreferencesKey(PreferenceKeys.SEPARATE_SCHEDULES)] ?: false,
shuffleEnabled = prefs[booleanPreferencesKey(PreferenceKeys.SHUFFLE_ENABLED)] ?: false,
homeEnabled = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLED)] ?: false,
lockEnabled = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLED)] ?: false,
homeAlbumId = prefs[stringPreferencesKey(PreferenceKeys.HOME_ALBUM_ID)],
lockAlbumId = prefs[stringPreferencesKey(PreferenceKeys.LOCK_ALBUM_ID)],
liveAlbumId = prefs[stringPreferencesKey(PreferenceKeys.LIVE_ALBUM_ID)],
homeIntervalMinutes = prefs[intPreferencesKey(PreferenceKeys.HOME_INTERVAL_MINUTES)]
?: Constants.DEFAULT_INTERVAL_MINUTES,
lockIntervalMinutes = prefs[intPreferencesKey(PreferenceKeys.LOCK_INTERVAL_MINUTES)]
?: Constants.DEFAULT_INTERVAL_MINUTES,
liveIntervalMinutes = prefs[intPreferencesKey(PreferenceKeys.LIVE_INTERVAL_MINUTES)]
?: Constants.DEFAULT_INTERVAL_MINUTES,
homeScalingType = ScalingType.fromString(prefs[stringPreferencesKey(PreferenceKeys.HOME_SCALING_TYPE)]),
lockScalingType = ScalingType.fromString(prefs[stringPreferencesKey(PreferenceKeys.LOCK_SCALING_TYPE)]),
liveScalingType = ScalingType.fromString(prefs[stringPreferencesKey(PreferenceKeys.LIVE_SCALING_TYPE)]),
homeScrollingEnabled = prefs[booleanPreferencesKey(PreferenceKeys.HOME_SCROLLING_ENABLED)] ?: false,
homeEffects = WallpaperEffects(
enableBlur = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_BLUR)] ?: false,
blurPercentage = prefs[intPreferencesKey(PreferenceKeys.HOME_BLUR)] ?: 0,
enableDarken = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_DARKEN)] ?: false,
darkenPercentage = prefs[intPreferencesKey(PreferenceKeys.HOME_DARKEN)] ?: 0,
enableVignette = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_VIGNETTE)] ?: false,
vignettePercentage = prefs[intPreferencesKey(PreferenceKeys.HOME_VIGNETTE)] ?: 0,
enableGrayscale = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_GRAYSCALE)] ?: false,
grayscalePercentage = prefs[intPreferencesKey(PreferenceKeys.HOME_GRAYSCALE)] ?: 0,
enableDoubleTap = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_DOUBLE_TAP)] ?: false,
enableParallax = prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_PARALLAX)] ?: false,
parallaxIntensity = prefs[intPreferencesKey(PreferenceKeys.HOME_PARALLAX_INTENSITY)] ?: Constants.DEFAULT_PARALLAX_INTENSITY
),
lockEffects = WallpaperEffects(
enableBlur = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_BLUR)] ?: false,
blurPercentage = prefs[intPreferencesKey(PreferenceKeys.LOCK_BLUR)] ?: 0,
enableDarken = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_DARKEN)] ?: false,
darkenPercentage = prefs[intPreferencesKey(PreferenceKeys.LOCK_DARKEN)] ?: 0,
enableVignette = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_VIGNETTE)] ?: false,
vignettePercentage = prefs[intPreferencesKey(PreferenceKeys.LOCK_VIGNETTE)] ?: 0,
enableGrayscale = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_GRAYSCALE)] ?: false,
grayscalePercentage = prefs[intPreferencesKey(PreferenceKeys.LOCK_GRAYSCALE)] ?: 0,
enableDoubleTap = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_DOUBLE_TAP)] ?: false,
enableParallax = prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_PARALLAX)] ?: false,
parallaxIntensity = prefs[intPreferencesKey(PreferenceKeys.LOCK_PARALLAX_INTENSITY)] ?: Constants.DEFAULT_PARALLAX_INTENSITY
),
liveEffects = WallpaperEffects(
enableBlur = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_BLUR)] ?: false,
blurPercentage = prefs[intPreferencesKey(PreferenceKeys.LIVE_BLUR)] ?: 0,
enableDarken = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_DARKEN)] ?: false,
darkenPercentage = prefs[intPreferencesKey(PreferenceKeys.LIVE_DARKEN)] ?: 0,
enableVignette = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_VIGNETTE)] ?: false,
vignettePercentage = prefs[intPreferencesKey(PreferenceKeys.LIVE_VIGNETTE)] ?: 0,
enableGrayscale = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_GRAYSCALE)] ?: false,
grayscalePercentage = prefs[intPreferencesKey(PreferenceKeys.LIVE_GRAYSCALE)] ?: 0,
enableDoubleTap = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_DOUBLE_TAP)] ?: false,
enableChangeOnScreenOff = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_CHANGE_ON_SCREEN_OFF)] ?: false,
enableParallax = prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_PARALLAX)] ?: false,
parallaxIntensity = prefs[intPreferencesKey(PreferenceKeys.LIVE_PARALLAX_INTENSITY)] ?: Constants.DEFAULT_PARALLAX_INTENSITY
),
adaptiveBrightness = prefs[booleanPreferencesKey(PreferenceKeys.ADAPTIVE_BRIGHTNESS)] ?: false
)
}
suspend fun updateScheduleSettings(settings: ScheduleSettings) {
dataStore.edit { prefs ->
prefs[booleanPreferencesKey(PreferenceKeys.ENABLE_CHANGER)] = settings.enableChanger
prefs[booleanPreferencesKey(PreferenceKeys.SEPARATE_SCHEDULES)] = settings.separateSchedules
prefs[booleanPreferencesKey(PreferenceKeys.SHUFFLE_ENABLED)] = settings.shuffleEnabled
prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLED)] = settings.homeEnabled
prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLED)] = settings.lockEnabled
if (settings.homeAlbumId != null) {
prefs[stringPreferencesKey(PreferenceKeys.HOME_ALBUM_ID)] = settings.homeAlbumId
} else {
prefs.remove(stringPreferencesKey(PreferenceKeys.HOME_ALBUM_ID))
}
if (settings.lockAlbumId != null) {
prefs[stringPreferencesKey(PreferenceKeys.LOCK_ALBUM_ID)] = settings.lockAlbumId
} else {
prefs.remove(stringPreferencesKey(PreferenceKeys.LOCK_ALBUM_ID))
}
if (settings.liveAlbumId != null) {
prefs[stringPreferencesKey(PreferenceKeys.LIVE_ALBUM_ID)] = settings.liveAlbumId
} else {
prefs.remove(stringPreferencesKey(PreferenceKeys.LIVE_ALBUM_ID))
}
prefs[intPreferencesKey(PreferenceKeys.HOME_INTERVAL_MINUTES)] = settings.homeIntervalMinutes
prefs[intPreferencesKey(PreferenceKeys.LOCK_INTERVAL_MINUTES)] = settings.lockIntervalMinutes
prefs[intPreferencesKey(PreferenceKeys.LIVE_INTERVAL_MINUTES)] = settings.liveIntervalMinutes
prefs[stringPreferencesKey(PreferenceKeys.HOME_SCALING_TYPE)] = settings.homeScalingType.name
prefs[stringPreferencesKey(PreferenceKeys.LOCK_SCALING_TYPE)] = settings.lockScalingType.name
prefs[stringPreferencesKey(PreferenceKeys.LIVE_SCALING_TYPE)] = settings.liveScalingType.name
prefs[booleanPreferencesKey(PreferenceKeys.HOME_SCROLLING_ENABLED)] = settings.homeScrollingEnabled
// Home effects
prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_BLUR)] = settings.homeEffects.enableBlur
prefs[intPreferencesKey(PreferenceKeys.HOME_BLUR)] = settings.homeEffects.blurPercentage
prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_DARKEN)] = settings.homeEffects.enableDarken
prefs[intPreferencesKey(PreferenceKeys.HOME_DARKEN)] = settings.homeEffects.darkenPercentage
prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_VIGNETTE)] = settings.homeEffects.enableVignette
prefs[intPreferencesKey(PreferenceKeys.HOME_VIGNETTE)] = settings.homeEffects.vignettePercentage
prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_GRAYSCALE)] = settings.homeEffects.enableGrayscale
prefs[intPreferencesKey(PreferenceKeys.HOME_GRAYSCALE)] = settings.homeEffects.grayscalePercentage
prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_DOUBLE_TAP)] = settings.homeEffects.enableDoubleTap
prefs[booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_PARALLAX)] = settings.homeEffects.enableParallax
prefs[intPreferencesKey(PreferenceKeys.HOME_PARALLAX_INTENSITY)] = settings.homeEffects.parallaxIntensity
// Lock effects
prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_BLUR)] = settings.lockEffects.enableBlur
prefs[intPreferencesKey(PreferenceKeys.LOCK_BLUR)] = settings.lockEffects.blurPercentage
prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_DARKEN)] = settings.lockEffects.enableDarken
prefs[intPreferencesKey(PreferenceKeys.LOCK_DARKEN)] = settings.lockEffects.darkenPercentage
prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_VIGNETTE)] = settings.lockEffects.enableVignette
prefs[intPreferencesKey(PreferenceKeys.LOCK_VIGNETTE)] = settings.lockEffects.vignettePercentage
prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_GRAYSCALE)] = settings.lockEffects.enableGrayscale
prefs[intPreferencesKey(PreferenceKeys.LOCK_GRAYSCALE)] = settings.lockEffects.grayscalePercentage
prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_DOUBLE_TAP)] = settings.lockEffects.enableDoubleTap
prefs[booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_PARALLAX)] = settings.lockEffects.enableParallax
prefs[intPreferencesKey(PreferenceKeys.LOCK_PARALLAX_INTENSITY)] = settings.lockEffects.parallaxIntensity
// Live effects
prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_BLUR)] = settings.liveEffects.enableBlur
prefs[intPreferencesKey(PreferenceKeys.LIVE_BLUR)] = settings.liveEffects.blurPercentage
prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_DARKEN)] = settings.liveEffects.enableDarken
prefs[intPreferencesKey(PreferenceKeys.LIVE_DARKEN)] = settings.liveEffects.darkenPercentage
prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_VIGNETTE)] = settings.liveEffects.enableVignette
prefs[intPreferencesKey(PreferenceKeys.LIVE_VIGNETTE)] = settings.liveEffects.vignettePercentage
prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_GRAYSCALE)] = settings.liveEffects.enableGrayscale
prefs[intPreferencesKey(PreferenceKeys.LIVE_GRAYSCALE)] = settings.liveEffects.grayscalePercentage
prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_DOUBLE_TAP)] = settings.liveEffects.enableDoubleTap
prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_CHANGE_ON_SCREEN_OFF)] = settings.liveEffects.enableChangeOnScreenOff
prefs[booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_PARALLAX)] = settings.liveEffects.enableParallax
prefs[intPreferencesKey(PreferenceKeys.LIVE_PARALLAX_INTENSITY)] = settings.liveEffects.parallaxIntensity
// Adaptive brightness
prefs[booleanPreferencesKey(PreferenceKeys.ADAPTIVE_BRIGHTNESS)] = settings.adaptiveBrightness
}
}
// ============ Atomic Album Selection Operations ============
/**
* Atomically update home album ID without race conditions
* This prevents lost updates when both home and lock albums are selected simultaneously
*/
suspend fun updateHomeAlbumId(albumId: String?) {
dataStore.edit { prefs ->
if (albumId != null) {
prefs[stringPreferencesKey(PreferenceKeys.HOME_ALBUM_ID)] = albumId
} else {
prefs.remove(stringPreferencesKey(PreferenceKeys.HOME_ALBUM_ID))
}
}
}
/**
* Atomically update lock album ID without race conditions
* This prevents lost updates when both home and lock albums are selected simultaneously
*/
suspend fun updateLockAlbumId(albumId: String?) {
dataStore.edit { prefs ->
if (albumId != null) {
prefs[stringPreferencesKey(PreferenceKeys.LOCK_ALBUM_ID)] = albumId
} else {
prefs.remove(stringPreferencesKey(PreferenceKeys.LOCK_ALBUM_ID))
}
}
}
/**
* Atomically update live album ID without race conditions
*/
suspend fun updateLiveAlbumId(albumId: String?) {
dataStore.edit { prefs ->
if (albumId != null) {
prefs[stringPreferencesKey(PreferenceKeys.LIVE_ALBUM_ID)] = albumId
} else {
prefs.remove(stringPreferencesKey(PreferenceKeys.LIVE_ALBUM_ID))
}
}
}
/**
* Atomically clear album selections if they match the given album ID
* Used when deleting an album to prevent race conditions
* Returns true if any selections were cleared
*/
suspend fun clearAlbumSelectionsIfMatches(albumId: String): Boolean {
var wasCleared = false
dataStore.edit { prefs ->
// Reset on each attempt — DataStore may retry the lambda on concurrent write conflicts
wasCleared = false
val homeAlbumId = prefs[stringPreferencesKey(PreferenceKeys.HOME_ALBUM_ID)]
val lockAlbumId = prefs[stringPreferencesKey(PreferenceKeys.LOCK_ALBUM_ID)]
val liveAlbumId = prefs[stringPreferencesKey(PreferenceKeys.LIVE_ALBUM_ID)]
// Clear home album if it matches
if (homeAlbumId == albumId) {
prefs.remove(stringPreferencesKey(PreferenceKeys.HOME_ALBUM_ID))
wasCleared = true
}
// Clear lock album if it matches
if (lockAlbumId == albumId) {
prefs.remove(stringPreferencesKey(PreferenceKeys.LOCK_ALBUM_ID))
wasCleared = true
}
// Clear live album if it matches
if (liveAlbumId == albumId) {
prefs.remove(stringPreferencesKey(PreferenceKeys.LIVE_ALBUM_ID))
wasCleared = true
}
}
return wasCleared
}
// ============ Atomic AppSettings Operations ============
/**
* Atomically update dark mode setting without race conditions
*/
suspend fun updateDarkMode(enabled: Boolean) {
dataStore.edit { prefs ->
prefs[booleanPreferencesKey(PreferenceKeys.DARK_MODE)] = enabled
}
}
/**
* Atomically update dynamic theming setting without race conditions
*/
suspend fun updateDynamicTheming(enabled: Boolean) {
dataStore.edit { prefs ->
prefs[booleanPreferencesKey(PreferenceKeys.DYNAMIC_THEMING)] = enabled
}
}
/**
* Atomically update animate setting without race conditions
*/
suspend fun updateAnimate(enabled: Boolean) {
dataStore.edit { prefs ->
prefs[booleanPreferencesKey(PreferenceKeys.ANIMATE)] = enabled
}
}
/**
* Atomically update first launch setting without race conditions
*/
suspend fun updateFirstLaunch(isFirstLaunch: Boolean) {
dataStore.edit { prefs ->
prefs[booleanPreferencesKey(PreferenceKeys.FIRST_LAUNCH)] = isFirstLaunch
}
}
// ============ Atomic ScheduleSettings Operations ============
/**
* Atomically update enableChanger setting without race conditions
*/
suspend fun updateEnableChanger(enabled: Boolean) {
dataStore.edit { prefs ->
prefs[booleanPreferencesKey(PreferenceKeys.ENABLE_CHANGER)] = enabled
}
}
// ============ Individual Preference Operations ============
suspend fun <T> setValue(key: String, value: T) {
dataStore.edit { prefs ->
when (value) {
is Boolean -> prefs[booleanPreferencesKey(key)] = value
is Int -> prefs[intPreferencesKey(key)] = value
is Long -> prefs[longPreferencesKey(key)] = value
is String -> prefs[stringPreferencesKey(key)] = value
else -> throw IllegalArgumentException("Unsupported preference type")
}
}
}
suspend fun <T> getValue(key: String, defaultValue: T): T {
val prefs = dataStore.data.first()
@Suppress("UNCHECKED_CAST")
return when (defaultValue) {
is Boolean -> prefs[booleanPreferencesKey(key)] ?: defaultValue
is Int -> prefs[intPreferencesKey(key)] ?: defaultValue
is Long -> prefs[longPreferencesKey(key)] ?: defaultValue
is String -> prefs[stringPreferencesKey(key)] ?: defaultValue
else -> throw IllegalArgumentException("Unsupported preference type")
} as T
}
/**
* Clear schedule settings (reset to defaults)
* Used when switching wallpaper modes
*/
suspend fun clearScheduleSettings() {
dataStore.edit { prefs ->
// Clear scheduling settings
prefs.remove(booleanPreferencesKey(PreferenceKeys.ENABLE_CHANGER))
prefs.remove(booleanPreferencesKey(PreferenceKeys.SEPARATE_SCHEDULES))
prefs.remove(booleanPreferencesKey(PreferenceKeys.SHUFFLE_ENABLED))
prefs.remove(booleanPreferencesKey(PreferenceKeys.HOME_ENABLED))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LOCK_ENABLED))
prefs.remove(stringPreferencesKey(PreferenceKeys.HOME_ALBUM_ID))
prefs.remove(stringPreferencesKey(PreferenceKeys.LOCK_ALBUM_ID))
prefs.remove(stringPreferencesKey(PreferenceKeys.LIVE_ALBUM_ID))
prefs.remove(intPreferencesKey(PreferenceKeys.HOME_INTERVAL_MINUTES))
prefs.remove(intPreferencesKey(PreferenceKeys.LOCK_INTERVAL_MINUTES))
prefs.remove(intPreferencesKey(PreferenceKeys.LIVE_INTERVAL_MINUTES))
// Clear home effects
prefs.remove(booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_BLUR))
prefs.remove(intPreferencesKey(PreferenceKeys.HOME_BLUR))
prefs.remove(booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_DARKEN))
prefs.remove(intPreferencesKey(PreferenceKeys.HOME_DARKEN))
prefs.remove(booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_VIGNETTE))
prefs.remove(intPreferencesKey(PreferenceKeys.HOME_VIGNETTE))
prefs.remove(booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_GRAYSCALE))
prefs.remove(intPreferencesKey(PreferenceKeys.HOME_GRAYSCALE))
prefs.remove(booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_DOUBLE_TAP))
prefs.remove(booleanPreferencesKey(PreferenceKeys.HOME_ENABLE_PARALLAX))
prefs.remove(intPreferencesKey(PreferenceKeys.HOME_PARALLAX_INTENSITY))
// Clear lock effects
prefs.remove(booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_BLUR))
prefs.remove(intPreferencesKey(PreferenceKeys.LOCK_BLUR))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_DARKEN))
prefs.remove(intPreferencesKey(PreferenceKeys.LOCK_DARKEN))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_VIGNETTE))
prefs.remove(intPreferencesKey(PreferenceKeys.LOCK_VIGNETTE))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_GRAYSCALE))
prefs.remove(intPreferencesKey(PreferenceKeys.LOCK_GRAYSCALE))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_DOUBLE_TAP))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LOCK_ENABLE_PARALLAX))
prefs.remove(intPreferencesKey(PreferenceKeys.LOCK_PARALLAX_INTENSITY))
// Clear live effects
prefs.remove(booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_BLUR))
prefs.remove(intPreferencesKey(PreferenceKeys.LIVE_BLUR))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_DARKEN))
prefs.remove(intPreferencesKey(PreferenceKeys.LIVE_DARKEN))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_VIGNETTE))
prefs.remove(intPreferencesKey(PreferenceKeys.LIVE_VIGNETTE))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_GRAYSCALE))
prefs.remove(intPreferencesKey(PreferenceKeys.LIVE_GRAYSCALE))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_DOUBLE_TAP))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_CHANGE_ON_SCREEN_OFF))
prefs.remove(booleanPreferencesKey(PreferenceKeys.LIVE_ENABLE_PARALLAX))
prefs.remove(intPreferencesKey(PreferenceKeys.LIVE_PARALLAX_INTENSITY))
// Clear scaling
prefs.remove(stringPreferencesKey(PreferenceKeys.HOME_SCALING_TYPE))
prefs.remove(stringPreferencesKey(PreferenceKeys.LOCK_SCALING_TYPE))
prefs.remove(stringPreferencesKey(PreferenceKeys.LIVE_SCALING_TYPE))
prefs.remove(booleanPreferencesKey(PreferenceKeys.HOME_SCROLLING_ENABLED))
// Clear adaptive brightness
prefs.remove(booleanPreferencesKey(PreferenceKeys.ADAPTIVE_BRIGHTNESS))
}
}
suspend fun clear() {
dataStore.edit { it.clear() }
}
}
@@ -0,0 +1,65 @@
package com.anthonyla.paperize.data.mapper
import com.anthonyla.paperize.data.database.entities.AlbumEntity
import com.anthonyla.paperize.data.database.relations.AlbumWithDetails
import com.anthonyla.paperize.domain.model.Album
/**
* Mappers for Album entity <-> domain model conversion
*/
fun AlbumEntity.toDomainModel(
wallpapers: List<com.anthonyla.paperize.domain.model.Wallpaper> = emptyList(),
folders: List<com.anthonyla.paperize.domain.model.Folder> = emptyList()
): Album = Album(
id = id,
name = name,
coverUri = coverUri,
wallpapers = wallpapers,
folders = folders,
createdAt = createdAt,
modifiedAt = modifiedAt
)
fun Album.toEntity(): AlbumEntity = AlbumEntity(
id = id,
name = name,
coverUri = coverUri,
createdAt = createdAt,
modifiedAt = modifiedAt
)
fun AlbumWithDetails.toDomainModel(): Album {
// Optimization: Group wallpapers by folderId once to avoid repeated filtering
val wallpapersByFolder = wallpapers.groupBy { it.folderId }
val domainWallpapers = wallpapersByFolder[null]?.map { it.toDomainModel() } ?: emptyList()
val domainFolders = folders.map { folderEntity ->
val folderWallpapers = wallpapersByFolder[folderEntity.id]?.map { it.toDomainModel() } ?: emptyList()
folderEntity.toDomainModel(folderWallpapers)
}
return album.toDomainModel(
wallpapers = domainWallpapers,
folders = domainFolders
)
}
fun List<AlbumEntity>.toDomainModels(): List<Album> = map { it.toDomainModel() }
fun List<AlbumWithDetails>.toDomainModelsFromRelations(): List<Album> = map { it.toDomainModel() }
fun com.anthonyla.paperize.data.database.entities.AlbumSummaryEntity.toDomainModel(): com.anthonyla.paperize.domain.model.AlbumSummary =
com.anthonyla.paperize.domain.model.AlbumSummary(
id = id,
name = name,
coverUri = coverUri,
wallpaperCount = wallpaperCount,
folderCount = folderCount,
createdAt = createdAt,
modifiedAt = modifiedAt
)
fun List<com.anthonyla.paperize.data.database.entities.AlbumSummaryEntity>.toDomainModelsFromSummaries(): List<com.anthonyla.paperize.domain.model.AlbumSummary> =
map { it.toDomainModel() }
@@ -0,0 +1,42 @@
package com.anthonyla.paperize.data.mapper
import com.anthonyla.paperize.data.database.entities.FolderEntity
import com.anthonyla.paperize.data.database.relations.FolderWithWallpapers
import com.anthonyla.paperize.domain.model.Folder
/**
* Mappers for Folder entity <-> domain model conversion
*/
fun FolderEntity.toDomainModel(
wallpapers: List<com.anthonyla.paperize.domain.model.Wallpaper> = emptyList()
): Folder = Folder(
id = id,
albumId = albumId,
name = name,
uri = uri,
coverUri = coverUri,
dateModified = dateModified,
displayOrder = displayOrder,
wallpapers = wallpapers,
addedAt = addedAt
)
fun Folder.toEntity(): FolderEntity = FolderEntity(
id = id,
albumId = albumId,
name = name,
uri = uri,
coverUri = coverUri,
dateModified = dateModified,
displayOrder = displayOrder,
addedAt = addedAt
)
fun FolderWithWallpapers.toDomainModel(): Folder = folder.toDomainModel(
wallpapers = wallpapers.map { it.toDomainModel() }
)
fun List<FolderEntity>.toDomainModels(): List<Folder> = map { it.toDomainModel() }
fun List<FolderWithWallpapers>.toDomainModelsFromRelations(): List<Folder> = map { it.toDomainModel() }
@@ -0,0 +1,38 @@
package com.anthonyla.paperize.data.mapper
import com.anthonyla.paperize.data.database.entities.WallpaperEntity
import com.anthonyla.paperize.domain.model.Wallpaper
/**
* Mappers for Wallpaper entity <-> domain model conversion
*/
fun WallpaperEntity.toDomainModel(): Wallpaper = Wallpaper(
id = id,
albumId = albumId,
folderId = folderId,
uri = uri,
fileName = fileName,
dateModified = dateModified,
displayOrder = displayOrder,
sourceType = sourceType,
addedAt = addedAt,
mediaType = mediaType
)
fun Wallpaper.toEntity(): WallpaperEntity = WallpaperEntity(
id = id,
albumId = albumId,
folderId = folderId,
uri = uri,
fileName = fileName,
dateModified = dateModified,
displayOrder = displayOrder,
sourceType = sourceType,
addedAt = addedAt,
mediaType = mediaType
)
fun List<WallpaperEntity>.toDomainModels(): List<Wallpaper> = map { it.toDomainModel() }
fun List<Wallpaper>.toEntities(): List<WallpaperEntity> = map { it.toEntity() }
@@ -1,62 +0,0 @@
package com.anthonyla.paperize.data
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.State
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
/**
* Remember the current offset of a [LazyListState].
* Source:
* https://stackoverflow.com/a/75677163
* https://stackoverflow.com/a/70558512
*/
@Composable
fun rememberCurrentOffset(state: LazyListState): State<Int> {
val position = remember { derivedStateOf { state.firstVisibleItemIndex } }
val itemOffset = remember { derivedStateOf { state.firstVisibleItemScrollOffset } }
val lastPosition = rememberPrevious(position.value)
val lastItemOffset = rememberPrevious(itemOffset.value)
val currentOffset = remember { mutableIntStateOf(0) }
LaunchedEffect(position.value, itemOffset.value) {
currentOffset.intValue = when {
lastPosition == null || position.value == 0 -> itemOffset.value
lastPosition == position.value -> currentOffset.intValue + (itemOffset.value - (lastItemOffset ?: 0))
lastPosition > position.value -> currentOffset.intValue - (lastItemOffset ?: 0)
else -> currentOffset.intValue + itemOffset.value
}
}
return currentOffset
}
@Composable
fun <T> rememberPrevious(
current: T,
shouldUpdate: (prev: T?, curr: T) -> Boolean = { prev, curr -> prev != curr },
): T? {
val ref = rememberRef<T>()
SideEffect {
if (shouldUpdate(ref.value, current)) {
ref.value = current
}
}
return ref.value
}
@Composable
fun <T> rememberRef(): MutableState<T?> {
return remember {
object : MutableState<T?> {
override var value: T? = null
override fun component1(): T? = value
override fun component2(): (T?) -> Unit = { value = it }
}
}
}
@@ -0,0 +1,362 @@
package com.anthonyla.paperize.data.repository
import android.content.Context
import android.net.Uri
import androidx.documentfile.provider.DocumentFile
import androidx.room.withTransaction
import com.anthonyla.paperize.core.Result
import com.anthonyla.paperize.core.util.generateId
import com.anthonyla.paperize.data.database.PaperizeDatabase
import com.anthonyla.paperize.data.database.dao.AlbumDao
import com.anthonyla.paperize.data.database.dao.FolderDao
import com.anthonyla.paperize.data.database.dao.WallpaperDao
import com.anthonyla.paperize.data.database.entities.AlbumEntity
import com.anthonyla.paperize.data.mapper.toDomainModel
import com.anthonyla.paperize.data.mapper.toDomainModelsFromRelations
import com.anthonyla.paperize.data.mapper.toDomainModelsFromSummaries
import com.anthonyla.paperize.data.mapper.toEntities
import com.anthonyla.paperize.data.mapper.toEntity
import com.anthonyla.paperize.domain.model.Album
import com.anthonyla.paperize.domain.model.AlbumSummary
import com.anthonyla.paperize.domain.model.Folder
import com.anthonyla.paperize.domain.model.Wallpaper
import com.anthonyla.paperize.domain.repository.AlbumRepository
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import javax.inject.Inject
import javax.inject.Singleton
/**
* Implementation of AlbumRepository
*
* Handles data operations for albums using Room database
*/
@Singleton
class AlbumRepositoryImpl @Inject constructor(
@param:ApplicationContext private val context: Context,
private val database: PaperizeDatabase,
private val albumDao: AlbumDao,
private val wallpaperDao: WallpaperDao,
private val folderDao: FolderDao,
private val wallpaperRepository: dagger.Lazy<com.anthonyla.paperize.domain.repository.WallpaperRepository>
) : AlbumRepository {
companion object {
/** Number of wallpapers written per insert/progress step during an import. */
private const val WALLPAPER_INSERT_CHUNK_SIZE = 500
}
override fun getAlbumSummaries(): Flow<List<AlbumSummary>> =
albumDao.getAlbumSummaries().map { it.toDomainModelsFromSummaries() }
override fun getAllAlbums(): Flow<List<Album>> =
albumDao.getAllAlbumsWithDetails().map { it.toDomainModelsFromRelations() }
override fun getAlbumById(albumId: String): Flow<Album?> =
albumDao.getAlbumWithDetails(albumId).map { it?.toDomainModel() }
override suspend fun getAlbumByName(name: String): Album? =
albumDao.getAlbumByName(name)?.toDomainModel()
override fun getFolderById(folderId: String): Flow<Folder?> =
folderDao.getFolderWithWallpapers(folderId).map { it?.toDomainModel() }
override suspend fun createAlbum(name: String, coverUri: String?): Result<Album> {
return try {
val album = Album(
id = generateId(),
name = name,
coverUri = coverUri,
createdAt = System.currentTimeMillis(),
modifiedAt = System.currentTimeMillis()
)
albumDao.insertAlbum(album.toEntity())
Result.Success(album)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun updateAlbum(album: Album): Result<Unit> {
return try {
albumDao.updateAlbum(album.toEntity())
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun deleteAlbum(albumId: String): Result<Unit> {
return try {
database.withTransaction {
albumDao.deleteAlbumById(albumId)
wallpaperRepository.get().clearQueuesForAlbum(albumId)
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun updateAlbumName(albumId: String, name: String): Result<Unit> {
return try {
albumDao.updateAlbumName(albumId, name, System.currentTimeMillis())
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun updateAlbumCover(albumId: String, coverUri: String?): Result<Unit> {
return try {
albumDao.updateAlbumCover(albumId, coverUri, System.currentTimeMillis())
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun addWallpapersToAlbum(
albumId: String,
wallpapers: List<Wallpaper>,
onProgress: (saved: Int, total: Int) -> Unit
): Result<Unit> {
return try {
// Atomic transaction - insert wallpapers, update timestamp, and update cover
database.withTransaction {
insertWallpapersChunked(wallpapers, onProgress)
albumDao.updateAlbumModifiedTime(albumId, System.currentTimeMillis())
// Update album cover if it doesn't have one
updateAlbumCoverIfNeeded(albumId)
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun addFolderToAlbum(
albumId: String,
folder: Folder,
onProgress: (saved: Int, total: Int) -> Unit
): Result<Unit> {
return try {
// Atomic transaction - folder, wallpapers, timestamp, and cover all succeed or all fail
database.withTransaction {
folderDao.insertFolder(folder.toEntity())
// Insert folder wallpapers
insertWallpapersChunked(folder.wallpapers, onProgress)
albumDao.updateAlbumModifiedTime(albumId, System.currentTimeMillis())
// Update album cover if it doesn't have one
updateAlbumCoverIfNeeded(albumId)
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
/**
* Insert [wallpapers] in chunks, mapping each chunk to entities only as it is written so the
* full entity list is never materialized at once, and reporting progress after each chunk.
* Must be called inside a transaction so the overall insert stays atomic.
*/
private suspend fun insertWallpapersChunked(
wallpapers: List<Wallpaper>,
onProgress: (saved: Int, total: Int) -> Unit
) {
val total = wallpapers.size
var saved = 0
wallpapers.chunked(WALLPAPER_INSERT_CHUNK_SIZE).forEach { chunk ->
wallpaperDao.insertWallpapers(chunk.toEntities())
saved += chunk.size
onProgress(saved, total)
}
}
override suspend fun updateFolder(folder: Folder): Result<Unit> {
return try {
folderDao.updateFolder(folder.toEntity())
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun removeWallpaperFromAlbum(
albumId: String,
wallpaperId: String
): Result<Unit> {
return try {
// Atomic transaction - delete wallpaper, update timestamp, and refresh cover
database.withTransaction {
val wallpaper = wallpaperDao.getWallpaperById(wallpaperId)
wallpaperDao.deleteWallpaperById(wallpaperId)
albumDao.updateAlbumModifiedTime(albumId, System.currentTimeMillis())
// Refresh cover if deleted wallpaper was the cover
val album = albumDao.getAlbumById(albumId)
if (album?.coverUri == wallpaper?.uri) {
updateAlbumCoverIfNeeded(albumId)
}
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun removeWallpapersFromAlbum(
albumId: String,
wallpaperIds: List<String>
): Result<Unit> {
return try {
if (wallpaperIds.isEmpty()) {
return Result.Success(Unit)
}
// Atomic transaction - delete wallpapers, update timestamp, and refresh cover
database.withTransaction {
val album = albumDao.getAlbumById(albumId)
val currentCoverUri = album?.coverUri
// Batch delete wallpapers
wallpaperDao.deleteWallpapersByIds(wallpaperIds)
albumDao.updateAlbumModifiedTime(albumId, System.currentTimeMillis())
// Refresh cover if any deleted wallpaper was the cover
// (we check by querying the album cover to see if it still exists)
if (currentCoverUri != null) {
val coverStillExists = wallpaperDao.getWallpaperByUri(currentCoverUri) != null
if (!coverStillExists) {
updateAlbumCoverIfNeeded(albumId)
}
}
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun removeFolderFromAlbum(albumId: String, folderId: String): Result<Unit> {
return try {
// Atomic transaction - delete folder, update timestamp, and refresh cover
database.withTransaction {
folderDao.deleteFolderById(folderId)
albumDao.updateAlbumModifiedTime(albumId, System.currentTimeMillis())
// Always refresh cover after folder deletion (folder wallpapers might be cover)
updateAlbumCoverIfNeeded(albumId)
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun getAlbumCount(): Int = albumDao.getAlbumCount()
override suspend fun deleteAllAlbums(): Result<Unit> {
return try {
database.withTransaction {
albumDao.deleteAllAlbums()
wallpaperRepository.get().clearAllQueues()
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun validateAndRemoveInvalidFolders(albumId: String): Result<Int> {
return try {
val album = albumDao.getAlbumWithDetails(albumId).first() ?: return Result.Success(0)
val folders = album.folders.map { it.toDomainModel() }
val invalidFolderIds = folders.filter { folder ->
// Check if folder URI is still valid
val uri = Uri.parse(folder.uri)
val documentFile = DocumentFile.fromTreeUri(context, uri)
documentFile == null || !documentFile.exists() || !documentFile.canRead()
}.map { it.id }
if (invalidFolderIds.isNotEmpty()) {
// Atomic transaction - delete all invalid folders or none
database.withTransaction {
invalidFolderIds.forEach { folderId ->
folderDao.deleteFolderById(folderId)
}
}
}
Result.Success(invalidFolderIds.size)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun refreshAlbumCover(albumId: String): Result<Unit> {
return try {
database.withTransaction {
updateAlbumCoverIfNeeded(albumId)
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun refreshFolderCovers(albumId: String): Result<Unit> {
return try {
// Get all folders in the album with their wallpapers
val folders = folderDao.getFoldersWithWallpapersByAlbum(albumId).first()
// Update each folder's cover to its first wallpaper
folders.forEach { folderWithWallpapers ->
val folder = folderWithWallpapers.folder
val wallpapers = folderWithWallpapers.wallpapers
val newCoverUri = wallpapers.firstOrNull()?.uri
// Only update if cover changed
if (folder.coverUri != newCoverUri) {
folderDao.updateFolderCover(folder.id, newCoverUri)
}
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
/**
* Update album cover art based on available wallpapers
* Priority: 1) First direct wallpaper, 2) First wallpaper from first folder
* NOTE: This must be called within a transaction
*/
private suspend fun updateAlbumCoverIfNeeded(albumId: String) {
val album = albumDao.getAlbumById(albumId) ?: return
// Try to get first direct wallpaper (uploaded directly, not from folder)
val directWallpapers = wallpaperDao.getDirectWallpapersByAlbumSync(albumId)
val newCoverUri = when {
// Priority 1: First direct wallpaper
directWallpapers.isNotEmpty() -> directWallpapers.first().uri
// Priority 2: First wallpaper from any folder
else -> {
val allWallpapers = wallpaperDao.getWallpapersByAlbumSync(albumId)
allWallpapers.firstOrNull()?.uri
}
}
// Only update if cover changed
if (album.coverUri != newCoverUri) {
albumDao.updateAlbumCover(albumId, newCoverUri, System.currentTimeMillis())
}
}
}
@@ -0,0 +1,83 @@
package com.anthonyla.paperize.data.repository
import com.anthonyla.paperize.core.WallpaperMode
import com.anthonyla.paperize.data.datastore.PreferencesManager
import com.anthonyla.paperize.domain.model.AppSettings
import com.anthonyla.paperize.domain.model.ScheduleSettings
import com.anthonyla.paperize.domain.repository.SettingsRepository
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject
import javax.inject.Singleton
/**
* Implementation of SettingsRepository
*/
@Singleton
class SettingsRepositoryImpl @Inject constructor(
private val preferencesManager: PreferencesManager
) : SettingsRepository {
override suspend fun getAppSettings(): AppSettings =
preferencesManager.getAppSettings()
override fun getAppSettingsFlow(): Flow<AppSettings> =
preferencesManager.getAppSettingsFlow()
override suspend fun updateAppSettings(settings: AppSettings) =
preferencesManager.updateAppSettings(settings)
override suspend fun getWallpaperMode(): WallpaperMode =
preferencesManager.getWallpaperMode()
override fun getWallpaperModeFlow(): Flow<WallpaperMode> =
preferencesManager.getWallpaperModeFlow()
override suspend fun updateWallpaperMode(mode: WallpaperMode) =
preferencesManager.updateWallpaperMode(mode)
override suspend fun getScheduleSettings(): ScheduleSettings =
preferencesManager.getScheduleSettings()
override fun getScheduleSettingsFlow(): Flow<ScheduleSettings> =
preferencesManager.getScheduleSettingsFlow()
override suspend fun updateScheduleSettings(settings: ScheduleSettings) =
preferencesManager.updateScheduleSettings(settings)
override suspend fun clearAllSettings() =
preferencesManager.clear()
override suspend fun clearScheduleSettings() =
preferencesManager.clearScheduleSettings()
override suspend fun updateHomeAlbumId(albumId: String?) =
preferencesManager.updateHomeAlbumId(albumId)
override suspend fun updateLockAlbumId(albumId: String?) =
preferencesManager.updateLockAlbumId(albumId)
override suspend fun updateLiveAlbumId(albumId: String?) =
preferencesManager.updateLiveAlbumId(albumId)
override suspend fun clearAlbumSelectionsIfMatches(albumId: String): Boolean =
preferencesManager.clearAlbumSelectionsIfMatches(albumId)
// ============ Atomic AppSettings Operations ============
override suspend fun updateDarkMode(enabled: Boolean) =
preferencesManager.updateDarkMode(enabled)
override suspend fun updateDynamicTheming(enabled: Boolean) =
preferencesManager.updateDynamicTheming(enabled)
override suspend fun updateAnimate(enabled: Boolean) =
preferencesManager.updateAnimate(enabled)
override suspend fun updateFirstLaunch(isFirstLaunch: Boolean) =
preferencesManager.updateFirstLaunch(isFirstLaunch)
// ============ Atomic ScheduleSettings Operations ============
override suspend fun updateEnableChanger(enabled: Boolean) =
preferencesManager.updateEnableChanger(enabled)
}
@@ -0,0 +1,304 @@
package com.anthonyla.paperize.data.repository
import android.content.ContentResolver
import android.content.Context
import android.net.Uri
import androidx.core.net.toUri
import com.anthonyla.paperize.core.Result
import com.anthonyla.paperize.core.ScreenType
import com.anthonyla.paperize.core.WallpaperSourceType
import com.anthonyla.paperize.core.util.generateId
import com.anthonyla.paperize.core.util.isValid
import com.anthonyla.paperize.core.util.scanFolderImages
import com.anthonyla.paperize.data.database.dao.WallpaperCurrentDao
import com.anthonyla.paperize.data.database.dao.WallpaperDao
import com.anthonyla.paperize.data.database.dao.WallpaperQueueDao
import com.anthonyla.paperize.data.database.entities.WallpaperCurrentEntity
import com.anthonyla.paperize.data.mapper.toDomainModel
import com.anthonyla.paperize.data.mapper.toDomainModels
import com.anthonyla.paperize.data.mapper.toEntity
import com.anthonyla.paperize.domain.model.Wallpaper
import com.anthonyla.paperize.domain.repository.WallpaperRepository
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import javax.inject.Inject
import javax.inject.Singleton
import java.util.concurrent.ConcurrentHashMap
/**
* Implementation of WallpaperRepository
*/
@Singleton
class WallpaperRepositoryImpl @Inject constructor(
@param:ApplicationContext private val context: Context,
private val wallpaperDao: WallpaperDao,
private val wallpaperQueueDao: WallpaperQueueDao,
private val wallpaperCurrentDao: WallpaperCurrentDao
) : WallpaperRepository {
private val contentResolver: ContentResolver = context.contentResolver
/**
* Mutexes to synchronize queue rebuild operations per (albumId, screenType)
* Prevents duplicate rebuilds when multiple threads detect empty queue simultaneously
*/
private val queueRebuildMutexes = ConcurrentHashMap<String, Mutex>()
override fun getWallpapersByAlbum(albumId: String): Flow<List<Wallpaper>> =
wallpaperDao.getWallpapersByAlbum(albumId).map { it.toDomainModels() }
override fun getDirectWallpapersByAlbum(albumId: String): Flow<List<Wallpaper>> =
wallpaperDao.getDirectWallpapersByAlbum(albumId).map { it.toDomainModels() }
override fun getWallpapersByFolder(folderId: String): Flow<List<Wallpaper>> =
wallpaperDao.getWallpapersByFolder(folderId).map { it.toDomainModels() }
override suspend fun getWallpaperById(wallpaperId: String): Wallpaper? =
wallpaperDao.getWallpaperById(wallpaperId)?.toDomainModel()
override suspend fun addWallpaper(wallpaper: Wallpaper): Result<Unit> {
return try {
wallpaperDao.insertWallpaper(wallpaper.toEntity())
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun updateWallpaper(wallpaper: Wallpaper): Result<Unit> {
return try {
wallpaperDao.updateWallpaper(wallpaper.toEntity())
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun deleteWallpaper(wallpaperId: String): Result<Unit> {
return try {
wallpaperDao.deleteWallpaperById(wallpaperId)
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun deleteWallpapers(wallpaperIds: List<String>): Result<Unit> {
return try {
if (wallpaperIds.isEmpty()) {
return Result.Success(Unit)
}
wallpaperDao.deleteWallpapersByIds(wallpaperIds)
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun deleteWallpapersByFolderId(folderId: String): Result<Unit> {
return try {
wallpaperDao.deleteWallpapersByFolder(folderId)
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun updateWallpaperOrder(wallpaperId: String, order: Int): Result<Unit> {
return try {
wallpaperDao.updateWallpaperOrder(wallpaperId, order)
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun validateAndRemoveInvalidWallpapers(albumId: String): Result<Int> {
return try {
var totalRemoved = 0
val batchSize = 100 // Process in smaller batches to avoid memory spikes
var offset = 0
while (true) {
val wallpapers = wallpaperDao.getWallpapersByAlbumPaged(albumId, batchSize, offset)
if (wallpapers.isEmpty()) break
val invalidUris = wallpapers
.filter { !it.uri.toUri().isValid(contentResolver) }
.map { it.uri }
.toSet()
if (invalidUris.isNotEmpty()) {
wallpaperDao.deleteWallpapersByUris(invalidUris.toList())
totalRemoved += invalidUris.size
// Advance offset only by the number of valid items in this batch,
// so valid items already checked are not re-fetched next iteration
offset += wallpapers.size - invalidUris.size
} else {
offset += batchSize
}
}
Result.Success(totalRemoved)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun getNextWallpaperInQueue(albumId: String, screenType: ScreenType): Wallpaper? =
wallpaperQueueDao.getNextWallpaperInQueue(albumId, screenType)?.toDomainModel()
override suspend fun getAndDequeueWallpaper(albumId: String, screenType: ScreenType): Wallpaper? =
wallpaperQueueDao.getAndDequeueWallpaper(albumId, screenType)?.toDomainModel()
override suspend fun removeWallpaperFromQueue(
albumId: String,
screenType: ScreenType,
wallpaperId: String
) {
wallpaperQueueDao.deleteQueueItem(albumId, screenType, wallpaperId)
}
override suspend fun restoreWallpaperToQueueFront(
albumId: String,
screenType: ScreenType,
wallpaperId: String
) {
wallpaperQueueDao.restoreQueueItem(albumId, screenType, wallpaperId)
}
override suspend fun buildWallpaperQueue(
albumId: String,
screenType: ScreenType,
shuffle: Boolean
): Result<Unit> {
// In shuffle mode, use album-level mutex to ensure synchronized shuffle order
// In sequential mode, use per-screen mutex for independent rebuilds
val mutexKey = if (shuffle) albumId else "$albumId:$screenType"
val mutex = queueRebuildMutexes.getOrPut(mutexKey) { Mutex() }
return mutex.withLock {
try {
// Load only IDs (+ order for sequential mode) instead of full WallpaperEntity
// objects, to avoid deserializing every field for every wallpaper in the album.
val otherScreenType: ScreenType? = if (shuffle) when (screenType) {
ScreenType.HOME -> ScreenType.LOCK
ScreenType.LOCK -> ScreenType.HOME
else -> null
} else null
val wallpaperIds = if (shuffle) {
val ids = wallpaperDao.getWallpaperIdsByAlbum(albumId)
// In shuffle mode, sync with the other screen's queue if it exists
val otherScreenQueueIds = otherScreenType?.let {
try {
wallpaperQueueDao.getQueueItems(albumId, it)
.map { item -> item.wallpaperId }
} catch (_: Exception) { null }
}
if (otherScreenQueueIds != null && otherScreenQueueIds.isNotEmpty()) {
com.anthonyla.paperize.core.util.QueueBuilder.mergeWithExistingQueue(otherScreenQueueIds, ids)
} else {
com.anthonyla.paperize.core.util.QueueBuilder.buildShuffledQueue(ids)
}
} else {
val idsWithOrder = wallpaperDao.getWallpaperIdsAndOrderByAlbum(albumId)
com.anthonyla.paperize.core.util.QueueBuilder.buildSequentialQueue(
idsWithOrder.map { it.id to it.displayOrder }
)
}
wallpaperQueueDao.rebuildQueue(albumId, screenType, wallpaperIds)
// In shuffle mode, pre-populate the other screen's queue with the same order
// if it doesn't yet exist. This ensures both screens start from the same
// shuffle sequence, preventing drift when switching to separate schedules.
if (shuffle && otherScreenType != null) {
try {
val otherQueueIsEmpty = wallpaperQueueDao
.getQueueItems(albumId, otherScreenType).isEmpty()
if (otherQueueIsEmpty) {
wallpaperQueueDao.rebuildQueue(albumId, otherScreenType, wallpaperIds)
}
} catch (_: Exception) {
// Best-effort: if pre-population fails the other screen will build its
// own queue on demand via mergeWithExistingQueue
}
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
}
override suspend fun clearAllQueues(): Result<Unit> {
return try {
wallpaperQueueDao.deleteAllQueueItems()
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun clearQueuesForAlbum(albumId: String): Result<Unit> {
return try {
wallpaperQueueDao.clearAllQueues(albumId)
// Prune mutexes for this album to prevent memory leak
// Keys are either albumId (shuffled) or $albumId:$screenType (sequential)
// Use exact match or prefix with colon to avoid false positives (e.g., album1 vs album10)
queueRebuildMutexes.keys.filter { it == albumId || it.startsWith("$albumId:") }.forEach {
queueRebuildMutexes.remove(it)
}
Result.Success(Unit)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun getCurrentWallpaper(albumId: String, screenType: ScreenType): Wallpaper? =
wallpaperCurrentDao.getCurrentWallpaper(albumId, screenType)?.toDomainModel()
override fun getCurrentWallpaperFlow(albumId: String, screenType: ScreenType): Flow<Wallpaper?> =
wallpaperCurrentDao.getCurrentWallpaperFlow(albumId, screenType).map { it?.toDomainModel() }
override suspend fun setCurrentWallpaper(albumId: String, screenType: ScreenType, wallpaperId: String) {
wallpaperCurrentDao.upsertCurrentWallpaper(
WallpaperCurrentEntity(albumId = albumId, screenType = screenType, wallpaperId = wallpaperId)
)
}
override suspend fun scanFolderForWallpapers(folderUri: Uri): Result<List<Wallpaper>> {
return try {
val wallpapers = folderUri.scanFolderImages(context).map { image ->
Wallpaper(
id = generateId(),
albumId = "",
folderId = null,
uri = image.uri.toString(),
fileName = image.name,
dateModified = image.lastModified,
sourceType = WallpaperSourceType.FOLDER
)
}
Result.Success(wallpapers)
} catch (e: Exception) {
Result.Error(e)
}
}
override suspend fun isWallpaperInAlbum(albumId: String, uri: String): Boolean =
wallpaperDao.getWallpaperByUri(uri)?.let { it.albumId == albumId } ?: false
override suspend fun getExistingWallpaperUris(albumId: String, folderId: String): Set<String> =
wallpaperDao.getWallpaperUrisByAlbumAndFolder(albumId, folderId).toHashSet()
}
@@ -1,17 +0,0 @@
package com.anthonyla.paperize.data.settings
/**
* Interface for the data store that handles the settings for application
*/
interface SettingsDataStore {
suspend fun putBoolean(key: String, value: Boolean)
suspend fun putString(key: String, value: String)
suspend fun putInt(key: String, value: Int)
suspend fun getBoolean(key: String): Boolean?
suspend fun getString(key: String): String?
suspend fun getInt(key: String): Int?
suspend fun deleteBoolean(key: String)
suspend fun deleteString(key: String)
suspend fun deleteInt(key: String)
suspend fun clearPreferences()
}
@@ -1,97 +0,0 @@
package com.anthonyla.paperize.data.settings
import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.datastore.preferences.preferencesDataStore
import com.anthonyla.paperize.core.SettingsConstants.SETTINGS_DATASTORE
import kotlinx.coroutines.flow.first
import javax.inject.Inject
private val Context.dataStore : DataStore<Preferences> by preferencesDataStore(name = SETTINGS_DATASTORE)
class SettingsDataStoreImpl @Inject constructor (private val context: Context): SettingsDataStore {
override suspend fun putBoolean(key: String, value: Boolean) {
val preferencesKey = booleanPreferencesKey(key)
context.dataStore.edit {
it[preferencesKey] = value
}
}
override suspend fun putString(key: String, value: String) {
val preferencesKey = stringPreferencesKey(key)
context.dataStore.edit {
it[preferencesKey] = value
}
}
override suspend fun putInt(key: String, value: Int) {
val preferencesKey = stringPreferencesKey(key)
context.dataStore.edit {
it[preferencesKey] = value.toString()
}
}
override suspend fun getBoolean(key: String): Boolean? {
val head = context.dataStore.data.first()
val preferencesKey = booleanPreferencesKey(key)
return head[preferencesKey]
}
override suspend fun getString(key: String): String? {
return try {
val head = context.dataStore.data.first()
val preferencesKey = stringPreferencesKey(key)
head[preferencesKey]
} catch (exception: Exception) {
exception.printStackTrace()
null
}
}
override suspend fun getInt(key: String): Int? {
return try {
val head = context.dataStore.data.first()
val preferencesKey = stringPreferencesKey(key)
head[preferencesKey]?.toInt()
} catch (exception: Exception) {
exception.printStackTrace()
null
}
}
override suspend fun deleteBoolean(key: String) {
val preferencesKey = booleanPreferencesKey(key)
context.dataStore.edit {
if (it.contains(preferencesKey)) {
it.remove(preferencesKey)
}
}
}
override suspend fun deleteString(key: String) {
val preferencesKey = stringPreferencesKey(key)
context.dataStore.edit {
if (it.contains(preferencesKey)) {
it.remove(preferencesKey)
}
}
}
override suspend fun deleteInt(key: String) {
val preferencesKey = stringPreferencesKey(key)
context.dataStore.edit {
if (it.contains(preferencesKey)) {
it.remove(preferencesKey)
}
}
}
override suspend fun clearPreferences() {
context.dataStore.edit {
it.clear()
}
}
}
@@ -1,82 +0,0 @@
package com.anthonyla.paperize.di
import android.app.Application
import android.content.Context
import androidx.room.Room
import com.anthonyla.paperize.data.settings.SettingsDataStore
import com.anthonyla.paperize.data.settings.SettingsDataStoreImpl
import com.anthonyla.paperize.feature.wallpaper.data.data_source.AlbumDatabase
import com.anthonyla.paperize.feature.wallpaper.data.data_source.SelectedAlbumDatabase
import com.anthonyla.paperize.feature.wallpaper.data.repository.AlbumRepositoryImpl
import com.anthonyla.paperize.feature.wallpaper.data.repository.SelectedAlbumRepositoryImpl
import com.anthonyla.paperize.feature.wallpaper.domain.repository.AlbumRepository
import com.anthonyla.paperize.feature.wallpaper.domain.repository.SelectedAlbumRepository
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
/**
* AppModule provides dependencies for the application for Dagger Hilt to inject
*/
@Module
@InstallIn(SingletonComponent::class)
object AppModule {
@Provides
@Singleton
fun provideAlbumDatabase(app: Application): AlbumDatabase {
return Room.databaseBuilder(
app,
AlbumDatabase::class.java,
AlbumDatabase.DATABASE_NAME
).build()
}
@Provides
@Singleton
fun provideSelectedAlbumDatabase(app: Application): SelectedAlbumDatabase {
return Room.databaseBuilder(
app,
SelectedAlbumDatabase::class.java,
SelectedAlbumDatabase.DATABASE_NAME
).build()
}
@Provides
@Singleton
fun provideAlbumDao(db: AlbumDatabase) = db.albumDao
@Provides
@Singleton
fun provideAlbumRepository(
db: AlbumDatabase
): AlbumRepository {
return AlbumRepositoryImpl(db.albumDao)
}
@Provides
@Singleton
fun provideSelectedAlbumDao(db: SelectedAlbumDatabase) = db.selectedAlbumDao
@Provides
@Singleton
fun provideSelectedAlbumRepository(
db: SelectedAlbumDatabase
): SelectedAlbumRepository {
return SelectedAlbumRepositoryImpl(db.selectedAlbumDao)
}
@Provides
@Singleton
fun provideSettingsDataStore (
@ApplicationContext context: Context
): SettingsDataStore = SettingsDataStoreImpl(context)
@Provides
@Singleton
fun provideContext(
@ApplicationContext context: Context,
): Context { return context }
}
@@ -0,0 +1,48 @@
package com.anthonyla.paperize.domain.model
/**
* Domain model for Album
*
* Pure Kotlin data class without Room annotations
*/
data class Album(
val id: String,
val name: String,
val coverUri: String?,
val wallpapers: List<Wallpaper> = emptyList(),
val folders: List<Folder> = emptyList(),
val createdAt: Long = System.currentTimeMillis(),
val modifiedAt: Long = System.currentTimeMillis()
) {
/**
* Get total wallpaper count (direct + in folders)
*/
val totalWallpaperCount: Int
get() = wallpapers.size + folders.sumOf { it.wallpapers.size }
/**
* Get all wallpapers (direct + from folders)
*/
val allWallpapers: List<Wallpaper>
get() = wallpapers + folders.flatMap { it.wallpapers }
/**
* Get all wallpapers sorted by display order
*/
val sortedWallpapers: List<Wallpaper>
get() = allWallpapers.sortedBy { it.displayOrder }
/**
* Check if album is empty
*/
val isEmpty: Boolean
get() = totalWallpaperCount == 0
companion object {
fun empty(id: String = "", name: String = "") = Album(
id = id,
name = name,
coverUri = null
)
}
}
@@ -0,0 +1,34 @@
package com.anthonyla.paperize.domain.model
/**
* Lightweight summary of an Album for list displays.
* Prevents loading potentially thousands of Wallpaper objects into memory
* when just displaying a list of albums.
*/
data class AlbumSummary(
val id: String,
val name: String,
val coverUri: String?,
val wallpaperCount: Int,
val folderCount: Int,
val createdAt: Long,
val modifiedAt: Long
) {
/**
* Check if album is empty without a full object load
*/
val isEmpty: Boolean
get() = wallpaperCount == 0
companion object {
fun empty(id: String = "", name: String = "") = AlbumSummary(
id = id,
name = name,
coverUri = null,
wallpaperCount = 0,
folderCount = 0,
createdAt = System.currentTimeMillis(),
modifiedAt = System.currentTimeMillis()
)
}
}
@@ -0,0 +1,15 @@
package com.anthonyla.paperize.domain.model
/**
* Domain model for App Settings (theme, preferences, etc.)
*/
data class AppSettings(
val darkMode: Boolean? = null, // null = system default, true = dark, false = light
val dynamicTheming: Boolean = false,
val animate: Boolean = true,
val firstLaunch: Boolean = true
) {
companion object {
fun default() = AppSettings()
}
}
@@ -0,0 +1,61 @@
package com.anthonyla.paperize.domain.model
import android.net.Uri
/**
* Domain model for Folder
*
* Pure Kotlin data class without Room annotations
*/
data class Folder(
val id: String,
val albumId: String,
val name: String,
val uri: String,
val coverUri: String?,
val dateModified: Long,
val displayOrder: Int = 0,
val wallpapers: List<Wallpaper> = emptyList(),
val addedAt: Long = System.currentTimeMillis()
) {
/**
* Get URL-decoded name for display (last path segment only)
*/
val displayName: String
get() = try {
val decoded = Uri.decode(name)
// Extract just the folder name (last segment after / or :)
decoded.substringAfterLast('/', decoded.substringAfterLast(':', decoded))
} catch (e: Exception) {
name
}
/**
* Get wallpaper count
*/
val wallpaperCount: Int
get() = wallpapers.size
/**
* Check if folder is empty
*/
val isEmpty: Boolean
get() = wallpapers.isEmpty()
/**
* Get sorted wallpapers
*/
val sortedWallpapers: List<Wallpaper>
get() = wallpapers.sortedBy { it.displayOrder }
companion object {
fun empty(id: String = "", albumId: String = "") = Folder(
id = id,
albumId = albumId,
name = "",
uri = "",
coverUri = null,
dateModified = 0L
)
}
}
@@ -0,0 +1,18 @@
package com.anthonyla.paperize.domain.model
import android.graphics.Bitmap
import com.anthonyla.paperize.core.ScreenType
/**
* A decoded and processed wallpaper that has not yet been committed as current.
*
* The queue item is only committed after WallpaperManager confirms that the platform accepted
* the bitmap. If applying fails, callers restore this item to the front of its queue.
*/
data class PreparedWallpaper(
val bitmap: Bitmap,
val albumId: String,
val screenType: ScreenType,
val wallpaperId: String,
val shuffle: Boolean
)
@@ -0,0 +1,82 @@
package com.anthonyla.paperize.domain.model
import com.anthonyla.paperize.core.ScalingType
import com.anthonyla.paperize.core.constants.Constants
/**
* Domain model for Wallpaper Schedule Settings
*/
data class ScheduleSettings(
val enableChanger: Boolean = false,
val separateSchedules: Boolean = false,
val shuffleEnabled: Boolean = false,
val homeEnabled: Boolean = false,
val lockEnabled: Boolean = false,
val homeAlbumId: String? = null,
val lockAlbumId: String? = null,
val homeIntervalMinutes: Int = Constants.DEFAULT_INTERVAL_MINUTES,
val lockIntervalMinutes: Int = Constants.DEFAULT_INTERVAL_MINUTES,
val liveIntervalMinutes: Int = Constants.DEFAULT_INTERVAL_MINUTES,
val homeScalingType: ScalingType = ScalingType.FILL,
val lockScalingType: ScalingType = ScalingType.FILL,
val homeScrollingEnabled: Boolean = false,
val homeEffects: WallpaperEffects = WallpaperEffects.none(),
val lockEffects: WallpaperEffects = WallpaperEffects.none(),
val liveAlbumId: String? = null,
val liveScalingType: ScalingType = ScalingType.FILL,
val liveEffects: WallpaperEffects = WallpaperEffects.none(),
val adaptiveBrightness: Boolean = false
) {
/**
* Validate interval values
*/
fun validate(): ScheduleSettings = copy(
homeIntervalMinutes = homeIntervalMinutes.coerceAtLeast(Constants.MIN_INTERVAL_MINUTES),
lockIntervalMinutes = lockIntervalMinutes.coerceAtLeast(Constants.MIN_INTERVAL_MINUTES),
liveIntervalMinutes = liveIntervalMinutes.coerceAtLeast(Constants.MIN_INTERVAL_MINUTES),
homeEffects = homeEffects.validate(),
lockEffects = lockEffects.validate(),
liveEffects = liveEffects.validate()
)
/**
* Check if scheduling-related settings changed (not just display settings)
*
* Returns true if any of these changed:
* - Screen enable/disable
* - Interval timing
* - Separate schedules toggle
* - Shuffle (handled separately with queue clearing)
*
* Display-only settings (scaling, effects, adaptive brightness) don't affect scheduling
*/
fun hasSchedulingChanges(other: ScheduleSettings): Boolean {
return homeEnabled != other.homeEnabled ||
lockEnabled != other.lockEnabled ||
homeIntervalMinutes != other.homeIntervalMinutes ||
lockIntervalMinutes != other.lockIntervalMinutes ||
separateSchedules != other.separateSchedules ||
liveIntervalMinutes != other.liveIntervalMinutes
}
/**
* Check if display settings changed (scaling, effects, adaptive brightness)
*
* When these change, we should reapply the current wallpaper immediately
* to show the user the effect, but we don't need to reschedule WorkManager
*/
fun hasDisplayChanges(other: ScheduleSettings): Boolean {
return homeScalingType != other.homeScalingType ||
lockScalingType != other.lockScalingType ||
homeScrollingEnabled != other.homeScrollingEnabled ||
homeEffects != other.homeEffects ||
lockEffects != other.lockEffects ||
liveEffects != other.liveEffects ||
liveScalingType != other.liveScalingType ||
adaptiveBrightness != other.adaptiveBrightness
}
companion object {
fun default() = ScheduleSettings()
}
}
@@ -0,0 +1,63 @@
package com.anthonyla.paperize.domain.model
import android.net.Uri
import com.anthonyla.paperize.core.WallpaperMediaType
import com.anthonyla.paperize.core.WallpaperSourceType
/**
* Domain model for Wallpaper
*
* Pure Kotlin data class without Room annotations
*/
data class Wallpaper(
val id: String,
val albumId: String,
val folderId: String? = null,
val uri: String,
val fileName: String,
val dateModified: Long,
val displayOrder: Int = 0,
val sourceType: WallpaperSourceType = WallpaperSourceType.DIRECT,
val addedAt: Long = System.currentTimeMillis(),
val mediaType: WallpaperMediaType = WallpaperMediaType.IMAGE
) {
/**
* Get URL-decoded file name for display (filename only, no path)
*/
val displayFileName: String
get() = try {
val decoded = Uri.decode(fileName)
// Extract just the filename (last segment after / or :)
decoded.substringAfterLast('/', decoded.substringAfterLast(':', decoded))
} catch (e: Exception) {
fileName
}
/**
* Check if wallpaper is from a folder
*/
val isFromFolder: Boolean
get() = folderId != null && sourceType == WallpaperSourceType.FOLDER
/**
* Get file extension
*/
val extension: String
get() = fileName.substringAfterLast('.', "").lowercase()
/**
* Check if file is a valid image
*/
val isValidImage: Boolean
get() = extension in setOf("jpg", "jpeg", "png", "webp", "avif")
companion object {
fun empty(id: String = "", albumId: String = "") = Wallpaper(
id = id,
albumId = albumId,
uri = "",
fileName = "",
dateModified = 0L
)
}
}
@@ -0,0 +1,52 @@
package com.anthonyla.paperize.domain.model
import com.anthonyla.paperize.core.constants.Constants
/**
* Domain model for Wallpaper Effects
*
* Represents the visual effects applied to wallpapers
* Includes both visual effects (blur, darken, etc.) and interactive effects (double-tap, parallax)
*/
data class WallpaperEffects(
// Visual effects (available in both static and live modes)
val enableBlur: Boolean = false,
val blurPercentage: Int = Constants.DEFAULT_BLUR_PERCENTAGE,
val enableDarken: Boolean = false,
val darkenPercentage: Int = Constants.DEFAULT_DARKEN_PERCENTAGE,
val enableVignette: Boolean = false,
val vignettePercentage: Int = Constants.DEFAULT_VIGNETTE_PERCENTAGE,
val enableGrayscale: Boolean = false,
val grayscalePercentage: Int = Constants.DEFAULT_GRAYSCALE_PERCENTAGE,
// Interactive effects (live wallpaper mode only)
val enableDoubleTap: Boolean = false,
val enableChangeOnScreenOff: Boolean = false,
val enableParallax: Boolean = false,
val parallaxIntensity: Int = Constants.DEFAULT_PARALLAX_INTENSITY
) {
/**
* Check if any effects are applied
*/
val hasEffects: Boolean
get() = (enableBlur && blurPercentage > 0) ||
(enableDarken && darkenPercentage > 0) ||
(enableVignette && vignettePercentage > 0) ||
(enableGrayscale && grayscalePercentage > 0)
/**
* Validate effect percentages
*/
fun validate(): WallpaperEffects = copy(
darkenPercentage = darkenPercentage.coerceIn(0, 100),
blurPercentage = blurPercentage.coerceIn(0, 100),
vignettePercentage = vignettePercentage.coerceIn(0, 100),
grayscalePercentage = grayscalePercentage.coerceIn(0, 100),
parallaxIntensity = parallaxIntensity.coerceIn(0, 100)
)
companion object {
fun default() = WallpaperEffects()
fun none() = WallpaperEffects()
}
}
@@ -0,0 +1,136 @@
package com.anthonyla.paperize.domain.repository
import com.anthonyla.paperize.core.Result
import com.anthonyla.paperize.domain.model.Album
import com.anthonyla.paperize.domain.model.AlbumSummary
import com.anthonyla.paperize.domain.model.Wallpaper
import com.anthonyla.paperize.domain.model.Folder
import kotlinx.coroutines.flow.Flow
/**
* Repository interface for Album operations
*
* Clean interface following repository pattern - implementation in data layer
*/
interface AlbumRepository {
/**
* Get all album summaries (lightweight metadata + counts)
*/
fun getAlbumSummaries(): Flow<List<AlbumSummary>>
/**
* Get all albums with their wallpapers and folders
*/
fun getAllAlbums(): Flow<List<Album>>
/**
* Get a specific album by ID
*/
fun getAlbumById(albumId: String): Flow<Album?>
/**
* Get a specific album by name
*/
suspend fun getAlbumByName(name: String): Album?
/**
* Get a specific folder by ID
*/
fun getFolderById(folderId: String): Flow<Folder?>
/**
* Create a new album
*/
suspend fun createAlbum(name: String, coverUri: String? = null): Result<Album>
/**
* Update album
*/
suspend fun updateAlbum(album: Album): Result<Unit>
/**
* Delete album
*/
suspend fun deleteAlbum(albumId: String): Result<Unit>
/**
* Update album name
*/
suspend fun updateAlbumName(albumId: String, name: String): Result<Unit>
/**
* Update album cover
*/
suspend fun updateAlbumCover(albumId: String, coverUri: String?): Result<Unit>
/**
* Add wallpapers to album.
*
* [onProgress] is invoked as rows are written, with the number saved so far and the total,
* so callers can show import progress.
*/
suspend fun addWallpapersToAlbum(
albumId: String,
wallpapers: List<Wallpaper>,
onProgress: (saved: Int, total: Int) -> Unit = { _, _ -> }
): Result<Unit>
/**
* Add folder to album.
*
* [onProgress] is invoked as the folder's wallpapers are written, with the number saved so far
* and the total, so callers can show import progress.
*/
suspend fun addFolderToAlbum(
albumId: String,
folder: Folder,
onProgress: (saved: Int, total: Int) -> Unit = { _, _ -> }
): Result<Unit>
/**
* Update folder
*/
suspend fun updateFolder(folder: Folder): Result<Unit>
/**
* Remove wallpaper from album
*/
suspend fun removeWallpaperFromAlbum(albumId: String, wallpaperId: String): Result<Unit>
/**
* Remove multiple wallpapers from album (batch operation)
* Updates album modified time and refreshes cover art
*/
suspend fun removeWallpapersFromAlbum(albumId: String, wallpaperIds: List<String>): Result<Unit>
/**
* Remove folder from album
*/
suspend fun removeFolderFromAlbum(albumId: String, folderId: String): Result<Unit>
/**
* Get album count
*/
suspend fun getAlbumCount(): Int
/**
* Delete all albums
*/
suspend fun deleteAllAlbums(): Result<Unit>
/**
* Validate folder URIs and remove invalid ones
* Returns number of folders removed
*/
suspend fun validateAndRemoveInvalidFolders(albumId: String): Result<Int>
/**
* Refresh album cover art based on current wallpapers
*/
suspend fun refreshAlbumCover(albumId: String): Result<Unit>
/**
* Refresh all folder covers in an album based on their current wallpapers
*/
suspend fun refreshFolderCovers(albumId: String): Result<Unit>
}
@@ -0,0 +1,113 @@
package com.anthonyla.paperize.domain.repository
import com.anthonyla.paperize.core.WallpaperMode
import com.anthonyla.paperize.domain.model.AppSettings
import com.anthonyla.paperize.domain.model.ScheduleSettings
import kotlinx.coroutines.flow.Flow
/**
* Repository interface for Settings operations
*/
interface SettingsRepository {
/**
* Get app settings
*/
suspend fun getAppSettings(): AppSettings
/**
* Get app settings as Flow
*/
fun getAppSettingsFlow(): Flow<AppSettings>
/**
* Update app settings
*/
suspend fun updateAppSettings(settings: AppSettings)
/**
* Get wallpaper mode (STATIC or LIVE)
*/
suspend fun getWallpaperMode(): WallpaperMode
/**
* Get wallpaper mode as Flow
*/
fun getWallpaperModeFlow(): Flow<WallpaperMode>
/**
* Update wallpaper mode
* IMPORTANT: Caller must handle data reset when switching modes
*/
suspend fun updateWallpaperMode(mode: WallpaperMode)
/**
* Get schedule settings
*/
suspend fun getScheduleSettings(): ScheduleSettings
/**
* Get schedule settings as Flow
*/
fun getScheduleSettingsFlow(): Flow<ScheduleSettings>
/**
* Update schedule settings
*/
suspend fun updateScheduleSettings(settings: ScheduleSettings)
/**
* Clear all settings
*/
suspend fun clearAllSettings()
/**
* Clear schedule settings (reset to defaults)
* Used when switching wallpaper modes to reset all scheduling configuration
*/
suspend fun clearScheduleSettings()
/**
* Set wallpaper mode (wrapper for updateWallpaperMode)
*/
suspend fun setWallpaperMode(mode: WallpaperMode) = updateWallpaperMode(mode)
/**
* Atomically update home album ID to prevent race conditions
* Use this instead of updateScheduleSettings when only changing home album
*/
suspend fun updateHomeAlbumId(albumId: String?)
/**
* Atomically update lock album ID to prevent race conditions
* Use this instead of updateScheduleSettings when only changing lock album
*/
suspend fun updateLockAlbumId(albumId: String?)
/**
* Atomically update live album ID to prevent race conditions
* Use this instead of updateScheduleSettings when only changing live album
*/
suspend fun updateLiveAlbumId(albumId: String?)
/**
* Atomically clear album selections if they match the given album ID
* Used when deleting an album to prevent race conditions
* Returns true if any selections were cleared
*/
suspend fun clearAlbumSelectionsIfMatches(albumId: String): Boolean
// ============ Atomic AppSettings Operations ============
suspend fun updateDarkMode(enabled: Boolean)
suspend fun updateDynamicTheming(enabled: Boolean)
suspend fun updateAnimate(enabled: Boolean)
suspend fun updateFirstLaunch(isFirstLaunch: Boolean)
// ============ Atomic ScheduleSettings Operations ============
/**
* Atomically update enableChanger to prevent race conditions
* Use this instead of updateScheduleSettings when only toggling changer
*/
suspend fun updateEnableChanger(enabled: Boolean)
}
@@ -0,0 +1,152 @@
package com.anthonyla.paperize.domain.repository
import android.net.Uri
import com.anthonyla.paperize.core.Result
import com.anthonyla.paperize.core.ScreenType
import com.anthonyla.paperize.domain.model.Wallpaper
import kotlinx.coroutines.flow.Flow
/**
* Repository interface for Wallpaper operations
*/
interface WallpaperRepository {
/**
* Get wallpapers for an album
*/
fun getWallpapersByAlbum(albumId: String): Flow<List<Wallpaper>>
/**
* Get direct wallpapers for an album (not from folders)
*/
fun getDirectWallpapersByAlbum(albumId: String): Flow<List<Wallpaper>>
/**
* Get wallpapers for a folder
*/
fun getWallpapersByFolder(folderId: String): Flow<List<Wallpaper>>
/**
* Get wallpaper by ID
*/
suspend fun getWallpaperById(wallpaperId: String): Wallpaper?
/**
* Add wallpaper
*/
suspend fun addWallpaper(wallpaper: Wallpaper): Result<Unit>
/**
* Update wallpaper
*/
suspend fun updateWallpaper(wallpaper: Wallpaper): Result<Unit>
/**
* Delete wallpaper
*/
suspend fun deleteWallpaper(wallpaperId: String): Result<Unit>
/**
* Delete multiple wallpapers by IDs (batch operation)
*/
suspend fun deleteWallpapers(wallpaperIds: List<String>): Result<Unit>
/**
* Delete all wallpapers in a folder
*/
suspend fun deleteWallpapersByFolderId(folderId: String): Result<Unit>
/**
* Update wallpaper order
*/
suspend fun updateWallpaperOrder(wallpaperId: String, order: Int): Result<Unit>
/**
* Validate wallpaper URIs and remove invalid ones
*/
suspend fun validateAndRemoveInvalidWallpapers(albumId: String): Result<Int>
/**
* Get next wallpaper in queue
*/
suspend fun getNextWallpaperInQueue(albumId: String, screenType: ScreenType): Wallpaper?
/**
* Atomically get and remove next wallpaper from queue
* Prevents race conditions when multiple wallpaper changes happen simultaneously
*/
suspend fun getAndDequeueWallpaper(albumId: String, screenType: ScreenType): Wallpaper?
/**
* Remove a specific wallpaper from a screen queue.
*/
suspend fun removeWallpaperFromQueue(
albumId: String,
screenType: ScreenType,
wallpaperId: String
)
/**
* Restore a prepared wallpaper to the front when applying it did not succeed.
*/
suspend fun restoreWallpaperToQueueFront(
albumId: String,
screenType: ScreenType,
wallpaperId: String
)
/**
* Build wallpaper queue for album
*/
suspend fun buildWallpaperQueue(
albumId: String,
screenType: ScreenType,
shuffle: Boolean = false
): Result<Unit>
/**
* Clear all queues for all albums
* Used when shuffle setting changes to force rebuild with new mode
*/
suspend fun clearAllQueues(): Result<Unit>
/**
* Clear all queues for a specific album
* Used when sort order changes to force rebuild with new order
*/
suspend fun clearQueuesForAlbum(albumId: String): Result<Unit>
/**
* Get the last-applied wallpaper for a given album/screen.
* Returns null if none has been recorded yet or if it was deleted.
*/
suspend fun getCurrentWallpaper(albumId: String, screenType: ScreenType): Wallpaper?
/**
* Reactive variant of [getCurrentWallpaper] that re-emits whenever the recorded wallpaper
* for this album/screen changes. Used by the in-app current-wallpaper preview.
*/
fun getCurrentWallpaperFlow(albumId: String, screenType: ScreenType): Flow<Wallpaper?>
/**
* Record the wallpaper that was just applied for a given album/screen.
* Called by WallpaperChangeService after a successful setBitmap().
*/
suspend fun setCurrentWallpaper(albumId: String, screenType: ScreenType, wallpaperId: String)
/**
* Scan folder for wallpapers
*/
suspend fun scanFolderForWallpapers(folderUri: Uri): Result<List<Wallpaper>>
/**
* Check if a wallpaper with the given URI already exists in the album
* Optimized for checking duplicates during folder sync
*/
suspend fun isWallpaperInAlbum(albumId: String, uri: String): Boolean
/**
* Get all existing wallpaper URIs for a specific folder within an album.
* Used for bulk duplicate detection during folder rescan (avoids N+1 queries).
*/
suspend fun getExistingWallpaperUris(albumId: String, folderId: String): Set<String>
}
@@ -0,0 +1,233 @@
package com.anthonyla.paperize.domain.usecase
import android.content.Context
import android.graphics.Bitmap
import android.util.Log
import androidx.core.net.toUri
import com.anthonyla.paperize.R
import com.anthonyla.paperize.core.EmptyAlbumException
import com.anthonyla.paperize.core.NoValidWallpaperException
import com.anthonyla.paperize.core.Result
import com.anthonyla.paperize.core.ScreenType
import com.anthonyla.paperize.core.constants.Constants
import com.anthonyla.paperize.core.util.adaptiveBrightnessAdjustment
import com.anthonyla.paperize.core.util.getWallpaperRenderSize
import com.anthonyla.paperize.core.util.processBitmap
import com.anthonyla.paperize.core.util.retrieveBitmap
import com.anthonyla.paperize.core.util.usesLauncherManagedScrolling
import com.anthonyla.paperize.domain.model.PreparedWallpaper
import com.anthonyla.paperize.domain.repository.SettingsRepository
import com.anthonyla.paperize.domain.repository.WallpaperRepository
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
/**
* Prepares the next wallpaper without marking it as current.
*
* The queue item is dequeued while it is decoded, but callers must invoke [complete] only after
* WallpaperManager confirms the bitmap was applied. If the platform rejects it, [restore] puts
* the item back at the front of the queue.
*/
class ChangeWallpaperUseCase @Inject constructor(
@param:ApplicationContext private val context: Context,
private val wallpaperRepository: WallpaperRepository,
private val settingsRepository: SettingsRepository
) {
suspend operator fun invoke(
albumId: String,
screenType: ScreenType
): Result<PreparedWallpaper> {
return try {
val settings = settingsRepository.getScheduleSettings()
if (wallpaperRepository.getNextWallpaperInQueue(albumId, screenType) == null) {
val buildResult = wallpaperRepository.buildWallpaperQueue(
albumId,
screenType,
settings.shuffleEnabled
)
if (buildResult is Result.Error) {
return Result.Error(
Exception(context.getString(R.string.error_failed_to_build_queue))
)
}
}
val effects = when (screenType) {
ScreenType.LIVE -> settings.liveEffects
ScreenType.HOME, ScreenType.BOTH -> settings.homeEffects
ScreenType.LOCK -> settings.lockEffects
}
val scaling = when (screenType) {
ScreenType.LIVE -> settings.liveScalingType
ScreenType.HOME, ScreenType.BOTH -> settings.homeScalingType
ScreenType.LOCK -> settings.lockScalingType
}
val preserveSourceOverflow = usesLauncherManagedScrolling(
screenType,
scaling,
settings.homeScrollingEnabled
)
val screenSize = getWallpaperRenderSize(context, screenType, scaling)
var finalBitmap: Bitmap? = null
var preparedWallpaperId: String? = null
var remainingRetries = Constants.MAX_WALLPAPER_LOAD_RETRIES
var queueRebuildAttempts = 0
while (finalBitmap == null && remainingRetries > 0) {
val candidate = wallpaperRepository.getAndDequeueWallpaper(albumId, screenType)
if (candidate == null) {
queueRebuildAttempts++
if (queueRebuildAttempts > Constants.MAX_QUEUE_REBUILD_ATTEMPTS) {
return Result.Error(
EmptyAlbumException(context.getString(R.string.no_wallpapers_in_album))
)
}
val rebuildResult = wallpaperRepository.buildWallpaperQueue(
albumId,
screenType,
settings.shuffleEnabled
)
if (rebuildResult is Result.Error) {
return Result.Error(
Exception(context.getString(R.string.error_failed_to_build_queue))
)
}
continue
}
try {
val bitmap = retrieveBitmap(
context = context,
wallpaperUri = candidate.uri.toUri(),
width = screenSize.width,
height = screenSize.height,
scaling = scaling,
preserveSourceOverflow = preserveSourceOverflow
)
if (bitmap == null) {
// A temporarily inaccessible/corrupt item is skipped for this cycle.
// AlbumRefreshWorker owns permanent pruning.
remainingRetries--
continue
}
var processedBitmap: Bitmap? = null
try {
processedBitmap = processBitmap(
source = bitmap,
enableDarken = effects.enableDarken,
darkenPercent = effects.darkenPercentage,
enableBlur = effects.enableBlur,
blurPercent = effects.blurPercentage,
enableVignette = effects.enableVignette,
vignettePercent = effects.vignettePercentage,
enableGrayscale = effects.enableGrayscale,
grayscalePercent = effects.grayscalePercentage
)
if (processedBitmap !== bitmap) bitmap.recycle()
if (settings.adaptiveBrightness) {
val previousBitmap = processedBitmap
processedBitmap = adaptiveBrightnessAdjustment(context, processedBitmap)
if (processedBitmap !== previousBitmap) previousBitmap.recycle()
}
finalBitmap = processedBitmap
preparedWallpaperId = candidate.id
} catch (e: Exception) {
if (processedBitmap != null && !processedBitmap.isRecycled) {
processedBitmap.recycle()
} else if (!bitmap.isRecycled) {
bitmap.recycle()
}
throw e
}
} catch (_: Exception) {
remainingRetries--
}
}
val preparedBitmap = finalBitmap
?: return Result.Error(
NoValidWallpaperException(
context.getString(R.string.error_no_valid_wallpaper_after_retries)
)
)
Result.Success(
PreparedWallpaper(
bitmap = preparedBitmap,
albumId = albumId,
screenType = screenType,
wallpaperId = checkNotNull(preparedWallpaperId),
shuffle = settings.shuffleEnabled
)
)
} catch (e: Exception) {
Result.Error(e)
}
}
/**
* Record a successfully applied wallpaper and keep the target screen queue in sync.
*
* [screenType] can differ from the prepared queue when one HOME item was atomically applied to
* both screens. The exact item is removed from LOCK rather than blindly dequeuing its head.
*/
suspend fun complete(
prepared: PreparedWallpaper,
screenType: ScreenType = prepared.screenType
) {
try {
wallpaperRepository.setCurrentWallpaper(
prepared.albumId,
screenType,
prepared.wallpaperId
)
} catch (e: Exception) {
Log.e(TAG, "Applied wallpaper could not be recorded as current", e)
return
}
try {
if (wallpaperRepository.getNextWallpaperInQueue(prepared.albumId, screenType) == null) {
wallpaperRepository.buildWallpaperQueue(
prepared.albumId,
screenType,
prepared.shuffle
)
}
// Build first when this is the first synchronized use of a screen queue, then remove
// the exact applied item. This prevents the just-applied wallpaper from being
// reintroduced at the head of a freshly built queue.
wallpaperRepository.removeWallpaperFromQueue(
prepared.albumId,
screenType,
prepared.wallpaperId
)
} catch (e: Exception) {
Log.w(TAG, "Queue sync failed; it will rebuild on the next change", e)
}
}
/** Restore a prepared item after WallpaperManager rejected it. */
suspend fun restore(prepared: PreparedWallpaper) {
try {
wallpaperRepository.restoreWallpaperToQueueFront(
prepared.albumId,
prepared.screenType,
prepared.wallpaperId
)
} catch (e: Exception) {
Log.e(TAG, "Failed to restore rejected wallpaper to its queue", e)
}
}
private companion object {
const val TAG = "ChangeWallpaperUseCase"
}
}
@@ -0,0 +1,26 @@
package com.anthonyla.paperize.domain.usecase
import com.anthonyla.paperize.core.Result
import com.anthonyla.paperize.domain.model.Album
import com.anthonyla.paperize.domain.repository.AlbumRepository
import javax.inject.Inject
/**
* Use case to create a new album
*/
class CreateAlbumUseCase @Inject constructor(
private val albumRepository: AlbumRepository
) {
suspend operator fun invoke(name: String, coverUri: String? = null): Result<Album> {
if (name.isBlank()) {
return Result.Error(IllegalArgumentException("Album name cannot be empty"))
}
val existingAlbum = albumRepository.getAlbumByName(name)
if (existingAlbum != null) {
return Result.Error(IllegalArgumentException("Album with this name already exists"))
}
return albumRepository.createAlbum(name, coverUri)
}
}
@@ -0,0 +1,22 @@
package com.anthonyla.paperize.domain.usecase
import com.anthonyla.paperize.core.Result
import com.anthonyla.paperize.data.datastore.PreferencesManager
import com.anthonyla.paperize.domain.repository.AlbumRepository
import javax.inject.Inject
/**
* Use case to delete an album
*/
class DeleteAlbumUseCase @Inject constructor(
private val albumRepository: AlbumRepository,
private val preferencesManager: PreferencesManager
) {
suspend operator fun invoke(albumId: String): Result<Unit> {
val result = albumRepository.deleteAlbum(albumId)
if (result is Result.Success) {
preferencesManager.clearAlbumSelectionsIfMatches(albumId)
}
return result
}
}
@@ -0,0 +1,16 @@
package com.anthonyla.paperize.domain.usecase
import com.anthonyla.paperize.domain.model.AlbumSummary
import com.anthonyla.paperize.domain.repository.AlbumRepository
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject
/**
* Use case to get all album summaries (lightweight metadata + counts)
* Optimized for displaying lists of albums without loading full wallpaper data
*/
class GetAlbumSummariesUseCase @Inject constructor(
private val albumRepository: AlbumRepository
) {
operator fun invoke(): Flow<List<AlbumSummary>> = albumRepository.getAlbumSummaries()
}
@@ -0,0 +1,15 @@
package com.anthonyla.paperize.domain.usecase
import com.anthonyla.paperize.domain.model.Album
import com.anthonyla.paperize.domain.repository.AlbumRepository
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject
/**
* Use case to get all albums
*/
class GetAlbumsUseCase @Inject constructor(
private val albumRepository: AlbumRepository
) {
operator fun invoke(): Flow<List<Album>> = albumRepository.getAllAlbums()
}
@@ -0,0 +1,114 @@
package com.anthonyla.paperize.domain.usecase
import android.content.Context
import android.graphics.Bitmap
import androidx.core.net.toUri
import com.anthonyla.paperize.R
import com.anthonyla.paperize.core.Result
import com.anthonyla.paperize.core.ScreenType
import com.anthonyla.paperize.core.util.adaptiveBrightnessAdjustment
import com.anthonyla.paperize.core.util.getWallpaperRenderSize
import com.anthonyla.paperize.core.util.isValid
import com.anthonyla.paperize.core.util.processBitmap
import com.anthonyla.paperize.core.util.retrieveBitmap
import com.anthonyla.paperize.core.util.usesLauncherManagedScrolling
import com.anthonyla.paperize.domain.repository.SettingsRepository
import com.anthonyla.paperize.domain.repository.WallpaperRepository
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
/**
* Reapply current visual effects to the last-applied wallpaper without advancing the queue.
*
* Used when display settings (blur, darken, scaling, etc.) change and the user wants
* to see the effect on the current wallpaper immediately rather than jumping to the next one.
*
* Returns Result.Error if no current wallpaper has been recorded yet — callers should
* fall back to [ChangeWallpaperUseCase] in that case.
*/
class ReapplyEffectsUseCase @Inject constructor(
@param:ApplicationContext private val context: Context,
private val wallpaperRepository: WallpaperRepository,
private val settingsRepository: SettingsRepository
) {
suspend operator fun invoke(
albumId: String,
screenType: ScreenType,
wallpaperId: String? = null
): Result<Bitmap> {
return try {
val current = wallpaperId
?.let { wallpaperRepository.getWallpaperById(it) }
?: wallpaperRepository.getCurrentWallpaper(albumId, screenType)
?: return Result.Error(Exception(context.getString(R.string.error_no_valid_wallpaper_after_retries)))
val settings = settingsRepository.getScheduleSettings()
val effects = when (screenType) {
ScreenType.LIVE -> settings.liveEffects
ScreenType.HOME, ScreenType.BOTH -> settings.homeEffects
ScreenType.LOCK -> settings.lockEffects
}
val scaling = when (screenType) {
ScreenType.LIVE -> settings.liveScalingType
ScreenType.HOME, ScreenType.BOTH -> settings.homeScalingType
ScreenType.LOCK -> settings.lockScalingType
}
val preserveSourceOverflow = usesLauncherManagedScrolling(
screenType,
scaling,
settings.homeScrollingEnabled
)
val screenSize = getWallpaperRenderSize(context, screenType, scaling)
val uri = current.uri.toUri()
if (!uri.isValid(context.contentResolver)) {
return Result.Error(Exception(context.getString(R.string.error_no_valid_wallpaper_after_retries)))
}
val bitmap = retrieveBitmap(
context,
uri,
screenSize.width,
screenSize.height,
scaling,
preserveSourceOverflow
)
?: return Result.Error(Exception(context.getString(R.string.error_no_valid_wallpaper_after_retries)))
var processed: Bitmap? = null
try {
processed = processBitmap(
source = bitmap,
enableDarken = effects.enableDarken,
darkenPercent = effects.darkenPercentage,
enableBlur = effects.enableBlur,
blurPercent = effects.blurPercentage,
enableVignette = effects.enableVignette,
vignettePercent = effects.vignettePercentage,
enableGrayscale = effects.enableGrayscale,
grayscalePercent = effects.grayscalePercentage
)
if (processed !== bitmap) bitmap.recycle()
if (settings.adaptiveBrightness) {
val prev = processed
processed = adaptiveBrightnessAdjustment(context, processed)
if (processed !== prev) prev.recycle()
}
Result.Success(processed)
} catch (e: Exception) {
if (processed != null && !processed.isRecycled) {
processed.recycle()
} else if (!bitmap.isRecycled) {
bitmap.recycle()
}
throw e
}
} catch (e: Exception) {
Result.Error(e)
}
}
}
@@ -0,0 +1,45 @@
package com.anthonyla.paperize.domain.usecase
import com.anthonyla.paperize.core.Result
import com.anthonyla.paperize.domain.repository.AlbumRepository
import com.anthonyla.paperize.domain.repository.WallpaperRepository
import javax.inject.Inject
/**
* Use case to refresh album wallpapers and folders
*
* Validates all wallpaper URIs and folder URIs, removes invalid ones
* Normalizes wallpaper queues after deletions to maintain queue integrity
* Returns total number of items removed (wallpapers + folders)
*/
class RefreshAlbumUseCase @Inject constructor(
private val wallpaperRepository: WallpaperRepository,
private val albumRepository: AlbumRepository
) {
suspend operator fun invoke(albumId: String): Result<Int> {
var totalRemoved = 0
// Validate and remove invalid folders
val foldersResult = albumRepository.validateAndRemoveInvalidFolders(albumId)
if (foldersResult is Result.Success) {
totalRemoved += foldersResult.data
}
// Validate and remove invalid wallpapers
val wallpapersResult = wallpaperRepository.validateAndRemoveInvalidWallpapers(albumId)
if (wallpapersResult is Result.Success) {
totalRemoved += wallpapersResult.data
}
if (totalRemoved > 0) {
albumRepository.refreshAlbumCover(albumId)
}
// Return error if either operation failed
return when {
foldersResult is Result.Error -> foldersResult
wallpapersResult is Result.Error -> wallpapersResult
else -> Result.Success(totalRemoved)
}
}
}
@@ -1,69 +0,0 @@
package com.anthonyla.paperize.feature.wallpaper.data.data_source
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import androidx.room.Update
import com.anthonyla.paperize.feature.wallpaper.domain.model.Album
import com.anthonyla.paperize.feature.wallpaper.domain.model.AlbumWithWallpaperAndFolder
import com.anthonyla.paperize.feature.wallpaper.domain.model.Folder
import com.anthonyla.paperize.feature.wallpaper.domain.model.Wallpaper
import kotlinx.coroutines.flow.Flow
/**
* Data access object for AlbumWithWallpaperAndFolder which is used for application's list of user albums
*/
@Dao
interface AlbumDao {
@Transaction
@Query("SELECT * FROM album")
fun getAlbumsWithWallpaperAndFolder(): Flow<List<AlbumWithWallpaperAndFolder>>
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun upsertAlbum(album: Album)
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun upsertWallpaper(wallpaper: Wallpaper)
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun upsertFolder(folder: Folder)
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun upsertWallpaperList(wallpapers: List<Wallpaper>)
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun upsertFolderList(folders: List<Folder>)
@Delete
suspend fun deleteAlbum(album: Album)
@Delete
suspend fun deleteWallpaper(wallpaper: Wallpaper)
@Delete
suspend fun deleteFolder(folder: Folder)
@Delete
suspend fun deleteWallpaperList(wallpapers: List<Wallpaper>)
@Delete
suspend fun deleteFolderList(folders: List<Folder>)
@Query("DELETE FROM wallpaper WHERE initialAlbumName=:initialAlbumName")
suspend fun cascadeDeleteWallpaper(initialAlbumName: String)
@Query("DELETE FROM folder WHERE initialAlbumName=:initialAlbumName")
suspend fun cascadeDeleteFolder(initialAlbumName: String)
@Update
suspend fun updateAlbum(album: Album)
@Update
suspend fun updateWallpaper(wallpaper: Wallpaper)
@Update
suspend fun updateFolder(folder: Folder)
}
@@ -1,24 +0,0 @@
package com.anthonyla.paperize.feature.wallpaper.data.data_source
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.anthonyla.paperize.feature.wallpaper.domain.model.Album
import com.anthonyla.paperize.feature.wallpaper.domain.model.Folder
import com.anthonyla.paperize.feature.wallpaper.domain.model.Wallpaper
/**
* Database for storing albums, wallpapers, and folders
* Stores [Album], [Wallpaper], and [Folder] inside AlbumWithWallpaperAndFolder
*/
@Database(
entities = [Album::class, Wallpaper::class, Folder::class],
version = 1
)
@TypeConverters(Converters::class)
abstract class AlbumDatabase: RoomDatabase() {
abstract val albumDao: AlbumDao
companion object {
const val DATABASE_NAME = "paperize_album_db"
}
}
@@ -1,24 +0,0 @@
package com.anthonyla.paperize.feature.wallpaper.data.data_source
import androidx.room.TypeConverter
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
/**
* Converters for Room database to convert list of strings to json string and vice versa
*/
class Converters {
private val gson = Gson()
/**
* Convert list of strings to json string
*/
@TypeConverter
fun listToJsonString(value: List<String>?): String = gson.toJson(value)
/**
* Convert json string to list of strings
*/
@TypeConverter
fun jsonStringToList(value: String) = gson.fromJson(value, Array<String>::class.java).toList()
}
@@ -1,57 +0,0 @@
package com.anthonyla.paperize.feature.wallpaper.data.data_source
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import androidx.room.Update
import com.anthonyla.paperize.feature.wallpaper.domain.model.Album
import com.anthonyla.paperize.feature.wallpaper.domain.model.SelectedAlbum
import com.anthonyla.paperize.feature.wallpaper.domain.model.Wallpaper
import kotlinx.coroutines.flow.Flow
/**
* Data Access Object for selected album for application to keep track of which album is currently selected for changing wallpapers from
*/
@Dao
interface SelectedAlbumDao {
@Transaction
@Query("SELECT * FROM album")
fun getSelectedAlbum(): Flow<List<SelectedAlbum>>
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun upsertAlbum(album: Album)
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun upsertWallpaper(wallpaper: Wallpaper)
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun upsertWallpaperList(wallpapers: List<Wallpaper>)
@Delete
suspend fun deleteAlbum(album: Album)
@Delete
suspend fun deleteWallpaper(wallpaper: Wallpaper)
@Query("DELETE FROM wallpaper WHERE initialAlbumName=:initialAlbumName")
suspend fun cascadeDeleteWallpaper(initialAlbumName: String)
@Query("DELETE FROM album")
suspend fun deleteAllAlbums()
@Query("DELETE FROM wallpaper")
suspend fun deleteAllWallpapers()
@Update
suspend fun updateAlbum(album: Album)
@Transaction
suspend fun deleteAll() {
deleteAllAlbums()
deleteAllWallpapers()
}
}
@@ -1,23 +0,0 @@
package com.anthonyla.paperize.feature.wallpaper.data.data_source
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.anthonyla.paperize.feature.wallpaper.domain.model.Album
import com.anthonyla.paperize.feature.wallpaper.domain.model.Wallpaper
/**
* Database for selected album
* Stores [Album] and [Wallpaper] inside SelectedAlbum
*/
@Database(
entities = [Album::class, Wallpaper::class],
version = 1
)
@TypeConverters(Converters::class)
abstract class SelectedAlbumDatabase: RoomDatabase() {
abstract val selectedAlbumDao: SelectedAlbumDao
companion object {
const val DATABASE_NAME = "paperize_selectedAlbum_db"
}
}
@@ -1,89 +0,0 @@
package com.anthonyla.paperize.feature.wallpaper.data.repository
import com.anthonyla.paperize.feature.wallpaper.data.data_source.AlbumDao
import com.anthonyla.paperize.feature.wallpaper.domain.model.Album
import com.anthonyla.paperize.feature.wallpaper.domain.model.AlbumWithWallpaperAndFolder
import com.anthonyla.paperize.feature.wallpaper.domain.model.Folder
import com.anthonyla.paperize.feature.wallpaper.domain.model.Wallpaper
import com.anthonyla.paperize.feature.wallpaper.domain.repository.AlbumRepository
import kotlinx.coroutines.flow.Flow
class AlbumRepositoryImpl(
private val dao: AlbumDao
): AlbumRepository {
override fun getAlbumsWithWallpaperAndFolder(): Flow<List<AlbumWithWallpaperAndFolder>> {
return dao.getAlbumsWithWallpaperAndFolder()
}
override suspend fun upsertAlbumWithWallpaperAndFolder(albumWithWallpaperAndFolder: AlbumWithWallpaperAndFolder) {
dao.upsertAlbum(albumWithWallpaperAndFolder.album)
dao.upsertWallpaperList(albumWithWallpaperAndFolder.wallpapers)
dao.upsertFolderList(albumWithWallpaperAndFolder.folders)
}
override suspend fun upsertAlbum(album: Album) {
dao.upsertAlbum(album)
}
override suspend fun upsertWallpaper(wallpaper: Wallpaper) {
dao.upsertWallpaper(wallpaper)
}
override suspend fun upsertFolder(folder: Folder) {
dao.upsertFolder(folder)
}
override suspend fun upsertFolderList(folders: List<Folder>) {
dao.upsertFolderList(folders)
}
override suspend fun upsertWallpaperList(wallpapers: List<Wallpaper>) {
dao.upsertWallpaperList(wallpapers)
}
override suspend fun deleteAlbum(album: Album) {
dao.deleteAlbum(album)
}
override suspend fun deleteWallpaper(wallpaper: Wallpaper) {
dao.deleteWallpaper(wallpaper)
}
override suspend fun deleteFolder(folder: Folder) {
dao.deleteFolder(folder)
}
override suspend fun updateAlbum(album: Album) {
dao.updateAlbum(album)
}
override suspend fun updateFolder(folder: Folder) {
dao.updateFolder(folder)
}
override suspend fun updateWallpaper(wallpaper: Wallpaper) {
dao.updateWallpaper(wallpaper)
}
override suspend fun cascadeDeleteAlbum(album: Album) {
dao.deleteAlbum(album)
dao.cascadeDeleteWallpaper(album.initialAlbumName)
dao.cascadeDeleteFolder(album.initialAlbumName)
}
override suspend fun cascadeDeleteFolder(initialAlbumName: String) {
dao.cascadeDeleteFolder(initialAlbumName)
}
override suspend fun cascadeDeleteWallpaper(initialAlbumName: String) {
dao.cascadeDeleteWallpaper(initialAlbumName)
}
override suspend fun deleteFolderList(folders: List<Folder>) {
dao.deleteFolderList(folders)
}
override suspend fun deleteWallpaperList(wallpapers: List<Wallpaper>) {
dao.deleteWallpaperList(wallpapers)
}
}
@@ -1,54 +0,0 @@
package com.anthonyla.paperize.feature.wallpaper.data.repository
import com.anthonyla.paperize.feature.wallpaper.data.data_source.SelectedAlbumDao
import com.anthonyla.paperize.feature.wallpaper.domain.model.Album
import com.anthonyla.paperize.feature.wallpaper.domain.model.AlbumWithWallpaperAndFolder
import com.anthonyla.paperize.feature.wallpaper.domain.model.Folder
import com.anthonyla.paperize.feature.wallpaper.domain.model.SelectedAlbum
import com.anthonyla.paperize.feature.wallpaper.domain.model.Wallpaper
import com.anthonyla.paperize.feature.wallpaper.domain.repository.SelectedAlbumRepository
import kotlinx.coroutines.flow.Flow
class SelectedAlbumRepositoryImpl(
private val dao: SelectedAlbumDao
): SelectedAlbumRepository {
override fun getSelectedAlbum(): Flow<List<SelectedAlbum>> {
return dao.getSelectedAlbum()
}
override suspend fun upsertSelectedAlbum(selectedAlbum: SelectedAlbum) {
dao.upsertAlbum(selectedAlbum.album)
dao.upsertWallpaperList(selectedAlbum.wallpapers)
}
override suspend fun upsertAlbum(album: Album) {
dao.upsertAlbum(album)
}
override suspend fun upsertWallpaper(wallpaper: Wallpaper) {
dao.upsertWallpaper(wallpaper)
}
override suspend fun upsertWallpaperList(wallpapers: List<Wallpaper>) {
dao.upsertWallpaperList(wallpapers)
}
override suspend fun updateAlbum(album: Album) {
dao.updateAlbum(album)
}
override suspend fun deleteAlbum(album: Album) {
dao.deleteAlbum(album)
}
override suspend fun deleteWallpaper(wallpaper: Wallpaper) {
dao.deleteWallpaper(wallpaper)
}
override suspend fun cascadeDeleteWallpaper(initialAlbumName: String) {
dao.cascadeDeleteWallpaper(initialAlbumName)
}
override suspend fun deleteAll() {
dao.deleteAll()
}
}
@@ -1,22 +0,0 @@
package com.anthonyla.paperize.feature.wallpaper.domain.model
import androidx.room.Entity
import androidx.room.PrimaryKey
/**
* Album model
*
* @param initialAlbumName The initial album name -- should not be changed as it is used as the key for database queries
* @param displayedAlbumName The displayed album name
* @param coverUri The cover uri of the album
* @param initialized Whether the album has been initialized
* @param wallpapersInQueue The wallpapers in the queue to be displayed
*/
@Entity
data class Album(
@PrimaryKey(autoGenerate = false) val initialAlbumName: String,
val displayedAlbumName: String,
val coverUri: String?,
val initialized: Boolean = false,
val wallpapersInQueue: List<String> = emptyList(),
)
Loaded 100 of 317 files, more files were not shown because too many files have changed in this diff. Show more