Skip to content

Commit 67d1a3a

Browse files
committed
fix(textview): some textfield color related fixes
1 parent 5195da9 commit 67d1a3a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/textview/textview.android.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ export class TextView extends TextViewBase {
137137

138138
[floatingInactiveColorProperty.setNative](value: Color) {
139139
const placeholderColor = value instanceof Color ? value.android : value;
140-
const floatingColor = (this.floatingColor || (themer.getPrimaryColor() as Color)).android;
141-
this.layoutView.setDefaultHintTextColor(getFullColorStateList(floatingColor, placeholderColor));
140+
const primaryColor = themer.getPrimaryColor();
141+
const floatingColor = this.floatingColor || (primaryColor instanceof Color ? primaryColor : new Color(primaryColor));
142+
this.layoutView.setDefaultHintTextColor(getFullColorStateList(floatingColor instanceof Color ? floatingColor.android : floatingColor, placeholderColor));
142143
}
143144

144145
public _configureEditText(editText: android.widget.EditText): void {
@@ -234,7 +235,9 @@ export class TextView extends TextViewBase {
234235
const inactiveColor = this.strokeInactiveColor instanceof Color ? this.strokeInactiveColor.android : undefined;
235236
const disabledColor = this.strokeDisabledColor instanceof Color ? this.strokeDisabledColor.android : undefined;
236237
const colorStateList = getFullColorStateList(color, inactiveColor, disabledColor);
237-
this.layoutView.setBoxStrokeColorStateList(colorStateList);
238+
if (colorStateList) {
239+
this.layoutView.setBoxStrokeColorStateList(colorStateList);
240+
}
238241
} else {
239242
this.layoutView.setBoxStrokeColor(color);
240243
}

0 commit comments

Comments
 (0)