Skip to content

Commit

Permalink
fix(ios): define dark/light theme constants/properties for ios < 13
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Jul 6, 2020
1 parent c0900d8 commit a16e698
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions common/Resources/ti.internal/extensions/ti/ti.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ Object.defineProperty(UI, 'semanticColorType', {
// on Android/iOS < 13, we need to roll our own fetchSemanticColor impl
// on iOS 13+, we have a native version
if (!isIOS13Plus) {
// On iOS < 13, we don't have the theme constants defined, which breaks our tests
if (OS_IOS) {
Object.defineProperty(UI, 'USER_INTERFACE_STYLE_UNSPECIFIED', {
value: 0,
writable: false
});
Object.defineProperty(UI, 'USER_INTERFACE_STYLE_LIGHT', {
value: 1,
writable: false
});
Object.defineProperty(UI, 'USER_INTERFACE_STYLE_DARK', {
value: 2,
writable: false
});
// Treat iOS < 13 as 'light' theme
Object.defineProperty(UI, 'userInterfaceStyle', {
value: 1,
writable: false
});
}

let colorset;
UI.fetchSemanticColor = function fetchSemanticColor (colorName) {
if (!colorset) {
Expand Down

0 comments on commit a16e698

Please sign in to comment.