mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix tslint
Revert code that set currentEntry in fragment.transitions.android Update tests & apps runtime version Fix broken import in frame-tests Revert TabView to fire loaded for all TabViewItems
This commit is contained in:
1
tests/app/ui/frame/frame-tests.d.ts
vendored
1
tests/app/ui/frame/frame-tests.d.ts
vendored
@@ -1,4 +1,3 @@
|
|||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
//@private
|
//@private
|
||||||
import * as android from "./frame-tests.android";
|
import * as android from "./frame-tests.android";
|
||||||
import * as iOS from "./frame-tests.ios";
|
|
||||||
@@ -187,7 +187,6 @@ export function test_correct_layout_scrollable_content_true_flat_action_bar() {
|
|||||||
TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - navBarHeight - tabBarHeight");
|
TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - navBarHeight - tabBarHeight");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function test_correct_layout_scrollable_content_true_flat_action_bar_edges_span_under_opaque_bars() {
|
export function test_correct_layout_scrollable_content_true_flat_action_bar_edges_span_under_opaque_bars() {
|
||||||
const page = new Page();
|
const page = new Page();
|
||||||
(<any>page).scrollableContent = true;
|
(<any>page).scrollableContent = true;
|
||||||
|
|||||||
@@ -168,17 +168,6 @@ export class TabViewTest extends UITest<tabViewModule.TabView> {
|
|||||||
TKUnit.assertEqual(actualValue, expectedValue, "selectedIndex");
|
TKUnit.assertEqual(actualValue, expectedValue, "selectedIndex");
|
||||||
}
|
}
|
||||||
|
|
||||||
public testSettingNegativeSelectedIndexShouldThrow() {
|
|
||||||
var tabView = this.testView;
|
|
||||||
tabView.items = this._createItems(3);
|
|
||||||
this.waitUntilTestElementIsLoaded();
|
|
||||||
|
|
||||||
tabView.items.forEach((item, index, array) => {
|
|
||||||
const expected = index === tabView.selectedIndex;
|
|
||||||
TKUnit.assertEqual(item.isLoaded, expected);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public testBindingToTabEntryWithUndefinedViewShouldThrow = function () {
|
public testBindingToTabEntryWithUndefinedViewShouldThrow = function () {
|
||||||
var tabView = this.testView;
|
var tabView = this.testView;
|
||||||
this.waitUntilTestElementIsLoaded();
|
this.waitUntilTestElementIsLoaded();
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
"nativescript": {
|
"nativescript": {
|
||||||
"id": "org.nativescript.UnitTestApp",
|
"id": "org.nativescript.UnitTestApp",
|
||||||
"tns-ios": {
|
"tns-ios": {
|
||||||
"version": "3.1.0"
|
"version": "3.2.0"
|
||||||
},
|
},
|
||||||
"tns-android": {
|
"tns-android": {
|
||||||
"version": "3.1.1"
|
"version": "3.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -350,18 +350,6 @@ export class TabView extends TabViewBase {
|
|||||||
super.disposeNativeView();
|
super.disposeNativeView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public _loadEachChild(): void {
|
|
||||||
// We load childs once they are added to native parent or Frame
|
|
||||||
// cannot navigate because its nativeView is not added to window.
|
|
||||||
const index = this.selectedIndex;
|
|
||||||
if (index >= 0) {
|
|
||||||
const item = this.items[index];
|
|
||||||
if (!item.isLoaded && this.isLoaded) {
|
|
||||||
item.onLoaded();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private setAdapterItems(items: Array<TabViewItem>) {
|
private setAdapterItems(items: Array<TabViewItem>) {
|
||||||
(<any>this._pagerAdapter).items = items;
|
(<any>this._pagerAdapter).items = items;
|
||||||
|
|
||||||
@@ -405,19 +393,12 @@ export class TabView extends TabViewBase {
|
|||||||
this._viewPager.setOffscreenPageLimit(value);
|
this._viewPager.setOffscreenPageLimit(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[selectedIndexProperty.getDefault](): number {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
[selectedIndexProperty.setNative](value: number) {
|
[selectedIndexProperty.setNative](value: number) {
|
||||||
if (traceEnabled()) {
|
if (traceEnabled()) {
|
||||||
traceWrite("TabView this._viewPager.setCurrentItem(" + value + ", true);", traceCategory);
|
traceWrite("TabView this._viewPager.setCurrentItem(" + value + ", true);", traceCategory);
|
||||||
}
|
}
|
||||||
|
|
||||||
const item = this.items[value];
|
|
||||||
this._viewPager.setCurrentItem(value, true);
|
this._viewPager.setCurrentItem(value, true);
|
||||||
if (!item.isLoaded && this.isLoaded) {
|
|
||||||
item.onLoaded();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[itemsProperty.getDefault](): TabViewItem[] {
|
[itemsProperty.getDefault](): TabViewItem[] {
|
||||||
|
|||||||
@@ -356,9 +356,6 @@ export class TabView extends TabViewBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[selectedIndexProperty.getDefault](): number {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
[selectedIndexProperty.setNative](value: number) {
|
[selectedIndexProperty.setNative](value: number) {
|
||||||
if (traceEnabled()) {
|
if (traceEnabled()) {
|
||||||
traceWrite("TabView._onSelectedIndexPropertyChangedSetNativeValue(" + value + ")", traceCategories.Debug);
|
traceWrite("TabView._onSelectedIndexPropertyChangedSetNativeValue(" + value + ")", traceCategories.Debug);
|
||||||
|
|||||||
Reference in New Issue
Block a user