All notable changes to this package are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[1.0.0] - Unreleased
First release. Requires Unity 6000.0 or newer. Android 8.0 (API 26) and newer; the package is inert below that.
Added
- Widgets:
HomeWidgetassets with an element tree (Stack, Row, Column, Text, Number, Button, Image, Progress, Chronometer, Clock, Spacer), cell sizes, resize modes, preview image, light and dark colours and Material You system colours on Android 12+. Up to 16 widgets, 40 elements per widget, depth 6. - Run-time setters on
HomeWidget:SetText,SetNumber,SetCounter,SetProgress,SetImage(Texture2D, RenderTexture or PNG bytes),SetCountdown,SetStopwatch,SetVisible,SetPayload,SetTimeline, thenPublish,PublishAsyncorHomeWidgets.PublishAll. Results arrive inHomeWidgets.Published. HomeCounter: a number that grows while the game is closed, with a cap and a refresh interval. Number formatting (decimals, grouping, K/M/B/T abbreviation, prefix, suffix) runs in the device locale and gives the same result in C# and in Java.- Countdown styles
TimerandEndTimefor the Chronometer element.EndTimenever shows negative time. HomeWidgetTimeline: up to 64 future states per widget, applied on the device while the game is closed.- Snapshots:
SetImagetakes a GPU snapshot, scales it to the element'smaxImagePixels(64 to 1024, default 512) and stays inside the per-update bitmap budget of the device. HomeWidget.RequestPinandHomeWidgets.Pinnedto ask the launcher to place a widget.- Launcher shortcuts: static shortcuts in
HomeScreenSettings(up to 4), dynamic shortcuts withHomeShortcuts.SetDynamic,Push,Remove,RemoveAllandReportUsed, pinned shortcuts withRequestPin, andGetShortcuts. Every shortcut opens the game through an invisible forwarding activity, so a running game is not restarted. - Quick Settings tiles:
HomeTileassets (up to 4),SetStatewith label and subtitle,RequestAddon Android 13+ andHomeTiles.AddRequestCompleted. - One event for every tap:
HomeScreenKit.ActivatedwithHomeScreenActivation(source, id, action, payload, widget instance, cold start flag, time, sequence),TryGetLaunchActivation, and the optionalHomeScreenActivationListenercomponent. Works withActivityandGameActivity. - Updates while the game is closed: re-render after reboot, app update, time zone, time and locale changes (option
RestoreAfterReboot), and a re-render of all placed widgets on every game start. - Build step that generates the receivers, services, forwarding activity, layouts, drawables, provider info, shortcut XML and manifest entries into
luanrobs-homescreen-gen/of the exported Gradle project. The project's manifest and the package folder are not edited. A build report is written toLibrary/LuanrobsHomeScreen/last-build.json. - Editor: menu Tools > luanrobs > Home Screen Kit (Settings, Widget Preview, Validate, Last Build Report, Documentation), inspectors for widgets, tiles and settings, and the Editor simulator that keeps a simulated device between Play sessions.
- Validator with 34 rules (V01 to V34), shown in a window and in the inspectors, and run at build time.
- Demo sample: an idle-game widget with a counter and a countdown, a pet widget with a RenderTexture snapshot, a daily-streak widget driven by a timeline, Continue and Daily reward shortcuts, a Quick match tile and a log of every tap.
- Domain Reload safe: statics and event subscribers are reset at SubsystemRegistration.
Fixed (integration, before release)
- Static shortcuts were dropped by the platform on every device run because the platform's shortcut parser rejects string references in
<extra>. The generator now writes literal values prefixed withs:and the forwarding activity strips the prefix. - The snapshot path flipped the image upside down on Direct3D. The extra flip is removed; the image is upright in the Editor on Direct3D 11 and on the Galaxy S23 with Vulkan.
HomeScreenSettingsandHomeTilelived in a file with other types, so Unity could not find their scripts and their assets lost them. Each type now has its own file.- A counter whose start value is above its cap is kept as it is in C# like in Java. A rate of 0, below 0 or NaN keeps the value constant.
LimitExceededfor pushed shortcuts below Android 11 counted only the shortcuts the system listed. Static shortcuts are now counted from the build.
Fixed (code review, before release)
- A publish with a snapshot made in
OnApplicationPause(true)orOnApplicationQuitnever left the game, because the player loop stops in the background. Publishes and shortcut calls waiting for a snapshot are now completed at once (one GPU sync) when the game pauses, loses focus or quits, and a publish made while the game is pausing is sent inside the call. - Any app could start the game with the package's intent action and forged extras, and C# raised them as taps. Every intent the package builds now carries a per-install token, and intents without it are ignored.
- The definition's tile subtitle disappeared after the first
SetState. An empty stored subtitle now shows the definition's, like the label. - With a splash or consent activity as the app's launcher, taps opened that activity or static shortcuts were dropped. Taps now go to the Unity activity and static shortcuts sit on the MAIN/LAUNCHER activity; new build rules V33 (taps would miss the Unity activity) and V34 (static shortcuts with no launcher activity).
- An add-tile refusal from the system (1004, not in the foreground) was read from the wrong field. It now raises
HomeScreenKit.FailedwithNotForeground(orSystemRefused) and a readable message. ClearAllDatacould delete a snapshot written right after it. Only images older than the call are deleted.TryGetLaunchActivationinAwakeof the first scene could miss the tap that started the game. The launch intent is now read before the first scene loads (at most 250 ms, once).- A hidden Chronometer became visible when a countdown or stopwatch was set. It now stays hidden until
SetVisible(true). - The Editor simulator never deleted its snapshots and shortcut icons. Older snapshots of an element are deleted on publish, and Clear Simulated Device and
ClearAllDataempty the folder. SetDynamicandPushwith the id of a static shortcut failed later on the device. They now throw anArgumentException.SetCounterthrew for a NaN rate, which the documentation describes as a constant counter. NaN is now stored as 0.
Changed
- A publish dropped by
ClearAllDataorResetStatecompletes with the new resultHomeScreenResult.Cancelledinstead ofOk, and is not raised inHomeScreenKit.Failed. - The Demo sample has a new menu item, Add Demo Scenes To Build, and a README with the setup steps.
Known issues
- Android 16: after Force stop, the first tap on a widget only wakes the game's widgets. Tap again, or open the game once. Measured on an Android 16 emulator and a Galaxy S23.
- With Battery saver on, a closed game's alarms were held back: on a Galaxy S23 a timeline update did not arrive within 840 seconds.
- Not verified: real launcher widget pickers (Pixel Launcher, One UI, Launcher3), Doze, a phone reboot, Material You colours, requestListeningState for standard tiles, Export Project and Symlink Sources on Unity 6000.0, a Gradle build of an exported project, the Widget Preview window and inspectors in a windowed Editor. See the manual.