Files
NativeScript/tns-core-modules/ui/layouts/wrap-layout/wrap-layout.android.ts
Hristo Hristov 1d49f5f3c3 fix padding on text-view & text-field (#3758)
* fix padding on text-view & text-field
text-base is now snapshotable
view.android is now snapshotable

* createNativeView returns the nativeView for android
Fix image tests
Implement test for image loaded from res://
EffectivePaddings updated when nativeView have some from its native theme
2017-03-09 16:09:53 +02:00

41 lines
1.3 KiB
TypeScript

import { WrapLayoutBase, orientationProperty, itemWidthProperty, itemHeightProperty, Length } from "./wrap-layout-common";
export * from "./wrap-layout-common";
export class WrapLayout extends WrapLayoutBase {
private _layout: org.nativescript.widgets.WrapLayout;
get android(): org.nativescript.widgets.WrapLayout {
return this._layout;
}
get _nativeView(): org.nativescript.widgets.WrapLayout {
return this._layout;
}
public _createNativeView() {
const layout = this._layout = new org.nativescript.widgets.WrapLayout(this._context);
return layout;
}
get [orientationProperty.native](): "horizontal" | "vertical" {
return "vertical";
}
set [orientationProperty.native](value: "horizontal" | "vertical") {
this._layout.setOrientation(value === "vertical" ? org.nativescript.widgets.Orientation.vertical : org.nativescript.widgets.Orientation.horizontal)
}
get [itemWidthProperty.native](): Length {
return "auto";
}
set [itemWidthProperty.native](value: Length) {
this._layout.setItemWidth(Length.toDevicePixels(value, -1));
}
get [itemHeightProperty.native](): Length {
return "auto";
}
set [itemHeightProperty.native](value: Length) {
this._layout.setItemHeight(Length.toDevicePixels(value, -1));
}
}