mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge pull request #8088 from NativeScript/merge-6.2.1-release-in-master
chore: merge 6.2.1 release in master
This commit is contained in:
18
CHANGELOG.md
18
CHANGELOG.md
@@ -1,3 +1,21 @@
|
||||
<a name="6.2.1"></a>
|
||||
## [6.2.1](https://github.com/NativeScript/NativeScript/compare/6.2.0...6.2.1) (2019-11-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dark-mode:** formatted string and html view text color ([#8031](https://github.com/NativeScript/NativeScript/issues/8031)) ([0c7f838](https://github.com/NativeScript/NativeScript/commit/0c7f838))
|
||||
* ensure @CallSuper native methods call superFunc ([#8025](https://github.com/NativeScript/NativeScript/issues/8025)) ([7fa9978](https://github.com/NativeScript/NativeScript/commit/7fa9978))
|
||||
* **dev-tools:** use app root in getDocument() ([#8071](https://github.com/NativeScript/NativeScript/issues/8071)) ([f686472](https://github.com/NativeScript/NativeScript/commit/f686472))
|
||||
* **gradient:** import LinearGradient with alias ([#8063](https://github.com/NativeScript/NativeScript/issues/8063)) ([eb33ede](https://github.com/NativeScript/NativeScript/commit/eb33ede))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **application:** add system appearance changed event to typings ([#8034](https://github.com/NativeScript/NativeScript/issues/8034)) ([2a34368](https://github.com/NativeScript/NativeScript/commit/2a34368))
|
||||
|
||||
|
||||
|
||||
<a name="6.2.0"></a>
|
||||
# [6.2.0](https://github.com/NativeScript/NativeScript/compare/6.1.2...6.2.0) (2019-10-24)
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@ import { getNodeById } from "./dom-node";
|
||||
import { ViewBase } from "../ui/core/view-base";
|
||||
import { mainThreadify } from "../utils/utils";
|
||||
|
||||
// Use lazy requires for core modules
|
||||
const getAppRootView = () => require("../application").getRootView();
|
||||
|
||||
let unsetValue;
|
||||
function unsetViewValue(view, name) {
|
||||
if (!unsetValue) {
|
||||
@@ -24,19 +27,19 @@ function getViewById(nodeId: number): ViewBase {
|
||||
}
|
||||
|
||||
export function getDocument() {
|
||||
const topMostFrame = require("../ui/frame").Frame.topmost();
|
||||
if (!topMostFrame) {
|
||||
const appRoot = getAppRootView();
|
||||
if (!appRoot) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
topMostFrame.ensureDomNode();
|
||||
appRoot.ensureDomNode();
|
||||
|
||||
} catch (e) {
|
||||
console.log("ERROR in getDocument(): " + e);
|
||||
}
|
||||
|
||||
return topMostFrame.domNode.toObject();
|
||||
return appRoot.domNode.toObject();
|
||||
}
|
||||
|
||||
export function getComputedStylesForNode(nodeId): Array<{ name: string, value: string }> {
|
||||
|
||||
@@ -937,18 +937,21 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
|
||||
@profile
|
||||
public onDestroyView(fragment: org.nativescript.widgets.FragmentBase, superFunc: Function): void {
|
||||
if (traceEnabled()) {
|
||||
traceWrite(`${fragment}.onDestroyView()`, traceCategories.NativeLifecycle);
|
||||
}
|
||||
try {
|
||||
if (traceEnabled()) {
|
||||
traceWrite(`${fragment}.onDestroyView()`, traceCategories.NativeLifecycle);
|
||||
}
|
||||
|
||||
const hasRemovingParent = fragment.getRemovingParentFragment();
|
||||
const hasRemovingParent = fragment.getRemovingParentFragment();
|
||||
|
||||
if (hasRemovingParent) {
|
||||
const bitmapDrawable = new android.graphics.drawable.BitmapDrawable(application.android.context.getResources(), this.backgroundBitmap);
|
||||
this.frame.nativeViewProtected.setBackgroundDrawable(bitmapDrawable);
|
||||
this.backgroundBitmap = null;
|
||||
if (hasRemovingParent) {
|
||||
const bitmapDrawable = new android.graphics.drawable.BitmapDrawable(application.android.context.getResources(), this.backgroundBitmap);
|
||||
this.frame.nativeViewProtected.setBackgroundDrawable(bitmapDrawable);
|
||||
this.backgroundBitmap = null;
|
||||
}
|
||||
} finally {
|
||||
superFunc.call(fragment);
|
||||
}
|
||||
superFunc.call(fragment);
|
||||
}
|
||||
|
||||
@profile
|
||||
@@ -982,14 +985,17 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
|
||||
@profile
|
||||
public onPause(fragment: org.nativescript.widgets.FragmentBase, superFunc: Function): void {
|
||||
// Get view as bitmap and set it as background. This is workaround for the disapearing nested fragments.
|
||||
// TODO: Consider removing it when update to androidx.fragment:1.2.0
|
||||
const hasRemovingParent = fragment.getRemovingParentFragment();
|
||||
try {
|
||||
// Get view as bitmap and set it as background. This is workaround for the disapearing nested fragments.
|
||||
// TODO: Consider removing it when update to androidx.fragment:1.2.0
|
||||
const hasRemovingParent = fragment.getRemovingParentFragment();
|
||||
|
||||
if (hasRemovingParent) {
|
||||
this.backgroundBitmap = this.loadBitmapFromView(this.frame.nativeViewProtected);
|
||||
if (hasRemovingParent) {
|
||||
this.backgroundBitmap = this.loadBitmapFromView(this.frame.nativeViewProtected);
|
||||
}
|
||||
} finally {
|
||||
superFunc.call(fragment);
|
||||
}
|
||||
superFunc.call(fragment);
|
||||
}
|
||||
|
||||
@profile
|
||||
@@ -1154,19 +1160,21 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
|
||||
@profile
|
||||
public onDestroy(activity: any, superFunc: Function): void {
|
||||
if (traceEnabled()) {
|
||||
traceWrite("NativeScriptActivity.onDestroy();", traceCategories.NativeLifecycle);
|
||||
try {
|
||||
if (traceEnabled()) {
|
||||
traceWrite("NativeScriptActivity.onDestroy();", traceCategories.NativeLifecycle);
|
||||
}
|
||||
|
||||
const rootView = this._rootView;
|
||||
if (rootView) {
|
||||
rootView._tearDownUI(true);
|
||||
}
|
||||
|
||||
const exitArgs = { eventName: application.exitEvent, object: application.android, android: activity };
|
||||
application.notify(exitArgs);
|
||||
} finally {
|
||||
superFunc.call(activity);
|
||||
}
|
||||
|
||||
const rootView = this._rootView;
|
||||
if (rootView) {
|
||||
rootView._tearDownUI(true);
|
||||
}
|
||||
|
||||
const exitArgs = { eventName: application.exitEvent, object: application.android, android: activity };
|
||||
application.notify(exitArgs);
|
||||
|
||||
superFunc.call(activity);
|
||||
}
|
||||
|
||||
@profile
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import {
|
||||
HtmlViewBase, View, layout, htmlProperty
|
||||
} from "./html-view-common";
|
||||
import { ios } from "../../utils/utils";
|
||||
|
||||
export * from "./html-view-common";
|
||||
|
||||
const majorVersion = ios.MajorVersion;
|
||||
|
||||
export class HtmlView extends HtmlViewBase {
|
||||
nativeViewProtected: UITextView;
|
||||
|
||||
@@ -50,6 +53,14 @@ export class HtmlView extends HtmlViewBase {
|
||||
[htmlProperty.setNative](value: string) {
|
||||
const htmlString = NSString.stringWithString(value + "");
|
||||
const nsData = htmlString.dataUsingEncoding(NSUnicodeStringEncoding);
|
||||
this.nativeViewProtected.attributedText = NSAttributedString.alloc().initWithDataOptionsDocumentAttributesError(nsData, <any>{ [NSDocumentTypeDocumentAttribute]: NSHTMLTextDocumentType }, null);
|
||||
this.nativeViewProtected.attributedText = NSAttributedString.alloc().initWithDataOptionsDocumentAttributesError(
|
||||
nsData,
|
||||
<any>{ [NSDocumentTypeDocumentAttribute]: NSHTMLTextDocumentType },
|
||||
null
|
||||
);
|
||||
|
||||
if (majorVersion >= 13) {
|
||||
this.nativeViewProtected.textColor = UIColor.labelColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +153,10 @@ export class TextBase extends TextBaseCommon {
|
||||
this.nativeTextViewProtected.setAttributedTitleForState(attrText, UIControlState.Normal);
|
||||
}
|
||||
else {
|
||||
if (majorVersion >= 13) {
|
||||
this.nativeTextViewProtected.textColor = UIColor.labelColor;
|
||||
}
|
||||
|
||||
this.nativeTextViewProtected.attributedText = attrText;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user