Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefuge committed Jan 10, 2024
1 parent f0752c5 commit 6d06106
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
15 changes: 0 additions & 15 deletions src/textfield/textfield.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ export class TextField extends TextFieldBase {
const nColor = getColorStateList(color);
this.layoutView.setErrorTextColor(nColor);
// TODO: find why it fails in cli build
//@ts-ignore
this.layoutView.setBoxStrokeErrorColor(nColor);
}

Expand All @@ -223,26 +222,19 @@ export class TextField extends TextFieldBase {
this.layoutView.setHintEnabled(!!value);
}
[strokeWidthProperty.setNative](value: CoreTypes.LengthType) {
// TODO: find why it fails in cli build
//@ts-ignore
this.layoutView.setBoxStrokeWidth(Length.toDevicePixels(value, 0));
}

[strokeWidthFocusedProperty.setNative](value: CoreTypes.LengthType) {
// TODO: find why it fails in cli build
//@ts-ignore
this.layoutView.setBoxStrokeWidthFocused(Length.toDevicePixels(value, 0));
}

[strokeColorProperty.setNative](value: Color | string) {
const color = value ? (value instanceof Color ? value.android : new Color(value).android) : null;
// TODO: find why it fails in cli build
//@ts-ignore
if (this.layoutView.setBoxStrokeColorStateList) {
const inactiveColor = this.strokeInactiveColor instanceof Color ? this.strokeInactiveColor.android : undefined;
const disabledColor = this.strokeDisabledColor instanceof Color ? this.strokeDisabledColor.android : undefined;
const colorStateList = getFullColorStateList(color, inactiveColor, disabledColor);
//@ts-ignore
this.layoutView.setBoxStrokeColorStateList(colorStateList);
} else {
this.layoutView.setBoxStrokeColor(color);
Expand All @@ -251,27 +243,20 @@ export class TextField extends TextFieldBase {

[strokeInactiveColorProperty.setNative](value: Color | string) {
const color = value ? (value instanceof Color ? value.android : new Color(value).android) : null;

// TODO: find why it fails in cli build
//@ts-ignore
if (this.layoutView.setBoxStrokeColorStateList) {
const activeColor = this.strokeColor instanceof Color ? this.strokeColor.android : this.layoutView.getBoxStrokeColor();
const disabledColor = this.strokeDisabledColor instanceof Color ? this.strokeDisabledColor.android : undefined;
const colorStateList = getFullColorStateList(activeColor, color, disabledColor);
//@ts-ignore
this.layoutView.setBoxStrokeColorStateList(colorStateList);
}
}

[strokeDisabledColorProperty.setNative](value: Color | string) {
const color = value ? (value instanceof Color ? value.android : new Color(value).android) : null;
// TODO: find why it fails in cli build
//@ts-ignore
if (this.layoutView.setBoxStrokeColorStateList) {
const activeColor = this.strokeColor instanceof Color ? this.strokeColor.android : this.layoutView.getBoxStrokeColor();
const inactiveColor = this.strokeInactiveColor instanceof Color ? this.strokeInactiveColor.android : undefined;
const colorStateList = getFullColorStateList(activeColor, inactiveColor, color);
//@ts-ignore
this.layoutView.setBoxStrokeColorStateList(colorStateList);
}
}
Expand Down
9 changes: 0 additions & 9 deletions src/textview/textview.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,42 +217,33 @@ export class TextView extends TextViewBase {
[strokeInactiveColorProperty.setNative](value: Color) {
const color = value instanceof Color ? value.android : value;
const layoutView = this.layoutView;
// TODO: find why it fails in cli build
//@ts-ignore
if (layoutView.setBoxStrokeColorStateList) {
const activeColor = this.strokeColor instanceof Color ? this.strokeColor.android : layoutView.getBoxStrokeColor();
const disabledColor = this.strokeDisabledColor instanceof Color ? this.strokeDisabledColor.android : undefined;
const colorStateList = getFullColorStateList(activeColor, color, disabledColor);
//@ts-ignore
layoutView.setBoxStrokeColorStateList(colorStateList);
}
}

[strokeDisabledColorProperty.setNative](value: Color) {
const color = value instanceof Color ? value.android : value;
const layoutView = this.layoutView;
// TODO: find why it fails in cli build
//@ts-ignore
if (layoutView.setBoxStrokeColorStateList) {
const activeColor = this.strokeColor instanceof Color ? this.strokeColor.android : layoutView.getBoxStrokeColor();
const inactiveColor = this.strokeInactiveColor instanceof Color ? this.strokeInactiveColor.android : undefined;
const colorStateList = getFullColorStateList(activeColor, inactiveColor, color);
//@ts-ignore
layoutView.setBoxStrokeColorStateList(colorStateList);
}
}

[strokeColorProperty.setNative](value: Color) {
const color = value instanceof Color ? value.android : value;
const layoutView = this.layoutView;
// TODO: find why it fails in cli build
//@ts-ignore
if (layoutView.setBoxStrokeColorStateList) {
const inactiveColor = this.strokeInactiveColor instanceof Color ? this.strokeInactiveColor.android : undefined;
const disabledColor = this.strokeDisabledColor instanceof Color ? this.strokeDisabledColor.android : undefined;
const colorStateList = getFullColorStateList(color, inactiveColor, disabledColor);
if (colorStateList) {
//@ts-ignore
layoutView.setBoxStrokeColorStateList(colorStateList);
}
} else {
Expand Down

0 comments on commit 6d06106

Please sign in to comment.