Skip to content

Commit f5f65d4

Browse files
author
Anthony Salamanca
committed
also implement for textview
1 parent 5cf2098 commit f5f65d4

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

src/textview/textview.android.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
floatingColorProperty,
55
floatingInactiveColorProperty,
66
floatingProperty,
7+
helperColorProperty,
78
helperProperty,
89
maxLengthProperty,
910
strokeColorProperty,
@@ -104,6 +105,10 @@ export class TextView extends TextViewBase {
104105
this.layoutView.setHint(text);
105106
}
106107

108+
[helperColorProperty.setNative](value) {
109+
const color = value instanceof Color ? value.android : value;
110+
this.layoutView.setHelperTextColor(android.content.res.ColorStateList.valueOf(color));
111+
}
107112
[placeholderColorProperty.setNative](value: Color) {
108113
const placeholderColor = value instanceof Color ? value.android : value;
109114
const floatingColor = this.floatingColor instanceof Color ? this.floatingColor.android : placeholderColor;

src/textview/textview.common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export abstract class TextViewBase extends NSTextView {
77
abstract clearFocus();
88

99
@cssProperty helper: string;
10+
@cssProperty helperColor: Color;
1011
@cssProperty maxLength: number;
1112
@cssProperty errorColor: Color;
1213
@cssProperty floating: boolean;

src/textview/textview.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class TextView extends EditableTextBase {
1212
nativeViewProtected: any;
1313

1414
helper: string;
15+
helperColor: Color;
1516
maxLength: number;
1617
errorColor: Color;
1718
floating: boolean;

src/textview/textview.ios.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
floatingColorProperty,
77
floatingInactiveColorProperty,
88
floatingProperty,
9+
helperColorProperty,
910
helperProperty,
1011
maxLengthProperty,
1112
strokeColorProperty,
@@ -312,6 +313,11 @@ export class TextView extends TextViewBase {
312313
[helperProperty.setNative](value: string) {
313314
this._controller.helperText = value;
314315
}
316+
[helperColorProperty.setNative](value: string | Color) {
317+
const temp = typeof value === 'string' ? new Color(value) : value;
318+
const color: UIColor = temp.ios;
319+
this._controller.leadingUnderlineLabelTextColor = color;
320+
}
315321
[maxLengthProperty.setNative](value: number) {
316322
this._controller.characterCountMax = value;
317323
}

0 commit comments

Comments
 (0)