LifeMate — Personal, Family & Learning Companion

feat/weekly-planner-android
chore/phase1-repository-cleanup deploy/stable-web-apk deployment-static design/mobile-accessibility-v2 design/mobile-navigation-review docs/child-education-access-decision docs/offline-data-rescue-options docs/owner-guide-and-delivery-plan docs/phase1-policy-options docs/public-review-live-2026-10-15 feat/aparat-learning-library feat/child-device-safety feat/child-identity-schema feat/flutter-mobile-navigation feat/learning-content-operations feat/local-signing-preflight feat/online-family-stage0 feat/personal-encrypted-recovery feat/private-planner-series-api feat/public-review-page feat/standalone-weekly-planner feat/weekly-planner-android final-feature-1/iran-family-school fix/auth-abuse-expiry-safety fix/auth-expiry-after-lock fix/backend-request-safety fix/lifeguide-bootstrap-naming-ci fix/lifeguide-pages-qa-base-preflight fix/lifeguide-qa-pages-env-deployment fix/local-task-persistence fix/managed-child-session-boundary fix/personal-jalali-dates fix/personal-notification-controls fix/personal-upgrade-delivery-guard fix/sms-approval-gates fix/study-duration-display infra/cloudflare-neon-migration infra/lifeguide-cloudflare-qa infra/lifeguide-github-pages-qa infra/lifeguide-supabase-qa main phase-1/foundation-completion phase-2/product-foundation-identity phase-3/planner-school-family-core phase-4/ai-learning-wellbeing phase-5/hardening-observability-release test/android-reminder-acceptance test/personal-notification-settings test/personal-recovery-acceptance test/role-entry-apk
py 34 lines 1.36 KB
Raw
1 """Compile the existing Android vector into matching PWA launcher assets."""
2 from pathlib import Path
3 import xml.etree.ElementTree as ET
4
5 ROOT = Path(__file__).resolve().parents[1]
6 ANDROID = "{http://schemas.android.com/apk/res/android}"
7 source = ET.parse(ROOT / "android/app/src/main/res/drawable/lifemate_logo.xml").getroot()
8 svg_ns = "http://www.w3.org/2000/svg"
9 ET.register_namespace("", svg_ns)
10
11
12 def export_svg(maskable=False):
13 svg = ET.Element(f"{{{svg_ns}}}svg", {
14 "width": "512", "height": "512",
15 "viewBox": f"0 0 {source.attrib[ANDROID + 'viewportWidth']} {source.attrib[ANDROID + 'viewportHeight']}",
16 })
17 if maskable:
18 ET.SubElement(svg, f"{{{svg_ns}}}rect", {
19 "width": source.attrib[ANDROID + "viewportWidth"],
20 "height": source.attrib[ANDROID + "viewportHeight"],
21 "fill": "#4D86E8",
22 })
23 for element in source.findall("path"):
24 ET.SubElement(svg, f"{{{svg_ns}}}path", {
25 "fill": element.attrib[ANDROID + "fillColor"],
26 "d": element.attrib[ANDROID + "pathData"],
27 })
28 output = ROOT / "web/icons" / ("lifeguide-maskable.svg" if maskable else "lifeguide.svg")
29 ET.ElementTree(svg).write(output, encoding="utf-8", xml_declaration=True)
30 return output
31
32
33 export_svg(), export_svg(True)
34 print("Matching PWA SVG sources compiled from the existing Android vector.")