Testing a theme
Reading the symptoms: a value at zero, a value that freezes, a list that shows everything, and what to check before publishing.
On this page
- The symptoms, and what they mean
- An element sits at the top left corner
- Text prints nothing
- A number prints as 1 when you wanted 1.0, or a clock reads 9:7
- A condition is always true
- A value freezes and recovers every couple of seconds
- A list shows entries it should have filtered out
- Everything disappeared after an edit
- Preview mode
- The preview device
- What preview cannot fake
- Other screen shapes
- Before you publish
A theme has no error console. Nothing throws, nothing logs, and nothing turns red. Every failure shows up as a value, usually a plausible looking one, so the useful skill is reading symptoms backwards.
For the short version of the most common ones, see questions and first problems.
The symptoms, and what they mean#
An element sits at the top left corner
Its x or y did not parse and evaluated to 0. Look for an unquoted word: '#FFFFFF' needs its quotes, and so does every other piece of text inside $…$.
Text prints nothing
A variable that means nothing in this place. app_name outside an app field, item_title outside a repeater card, scrub_pos outside a scrub strip. Each is simply unknown, which is empty. The scope table says where each one lives.
A number prints as 1 when you wanted 1.0, or a clock reads 9:7
1 when you wanted 1.0, or a clock reads 9:7Whole numbers lose their decimal part when they become text. format(value, '00') is the fix.
A condition is always true
Text converts to yes/no by being non-empty, so 'false' is false, '0' is false, and 'no', 'off' and 'nope' are all true. When a variable holds a word, compare it: $mode == 'on'$.
A value freezes and recovers every couple of seconds
That is the time budget: the expression went over 2 ms three times in a row and was paused. It is not a layout bug and it will not fix itself. Shorten the formula.
A list shows entries it should have filtered out
A filterFormula that does not parse lets everything through on purpose, because a broken filter that hid everything would look exactly like an empty list.
Everything disappeared after an edit
Check hidden. It takes a formula, and a formula that fails to parse is 0, which is false, so that one fails safe. The dangerous direction is a hidden that is accidentally always true.
Preview mode#
The eye in the editor toolbar switches the canvas from editing to using. Taps launch, gestures navigate, actions fire. This is the only way to test an interaction without leaving the editor, and it is the only place where an appear trigger fires the way it will in use.
While you are editing, nothing acts: a tap selects instead of launching, and the pages drawn around the one you are working on are inert previews. That is deliberate, and it means "my button does nothing" is not a bug until you have checked it in preview mode.
What preview draws is the home screen itself: the same pages, transitions, gestures and layers, measured at the full size of the device and then scaled down to fit. It is not a second rendering that might disagree with the first. Sizes, line heights and every formula over screen_width see the numbers of the device being simulated, not the numbers of the small rectangle they are drawn in.
The preview device#
While preview is on, the panel below the canvas becomes the preview device. Each group starts on Use real device values and shows your own device; switch a group off and its fields take over. Reset all returns every group to the device.
| Group | What it changes | What it is for |
|---|---|---|
| Screen | Width and height in dp, and one of the eight reference shapes | Seeing a tablet or a landscape phone without owning one |
| System bars | status_bar_height, nav_bar_height, inset_left, inset_right | Gesture bar versus three buttons; a cutout in landscape |
| Appearance | font_scale, is_dark_mode | Text at 1.5×, where clipping shows up |
| Time | Hour, minute, and the date | A clock format at 23:59, a weekday, a New Year's Eve |
| Battery | battery_level, is_charging | The 5% branch of a battery ring, without waiting for 5% |
| Connection & notifications | wifi_connected, notification_access, notification_count | What a first minute looks like before permissions are granted |
| Profiles | Work profile and Private Space, present and locked | A drawer's profile tabs on a device that has none |
| Sensors | tilt_x, tilt_y (degrees), compass_heading, parallax_x, parallax_y (-1 to 1) | Holding a parallax layer still at a chosen angle |
| Weather | Every weather and air-quality value | The card at −7°, at UV 11, at AQI 180 |
Picking a screen format also sets that shape's bars and insets, because they are part of the shape: the landscape phone in the list carries a 48dp inset on its right, and layouts that only think about the top and bottom edges fail exactly there.
The time is set, not started. It stays where you put it while animations keep running. A clock that reads 10:09 still reads 10:09 a minute later, which is what makes a screenshot of a particular minute possible.
What preview cannot fake#
- Apps. Turning on work profile present flips the variables a theme reads, so its tabs and sections appear. The apps behind them are still your own; the launcher cannot invent a work profile.
- Notification counts per app. Badges come from real notifications. Turning notification access off does remove them (that check is real) but turning it on does not fill them in.
- Live sources. Feeds and weather come from the network. The weather group replaces the values wholesale, which is the point; an empty feed stays empty.
Everything else, every formula reading screen_width, font_scale, battery_level or time_hour, is the value the group says it is.
Other screen shapes#
The store checks a theme against eight reference shapes and shows which ones it fits. It is a layout check (elements falling outside the screen) not a judgement about how it looks.
Those eight shapes are the same list the preview device offers, so a shape the store flags can be looked at directly instead of guessed at. Walk down the list: the small phone and the landscape phone find nearly everything, because one is the narrowest and the other has 411dp of height for the whole layout.
Passing the check is not the same as being right, and this is where looking pays. Check what the check cannot see: a dock whose cells go from square to letterboxed, text that wraps to three lines at a larger font scale, a card that fits but is now three times wider than its content. A theme may also choose to drop something on a short screen. The theme shipped with the launcher hides its clock and search bar below 520dp of height, and a deliberate decision looks exactly like a bug until you see it happen. See different screens.
Before you publish#
- The launcher options are reachable. Check it from every page, including any that covers the whole screen. See leaving a way back in. The app list entry always opens them, but a reader who needs it has already concluded your theme is broken.
- Every page reachable, in both directions, by the gesture you intended.
- Every icon points somewhere. Prefer roles over package names, then delete an app and check the slot degrades quietly rather than showing a hole.
- Open it with no feeds configured, no weather permission, and no notification access. That is what somebody's first minute looks like, and a theme that appears broken then is a theme that gets uninstalled. The Connection & notifications group above fakes the last of those without revoking anything. See live data.
- Walk the screen formats in the preview device, at least the small phone and the landscape phone, and raise the font scale to 1.5 while you are there.
- Leave it idle for a minute and watch what still moves; see performance.
- Look at the screenshots the app renders for the listing. They are drawn from your theme without your wallpaper or your apps, so they show what a stranger will actually get.
Documentation for launcher 0.1.0-alpha Android 12 and later last updated