mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
iOS layout positioning now respects native properties like automaticallyAdjustsScrollViewInsets, edgesForExtendedLayout, extendedLayoutIncludesOpaqueBars, navigationBar.translucent, tabBar.translucent Removed frame-tests.ios.ts - those tests are now invalid Added new layout tests inside page-tests.ios.ts Commented few asserts in scroll-view-tests View now expose ios namespace with layoutView method and UILayoutViewController used by page, tab-view and application module ViewBase now expose viewController property that should be set from all widgets that are using viewcontrollers internally (like Page, Frame, TabView) ViewBase now sets ios property to either the view returned from createNativeView or to nativeViewProptected fragment.transitions now use animation/transition start to add fragments to waitingQueue. Before we did it manually in navigate/goBack. This way we can reuse the fragment.transition when calling showDialog. Also when animation/transition ends we check the animation/transition to see if this fragment should be set as current. Frame expose new loadViewFromEntry method (to load a view from URI) Frame navigation happens once frame is loaded Frame now supports Page as a child in XML Fixed GridLayout row, rowSpan, column, columnSpan properties type Fixed bug in GridLayout where add/remove of columns/rows won't update the internal state of the grid (backport from android when GridLayout is recycled) ListView will no longer invalidate layout when cell is removed Fixed bug in ScrollView ios where effectiveMinWidth/Height was multiplied to density (it is already on device pixels so no need to multiply) TabView android now calls loaded only on the selected child (not all) Core refactoring
182 lines
4.3 KiB
TypeScript
182 lines
4.3 KiB
TypeScript
/**
|
|
* @module "ui/layouts/grid-layout"
|
|
*/ /** */
|
|
|
|
import { LayoutBase, Property, View } from "../layout-base";
|
|
|
|
/**
|
|
* Defines row/column specific properties that apply to GridLayout elements.
|
|
*/
|
|
export class ItemSpec {
|
|
|
|
constructor();
|
|
constructor(value: number, type: GridUnitType);
|
|
|
|
/**
|
|
* Gets the actual length of an ItemSpec.
|
|
*/
|
|
actualLength: number;
|
|
|
|
/**
|
|
* Returns unit type of this ItemSpec instance.
|
|
*/
|
|
gridUnitType: GridUnitType;
|
|
|
|
/**
|
|
* Returns true if this ItemSpec instance holds
|
|
* an absolute (pixel) value.
|
|
*/
|
|
isAbsolute: boolean;
|
|
|
|
/**
|
|
* Returns true if this GridLength instance is
|
|
* automatic (not specified).
|
|
*/
|
|
isAuto: boolean;
|
|
|
|
/**
|
|
* Returns true if this ItemSpec instance holds weighted proportion
|
|
* of available space.
|
|
*/
|
|
isStar: boolean;
|
|
|
|
/**
|
|
* Returns value part of this ItemSpec instance.
|
|
*/
|
|
value: number;
|
|
}
|
|
|
|
/**
|
|
* Defines a rectangular layout area that consists of columns and rows.
|
|
*/
|
|
export class GridLayout extends LayoutBase {
|
|
|
|
/**
|
|
* Gets the value of the Column attached property from a given View.
|
|
*/
|
|
static getColumn(view: View): number;
|
|
|
|
/**
|
|
* Sets the value of the Column attached property to a given View.
|
|
*/
|
|
static setColumn(view: View, value: number): void;
|
|
|
|
/**
|
|
* Gets the value of the ColumnSpan attached property from a given View.
|
|
*/
|
|
static getColumnSpan(view: View): number;
|
|
|
|
/**
|
|
* Sets the value of the ColumnSpan attached property to a given View.
|
|
*/
|
|
static setColumnSpan(view: View, value: number): void;
|
|
|
|
/**
|
|
* Gets the value of the Row attached property from a given View.
|
|
*/
|
|
static getRow(view: View): number;
|
|
|
|
/**
|
|
* Sets the value of the Row attached property to a given View.
|
|
*/
|
|
static setRow(view: View, value: number): void;
|
|
|
|
/**
|
|
* Gets the value of the RowSpan attached property from a given View.
|
|
*/
|
|
static getRowSpan(view: View): number;
|
|
|
|
/**
|
|
* Sets the value of the RowSpan attached property to a given View.
|
|
*/
|
|
static setRowSpan(view: View, value: number): void;
|
|
|
|
/**
|
|
* Adds a column specification to a GridLayout.
|
|
*/
|
|
public addColumn(itemSpec: ItemSpec): void;
|
|
|
|
/**
|
|
* Adds a row specification to a GridLayout.
|
|
*/
|
|
public addRow(itemSpec: ItemSpec): void;
|
|
|
|
/**
|
|
* Removes a column specification from a GridLayout.
|
|
*/
|
|
public removeColumn(itemSpec: ItemSpec): void;
|
|
|
|
/**
|
|
* Removes all column specifications from a GridLayout.
|
|
*/
|
|
public removeColumns(): void;
|
|
|
|
/**
|
|
* Removes a row specification from a GridLayout.
|
|
*/
|
|
public removeRow(itemSpec: ItemSpec): void;
|
|
|
|
/**
|
|
* Removes all row specifications from a GridLayout.
|
|
*/
|
|
public removeRows(): void;
|
|
|
|
/**
|
|
* Gets array of column specifications defined on this instance of GridLayout.
|
|
*/
|
|
public getColumns(): Array<ItemSpec>;
|
|
|
|
/**
|
|
* Gets array of row specifications defined on this instance of GridLayout.
|
|
*/
|
|
public getRows(): Array<ItemSpec>;
|
|
|
|
//@private
|
|
/**
|
|
* @private
|
|
*/
|
|
public _onRowAdded(itemSpec: ItemSpec): void;
|
|
/**
|
|
* @private
|
|
*/
|
|
public _onColumnAdded(itemSpec: ItemSpec): void;
|
|
/**
|
|
* @private
|
|
*/
|
|
public _onRowRemoved(itemSpec: ItemSpec, index: number): void;
|
|
/**
|
|
* @private
|
|
*/
|
|
public _onColumnRemoved(itemSpec: ItemSpec, index: number): void;
|
|
//@endprivate
|
|
}
|
|
|
|
/**
|
|
* Represents the observable property backing the column property.
|
|
*/
|
|
export const columnProperty: Property<View, number>;
|
|
|
|
/**
|
|
* Represents the observable property backing the columnSpan property.
|
|
*/
|
|
export const columnSpanProperty: Property<View, number>;
|
|
|
|
/**
|
|
* Represents the observable property backing the row property.
|
|
*/
|
|
export const rowProperty: Property<View, number>;
|
|
|
|
/**
|
|
* Represents the observable property backing the rowSpan property.
|
|
*/
|
|
export const rowSpanProperty: Property<View, number>;
|
|
|
|
export type GridUnitType = "pixel" | "star" | "auto";
|
|
export namespace GridUnitType {
|
|
export const PIXEL: "pixel";
|
|
export const STAR: "star";
|
|
export const AUTO: "auto";
|
|
export function isValid(value: any): boolean;
|
|
export function parse(value: string): GridUnitType;
|
|
}
|