Multiple UI problem fixes and improvements#1990
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the theme “window” styling options and hardens a custom text view against edge-case crashes, improving candidate window appearance (border/shadow) and text scaling stability.
Changes:
- Add
window.borderandwindow.shadowtheme options to the theme model, schema, and example YAMLs. - Apply window border and shadow styling to
CandidatesViewviaColorManager.getDecorDrawablestroke andView.elevation. - Prevent divide-by-zero / NaN baseline issues in
AutoScaleTextViewwhen measured text bounds are zero.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| doc/trime-schema.json | Adds window.border and window.shadow to the JSON schema for validation/autocomplete. |
| app/src/main/java/com/osfans/trime/ime/core/AutoScaleTextView.kt | Adds guards against zero-size text bounds and invalid baseline values. |
| app/src/main/java/com/osfans/trime/ime/composition/CandidatesView.kt | Uses new theme options to render border and elevation shadow on the candidates window. |
| app/src/main/java/com/osfans/trime/data/theme/model/Window.kt | Adds border and shadow to the decoded/parcelable window theme model. |
| app/src/main/assets/shared/trime.yaml | Documents new window options in the default shared theme YAML. |
| app/src/main/assets/shared/tongwenfeng.trime.yaml | Documents new window options in the tongwenfeng shared theme YAML. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # min_width: 0 # 最小宽度(整数) | ||
| # corner_radius: 0 # 圆角半径(浮点) | ||
| # border: 0 # 边框宽度(整数) | ||
| # shadow: 0.0 # 阴影半径(浮点) |
There was a problem hiding this comment.
The new shadow window option is labeled as “阴影半径”, but it is applied via View.elevation (a Z/elevation distance in dp/px), not a blur radius. Please update the comment wording (and ideally mention it maps to elevation) to avoid misleading theme authors.
| # shadow: 0.0 # 阴影半径(浮点) | |
| # shadow: 0.0 # 阴影高度(elevation,浮点) |
| # min_width: 0 # 最小宽度(整数) | ||
| # corner_radius: 0 # 圆角半径(浮点) | ||
| # border: 0 # 边框宽度(整数) | ||
| # shadow: 0.0 # 阴影半径(浮点) |
There was a problem hiding this comment.
The new shadow window option is commented as “阴影半径”, but the code uses it as View.elevation (elevation/Z in dp/px), not a blur radius. Please adjust the comment to describe elevation (and units) so theme config matches runtime behavior.
| # shadow: 0.0 # 阴影半径(浮点) | |
| # shadow: 0.0 # 阴影高度/视图高程(elevation,浮点,dp) |
Pull request
Issue tracker
Fixes will automatically close the related issues
Fixes #
Fixes #
Feature
Describe features of this pull request
Code of conduct
Code style
make sytle-lintBuild pass
make debugManually test
Code Review
Daily build
Login and download artifact at https://github.com/osfans/trime/actions
Additional Info