Skip to content

feat(duo): add subtle battery progress wiggle charging animation - #954

Open
Balajitechlabs wants to merge 8 commits into
sameerasw:developfrom
Balajitechlabs:feat/duo-charging-battery-wiggle
Open

feat(duo): add subtle battery progress wiggle charging animation#954
Balajitechlabs wants to merge 8 commits into
sameerasw:developfrom
Balajitechlabs:feat/duo-charging-battery-wiggle

Conversation

@Balajitechlabs

@Balajitechlabs Balajitechlabs commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Context

Following maintainer and community feedback on charging indicators, continuous animations while plugged in are visually distracting and waste display cycles. This PR replaces any looping motion with a refined, one-time tactile entrance when a charger is plugged in: a liquid progress sweep from 0% to the current battery level with a gentle elastic breath, settling into a damped spring wiggle. Once the initial 950ms entrance finishes, the ring settles completely static at the current battery percentage with zero ongoing redraws.

What's included

  • One-time liquid charging surge & wiggle: When ACTION_POWER_CONNECTED fires, Duo runs a single-shot 950ms entrance:
    • Sweeps the progress arc smoothly from 0% up to the device's battery level.
    • Gently expands the ring by 7.5% with an elastic breath (.0 \to 1.075 \to 1.0$) around the camera cutout.
    • Settles into the battery percentage with a physical damped spring wobble before locking into place.
    • Flares a subtle luminous neon glow along the sweep arc that dissolves cleanly as the ring settles.
  • Orbital gap bolt icon: Scales an electric bolt glyph (0.0 -> 1.0) into the cutout gap using an overshoot interpolator on plug-in, and scales it back to 0 on disconnect.
  • 100% static guarantee: The view completely halts invalidation after 950ms, ensuring zero CPU, GPU, or battery overhead while resting on charge.
  • Dynamic charging accents: Transitions the ring and bolt to cyan (#00E5FF) on fast charging (SuperVOOC, PD, QC) or emerald (#00E676) on standard charging.
  • Portrait display cutout fix: Guards checkFullscreenState so Duo does not falsely treat edge-to-edge portrait apps as fullscreen media, keeping the cutout overlay visible in portrait orientation.
  • Settings toggle: Added a toggle under Duo > What to show labeled "Charging animation".

Testing

  • Built with ./gradlew :app:assembleDebug --no-daemon on JDK 21 / Gradle 9.5 (clean build).
  • Verified on a physical Android 15/16 device (Vivo V2513) via wireless ADB and physical power connection.
  • Confirmed the progress arc sweeps and settles once on plug-in, and remains completely motionless while charging.

- Animate subtle damped spring wiggle on battery progress upon power connection
- Render electric bolt glyph in the cutout orbital gap with dynamic charging accent
- Settle static immediately after initial wiggle to prevent constant visual distraction
- Guard fullscreen detection to preserve Duo rendering in portrait orientation
- Add user toggle in Duo settings under What to Show
@sameerasw sameerasw added the enhancement New feature or request label Sep 10, 2026
@sameerasw sameerasw moved this from Backlog to In progress in Essentials Progress Sep 10, 2026
@sameerasw
sameerasw self-requested a review September 10, 2026 19:46
Balajitechlabs and others added 5 commits September 11, 2026 01:17
…lashlight, beta, description fixes, motion blur slider, fix fav feature order, (sameerasw#955)

This pull request introduces support for tracking active progress
notifications and adds new settings and feature toggles for the "Duo"
interface. It also refactors how media session state is handled in the
AOD wallpaper overlay and updates the app version. The most significant
changes are grouped below:

**Progress Notification Tracking:**

* Introduced the `ProgressNotificationData` data class to represent
active progress notification details
(`app/src/main/java/com/sameerasw/essentials/domain/model/ProgressNotificationData.kt`).
* Added logic in `NotificationListener` to extract, track, and notify
listeners about progress notifications, including
registering/unregistering listeners and extracting notification details
(`app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt`).
[[1]](diffhunk://#diff-498b28fde1f8658b760f1a339a81eb7f8b84cca34cdfa32fde7f775168ed4d63R42-R45)
[[2]](diffhunk://#diff-498b28fde1f8658b760f1a339a81eb7f8b84cca34cdfa32fde7f775168ed4d63R56-R79)
[[3]](diffhunk://#diff-498b28fde1f8658b760f1a339a81eb7f8b84cca34cdfa32fde7f775168ed4d63R918-R922)
[[4]](diffhunk://#diff-498b28fde1f8658b760f1a339a81eb7f8b84cca34cdfa32fde7f775168ed4d63R1276-R1277)
[[5]](diffhunk://#diff-498b28fde1f8658b760f1a339a81eb7f8b84cca34cdfa32fde7f775168ed4d63R1621-R1687)

**Duo Feature and Settings Enhancements:**

* Added new keys and getter/setter methods in `SettingsRepository` for
Duo feature options such as showing media, progress, flashlight, and
advanced screen-off behavior
(`app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt`).
[[1]](diffhunk://#diff-3034452163f09f9c5b913dccd6f93b4a3fefaf773460d401d8904f6f151eb1a7R340)
[[2]](diffhunk://#diff-3034452163f09f9c5b913dccd6f93b4a3fefaf773460d401d8904f6f151eb1a7R369-R373)
[[3]](diffhunk://#diff-3034452163f09f9c5b913dccd6f93b4a3fefaf773460d401d8904f6f151eb1a7R3103-R3117)
* Updated the `FeatureRegistry` to register the Duo feature as a beta
feature under the "Display" category, and added the necessary permission
registration
(`app/src/main/java/com/sameerasw/essentials/domain/registry/FeatureRegistry.kt`,
`app/src/main/java/com/sameerasw/essentials/domain/registry/PermissionRegistry.kt`).
[[1]](diffhunk://#diff-24845de72ed4d362c708778c76734f4c7ebe02be324274ede2d7bfcc2bbfd23dR688-R713)
[[2]](diffhunk://#diff-24845de72ed4d362c708778c76734f4c7ebe02be324274ede2d7bfcc2bbfd23dL1364-L1393)
[[3]](diffhunk://#diff-b1f1d547c9026cdc9d71b988988d5b536d7b0aad6cabde798889fb8abc00d6c6R114)

**AOD Wallpaper Overlay Media Handling Refactor:**

* Refactored `AodWallpaperOverlayHandler` to better manage media session
controllers, callbacks, and excluded packages, improving maintainability
and reliability of media state handling
(`app/src/main/java/com/sameerasw/essentials/services/handlers/AodWallpaperOverlayHandler.kt`).
[[1]](diffhunk://#diff-52f1cbd34ce4793a643ebc79ea0f84d7522fbebe0ab94916e8dc0985f2f93e25R30)
[[2]](diffhunk://#diff-52f1cbd34ce4793a643ebc79ea0f84d7522fbebe0ab94916e8dc0985f2f93e25R42)
[[3]](diffhunk://#diff-52f1cbd34ce4793a643ebc79ea0f84d7522fbebe0ab94916e8dc0985f2f93e25R67-R68)
[[4]](diffhunk://#diff-52f1cbd34ce4793a643ebc79ea0f84d7522fbebe0ab94916e8dc0985f2f93e25L92-R100)
[[5]](diffhunk://#diff-52f1cbd34ce4793a643ebc79ea0f84d7522fbebe0ab94916e8dc0985f2f93e25R109-R117)
[[6]](diffhunk://#diff-52f1cbd34ce4793a643ebc79ea0f84d7522fbebe0ab94916e8dc0985f2f93e25L146-L156)

**Version Update:**

* Updated the app version name to `18.0-beta.4` in the Gradle build
configuration (`app/build.gradle.kts`).
@Balajitechlabs

Copy link
Copy Markdown
Contributor Author

Hey @sameerasw, while syncing with latest main, noticed SettingsActivity was failing to compile due to a missing label_motion_blur_amount string from the recent motion blur slider merge. I've restored it here so the build passes cleanly alongside the charging updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants