Skip to content

Commit 6b20030

Browse files
committed
fix: ios text button not respecting theme
1 parent 8c8f725 commit 6b20030

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/button/button.android.ts

-2
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,9 @@ export class Button extends ButtonBase {
123123
}
124124

125125
setCornerRadius(value) {
126-
// const newValue = Length.toDevicePixels(typeof value === 'string' ? Length.parse(value) : value, 0);
127126
this.nativeViewProtected.setCornerRadius(value);
128127
}
129128
setStrokeWidth(value) {
130-
// const newValue = Length.toDevicePixels(typeof value === 'string' ? Length.parse(value) : value, 0);
131129
this.nativeViewProtected.setStrokeWidth(value);
132130
}
133131
[textTransformProperty.setNative](value: TextTransform) {

src/button/button.ios.ts

+5
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ export class Button extends ButtonBase {
128128
const scheme = MDCContainerScheme.new();
129129
scheme.colorScheme = colorScheme;
130130
if (this.variant === 'text') {
131+
// fixes a bug where N would set default UILabel system color
132+
// if no color in style which would break theming
133+
if (!this.style.color) {
134+
this.style.color = themer.getPrimaryColor() as Color;
135+
}
131136
view.applyTextThemeWithScheme(scheme);
132137
} else if (this.variant === 'flat') {
133138
if (colorScheme) {

src/core/index.ios.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export class Themer {
3434
this.primaryColor = value;
3535
const colorTheme = this.getOrcreateAppColorScheme();
3636
const color = value instanceof Color ? value : new Color(value);
37-
console.log('setPrimaryColor', color, colorTheme);
3837
colorTheme.primaryColor = color.ios;
3938
this.appColorScheme.primaryColorVariant = this.appColorScheme.primaryColor.colorWithAlphaComponent(0.24);
4039
// colorTheme.primaryColorVariant = new Color(61.2, color.r, color.g, color.b).ios; // default alpha is 0.24
@@ -53,10 +52,10 @@ export class Themer {
5352
}
5453

5554
setAccentColor(value: string | Color) {
56-
this.accentColor = value;
55+
this.setSecondaryColor(value);
5756
}
5857
getAccentColor(): string | Color {
59-
return this.accentColor;
58+
return this.getSecondaryColor();
6059
}
6160

6261
setSurfaceColor(value: string | Color) {

0 commit comments

Comments
 (0)