Repository navigation
Fixed: Widget title and refresh button cut off by rounded corners; add theme-aware style, background color/opacity and text color settings and One UI blur - #175
Open
byzosc wants to merge 3 commits into
Conversation
…ting - The list widget now follows the system light/dark theme instead of the hardcoded black title bar and light list background. - The background is drawn with the system widget corner radius on Android 12+ (`system_app_widget_background_radius`) and the title/refresh button are inset so the launcher's corner clipping no longer cuts them off. - Add a configuration activity to set the background opacity per widget instance. It is reachable from the launcher's widget "Settings" entry (`reconfigurable|configuration_optional`) and by tapping the widget title. Closes termux#10 Assisted-by: Claude Opus 5.5 (Claude Code)
byzosc
force-pushed
the
widget-skin-opacity
branch
from
November 3, 2026 09:02
ff0399f to
5173f16
Compare
byzosc
added a commit
to byzosc/termux-widget
that referenced
this pull request
Nov 3, 2026
- Add a background color choice to the widget settings: follow dark mode (default), white, black, or the wallpaper based system palette on Android 12+. The title, refresh button and list items use a matching light or dark text color. On Android 12+ the colors follow dark mode changes without a widget update (`RemoteViews.setColorInt()`). - The root view is now `@android:id/background` and its color is set with `setBackgroundColor()`, with alpha kept between 1 and 254. Together with the `app:widgetStyle` and `app:widgetSize` provider attributes this makes Samsung One UI Home 7.0+ draw its wallpaper blur behind the widget, like it does for its own widgets. Other launchers ignore these attributes and draw the translucent color. - The refresh button now uses the title color. Assisted-by: Claude Opus 5.5 (Claude Code)
- Add a per-widget text color choice: follow background (default, preserving the existing behavior), white, or black. Explicit choices keep the same text color across backgrounds and system light/dark modes. - Use the selected color for the title, list items and refresh button, with a translucent version of the same color for the empty-list hint. - Make the settings screen scrollable so the save button stays reachable on smaller screens and with larger text. Assisted-by: Claude Opus 5.5 (Claude Code), Codex
Author
|
Friendly ping: this PR is ready for review whenever someone has time. Summary of the three commits:
Built and tested on a Galaxy Z Fold8 (One UI 9 / Android 17). If smaller PRs would make review easier, I'm happy to split it up or adjust anything. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10
Screenshots
Samsung Galaxy Z Fold8, One UI 9 / Android 17, One UI Home. Left: current 0.15.0 — the "Termux" title and the refresh button run into the clipped corners. Right: the first commit of this PR (dark theme, reduced background opacity) — nothing is cut off. These were taken before the color option and the One UI blur were added.
What
Main fix: the title and the refresh button are no longer cut off by the rounded corners. On Android 12+ launchers clip every widget to the system widget corner radius. The old layout puts the "Termux" title and the refresh button right into the corners, so on launchers with a large radius (e.g. Samsung One UI Home) both get visibly cut. The title row is now inset by 16dp, which stays clear of radii up to ~54dp, and the background is the
@android:id/backgroundroot view, which Android 12+ launchers clip with the system radius.Also:
TermuxWidgetConfigureActivity), stored per widget instance byappWidgetIdand cleared inonDeleted. It opens from the launcher's widget "Settings" entry (android:widgetFeatures="reconfigurable|configuration_optional", so adding a widget does not force the config screen) and by tapping the widget title, for launchers that do not show a reconfigure entry.system_accent1_100/_800, Android 12+ only). Title, refresh button and list text get a matching light or dark color. On Android 12+ colors are set withRemoteViews.setColorInt(), so they follow dark mode changes without a widget update.setBackgroundColor()on the root view and its alpha is kept between 1 and 254. With theapp:widgetStyle="colorful"andapp:widgetSizeprovider attributes (defined invalues/attrs.xml), One UI Home 7.0+ then draws its own wallpaper blur behind the widget and tints it with the background color, the same frosted glass look as Samsung's own widgets. Lower opacity gives more visible blur. Samsung does not document these attributes; the approach follows blur-widget-demo. Other launchers ignore them and simply draw the translucent color.No changes to the shortcut list behaviour, signing config,
sharedUserIdor version.Notes
setImageAlpha, but One UI Home only applies its blur to a plain background color on the root view.Tested
Installed over the GitHub 0.15.0 build (same test key) on a Samsung Galaxy Z Fold8, One UI 9 / Android 17, One UI Home launcher: the widget renders with the launcher's corner radius, the title and refresh button are not clipped, the One UI wallpaper blur shows behind the widget, and shortcuts and refresh still work. The launcher reports the widget with
semWidgetStyle=1andsemIsWallpaperBlurSupported=truein its options. Light/dark switching, every color choice, other launchers and Android versions below 12 have not been tested separately yet.AI assistance disclosure: this change was written with Claude Opus 5.5 (Claude Code); I reviewed it and tested it on my device.
🤖 Generated with Claude Code