diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df7a483f..2ca487fb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,25 @@ Cross Platform Modules Changelog ============================== + +## [4.2.1](https://github.com/NativeScript/NativeScript/compare/4.2.0...4.2.1) (2018-09-18) + +### Bug Fixes + +* enable reportProgress property for NativeScirpt Angular's HTTPClient ([#6154](https://github.com/NativeScript/NativeScript/issues/6154)) ([349850f](https://github.com/NativeScript/NativeScript/commit/349850f)) +* **ios:** listview scrollToIndex crash with async data ([#6182](https://github.com/NativeScript/NativeScript/issues/6182)) ([ca6cccb](https://github.com/NativeScript/NativeScript/commit/ca6cccb)) +* **ios:** touch delegate does not call base class touch methods ([#6113](https://github.com/NativeScript/NativeScript/pull/6113)) ([284cd5](https://github.com/NativeScript/NativeScript/commit/284cd5)) +* **ios:** TimePicker minuteInterval property ([#6116](https://github.com/NativeScript/NativeScript/issues/6116)) ([ca9bad6](https://github.com/NativeScript/NativeScript/commit/ca9bad6)) +* **android:** parallel navigation actions should not be triggered ([#6275](https://github.com/NativeScript/NativeScript/issues/6275)) ([405ccae](https://github.com/NativeScript/NativeScript/commit/405ccae)) +* **android:** HEAD request should return statusCode ([fe35567](https://github.com/NativeScript/NativeScript/commit/fe35567)) +* observable array reduce bug ([#6219](https://github.com/NativeScript/NativeScript/issues/6219)) ([b028dd9](https://github.com/NativeScript/NativeScript/commit/b028dd9)) +* Page and Frame isLoaded undefined checks ([#6255](https://github.com/NativeScript/NativeScript/issues/6255)) ([4a11cf9](https://github.com/NativeScript/NativeScript/commit/4a11cf9)) +* **android/platform:** reinitialise screen metrics on orientation change ([#6164](https://github.com/NativeScript/NativeScript/issues/6164)) ([040781c](https://github.com/NativeScript/NativeScript/commit/040781c)) +* **ios:** nowrap label measure in horizontal stack layout ([#6186](https://github.com/NativeScript/NativeScript/issues/6186)) ([efd5f8d](https://github.com/NativeScript/NativeScript/commit/efd5f8d)) +* **list-view:** Layout list-view items on request ([#6159](https://github.com/NativeScript/NativeScript/issues/6159)) ([115a4c1](https://github.com/NativeScript/NativeScript/commit/115a4c1)) +* **modals:** application activityBackPressed event not fired for modals ([#6261](https://github.com/NativeScript/NativeScript/issues/6261)) ([13d4f34](https://github.com/NativeScript/NativeScript/commit/13d4f34)) + + # [4.2.0](https://github.com/NativeScript/NativeScript/compare/4.1.1...4.2.0) (2018-08-08) diff --git a/README.md b/README.md index 35b55a981..9b44f162d 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,6 @@ We [worked together with the Google Angular team](http://angularjs.blogspot.com/ ## Get Help -Please, use [github issues](https://github.com/NativeScript/NativeScript/issues) strictly for [reporting a bugs](CONTRIBUTING.md#bugs) or [requesting features](CONTRIBUTING.md#features). For general NativeScript questions and support, check out the [NativeScript community forum](https://discourse.nativescript.org/) or ask our experts in [NativeScript community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation). +Please, use [github issues](https://github.com/NativeScript/NativeScript/issues) strictly for [reporting a bugs](CONTRIBUTING.md#bugs) or [requesting features](CONTRIBUTING.md#features). For general NativeScript questions and support, check out [Stack Overflow](https://stackoverflow.com/questions/tagged/nativescript) or ask our experts in [NativeScript community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation). ![](https://ga-beacon.appspot.com/UA-111455-24/nativescript/nativescript?pixel) diff --git a/apps/app/ui-tests-app/events/main-page.ts b/apps/app/ui-tests-app/events/main-page.ts index 2033fb6b5..ae563e442 100644 --- a/apps/app/ui-tests-app/events/main-page.ts +++ b/apps/app/ui-tests-app/events/main-page.ts @@ -14,6 +14,7 @@ export function loadExamples() { examples.set("gestures", "events/gestures"); examples.set("touch", "events/touch-event"); examples.set("pan", "events/pan-event"); + examples.set("swipe-passtrough", "events/swipe-event-passtrough"); examples.set("handlers", "events/handlers"); examples.set("console", "events/console"); examples.set("i61", "events/i61"); diff --git a/apps/app/ui-tests-app/events/swipe-event-passtrough.ts b/apps/app/ui-tests-app/events/swipe-event-passtrough.ts new file mode 100644 index 000000000..3f768634a --- /dev/null +++ b/apps/app/ui-tests-app/events/swipe-event-passtrough.ts @@ -0,0 +1,22 @@ +import { EventData } from "tns-core-modules/data/observable"; +import { Page } from "tns-core-modules/ui/page"; +import { SwipeGestureEventData } from "tns-core-modules/ui/gestures"; +import { TextView } from "tns-core-modules/ui/text-view"; + +let outputText: TextView; +export function navigatingTo(args: EventData) { + var page = args.object; + outputText = page.getViewById("output"); +} + +export function onSwipe(data: SwipeGestureEventData) { + const msg = `swipe state:${data.direction}`; + console.log(msg); + outputText.text += msg + "\n"; +} + +export function onTap(args) { + const msg = `tapEvent triggered`; + console.log(msg); + outputText.text += msg + "\n"; +} diff --git a/apps/app/ui-tests-app/events/swipe-event-passtrough.xml b/apps/app/ui-tests-app/events/swipe-event-passtrough.xml new file mode 100644 index 000000000..2a92d765b --- /dev/null +++ b/apps/app/ui-tests-app/events/swipe-event-passtrough.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/apps/app/ui-tests-app/layouts/main-page.ts b/apps/app/ui-tests-app/layouts/main-page.ts index 3111f135b..5d0b7adf2 100644 --- a/apps/app/ui-tests-app/layouts/main-page.ts +++ b/apps/app/ui-tests-app/layouts/main-page.ts @@ -21,6 +21,7 @@ export function loadExamples() { examples.set("pgrid", "layouts-percent/grid"); examples.set("pstack", "layouts-percent/stack"); examples.set("pwrap", "layouts-percent/wrap"); + examples.set("passThroughParent", "layouts/passThroughParent"); examples.set("stacklayout-6059", "layouts/stacklayout-6059"); return examples; diff --git a/apps/app/ui-tests-app/layouts/passThroughParent.ts b/apps/app/ui-tests-app/layouts/passThroughParent.ts new file mode 100644 index 000000000..1080e0b3c --- /dev/null +++ b/apps/app/ui-tests-app/layouts/passThroughParent.ts @@ -0,0 +1,19 @@ +export function onOuterWrapLayoutTap() { + console.log("on outer wrap layout tap"); +} + +export function onStackLayoutThrowTap() { + throw new Error("Should not tap layout with IsPassThroughParentEnabled=true"); +} + +export function onUserInteractionDisabledTap() { + throw new Error("Should not tap button with IsUserInteractionEnabled=false"); +} + +export function onDisabledThrowTap() { + throw new Error("Should not tap button with IsEnabled=false"); +} + +export function onTap() { + console.log("on button tap"); +} \ No newline at end of file diff --git a/apps/app/ui-tests-app/layouts/passThroughParent.xml b/apps/app/ui-tests-app/layouts/passThroughParent.xml new file mode 100644 index 000000000..d6795f742 --- /dev/null +++ b/apps/app/ui-tests-app/layouts/passThroughParent.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/build-docs.sh b/build-docs.sh index e7bfa5a8d..1bea9fcee 100755 --- a/build-docs.sh +++ b/build-docs.sh @@ -27,7 +27,7 @@ extract_snippets() { npm install markdown-snippet-injector - for SNIPPET_DIR in {tests,apps,tns-core-modules} ; do + for SNIPPET_DIR in {tests/app,apps/app,tns-core-modules} ; do echo "Extracting snippets from: $SNIPPET_DIR" node "$BIN" --root="$SNIPPET_DIR" --target="$TARGET_DIR" \ --sourceext=".js|.ts|.xml|.html|.css" diff --git a/e2e/config/appium.capabilities.json b/e2e/config/appium.capabilities.json index c13c15e75..f7112699b 100644 --- a/e2e/config/appium.capabilities.json +++ b/e2e/config/appium.capabilities.json @@ -83,6 +83,18 @@ "fullReset": false, "app": "" }, + "android28": { + "platformName": "Android", + "platformVersion": "28", + "deviceName": "Emulator-Api28-Google", + "avd": "Emulator-Api28-Google", + "lt": 60000, + "appActivity": "com.tns.NativeScriptActivity", + "newCommandTimeout": 720, + "noReset": true, + "fullReset": false, + "app": "" + }, "sim.iPhone7.iOS110": { "platformName": "iOS", "platformVersion": "11.2", diff --git a/e2e/modal-navigation/app/android-back-button/android-back-button-page.ts b/e2e/modal-navigation/app/android-back-button/android-back-button-page.ts new file mode 100644 index 000000000..dcf20cde3 --- /dev/null +++ b/e2e/modal-navigation/app/android-back-button/android-back-button-page.ts @@ -0,0 +1,32 @@ +import { android as androidApp, AndroidActivityBackPressedEventData } from "tns-core-modules/application"; +import { fromObject, Observable } from "tns-core-modules/data/observable" + +let context: Observable; +function activityBackPressedCallback(args: AndroidActivityBackPressedEventData) { + if (context && context.get("shouldCancel")) { + context.set("shouldCancel", false); + context.set("message", "Back-pressed canceled!"); + args.cancel = true; + } +} +export function onLoaded(args) { + console.log("back-button modal test loaded"); + context = fromObject({ + message: "First back-press will be canceled", + shouldCancel: true + }); + + args.object.bindingContext = context; + + if (androidApp) { + androidApp.on("activityBackPressed", activityBackPressedCallback); + } +} + +export function onUnloaded(args) { + console.log("back-button modal test unloaded"); + + if (androidApp) { + androidApp.off("activityBackPressed", activityBackPressedCallback); + } +} diff --git a/e2e/modal-navigation/app/android-back-button/android-back-button-page.xml b/e2e/modal-navigation/app/android-back-button/android-back-button-page.xml new file mode 100644 index 000000000..3da48a7a9 --- /dev/null +++ b/e2e/modal-navigation/app/android-back-button/android-back-button-page.xml @@ -0,0 +1,4 @@ + + diff --git a/e2e/modal-navigation/app/app.android.css b/e2e/modal-navigation/app/app.android.css new file mode 100644 index 000000000..5151a975a --- /dev/null +++ b/e2e/modal-navigation/app/app.android.css @@ -0,0 +1,19 @@ +#home-page { + font-size: 8; + margin: 0px; + padding: 0px; +} + +#action-bar-home-page{ + font-size: 10; + margin: 0px; + padding: 0px; +} + +#home-page Button { + margin-bottom: 5px; + border-color: gray; + border-width: 2px; + border-radius: 8px; + padding: 0px; +} \ No newline at end of file diff --git a/e2e/modal-navigation/app/app.css b/e2e/modal-navigation/app/app.css index ff57461c5..e69de29bb 100644 --- a/e2e/modal-navigation/app/app.css +++ b/e2e/modal-navigation/app/app.css @@ -1,13 +0,0 @@ -/* -In NativeScript, the app.css file is where you place CSS rules that -you would like to apply to your entire application. Check out -http://docs.nativescript.org/ui/styling for a full list of the CSS -selectors and properties you can use to style UI components. - -/* -For example, the following CSS rule changes the font size of all UI -components that have the btn class name. -*/ -.btn { - font-size: 18; -} diff --git a/e2e/modal-navigation/app/app.ios.css b/e2e/modal-navigation/app/app.ios.css new file mode 100644 index 000000000..d123538c3 --- /dev/null +++ b/e2e/modal-navigation/app/app.ios.css @@ -0,0 +1,14 @@ + +#home-page { + font-size: 13; + margin: 0px; + padding: 0px; +} + +#home-page Button { + margin-bottom: 20px; + padding: 20px; + border-color: gray; + border-width: 2px; + border-radius: 8px; +} \ No newline at end of file diff --git a/e2e/modal-navigation/app/home/home-page.ts b/e2e/modal-navigation/app/home/home-page.ts index 6537e5b79..54cb458fa 100644 --- a/e2e/modal-navigation/app/home/home-page.ts +++ b/e2e/modal-navigation/app/home/home-page.ts @@ -57,6 +57,15 @@ export function onModalLayout(args: EventData) { false); } +export function onAndroidBackEvents(args: EventData) { + const view = args.object as View; + view.showModal( + "android-back-button/android-back-button-page", + null, + () => console.log("android-back-button modal page layout closed"), + true, true, true); +} + export function onModalTabView(args: EventData) { const fullscreen = false; const animated = false; diff --git a/e2e/modal-navigation/app/home/home-page.xml b/e2e/modal-navigation/app/home/home-page.xml index 4abbc0488..67a6197eb 100644 --- a/e2e/modal-navigation/app/home/home-page.xml +++ b/e2e/modal-navigation/app/home/home-page.xml @@ -1,23 +1,28 @@ - - - + navigatingFrom="onNavigatingFrom" + navigatedTo="onNavigatedTo" + navigatedFrom="onNavigatedFrom"> + + - -