diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 59e0d1e..43859d6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -171,14 +171,14 @@ jobs: name: mapping path: ${{ env.mapping_file }} - - name: "Upload Mapping to Acrarium" + - name: "Create Version in Acrarium" if: ${{ env.acra_id }} continue-on-error: true run: | - curl -m 120 \ + echo -n "See GitHub Actions" | curl -m 120 \ -H "Content-Type: text/plain" \ -u "${{ secrets.ACRARIUM_USER }}:${{ secrets.ACRARIUM_PASS }}" \ - --data-binary "@${{ env.mapping_file }}" \ + --data-binary @- \ "${{ secrets.ACRARIUM_HOST }}/api/apps/${{ env.acra_id }}/version/upload/${{ github.run_number }}?name=${{ github.ref_name }}" - name: "Upload APK to Artifacts" diff --git a/app/src/main/java/org/cssnr/remotewallpaper/ui/home/HomeFragment.kt b/app/src/main/java/org/cssnr/remotewallpaper/ui/home/HomeFragment.kt index 0f5601f..3c0ab0a 100644 --- a/app/src/main/java/org/cssnr/remotewallpaper/ui/home/HomeFragment.kt +++ b/app/src/main/java/org/cssnr/remotewallpaper/ui/home/HomeFragment.kt @@ -434,7 +434,13 @@ suspend fun Context.downloadImage(remote: Remote): DownloadResult { val requestBuilder = Request.Builder().url(remote.url) val preferences = PreferenceManager.getDefaultSharedPreferences(this) val wallpaperSource = preferences.getString("wallpaper_source", null) - if (remote.url == wallpaperSource) { + // Debug override: skip conditional headers so every update is a full + // download (200) and always runs scale/crop + setBitmap. Validators are + // still persisted for when the toggle is turned back off. + val disableCache = preferences.getBoolean("disable_cache", false) + if (disableCache) { + Log.d("downloadImage", "cache disabled - get ${remote.url} minus cache validators") + } else if (remote.url == wallpaperSource) { remote.etag?.let { requestBuilder.header("If-None-Match", it) } remote.lastModified?.let { requestBuilder.header("If-Modified-Since", it) } } else { @@ -486,7 +492,7 @@ suspend fun Context.downloadImage(remote: Remote): DownloadResult { fun Context.setAutoCroppedWallpaper(imageFile: File): Boolean { val wallpaperManager = WallpaperManager.getInstance(this) val displayMetrics = resources.displayMetrics - val targetWidth = wallpaperManager.desiredMinimumWidth + var targetWidth = wallpaperManager.desiredMinimumWidth .let { if (it > 0) it else displayMetrics.widthPixels } val targetHeight = wallpaperManager.desiredMinimumHeight .let { if (it > 0) it else displayMetrics.heightPixels } @@ -494,6 +500,34 @@ fun Context.setAutoCroppedWallpaper(imageFile: File): Boolean { val preferences = PreferenceManager.getDefaultSharedPreferences(this) val cropWallpaper = preferences.getBoolean("crop_wallpaper", true) + // Optional cap for extra-wide parallax canvases: canvas no wider than + // factor x screen width, so the sliding window shows a larger fraction. + // Same cover-fill (no bars, parallax kept), just less hidden image and a + // smaller cover-crop on mismatched aspects (emulator at 2x: 2560->1440). + // Height is untouched. "0" (Off) keeps system behavior. New installs + // default Off; the short-lived boolean switch is migrated (true -> "2"). + val widthFactor = run { + if (!preferences.contains("parallax_width_factor")) { + val legacy = try { + preferences.getBoolean("limit_parallax_width", false) + } catch (_: ClassCastException) { + false + } + preferences.edit { + putString("parallax_width_factor", if (legacy) "2" else "0") + remove("limit_parallax_width") + } + } + preferences.getString("parallax_width_factor", "0")?.toFloatOrNull() ?: 0f + } + if (widthFactor > 0f) { + val maxWidth = (displayMetrics.widthPixels * widthFactor).toInt() + if (maxWidth in 1.. $maxWidth (x$widthFactor)") + targetWidth = maxWidth + } + } + // Bound the longest side to 2x the largest target dimension, avoiding the // full-resolution decode that can OOM or exceed the canvas bitmap limit. val targetMax = maxOf(targetWidth, targetHeight) * 2 diff --git a/app/src/main/java/org/cssnr/remotewallpaper/ui/settings/SettingsFragment.kt b/app/src/main/java/org/cssnr/remotewallpaper/ui/settings/SettingsFragment.kt index 30f4c75..1cb62dc 100644 --- a/app/src/main/java/org/cssnr/remotewallpaper/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/org/cssnr/remotewallpaper/ui/settings/SettingsFragment.kt @@ -60,6 +60,10 @@ class SettingsFragment : PreferenceFragmentCompat() { val updateType = findPreference("set_screens") updateType?.summaryProvider = ListPreference.SimpleSummaryProvider.getInstance() + // Parallax Width Factor + findPreference("parallax_width_factor")?.summaryProvider = + ListPreference.SimpleSummaryProvider.getInstance() + // Update Interval val workInterval = findPreference("work_interval") updateWorkIntervalSettings(workInterval?.value) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 28d29dc..8b5c0eb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -59,6 +59,21 @@ lock + + Not Limited + 1.25x Screen Width + 1.5x Screen Width + 2.0x Screen Width + 2.5x Screen Width + + + 0 + 1.25 + 1.5 + 2 + 2.5 + + White Black diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index d28eb3f..65a006a 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -19,6 +19,16 @@ android:defaultValue="true" android:summary="Ensure Parallax Works"/> + + + +