labnex/LabNex
2
6
Fork
You've already forked LabNex
0

Fix bottom sheet crash from missing primaryTextColor in base themes #155

Merged
Kreyren merged 1 commit from fix-missing-primary-text-color into main 2026年06月15日 11:09:10 +02:00
Kreyren commented 2026年06月13日 13:08:06 +02:00 (Migrated from github.com)
Copy link

Hitting the PAT help button crashes when you're not using Dynamic Colors.

The bottom sheet inflates and fails because primaryTextColor isn't defined in the
base themes.

The attribute only exists in AppThemeDynamicColors (the Android 12+ variant).
AppTheme, AppThemeLight, and AppThemeDark never set it. The BottomSheetDialogFragment wraps AppTheme with its overlay, so the attribute lookup never reaches the dynamic colors theme even when that's what the
activity is using.

The ?attr/primaryTextColor in the layout can't resolve and the whole thing chokes.

To reproduce on current main:

  1. Set theme to System default / Light / Dark (not Dynamic Colors)
  2. Open any screen with the PAT help button and tap it
  3. Observe the crash

The fix just adds primaryTextColor to AppTheme, AppThemeLight, AppThemeDark in values/themes.xml, and the dark variant in values-night/themes.xml, mapped to the appropriate colorOnSurface for each theme.


P.S. I videcoded this whole thing, cuz that's the only sane way for me to work with java, feel free to just treat this as elaborate issue report and implement your own fix, It did seem to solve the application crash for me on Razer Phone 2 with LineageOS 22.2-20260515-NIGHTLY-aura though and the solution seems to make sense so submitting it as is.

Update: It also seem to made the app significantly faster (from pressing on button and waiting for ~3 seconds to open nearly instantly) and it doesn't crash anymore when i try to open a new issue.

Hitting the PAT help button crashes when you're not using Dynamic Colors. The bottom sheet inflates and fails because `primaryTextColor` isn't defined in the base themes. The attribute only exists in `AppThemeDynamicColors` (the Android 12+ variant). `AppTheme`, `AppThemeLight`, and `AppThemeDark` never set it. The `BottomSheetDialogFragment` wraps `AppTheme` with its overlay, so the attribute lookup never reaches the dynamic colors theme even when that's what the activity is using. The `?attr/primaryTextColor` in the layout can't resolve and the whole thing chokes. To reproduce on current main: 1. Set theme to System default / Light / Dark (not Dynamic Colors) 2. Open any screen with the PAT help button and tap it 3. Observe the crash The fix just adds `primaryTextColor` to `AppTheme`, `AppThemeLight`, `AppThemeDark` in `values/themes.xml`, and the dark variant in `values-night/themes.xml`, mapped to the appropriate `colorOnSurface` for each theme. --- P.S. I videcoded this whole thing, cuz that's the only sane way for me to work with java, feel free to just treat this as elaborate issue report and implement your own fix, It did seem to solve the application crash for me on Razer Phone 2 with LineageOS 22.2-20260515-NIGHTLY-aura though and the solution seems to make sense so submitting it as is. Update: It also seem to made the app significantly faster (from pressing on button and waiting for ~3 seconds to open nearly instantly) and it doesn't crash anymore when i try to open a new issue.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
⚔️ Wontfix
This will not be worked on
⚙️ CI
Update
⛏️ Breaking
Fixed
Duplicate
This issue or pull request already exists
Invalid
This doesn't seem right
Question
❤️ Support
➡️ Frontport
➡️ Needs-frontport
🌐 Translation
🎉 Feature
🎯 Enhancement
🏗️ Build
🐛 Bug
Something isn't working
👋 Good-first-issue
💀 Deprecation
💡 Suggestion
💬 Discussion
💭 Brainstorming
💰 Sponsored
A feature which is sponsored by someone
💻 UI/UX
📄 Documentation
Improvements or additions to documentation
📈 Performance
📌 Priority-critical
📌 Priority-high
📍 Priority-low
📍 Priority-medium
📡 Needs-feedback
📱 F-droid
📸 Release
🔒 Security
🔙 Backport
Bugfix ported to a release branch for point release
🔙 Has-backport
🔙 Needs-backport
🔙 Regression
🔭 Cannot-reproduce
🗄️ Repository
🗒️ Changelog
🗓️ Summary
🤾 Google-play
🥑 Ready
🧪 Testing
🧺 Cleanup
🧺 Needs-cleanup
🧾 Confirmed
🧾 To-confirm
🩹 External-dependecy
🪒 Refactor
🪜 Upstream
🙇‍♂️ Help-wanted
Extra attention is needed
🚀 Improvement
🚨 Investigate
🛡️ Blocked
🛰️ API-dependency
🟦 Website
No labels
⚔️ Wontfix
⚙️ CI
Update
⛏️ Breaking
Fixed
Duplicate
Invalid
Question
❤️ Support
➡️ Frontport
➡️ Needs-frontport
🌐 Translation
🎉 Feature
🎯 Enhancement
🏗️ Build
🐛 Bug
👋 Good-first-issue
💀 Deprecation
💡 Suggestion
💬 Discussion
💭 Brainstorming
💰 Sponsored
💻 UI/UX
📄 Documentation
📈 Performance
📌 Priority-critical
📌 Priority-high
📍 Priority-low
📍 Priority-medium
📡 Needs-feedback
📱 F-droid
📸 Release
🔒 Security
🔙 Backport
🔙 Has-backport
🔙 Needs-backport
🔙 Regression
🔭 Cannot-reproduce
🗄️ Repository
🗒️ Changelog
🗓️ Summary
🤾 Google-play
🥑 Ready
🧪 Testing
🧺 Cleanup
🧺 Needs-cleanup
🧾 Confirmed
🧾 To-confirm
🩹 External-dependecy
🪒 Refactor
🪜 Upstream
🙇‍♂️ Help-wanted
🚀 Improvement
🚨 Investigate
🛡️ Blocked
🛰️ API-dependency
🟦 Website
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
labnex/LabNex!155
Reference in a new issue
labnex/LabNex
No description provided.
Delete branch "fix-missing-primary-text-color"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?