diff --git a/AndroidManifest.xml b/AndroidManifest.xml index e62206a..2d361a2 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ diff --git a/README.md b/README.md index ddc834b..eb28928 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Podlite -A tiny Audiobookshelf **podcast** client for the Samsung Galaxy Mini (GT-S5570) and other Android 2.2+ phones. Native Java; the APK is about 1.1 MB, nearly all of it the bundled TLS stack. Formerly MiniABS. The interface is in Galician, with large text and touch targets sized for the Mini's 240×320 screen. Its purple colour scheme and launcher icon come from the Audiobookshelf icon pack (`art/icon_master_512.png`); `tools/make_icons.py` derives the notification and player icons from it. +A tiny Audiobookshelf **podcast** client for the Samsung Galaxy Mini (GT-S5570) and other Android 2.2+ phones. Native Java; the APK is about 1.1 MB, nearly all of it the bundled TLS stack. Formerly MiniABS. The interface is in Galician, with large text and touch targets sized for the Mini's 240×320 screen. The launcher icon is the "Podcasts Radio" pack (master in `art/icon-master.png`); `tools/make_icons.py` draws the notification icon (a white radio silhouette) and the player icons. The purple colour scheme comes from the earlier Audiobookshelf icon. ## Install diff --git a/art/icon-master.png b/art/icon-master.png new file mode 100644 index 0000000..0b8d874 Binary files /dev/null and b/art/icon-master.png differ diff --git a/art/icon_master_512.png b/art/icon_master_512.png deleted file mode 100644 index b7e4589..0000000 Binary files a/art/icon_master_512.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png index 3587b89..d39fb05 100644 Binary files a/res/drawable-hdpi/ic_launcher.png and b/res/drawable-hdpi/ic_launcher.png differ diff --git a/res/drawable-hdpi/ic_stat.png b/res/drawable-hdpi/ic_stat.png index b8d2bda..ed00982 100644 Binary files a/res/drawable-hdpi/ic_stat.png and b/res/drawable-hdpi/ic_stat.png differ diff --git a/res/drawable-ldpi/ic_launcher.png b/res/drawable-ldpi/ic_launcher.png index 36ff689..580e518 100644 Binary files a/res/drawable-ldpi/ic_launcher.png and b/res/drawable-ldpi/ic_launcher.png differ diff --git a/res/drawable-ldpi/ic_stat.png b/res/drawable-ldpi/ic_stat.png index 8eba59d..05b6c5e 100644 Binary files a/res/drawable-ldpi/ic_stat.png and b/res/drawable-ldpi/ic_stat.png differ diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png index a7fad24..3c42a68 100644 Binary files a/res/drawable-mdpi/ic_launcher.png and b/res/drawable-mdpi/ic_launcher.png differ diff --git a/res/drawable-mdpi/ic_stat.png b/res/drawable-mdpi/ic_stat.png index acc9748..f220484 100644 Binary files a/res/drawable-mdpi/ic_stat.png and b/res/drawable-mdpi/ic_stat.png differ diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/drawable-xhdpi/ic_launcher.png index 6fd6c0f..3590432 100644 Binary files a/res/drawable-xhdpi/ic_launcher.png and b/res/drawable-xhdpi/ic_launcher.png differ diff --git a/res/xml/settings.xml b/res/xml/settings.xml index 5c328a2..ee68382 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -50,7 +50,7 @@ diff --git a/src/com/miniabs/Api.java b/src/com/miniabs/Api.java index 851d017..047b0c7 100644 --- a/src/com/miniabs/Api.java +++ b/src/com/miniabs/Api.java @@ -26,7 +26,7 @@ import android.os.Build; /** Audiobookshelf REST client (API as of server 2.x, including the 2.26+ token system). */ final class Api { - static final String VERSION = "1.8"; + static final String VERSION = "1.9"; static class ApiException extends IOException { final int code; diff --git a/tools/make_icons.py b/tools/make_icons.py index 939f04d..80c1a80 100644 --- a/tools/make_icons.py +++ b/tools/make_icons.py @@ -1,9 +1,9 @@ """Draws Podlite's PNG icons for ldpi (Galaxy Mini), mdpi and hdpi. The launcher icon (res/drawable-*/ic_launcher.png) comes from the supplied -Audiobookshelf icon pack and is not generated here. The notification icon is -cut out of that same artwork (art/icon_master_512.png): the white headphones -and equalizer become a white silhouette, as Android 2.3's status bar expects. +"Podcasts Radio" icon pack (master in art/icon-master.png) and is not generated +here. The notification icon is a white silhouette of that radio, as Android +2.3's status bar expects. Android 2.x has no vector drawables, so the player icons are rendered at 4x and downsampled for smooth edges. @@ -33,22 +33,24 @@ def save(img, px, folder, name): def status_silhouette(): - """White mask of the icon's light parts (headphones, bars, waves) on transparency.""" - src = Image.open(os.path.join(ROOT, "art", "icon_master_512.png")).convert("RGBA") - out = Image.new("RGBA", src.size, (0, 0, 0, 0)) - sp, op = src.load(), out.load() - for y in range(src.size[1]): - for x in range(src.size[0]): - r, g, b, a = sp[x, y] - # the purple background has a low green channel; the white/lilac artwork a high one - level = min(255, max(0, (g - 80) * 255 // 50)) - op[x, y] = (255, 255, 255, level * a // 255) - box = out.getbbox() - out = out.crop(box) - side = max(out.size) - sq = Image.new("RGBA", (side, side), (0, 0, 0, 0)) - sq.paste(out, ((side - out.size[0]) // 2, (side - out.size[1]) // 2)) - return sq + """White silhouette of the launcher icon's old radio (handle, grille, two knobs) on transparency: + Android 2.3's status bar expects a light glyph, not the colour artwork.""" + S = 24 * 32 # drawn on a 24-unit grid, supersampled + u = lambda v: int(round(v * 32)) + m = Image.new("L", (S, S), 0) + d = ImageDraw.Draw(m) + d.arc((u(6), u(1.2), u(18), u(11)), 200, 340, fill=255, width=u(1.8)) # carrying handle + d.rounded_rectangle((u(1.5), u(6.5), u(22.5), u(21.5)), radius=u(3.5), fill=255) + d.rounded_rectangle((u(4), u(9), u(14), u(19)), radius=u(1.2), fill=0) # grille window + for i in range(3): # grille bars + y = 10.6 + i * 2.9 + d.rounded_rectangle((u(5.2), u(y), u(12.8), u(y + 1.5)), radius=u(0.7), fill=255) + for cy, r in ((11.6, 2.4), (17.0, 2.0)): # knobs as rings + d.ellipse((u(18 - r), u(cy - r), u(18 + r), u(cy + r)), fill=0) + d.ellipse((u(18 - r + 1.1), u(cy - r + 1.1), u(18 + r - 1.1), u(cy + r - 1.1)), fill=255) + out = Image.new("RGBA", (S, S), (255, 255, 255, 0)) + out.putalpha(m) + return out def status(sil, px, folder):