-
Notifications
You must be signed in to change notification settings - Fork 46
Fix dualscreenactivity darkmode #2737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a resource naming conflict in the DualScreenActivity dark mode where a color constant named "white" was defined in both Android Common and Auth App with different values, causing the activity to display incorrectly in dark theme.
- Renamed the color constant from "white" to "com_microsoft_identity_common_white" in Android Common to avoid conflicts
- Updated the DualScreenActivity theme to use the renamed color constant
- Added changelog entry documenting the fix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| common/src/main/res/values/colors.xml | Renamed color constant to include library namespace prefix |
| common/src/main/res/values/styles.xml | Updated theme to reference the renamed color constant |
| changelog.txt | Added entry documenting the bug fix |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Issue:
Color constant value "white" is defined in both Android Common and Auth App
In Common, this is defined as FFFFFF which is real white.
In Auth App, defined as background_1, which itself it defined as FFFFFF (white) in day mode - light and 000000 in night mode. 000000 is actually black.
Due to same names, the final APK uses the one from auth app, and effectively makes color of DualScreenActivity black (000000) in dark theme/night mode.
Fix
Change the constant name in Android common. Named it with prefix library package suffix com_microsoft_identity_common, to avoid any conflicts.
Going forward we should name resources with namespace prefix to avoid resource merging issues. (Perhaps rename existing ones)
Also change them for DualScreenActivity from Base.Theme.AppCompat.Light to Theme.AppCompat.Light (recommended)
Auth App should also address this: Using "white" to indirectly define both white and black, is misleading and causes confusion.