mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,3 +1,14 @@
|
||||
<a name="5.0.4"></a>
|
||||
## [5.0.4](https://github.com/NativeScript/NativeScript/compare/5.0.3...5.0.4) (2018-11-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **android-fragment:** child already has a parent ([#6589](https://github.com/NativeScript/NativeScript/issues/6589)) ([5b9b335](https://github.com/NativeScript/NativeScript/commit/5b9b335))
|
||||
* **back-navigation:** app freeze on going back in parent frame with states ([#6595](https://github.com/NativeScript/NativeScript/issues/6595)) ([fc1f8c1](https://github.com/NativeScript/NativeScript/commit/fc1f8c1))
|
||||
|
||||
|
||||
|
||||
<a name="5.0.3"></a>
|
||||
## [5.0.3](https://github.com/NativeScript/NativeScript/compare/5.0.2...5.0.3) (2018-11-20)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "tns-core-modules",
|
||||
"description": "Telerik NativeScript Core Modules",
|
||||
"version": "5.0.3",
|
||||
"version": "5.0.4",
|
||||
"homepage": "https://www.nativescript.org",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -616,7 +616,7 @@ export function goBack(): boolean {
|
||||
if (parentFrame && parentFrame.canGoBack()) {
|
||||
parentFrameCanGoBack = true;
|
||||
} else {
|
||||
parentFrame = <FrameBase>getAncestor(top, "Frame");
|
||||
parentFrame = <FrameBase>getAncestor(parentFrame, "Frame");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -834,6 +834,24 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
entry.viewSavedState = null;
|
||||
}
|
||||
|
||||
// fixes 'java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first'.
|
||||
// on app resume in nested frame scenarios with support library version greater than 26.0.0
|
||||
// HACK: this whole code block shouldn't be necessary as the native view is supposedly removed from its parent
|
||||
// right after onDestroyView(...) is called but for some reason the fragment view (page) still thinks it has a
|
||||
// parent while its supposed parent believes it properly removed its children; in order to "force" the child to
|
||||
// lose its parent we temporarily add it to the parent, and then remove it (addViewInLayout doesn't trigger layout pass)
|
||||
const nativeView = page.nativeViewProtected;
|
||||
if (nativeView != null) {
|
||||
const parentView = nativeView.getParent();
|
||||
if (parentView instanceof android.view.ViewGroup) {
|
||||
if (parentView.getChildCount() === 0) {
|
||||
parentView.addViewInLayout(nativeView, -1, new org.nativescript.widgets.CommonLayoutParams());
|
||||
}
|
||||
|
||||
parentView.removeView(nativeView);
|
||||
}
|
||||
}
|
||||
|
||||
return page.nativeViewProtected;
|
||||
}
|
||||
|
||||
@ -873,24 +891,6 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
traceError(`${fragment}.onDestroy: entry has no resolvedPage`);
|
||||
return null;
|
||||
}
|
||||
|
||||
// fixes 'java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first'.
|
||||
// on app resume in nested frame scenarios with support library version greater than 26.0.0
|
||||
// HACK: this whole code block shouldn't be necessary as the native view is supposedly removed from its parent
|
||||
// right after onDestroyView(...) is called but for some reason the fragment view (page) still thinks it has a
|
||||
// parent while its supposed parent believes it properly removed its children; in order to "force" the child to
|
||||
// lose its parent we temporarily add it to the parent, and then remove it (addViewInLayout doesn't trigger layout pass)
|
||||
const nativeView = page.nativeViewProtected;
|
||||
if (nativeView != null) {
|
||||
const parentView = nativeView.getParent();
|
||||
if (parentView instanceof android.view.ViewGroup) {
|
||||
if (parentView.getChildCount() === 0) {
|
||||
parentView.addViewInLayout(nativeView, -1, new org.nativescript.widgets.CommonLayoutParams());
|
||||
}
|
||||
|
||||
parentView.removeView(nativeView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@profile
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tns-platform-declarations",
|
||||
"version": "5.0.3",
|
||||
"version": "5.0.4",
|
||||
"description": "Platform-specific TypeScript declarations for NativeScript for accessing native objects",
|
||||
"main": "",
|
||||
"scripts": {
|
||||
|
Reference in New Issue
Block a user