diff --git a/android/app/src/main/res/drawable-land-hdpi/splash.png b/android/app/src/main/res/drawable-land-hdpi/splash.png index e31573b..725a9bf 100644 Binary files a/android/app/src/main/res/drawable-land-hdpi/splash.png and b/android/app/src/main/res/drawable-land-hdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-mdpi/splash.png b/android/app/src/main/res/drawable-land-mdpi/splash.png index f7a6492..1aca589 100644 Binary files a/android/app/src/main/res/drawable-land-mdpi/splash.png and b/android/app/src/main/res/drawable-land-mdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xhdpi/splash.png b/android/app/src/main/res/drawable-land-xhdpi/splash.png index 8077255..3839535 100644 Binary files a/android/app/src/main/res/drawable-land-xhdpi/splash.png and b/android/app/src/main/res/drawable-land-xhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxhdpi/splash.png index 14c6c8f..93e8d28 100644 Binary files a/android/app/src/main/res/drawable-land-xxhdpi/splash.png and b/android/app/src/main/res/drawable-land-xxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xxxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png index 244ca25..e4e80c4 100644 Binary files a/android/app/src/main/res/drawable-land-xxxhdpi/splash.png and b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-hdpi/splash.png b/android/app/src/main/res/drawable-port-hdpi/splash.png index 74faaa5..418a1da 100644 Binary files a/android/app/src/main/res/drawable-port-hdpi/splash.png and b/android/app/src/main/res/drawable-port-hdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-mdpi/splash.png b/android/app/src/main/res/drawable-port-mdpi/splash.png index e944f4a..70e7e13 100644 Binary files a/android/app/src/main/res/drawable-port-mdpi/splash.png and b/android/app/src/main/res/drawable-port-mdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xhdpi/splash.png b/android/app/src/main/res/drawable-port-xhdpi/splash.png index 564a82f..3f8c745 100644 Binary files a/android/app/src/main/res/drawable-port-xhdpi/splash.png and b/android/app/src/main/res/drawable-port-xhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxhdpi/splash.png index bfabe68..0bcdd4c 100644 Binary files a/android/app/src/main/res/drawable-port-xxhdpi/splash.png and b/android/app/src/main/res/drawable-port-xxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xxxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png index 6929071..e45063f 100644 Binary files a/android/app/src/main/res/drawable-port-xxxhdpi/splash.png and b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable/splash.png b/android/app/src/main/res/drawable/splash.png index f7a6492..1aca589 100644 Binary files a/android/app/src/main/res/drawable/splash.png and b/android/app/src/main/res/drawable/splash.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index c023e50..a7b61bc 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png index 2127973..b719002 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index b441f37..643c6c2 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 72905b8..9e5965e 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png index 8ed0605..91d82c3 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index 9502e47..c7831d2 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 4d1e077..89e6e9a 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png index df0f158..9244809 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index 853db04..be59217 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 6cdf97c..2ec9767 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png index 2960cbb..ae4d285 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index 8e3093a..f049e03 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 46de6e2..974719a 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png index d2ea9ab..d60840d 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index a40d73e..ce217c7 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/android/app/src/main/res/values/ic_launcher_background.xml index c5d5899..6519ce1 100644 --- a/android/app/src/main/res/values/ic_launcher_background.xml +++ b/android/app/src/main/res/values/ic_launcher_background.xml @@ -1,4 +1,4 @@ - #FFFFFF + #0F1115 \ No newline at end of file diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index be874e5..4cb730f 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -18,5 +18,6 @@ \ No newline at end of file diff --git a/scripts/android-icons.ps1 b/scripts/android-icons.ps1 new file mode 100644 index 0000000..8b2f35d --- /dev/null +++ b/scripts/android-icons.ps1 @@ -0,0 +1,62 @@ +# Regenerates the Android launcher icons and splash images from the web app icon +# (public/icon-512.png), so the app and the PWA carry the same logo. +# Run from the repo root: powershell -File scripts/android-icons.ps1 +Add-Type -AssemblyName System.Drawing + +$root = Split-Path -Parent $PSScriptRoot +$res = Join-Path $root 'android\app\src\main\res' +$src = [System.Drawing.Bitmap]::FromFile((Join-Path $root 'public\icon-512.png')) +$bg = $src.GetPixel(5, 5) # the icon's own background colour + +function New-Canvas([int]$w, [int]$h) { + $b = New-Object System.Drawing.Bitmap($w, $h, [System.Drawing.Imaging.PixelFormat]::Format32bppArgb) + $g = [System.Drawing.Graphics]::FromImage($b) + $g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic + $g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias + $g.PixelOffsetMode = [System.Drawing.Drawing2D.PixelOffsetMode]::HighQuality + return @($b, $g) +} + +function Save([System.Drawing.Bitmap]$b, [string]$rel) { + $b.Save((Join-Path $res $rel), [System.Drawing.Imaging.ImageFormat]::Png) + $b.Dispose() +} + +# Adaptive icon foreground: 108 dp canvas, of which a 66 dp circle survives any launcher +# mask. The ring spans 68% of the source, so the source is drawn at 86% of the canvas +# (ring = 58% < 61%); the transparent margin shows the background colour below it. +$dens = @{ 'mdpi' = 1; 'hdpi' = 1.5; 'xhdpi' = 2; 'xxhdpi' = 3; 'xxxhdpi' = 4 } +foreach ($d in $dens.Keys) { + $f = $dens[$d] + $fg = [int](108 * $f); $b, $g = New-Canvas $fg $fg + $s = [int]($fg * 0.86); $o = [int](($fg - $s) / 2) + $g.DrawImage($src, $o, $o, $s, $s); $g.Dispose() + Save $b "mipmap-$d\ic_launcher_foreground.png" + + $lg = [int](48 * $f) + $b, $g = New-Canvas $lg $lg + $g.DrawImage($src, 0, 0, $lg, $lg); $g.Dispose() + Save $b "mipmap-$d\ic_launcher.png" + + $b, $g = New-Canvas $lg $lg + $brush = New-Object System.Drawing.TextureBrush($src) + $brush.ScaleTransform($lg / $src.Width, $lg / $src.Height) + $g.FillEllipse($brush, 0, 0, $lg, $lg); $brush.Dispose(); $g.Dispose() + Save $b "mipmap-$d\ic_launcher_round.png" +} + +# Splash: the icon centred on its background colour, 40% of the short side. +Get-ChildItem $res -Recurse -Filter splash.png | ForEach-Object { + $old = [System.Drawing.Image]::FromFile($_.FullName); $w = $old.Width; $h = $old.Height; $old.Dispose() + $b, $g = New-Canvas $w $h + $g.Clear($bg) + $s = [int]([Math]::Min($w, $h) * 0.4) + $g.DrawImage($src, [int](($w - $s) / 2), [int](($h - $s) / 2), $s, $s); $g.Dispose() + $b.Save($_.FullName, [System.Drawing.Imaging.ImageFormat]::Png); $b.Dispose() +} + +$hex = '#{0:X2}{1:X2}{2:X2}' -f $bg.R, $bg.G, $bg.B +$xml = "`n`n $hex`n" +[System.IO.File]::WriteAllText((Join-Path $res 'values\ic_launcher_background.xml'), $xml) +$src.Dispose() +"icons and splash written, background $hex"