From 32fb5bfb58c443fcdf5c8815df225127a0fab9eb Mon Sep 17 00:00:00 2001 From: hamidbsd <50081218+hamidbsd@users.noreply.github.com> Date: Wed, 27 Nov 2019 20:17:57 +0300 Subject: [PATCH 1/7] fix the crash --- nativescript-core/ui/core/view/view.android.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nativescript-core/ui/core/view/view.android.ts b/nativescript-core/ui/core/view/view.android.ts index c6a3132f2..b11f7d73b 100644 --- a/nativescript-core/ui/core/view/view.android.ts +++ b/nativescript-core/ui/core/view/view.android.ts @@ -380,11 +380,13 @@ export class View extends ViewCommon { @profile public onUnloaded() { if (this.touchListenerIsSet) { - this.nativeViewProtected.setOnTouchListener(null); this.touchListenerIsSet = false; - this.nativeViewProtected.setClickable(this._isClickable); + if (this.nativeViewProtected) { + this.nativeViewProtected.setOnTouchListener(null); + this.nativeViewProtected.setClickable(this._isClickable); + } } - + this._manager = null; this._rootManager = null; super.onUnloaded(); From 9a6695f8383353c8d0c9fa048066d3da82cd8073 Mon Sep 17 00:00:00 2001 From: Vasil Trifonov Date: Mon, 9 Dec 2019 15:27:04 +0200 Subject: [PATCH 2/7] chore: update MaterialComponents pod (#8176) * chore: update MaterialComponents pod * chore: remove copy of pod file in build script --- build/prepare-compat.sh | 4 ---- nativescript-core/platforms/ios/Podfile | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/build/prepare-compat.sh b/build/prepare-compat.sh index 82e548500..8d09bcc37 100755 --- a/build/prepare-compat.sh +++ b/build/prepare-compat.sh @@ -31,10 +31,6 @@ NATIVESCRIPT_CORE_ARGS=${NATIVESCRIPT_CORE_ARGS:-$DEFAULT_NATIVESCRIPT_CORE_ARGS echo "Copying $PACKAGE_SOURCE $DIST/$PACKAGE..." npx ncp "$PACKAGE_SOURCE" "$DIST/$PACKAGE" - echo "TODO(REMOVE THIS HACK): Copying platfroms/ios/Podfile" - mkdir -p "$DIST/$PACKAGE/platforms/ios" - npx ncp "nativescript-core/platforms/ios/Podfile" "$DIST/$PACKAGE/platforms/ios/Podfile" - echo "Copying README and LICENSE to $DIST/$PACKAGE" npx ncp LICENSE "$DIST"/"$PACKAGE"/LICENSE diff --git a/nativescript-core/platforms/ios/Podfile b/nativescript-core/platforms/ios/Podfile index 8bdf3a050..7ba729baa 100644 --- a/nativescript-core/platforms/ios/Podfile +++ b/nativescript-core/platforms/ios/Podfile @@ -1,4 +1,4 @@ platform :ios, '9.0' use_frameworks! -pod 'MaterialComponents/Tabs', '~> 92.3' \ No newline at end of file +pod 'MaterialComponents/Tabs', '~> 94.5' \ No newline at end of file From ff710b76926014e261419bedaa22dfc5c6731794 Mon Sep 17 00:00:00 2001 From: Vasil Trifonov Date: Mon, 9 Dec 2019 16:22:30 +0200 Subject: [PATCH 3/7] chore: cut the 6.3.0 release (#8174) --- CHANGELOG.md | 21 +++++++++++++++++++++ e2e/scoped-packages/package.json | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e72aaab8f..af4d43c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +# [6.3.0](https://github.com/NativeScript/NativeScript/compare/6.2.2...6.3.0) (2019-12-06) + + +### Bug Fixes + +* **android:** Fatal Exception: java.lang.OutOfMemoryError ([#8061](https://github.com/NativeScript/NativeScript/issues/8061)) ([8d382a6](https://github.com/NativeScript/NativeScript/commit/8d382a6b2e722e9298becdcfb3b43a41352a9136)) +* **grid-layout:** value parser will now accept strings or numbers ([#8042](https://github.com/NativeScript/NativeScript/issues/8042)) ([3199a39](https://github.com/NativeScript/NativeScript/commit/3199a392b45635606e06119845099965246395c3)) +* **iOS:** Opening alert/confirm on top most of modal dialogs ([#7982](https://github.com/NativeScript/NativeScript/issues/7982)) ([60ac4e7](https://github.com/NativeScript/NativeScript/commit/60ac4e7a05c9e627eb9fc7a1bdf004c7fca99817)), closes [#6939](https://github.com/NativeScript/NativeScript/issues/6939) +* nested css-calc and css-variables with fallback ([#7987](https://github.com/NativeScript/NativeScript/issues/7987)) ([fc2a233](https://github.com/NativeScript/NativeScript/commit/fc2a233e9598def50969247c1516c32260b7e283)) + + +### Features + +* **css:** Added optional css-tree parser ([#8076](https://github.com/NativeScript/NativeScript/issues/8076)) ([49a7607](https://github.com/NativeScript/NativeScript/commit/49a7607f4e0f3d359820b5ae731f806966de2921)) +* **dialogs:** Setting the size of popup dialog thru dialog options ([#8041](https://github.com/NativeScript/NativeScript/issues/8041)) ([cd5703a](https://github.com/NativeScript/NativeScript/commit/cd5703a6b79598031ef334a9cf3132e688422aba)) +* support requestAnimationFrame ([#8112](https://github.com/NativeScript/NativeScript/issues/8112)) ([2aa6e9b](https://github.com/NativeScript/NativeScript/commit/2aa6e9bf922286f9ffd747f901dbc922cd9446b9)) +* System css classes for modals ([#8155](https://github.com/NativeScript/NativeScript/issues/8155)) ([7b78f3b](https://github.com/NativeScript/NativeScript/commit/7b78f3b0c640d9d43026744b919a03996191f788)) +* **modal-view-ios:** handle iOS 13 dismiss modal gesture ([#8024](https://github.com/NativeScript/NativeScript/issues/8024)) ([c5df258](https://github.com/NativeScript/NativeScript/commit/c5df2580439c24c57fb364cba91050a00e391c35)) + + + ## [6.2.2](https://github.com/NativeScript/NativeScript/compare/6.2.1...6.2.2) (2019-11-25) diff --git a/e2e/scoped-packages/package.json b/e2e/scoped-packages/package.json index 603688e15..5ccc47b88 100644 --- a/e2e/scoped-packages/package.json +++ b/e2e/scoped-packages/package.json @@ -13,9 +13,9 @@ "license": "SEE LICENSE IN ", "repository": "", "dependencies": { - "@nativescript/core": "file:../../dist/nativescript-core-6.2.0.tgz", + "@nativescript/core": "file:../../dist/nativescript-core-6.3.0.tgz", "nativescript-theme-core": "~1.0.6", - "tns-core-modules": "file:../../dist/tns-core-modules-6.2.0.tgz" + "tns-core-modules": "file:../../dist/tns-core-modules-6.3.0.tgz" }, "devDependencies": { "nativescript-dev-webpack": "~1.2.0", From e5dc0de54a513b77aedbdd5ae83654eb62370c6f Mon Sep 17 00:00:00 2001 From: Dimitar Topuzov Date: Mon, 16 Dec 2019 10:43:16 +0200 Subject: [PATCH 4/7] hore: cut the 6.3.1 release --- CHANGELOG.md | 9 +++++++++ nativescript-core/package.json | 2 +- tns-core-modules-package/package.json | 2 +- tns-platform-declarations/package.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af4d43c54..168be840c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [6.3.1](https://github.com/NativeScript/NativeScript/compare/6.3.0...6.3.1) (2019-12-16) + + +### Bug Fixes + +* null reference exception in view.android.onUnloaded ([#8153](https://github.com/NativeScript/NativeScript/issues/8153)) ([da639f2](https://github.com/NativeScript/NativeScript/commit/da639f2)) + + + # [6.3.0](https://github.com/NativeScript/NativeScript/compare/6.2.2...6.3.0) (2019-12-06) diff --git a/nativescript-core/package.json b/nativescript-core/package.json index 5ff92805f..40923a866 100644 --- a/nativescript-core/package.json +++ b/nativescript-core/package.json @@ -3,7 +3,7 @@ "main": "index", "types": "index.d.ts", "description": "Telerik NativeScript Core Modules", - "version": "6.3.0", + "version": "6.3.1", "homepage": "https://www.nativescript.org", "repository": { "type": "git", diff --git a/tns-core-modules-package/package.json b/tns-core-modules-package/package.json index 80898b426..2be2790cc 100644 --- a/tns-core-modules-package/package.json +++ b/tns-core-modules-package/package.json @@ -3,7 +3,7 @@ "main": "index", "types": "index.d.ts", "description": "Telerik NativeScript Core Modules", - "version": "6.3.0", + "version": "6.3.1", "homepage": "https://www.nativescript.org", "repository": { "type": "git", diff --git a/tns-platform-declarations/package.json b/tns-platform-declarations/package.json index efdf880e3..2bb0ff065 100644 --- a/tns-platform-declarations/package.json +++ b/tns-platform-declarations/package.json @@ -1,6 +1,6 @@ { "name": "tns-platform-declarations", - "version": "6.3.0", + "version": "6.3.1", "description": "Platform-specific TypeScript declarations for NativeScript for accessing native objects", "main": "", "scripts": { From d1858f81b7e2e8df78cd466f8a74807ceddbeb54 Mon Sep 17 00:00:00 2001 From: Alexander Vakrilov Date: Tue, 17 Dec 2019 08:57:30 +0200 Subject: [PATCH 5/7] fix: handle fake attach after FragMgr is destroyed (#8200) --- .../ui/bottom-navigation/bottom-navigation.android.ts | 4 ++-- nativescript-core/ui/frame/frame.android.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts b/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts index 077a4096c..0f253dfa1 100644 --- a/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts +++ b/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts @@ -385,14 +385,14 @@ export class BottomNavigation extends TabNavigationBase { _onAttachedToWindow(): void { super._onAttachedToWindow(); - this._attachedToWindow = true; // _onAttachedToWindow called from OS again after it was detach // TODO: Consider testing and removing it when update to androidx.fragment:1.2.0 if (this._manager && this._manager.isDestroyed()) { return; } - + + this._attachedToWindow = true; this.changeTab(this.selectedIndex); } diff --git a/nativescript-core/ui/frame/frame.android.ts b/nativescript-core/ui/frame/frame.android.ts index e06248e64..286575b3c 100644 --- a/nativescript-core/ui/frame/frame.android.ts +++ b/nativescript-core/ui/frame/frame.android.ts @@ -150,14 +150,14 @@ export class Frame extends FrameBase { _onAttachedToWindow(): void { super._onAttachedToWindow(); - this._attachedToWindow = true; - + // _onAttachedToWindow called from OS again after it was detach // TODO: Consider testing and removing it when update to androidx.fragment:1.2.0 if (this._manager && this._manager.isDestroyed()) { return; } - + + this._attachedToWindow = true; this._processNextNavigationEntry(); } From 4b00376957196295dd5231e2de0a7b10635f3e69 Mon Sep 17 00:00:00 2001 From: Alexander Vakrilov Date: Tue, 17 Dec 2019 12:04:32 +0200 Subject: [PATCH 6/7] fix: check is disposed fragment is in the FragmentManager (#8201) --- .../ui/core/view/view.android.ts | 2 ++ nativescript-core/ui/frame/frame.android.ts | 19 +++++++++++++------ nativescript-core/utils/utils.ios.ts | 4 ---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/nativescript-core/ui/core/view/view.android.ts b/nativescript-core/ui/core/view/view.android.ts index b11f7d73b..244edad35 100644 --- a/nativescript-core/ui/core/view/view.android.ts +++ b/nativescript-core/ui/core/view/view.android.ts @@ -155,6 +155,8 @@ function initializeDialogFragment() { const ownerId = this.getArguments().getInt(DOMID); const options = getModalOptions(ownerId); this.owner = options.owner; + // Set owner._dialogFragment to this in case the DialogFragment was recreated after app suspend + this.owner._dialogFragment = this; this._fullscreen = options.fullscreen; this._animated = options.animated; this._cancelable = options.cancelable; diff --git a/nativescript-core/ui/frame/frame.android.ts b/nativescript-core/ui/frame/frame.android.ts index 286575b3c..e8f798f28 100644 --- a/nativescript-core/ui/frame/frame.android.ts +++ b/nativescript-core/ui/frame/frame.android.ts @@ -264,13 +264,13 @@ export class Frame extends FrameBase { !this._currentEntry.fragment.isAdded()) { return; } + const fragment: androidx.fragment.app.Fragment = this._currentEntry.fragment; + const fragmentManager: androidx.fragment.app.FragmentManager = fragment.getFragmentManager(); - const manager: androidx.fragment.app.FragmentManager = this._getFragmentManager(); - const transaction = manager.beginTransaction(); - const fragment = this._currentEntry.fragment; + const transaction = fragmentManager.beginTransaction(); const fragmentExitTransition = fragment.getExitTransition(); - // Reset animation to its initial state to prevent mirrorered effect when restore current fragment transitions + // Reset animation to its initial state to prevent mirrored effect when restore current fragment transitions if (fragmentExitTransition && fragmentExitTransition instanceof org.nativescript.widgets.CustomTransition) { fragmentExitTransition.setResetOnTransitionEnd(true); } @@ -637,7 +637,7 @@ function clearEntry(entry: BackstackEntry): void { entry.recreated = false; entry.fragment = null; const page = entry.resolvedPage; - if (page._context) { + if (page && page._context) { entry.resolvedPage._tearDownUI(true); } } @@ -1032,6 +1032,12 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { } private loadBitmapFromView(view: android.view.View): android.graphics.Bitmap { + // Don't try to creat bitmaps with no dimensions as this causes a crash + // This might happen when showing and closing dialogs fast. + if (!(view && view.getWidth() > 0 && view.getHeight() > 0)) { + return undefined; + } + // Another way to get view bitmap. Test performance vs setDrawingCacheEnabled // const width = view.getWidth(); // const height = view.getHeight(); @@ -1041,7 +1047,8 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { // view.draw(canvas); view.setDrawingCacheEnabled(true); - const bitmap = android.graphics.Bitmap.createBitmap(view.getDrawingCache()); + const drawCache = view.getDrawingCache(); + const bitmap = android.graphics.Bitmap.createBitmap(drawCache); view.setDrawingCacheEnabled(false); return bitmap; diff --git a/nativescript-core/utils/utils.ios.ts b/nativescript-core/utils/utils.ios.ts index 17474fd8d..c01e04f39 100644 --- a/nativescript-core/utils/utils.ios.ts +++ b/nativescript-core/utils/utils.ios.ts @@ -6,8 +6,6 @@ import { export { ios }; export * from "./utils-common"; -let mainScreenScale; - export function openFile(filePath: string): boolean { try { const appPath = ios.getCurrentAppPath(); @@ -47,5 +45,3 @@ export function openUrl(location: string): boolean { return false; } - -mainScreenScale = UIScreen.mainScreen.scale; From a02c92530617caed533f3ede5d7f4a014fe356dd Mon Sep 17 00:00:00 2001 From: Dimitar Topuzov Date: Fri, 20 Dec 2019 13:52:51 +0200 Subject: [PATCH 7/7] release: cut the 6.3.2 release --- CHANGELOG.md | 10 ++++++++++ nativescript-core/package.json | 2 +- tns-core-modules-package/package.json | 2 +- tns-core-modules-widgets/package.json | 2 +- tns-platform-declarations/package.json | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 168be840c..a359971c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [6.3.2](https://github.com/NativeScript/NativeScript/compare/6.3.1...6.3.2) (2019-12-20) + + +### Bug Fixes + +* check is disposed fragment is in the FragmentManager ([#8201](https://github.com/NativeScript/NativeScript/issues/8201)) ([4b00376](https://github.com/NativeScript/NativeScript/commit/4b00376)) +* handle fake attach after FragMgr is destroyed ([#8200](https://github.com/NativeScript/NativeScript/issues/8200)) ([d1858f8](https://github.com/NativeScript/NativeScript/commit/d1858f8)) + + + ## [6.3.1](https://github.com/NativeScript/NativeScript/compare/6.3.0...6.3.1) (2019-12-16) diff --git a/nativescript-core/package.json b/nativescript-core/package.json index 40923a866..11eeda6ee 100644 --- a/nativescript-core/package.json +++ b/nativescript-core/package.json @@ -3,7 +3,7 @@ "main": "index", "types": "index.d.ts", "description": "Telerik NativeScript Core Modules", - "version": "6.3.1", + "version": "6.3.2", "homepage": "https://www.nativescript.org", "repository": { "type": "git", diff --git a/tns-core-modules-package/package.json b/tns-core-modules-package/package.json index 2be2790cc..5a50e7b61 100644 --- a/tns-core-modules-package/package.json +++ b/tns-core-modules-package/package.json @@ -3,7 +3,7 @@ "main": "index", "types": "index.d.ts", "description": "Telerik NativeScript Core Modules", - "version": "6.3.1", + "version": "6.3.2", "homepage": "https://www.nativescript.org", "repository": { "type": "git", diff --git a/tns-core-modules-widgets/package.json b/tns-core-modules-widgets/package.json index edc6372b7..160eaea21 100644 --- a/tns-core-modules-widgets/package.json +++ b/tns-core-modules-widgets/package.json @@ -1,6 +1,6 @@ { "name": "tns-core-modules-widgets", - "version": "6.3.0", + "version": "6.3.2", "description": "Native widgets used in the NativeScript framework.", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/tns-platform-declarations/package.json b/tns-platform-declarations/package.json index 2bb0ff065..55442e8f8 100644 --- a/tns-platform-declarations/package.json +++ b/tns-platform-declarations/package.json @@ -1,6 +1,6 @@ { "name": "tns-platform-declarations", - "version": "6.3.1", + "version": "6.3.2", "description": "Platform-specific TypeScript declarations for NativeScript for accessing native objects", "main": "", "scripts": {