Fixed xml-declaration tests.

This commit is contained in:
Nedyalko Nikolov
2017-01-11 14:35:31 +02:00
parent ae2012bc10
commit b4575e1d5b
14 changed files with 58 additions and 67 deletions

View File

@@ -192,7 +192,7 @@ export class Binding {
public loadedHandlerVisualTreeBinding(args) {
let target = args.object;
target.off(ViewBase.loadedEvent, this.loadedHandlerVisualTreeBinding, this);
target.off("loaded", this.loadedHandlerVisualTreeBinding, this);
if (!types.isNullOrUndefined(target.bindingContext)) {
this.bind(target.bindingContext);
}
@@ -288,8 +288,8 @@ export class Binding {
currentObject = parentView.bindingContext;
} else {
let targetInstance = this.target.get();
targetInstance.off(ViewBase.loadedEvent, this.loadedHandlerVisualTreeBinding, this);
targetInstance.on(ViewBase.loadedEvent, this.loadedHandlerVisualTreeBinding, this);
targetInstance.off("loaded", this.loadedHandlerVisualTreeBinding, this);
targetInstance.on("loaded", this.loadedHandlerVisualTreeBinding, this);
}
currentObjectChanged = true;

View File

@@ -362,7 +362,6 @@ export class InheritedProperty<T extends ViewBase, U> extends Property<T, U> imp
if (currentValue !== newValue) {
if (this.hasListeners(eventName)) {
console.log("Notify " + eventName);
this.notify({
eventName: eventName,
propertyName: name,

View File

@@ -1,5 +1,5 @@
import { GestureEventData, SwipeGestureEventData, PanGestureEventData, RotationGestureEventData, PinchGestureEventData } from "ui/gestures";
import { GesturesObserverBase, toString, TouchAction, GestureStateTypes, GestureTypes, SwipeDirection, View, EventData } from "./gestures-common";
import { GesturesObserverBase, toString, TouchAction, GestureStateTypes, GestureTypes, SwipeDirection, View, EventData } from "./gestures-common";
import { ios } from "utils/utils";
import getter = ios.getter;
@@ -92,8 +92,8 @@ export class GesturesObserver extends GesturesObserverBase {
this._detach();
};
this.target.on(View.loadedEvent, this._onTargetLoaded);
this.target.on(View.unloadedEvent, this._onTargetUnloaded);
this.target.on("loaded", this._onTargetLoaded);
this.target.on("unloaded", this._onTargetUnloaded);
if (this.target.isLoaded) {
this._attach(this.target, type);
@@ -183,8 +183,8 @@ export class GesturesObserver extends GesturesObserverBase {
this._detach();
if (this.target) {
this.target.off(View.loadedEvent, this._onTargetLoaded);
this.target.off(View.unloadedEvent, this._onTargetUnloaded);
this.target.off("loaded", this._onTargetLoaded);
this.target.off("unloaded", this._onTargetUnloaded);
this._onTargetLoaded = null;
this._onTargetUnloaded = null;

View File

@@ -67,5 +67,3 @@ export class HtmlView extends HtmlViewBase {
this._ios.attributedText = NSAttributedString.alloc().initWithDataOptionsDocumentAttributesError(nsData, <any>{ [NSDocumentTypeDocumentAttribute]: NSHTMLTextDocumentType }, null);
}
}
htmlProperty.register(HtmlView);

View File

@@ -1,5 +1,5 @@
declare module "ui/layouts/absolute-layout" {
import { LayoutBase, View, Property } from "ui/layouts/layout-base";
import { LayoutBase, View, Property, Length } from "ui/layouts/layout-base";
/**
* A layout that lets you specify exact locations (left/top coordinates) of its children.
@@ -8,31 +8,31 @@
/**
* Gets the value of the Left property from a given View.
*/
static getLeft(view: View): number;
static getLeft(view: View): Length;
/**
* Sets the value of the Left property from a given View.
*/
static setLeft(view: View, value: number): void;
static setLeft(view: View, value: Length): void;
/**
* Gets the value of the Top property from a given View.
*/
static getTop(view: View): number;
static getTop(view: View): Length;
/**
* Sets the value of the Top property from a given View.
*/
static setTop(view: View, value: number): void;
static setTop(view: View, value: Length): void;
}
/**
* Represents the observable property backing the left property.
*/
export const leftProperty: Property<View, number>;
export const leftProperty: Property<View, Length>;
/**
* Represents the observable property backing the top property.
*/
export const topProperty: Property<View, number>;
export const topProperty: Property<View, Length>;
}

View File

@@ -46,6 +46,7 @@ export abstract class SegmentedBarBase extends View implements SegmentedBarDefin
this.items = new Array<SegmentedBarItemBase>();
}
this.items.push(<SegmentedBarItemBase>value);
selectedIndexProperty.coerce(this);
}
}

View File

@@ -259,9 +259,9 @@ export class SegmentedBar extends SegmentedBarBase {
if (newItems) {
newItems.forEach((item, i, arr) => this.insertTab(item, i));
if (this.selectedIndex < 0) {
this.selectedIndex = tabHost.getCurrentTab();
}
// if (this.selectedIndex < 0) {
// this.selectedIndex = tabHost.getCurrentTab();
// }
}
}
}

View File

@@ -57,9 +57,9 @@ export class SegmentedBar extends SegmentedBarBase {
segmentedControl.insertSegmentWithTitleAtIndexAnimated(title, index, false);
})
if (this.selectedIndex < 0) {
this.selectedIndex = segmentedControl.selectedSegmentIndex;
}
// if (this.selectedIndex < 0) {
// this.selectedIndex = segmentedControl.selectedSegmentIndex;
// }
}
}

View File

@@ -91,6 +91,7 @@ export class TabViewBase extends View implements TabViewDefinition, AddChildFrom
}
this.items.push(<TabViewItemBase>value);
this._addView(value);
selectedIndexProperty.coerce(this);
}
}

View File

@@ -358,11 +358,6 @@ export class TabView extends TabViewBase {
const tv = tabLayout.getTextViewForItemAt(i);
item.setNativeView(tv);
});
let selectedIndex = this.selectedIndex;
if (selectedIndex < 0) {
this.selectedIndex = this._viewPager.getCurrentItem();
}
}
get [androidOffscreenTabLimitProperty.native](): number {

View File

@@ -268,10 +268,6 @@ export class TabView extends TabViewBase {
// When we set this._ios.viewControllers, someone is clearing the moreNavigationController.delegate, so we have to reassign it each time here.
this._ios.moreNavigationController.delegate = this._moreNavigationControllerDelegate;
if (this.selectedIndex < 0) {
this.selectedIndex = this._ios.selectedIndex;
}
}
private _getIconRenderingMode(): UIImageRenderingMode {