Skip to content

Conversation

@decrowle
Copy link
Contributor

@decrowle decrowle commented Jun 28, 2019

Adding in High Contrast awareness for React Native.

Adds High contrast event to the AppTheme module. Provides awareness of the 'isHighContrast' Boolean and 'highContrastColors' which are the RGB hex values for the eight main system colors from Windows:
ButtonFace
ButtonText
GrayText
Highlight
HighlightText
Hotlight
Window
WindowText
These are sent via the highContrastChanged event as strings of the form "#FFFFFF", matching conventional RGB color values for React Native.

Examples are also added to AccessibilityExample.tsx.
This PR also includes the addition of ThemingExample.tsx which adds an example of usage for the light and dark theme awareness from the AppTheme module.

Microsoft Reviewers: Open in CodeFlow

@decrowle decrowle requested a review from a team as a code owner June 28, 2019 16:23
@ghost ghost added the vnext label Jun 28, 2019
@marlenecota
Copy link
Contributor

marlenecota commented Jun 28, 2019

class AppThemeModule extends NativeEventEmitter {

add isHighContrast #Pending


Refers to: vnext/src/Libraries/Modules/AppTheme/mocks/AppTheme.uwp.ts:6 in cbd5625. [](commit_id = cbd5625, deletion_comment = False)

Copy link
Contributor

@marlenecota marlenecota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@ghost ghost added Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) and removed Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) labels Jun 28, 2019
@marlenecota
Copy link
Contributor

marlenecota commented Jun 28, 2019

public currentTheme = '';

add isHighContrast and currentHighContrastColorValues to shim #Pending


Refers to: vnext/src/Libraries/Modules/AppTheme/AppTheme.uwp.ts:51 in 70487b7. [](commit_id = 70487b7, deletion_comment = False)

@marlenecota marlenecota changed the title User/decrowle/high contrast events [AppTheme] Add high contrast properties and events Jun 28, 2019
@decrowle decrowle modified the milestone: vNext Milestone 2 Jun 28, 2019

bool AppTheme::getIsHighContrast()
{
return m_accessibilitySettings.HighContrast();;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; [](start = 48, length = 1)

nit: extra semicolon

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shoot, merged before the page fully loaded. Will fix this on next PR.

Copy link
Contributor

@kmelmon kmelmon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@decrowle decrowle merged commit ba6bb1e into microsoft:master Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants