Skip to content

Commit 6e285ae

Browse files
author
farfromrefuge
committed
fix(textfield,textview): android padding was using wrong unit
1 parent 77aaa7c commit 6e285ae

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

src/textfield/textfield.android.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -332,30 +332,30 @@ export class TextField extends TextFieldBase {
332332
this.nativeTextViewProtected.setTypeface(value instanceof Font ? value.getAndroidTypeface() : value);
333333
}
334334
}
335-
[paddingTopProperty.setNative](value: CoreTypes.LengthType) {
336-
org.nativescript.widgets.ViewHelper.setPaddingTop(
337-
this.nativeTextViewProtected,
338-
Utils.layout.toDeviceIndependentPixels(Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderTopWidth, 0))
339-
);
340-
}
341-
[paddingRightProperty.setNative](value: CoreTypes.LengthType) {
342-
org.nativescript.widgets.ViewHelper.setPaddingRight(
343-
this.nativeTextViewProtected,
344-
Utils.layout.toDeviceIndependentPixels(Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderRightWidth, 0))
345-
);
346-
}
347-
[paddingBottomProperty.setNative](value: CoreTypes.LengthType) {
348-
org.nativescript.widgets.ViewHelper.setPaddingBottom(
349-
this.nativeTextViewProtected,
350-
Utils.layout.toDeviceIndependentPixels(Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderBottomWidth, 0))
351-
);
352-
}
353-
[paddingLeftProperty.setNative](value: CoreTypes.LengthType) {
354-
org.nativescript.widgets.ViewHelper.setPaddingLeft(
355-
this.nativeTextViewProtected,
356-
Utils.layout.toDeviceIndependentPixels(Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0))
357-
);
358-
}
335+
// [paddingTopProperty.setNative](value: CoreTypes.LengthType) {
336+
// org.nativescript.widgets.ViewHelper.setPaddingTop(
337+
// this.nativeTextViewProtected,
338+
// Utils.layout.toDeviceIndependentPixels(Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderTopWidth, 0))
339+
// );
340+
// }
341+
// [paddingRightProperty.setNative](value: CoreTypes.LengthType) {
342+
// org.nativescript.widgets.ViewHelper.setPaddingRight(
343+
// this.nativeTextViewProtected,
344+
// Utils.layout.toDeviceIndependentPixels(Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderRightWidth, 0))
345+
// );
346+
// }
347+
// [paddingBottomProperty.setNative](value: CoreTypes.LengthType) {
348+
// org.nativescript.widgets.ViewHelper.setPaddingBottom(
349+
// this.nativeTextViewProtected,
350+
// Utils.layout.toDeviceIndependentPixels(Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderBottomWidth, 0))
351+
// );
352+
// }
353+
// [paddingLeftProperty.setNative](value: CoreTypes.LengthType) {
354+
// org.nativescript.widgets.ViewHelper.setPaddingLeft(
355+
// this.nativeTextViewProtected,
356+
// Utils.layout.toDeviceIndependentPixels(Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0))
357+
// );
358+
// }
359359
[textAlignmentProperty.setNative](value: CoreTypes.TextAlignmentType) {
360360
this.nativeTextViewProtected.setGravity(getHorizontalGravity(value) | getVerticalGravity(this.verticalTextAlignment));
361361
}

src/textview/textview.android.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -306,18 +306,18 @@ export class TextView extends TextViewBase {
306306
this.nativeTextViewProtected.setTypeface(value instanceof Font ? value.getAndroidTypeface() : value);
307307
}
308308
}
309-
[paddingTopProperty.setNative](value: CoreTypes.LengthType) {
310-
org.nativescript.widgets.ViewHelper.setPaddingTop(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderTopWidth, 0));
311-
}
312-
[paddingRightProperty.setNative](value: CoreTypes.LengthType) {
313-
org.nativescript.widgets.ViewHelper.setPaddingRight(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderRightWidth, 0));
314-
}
315-
[paddingBottomProperty.setNative](value: CoreTypes.LengthType) {
316-
org.nativescript.widgets.ViewHelper.setPaddingBottom(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderBottomWidth, 0));
317-
}
318-
[paddingLeftProperty.setNative](value: CoreTypes.LengthType) {
319-
org.nativescript.widgets.ViewHelper.setPaddingLeft(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0));
320-
}
309+
// [paddingTopProperty.setNative](value: CoreTypes.LengthType) {
310+
// org.nativescript.widgets.ViewHelper.setPaddingTop(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderTopWidth, 0));
311+
// }
312+
// [paddingRightProperty.setNative](value: CoreTypes.LengthType) {
313+
// org.nativescript.widgets.ViewHelper.setPaddingRight(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderRightWidth, 0));
314+
// }
315+
// [paddingBottomProperty.setNative](value: CoreTypes.LengthType) {
316+
// org.nativescript.widgets.ViewHelper.setPaddingBottom(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderBottomWidth, 0));
317+
// }
318+
// [paddingLeftProperty.setNative](value: CoreTypes.LengthType) {
319+
// org.nativescript.widgets.ViewHelper.setPaddingLeft(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0));
320+
// }
321321
[textAlignmentProperty.setNative](value: CoreTypes.TextAlignmentType) {
322322
this.nativeTextViewProtected.setGravity(getHorizontalGravity(value) | getVerticalGravity(this.verticalTextAlignment));
323323
}

0 commit comments

Comments
 (0)