Skip to content

feat: more Hilight effect options and app colors for notification rules - #1479

Open
jawzf wants to merge 4 commits into
sameerasw:developfrom
jawzf:feat/016-hilight-app-color
Open

jawzf wants to merge 4 commits into
sameerasw:developfrom
jawzf:feat/016-hilight-app-color

Conversation

@jawzf

@jawzf jawzf commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds more ways to customise Hilight effects. The DIY Hilight action and the per-app notification rules share one effect sheet, so the options below show up in both (and in Duo and Status Glance, which use the same action).

Before: six patterns, one fixed colour and a duration in seconds. A looping pattern was often cut off partway through a cycle, and there was no way to dim the LEDs.

After:

  • Three new patterns: Pulse (a heartbeat double beat), Ripple (spreads from the middle LEDs out to both ends) and Sparkle (random twinkles at varied brightness).
  • Battery level (DIY action only): lights the share of LEDs matching the current charge, one at a time, then holds. With a "Charger connected" or "Battery level" automation it works as a charging or low-battery indicator. The charge is read once per play, with no receivers.
  • Brightness: a 10–100 % slider for every pattern.
  • Repeat: looping patterns get a 1–10× slider instead of Duration, so an effect always ends on a whole cycle. Solid, Sparkle and Battery level keep Duration. The 30 s cap stays.
  • Match app color (notification rules only): plays the effect in the app's colour, using its Custom app colors override if one is set, otherwise its icon colour. If the icon gives no usable colour, it falls back to the rule's swatch. The swatches hide while it's on, and the app row's dot shows the app colour.
  • The effect sheet now scrolls, so it fits in landscape.

Effects saved before this change load and play exactly as before: brightness 100 %, played by duration. When one is opened and saved again, it takes the repeat count the slider shows.

How: the new fields (brightness, repeats, autoColor) have defaults, so old JSON loads unchanged through Gson. The frame maths stays pure in HilightFrames and is unit tested. HilightFrames.durationMs turns repeats into whole cycles. HilightController.playForApp resolves the colour with the existing AppColorUtil.resolveColor (cached) and only runs after handleHilight's existing checks pass. Effects stay one-shot, with nothing running in the background.

Type of change

  • Bug fix
  • New feature
  • UI / visual update
  • Performance improvement
  • Refactoring / cleanup
  • Translations
  • Build / CI tooling

UI changes

1_app_rule_match_color

A notification app rule with Match app color on: the swatches are hidden, with Repeat and Brightness sliders.

2_app_rules_list

The app list: the dot shows the app colour, and the summary shows the repeat count.

3_diy_action_battery

The DIY Hilight action with the new patterns and Battery level selected (Duration slider).

Checklist

  • The base branch is set to develop (not main).
  • The app builds cleanly locally with ./gradlew assembleDebug (and assembleRelease).
  • Unit tests pass with ./gradlew testDebugUnitTest (11 new tests in HilightFramesTest: each new pattern, battery fill, brightness, whole-cycle durations, repeat counts, app colour fallback, and old JSON loading with defaults).
  • Tested on a Pixel 11 Pro (Android 17) with Shizuku, reading the LEDs through dumpsys lights:
    • Glow at 3× plays three full cycles (about 6 s) and ends dark.
    • Pulse, Ripple and Sparkle play as described.
    • Solid at 10 % gives exactly 10 % of the colour, and Rainbow at 50 % tops out at half.
    • At 44 % charge, Battery level fills 4 of 8 LEDs one by one and holds.
    • With Match app color on, a real notification glows in the app's icon colour. After setting a Custom app colors override, it glows in the override colour.
    • The app sheet doesn't offer Battery level, and the DIY sheet doesn't show Match app color.
    • A rule saved without touching the Repeat slider plays the count it shows.
  • Reuses ConfigSliderItem, IconToggleItem, RoundedCardContainer, HilightProgressFrames.litCount and AppColorUtil.resolveColor.
  • New strings are in strings.xml (English only); icons are existing rounded_* drawables.
  • No new settings keys, so nothing to register in FeatureRegistry.kt.
  • No new dependencies or permissions in the manifest. Release APK +8 KB.

🤖 Generated with Claude Code

@jawzf

jawzf commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Note: the first screenshot still shows a Comet chip. Comet was dropped from this PR because it was nearly the same as Sweep, so the sheet now has 10 patterns (9 in notification rules).

sameerasw and others added 4 commits October 22, 2026 22:00
Adds Pulse, Ripple and Sparkle patterns, a Battery level pattern for
the DIY action, a brightness slider and a repeat count for looping
patterns so effects end on a whole cycle. Notification rules can match
the app's color (its Custom app colors override, or its icon color).
The effect sheet now scrolls. Older saved effects load unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants