Skip to content

Commit 6e3e20d

Browse files
authored
Merge pull request #126 from sameerasw/main
Upstream
2 parents 9584f5e + ce94b49 commit 6e3e20d

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ replay_pid*
3030
*.DS_Store
3131
*app/release/
3232

33-
Build/
33+
Build/
34+
build/reports/problems/problems-report.html

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Essential tools, mods and workarounds for Pixels and other Androids
3333

3434
- **Maps Power Saving Mode**: Optimize battery usage during Google Maps navigation by managing screen state (requires Shizuku or Root).
3535
- **Are we there yet? (Travel Alarm)**: Never miss your stop again. Set a destination and get notified when you are nearby. Features real-time distance tracking in the status bar and Live Activity support on the lock screen.
36-
- **DIY Automation [Testing]**: Create custom automations based on device triggers (e.g., app launches, time) or states (e.g., screen on/off, battery level).
36+
- **DIY Automation**: Create custom automations based on device triggers (e.g., app launches, time) or states (e.g., screen on/off, battery level).
3737
- **Screen Off Widget**: An invisible widget that can be placed on the home screen to quickly lock the device without using the power button. Now with configurable haptic feedback.
3838
- **Caffeinate**: A Quick Settings tile to keep the display awake indefinitely or for a set duration.
3939
- **Sound Mode Tile**: A Quick Settings tile to toggle between Ring, Vibrate, and Silent sound modes.
@@ -44,6 +44,7 @@ Essential tools, mods and workarounds for Pixels and other Androids
4444
- **App Lock**: Secure your applications with a dedicated app lock feature. Integrated with Quick Settings for easy toggling.
4545
- **Flashlight Enhancements**: Advanced flashlight control with smooth fade-in/out, volume key intensity adjustment, global brightness controls, and live activity support.
4646
- **Screen Locked Security**: Protect your device by disabling sensitive Quick Settings tiles and power menu when the device is locked.
47+
- **A keyboard**: That no one asked for.
4748

4849
### Visuals
4950

@@ -70,13 +71,16 @@ A collection of useful tiles to toggle system settings:
7071
- **App Lock**: Toggle application lock.
7172
- **Flashlight**: Toggle flashlight with brightness adjustment support.
7273
- **NFC**: Toggle NFC functionality.
73-
- **Flashlight pulse**: Pulse flashlight for notifications
74+
- **Flashlight Pulse**: Pulse flashlight for notifications
75+
- **Stay Awake**: Using the developer options
76+
- **Maps Power Saving Mode**: Easier access
77+
- **Adaptive Brightness**: Especially for Pixels
7478

7579
# Requirements
7680

77-
- Android 7.0 or higher (Feature support may vary)
81+
- Android 8.0 or higher (Feature support may vary)
7882
- App permissions are optional, Grant necessary permissions for each feature
79-
- Targetted for Google Pixel devices
83+
- Targetted for Google Pixel devices extending to other Androids
8084
- Tested on Google Pixel 7 (Android 16 beta program)
8185

8286
# Screenshots
@@ -133,5 +137,5 @@ Please read our [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of co
133137
---
134138

135139
<p align="center">
136-
Last updated: 2026-01-13
140+
Last updated: 2026-01-15
137141
</p>

app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidget.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import androidx.core.content.ContextCompat
2525
import androidx.core.graphics.ColorUtils
2626
import androidx.glance.Image
2727
import androidx.glance.ImageProvider
28+
import com.google.android.material.color.MaterialColors
2829
import com.sameerasw.essentials.R
2930

3031
class BatteriesWidget : GlanceAppWidget() {
@@ -155,6 +156,7 @@ class BatteriesWidget : GlanceAppWidget() {
155156
val baseError = GlanceTheme.colors.error.getColor(configContext).toArgb()
156157
val onSurface = GlanceTheme.colors.onSurface.getColor(configContext).toArgb()
157158
val surfaceColor = GlanceTheme.colors.surface.getColor(configContext).toArgb()
159+
val warning = MaterialColors.harmonizeWithPrimary(configContext, android.graphics.Color.parseColor("#FFC107"))
158160

159161
val isNightMode = (systemConfig.uiMode and
160162
android.content.res.Configuration.UI_MODE_NIGHT_MASK) ==
@@ -164,15 +166,15 @@ class BatteriesWidget : GlanceAppWidget() {
164166
val colors = ThemeColors(
165167
primary = basePrimary,
166168
error = baseError,
167-
warning = android.graphics.Color.parseColor("#FFC107"),
169+
warning = warning,
168170
track = ColorUtils.setAlphaComponent(onSurface, 30),
169171
surface = surfaceColor,
170172
iconTint = onSurface
171173
)
172174

173175

174176
val backgroundModifier = if (isBackgroundEnabled) {
175-
GlanceModifier.background(GlanceTheme.colors.surface)
177+
GlanceModifier.background(GlanceTheme.colors.widgetBackground)
176178
} else {
177179
GlanceModifier.background(android.graphics.Color.TRANSPARENT)
178180
}

0 commit comments

Comments
 (0)