Skip to content

refactor(island): consolidate battery status logic and update BatteryGlyph rendering - #1792

Merged
sameerasw merged 2 commits into
sameerasw:developfrom
isaacsa51:fix/island/battery_glyph_rendering
Nov 13, 2026
Merged

sameerasw merged 2 commits into
sameerasw:developfrom
isaacsa51:fix/island/battery_glyph_rendering

Conversation

@isaacsa51

Copy link
Copy Markdown
Contributor

Linked issue

Closes #1791

Description

Symbols hidden behind the battery: the charging bolt and battery saver plus had their own offscreen layer, which cut off the part that overlaps the battery and stopped the gap around them from cutting into it. I removed that layer, so all symbols draw on top with a proper cutout.

Squashed symbols: the symbol was measured without the 7dp it overlaps the battery by, so tight containers shrank it to a sliver. It now always gets its full size.

Matching outlines: the bolt now uses the same cutout and outline as the limiter shield, and the plus’s gap was widened to match.

Sizing: the battery number is about 10% smaller, and the bolt is shorter (9×11dp, the same size as the shield).

This branch has one commit, b3f7790cb, with these changes:

Glyph rendering fixes (IslandComponents.kt)

  • Symbols hidden behind the battery: the charging bolt and battery saver plus had their own offscreen layer, which cut off the part that overlaps the battery and stopped the gap around them from cutting into it. I removed that layer, so all symbols draw on top with a proper cutout.
  • Squashed symbols: the symbol was measured without the 7dp it overlaps the battery by, so tight containers shrank it to a sliver. It now always gets its full size.
  • Matching outlines: the bolt now uses the same cutout and outline as the limiter shield, and the plus's gap was widened to match.
  • Sizing: the battery number is about 10% smaller, and the bolt is shorter (9×11dp, the same size as the shield).
  • Preview: a BatteryGlyphPreview showing every battery state.

Battery state everywhere (BatteryStatus.kt, TimeBatteryPlugin.kt, BriefPlugin.kt)

  • Shared logic: battery reading and state and idle colors now live in one file, BatteryStatus.kt, used by both plugins.
  • Brief header: the battery now shows its state color and the charging, saver and limiter glyphs. Before, it only showed the level in the accent color.
  • Charging peek: the peek line's battery now shows the charging bolt and the other state glyphs.

Type of change

  • Bug fix
  • New feature
  • Translations
  • Documentation
  • Build / CI tooling

UI changes

added a small preview to see quickly all the states of the icon
image

Screen_recording_20261112_164705.webm

now the peek alerts and brief uses the correct battery status too.

Checklist

  • For new features: the linked issue is labeled approved and assigned to me.
  • This PR covers a single feature or fix and is under ~1,000 changed lines (or the size was agreed in the issue).
  • The base branch is develop.
  • ./gradlew assembleDebug and ./gradlew testDebugUnitTest pass.
  • I tested the changes on a device or emulator (including Shizuku or Root if applicable).
  • I understand every line of this change and can explain it in review, including any AI-assisted code.
  • The code follows the Development Guide.

@github-actions

Copy link
Copy Markdown

Thanks! This PR meets the contribution requirements and is queued for review.

@sameerasw sameerasw left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contributions <3

@sameerasw
sameerasw merged commit 60d0144 into sameerasw:develop Nov 13, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Essentials Progress Nov 13, 2026
@sameerasw sameerasw added the bug Something isn't working label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants