diff --git a/CHANGELOG.md b/CHANGELOG.md
index 82471abae..88be57ad3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+## [8.1.3](https://github.com/NativeScript/NativeScript/compare/8.1.2-core...8.1.3) (2021-09-18)
+
+
+### Bug Fixes
+
+* **android:** only attach if activity is CREATED ([#9552](https://github.com/NativeScript/NativeScript/issues/9552)) ([90b8718](https://github.com/NativeScript/NativeScript/commit/90b8718138fc6e67e2141d9b77017b3d96e50d51))
+
+
+
## [8.1.2](https://github.com/NativeScript/NativeScript/compare/8.1.1-core...8.1.2) (2021-09-15)
diff --git a/apps/automated/package.json b/apps/automated/package.json
index d9bd699f3..dbec953e9 100644
--- a/apps/automated/package.json
+++ b/apps/automated/package.json
@@ -10,8 +10,8 @@
"clean": "npx rimraf hooks node_modules platforms package-lock.json && npm i --legacy-peer-deps"
},
"dependencies": {
- "nativescript-theme-core": "file:../../node_modules/nativescript-theme-core",
- "@nativescript/core": "file:../../packages/core"
+ "@nativescript/core": "file:../../packages/core",
+ "nativescript-theme-core": "file:../../node_modules/nativescript-theme-core"
},
"devDependencies": {
"@nativescript/android": "7.0.1",
diff --git a/apps/ui/src/css/background-image-page.xml b/apps/ui/src/css/background-image-page.xml
index 2b1beaa79..eef80d30e 100644
--- a/apps/ui/src/css/background-image-page.xml
+++ b/apps/ui/src/css/background-image-page.xml
@@ -1,5 +1,5 @@
-
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/ui/src/image-view/missing-image-page.xml b/apps/ui/src/image-view/missing-image-page.xml
index d8f5596d8..9bed83ad7 100644
--- a/apps/ui/src/image-view/missing-image-page.xml
+++ b/apps/ui/src/image-view/missing-image-page.xml
@@ -12,6 +12,8 @@
+
+
diff --git a/nx.json b/nx.json
index 20d0fcd77..4de54dd12 100644
--- a/nx.json
+++ b/nx.json
@@ -28,6 +28,9 @@
"core": {
"tags": []
},
+ "core-api-docs": {
+ "tags": []
+ },
"types": {
"tags": []
},
diff --git a/package.json b/package.json
index b5dfe37e3..6c87d6525 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "nativescript",
- "version": "8.1.2",
+ "version": "8.1.3",
"license": "MIT",
"config": {
"npm_alias": "npm"
@@ -8,7 +8,7 @@
"scripts": {
"clean": "git clean -f -X -d --exclude=!.idea/ --exclude=!.vscode/*",
"setup": "npm run clean && npm install --legacy-peer-deps",
- "setup:yarn": "yarn run clean && yarn",
+ "setup:yarn": "yarn clean && yarn",
"setup:pnpm": "pnpm run clean && pnpm install",
"postinstall": "ts-patch install && husky install && nx run core:setup",
"start": "nps",
@@ -82,8 +82,8 @@
"mocha": "^8.0.1",
"mocha-typescript": "^1.1.17",
"module-alias": "^2.2.2",
- "nativescript": "~7.2.0",
- "nativescript-typedoc-theme": "1.0.0",
+ "nativescript": "~8.1.2",
+ "nativescript-typedoc-theme": "1.1.0",
"parse-css": "git+https://github.com/tabatkins/parse-css.git",
"parserlib": "^1.1.1",
"prettier": "~2.2.1",
diff --git a/packages/core/core-types/index.d.ts b/packages/core/core-types/index.d.ts
index 19dbb1f17..57790b921 100644
--- a/packages/core/core-types/index.d.ts
+++ b/packages/core/core-types/index.d.ts
@@ -104,7 +104,7 @@ export namespace CoreTypes {
export const send: string;
}
- export type TextAlignmentType = 'initial' | 'left' | 'center' | 'right';
+ export type TextAlignmentType = 'initial' | 'left' | 'center' | 'right' | 'justify';
/**
* Represents a text-align enumeration.
*/
@@ -123,6 +123,11 @@ export namespace CoreTypes {
* Represents right text-align.
*/
export const right: TextAlignmentType;
+
+ /**
+ * Represents justify text-align.
+ */
+ export const justify: TextAlignmentType;
}
export type OrientationType = 'horizontal' | 'vertical';
diff --git a/packages/core/core-types/index.ts b/packages/core/core-types/index.ts
index 1480c21a6..0d13785f7 100644
--- a/packages/core/core-types/index.ts
+++ b/packages/core/core-types/index.ts
@@ -58,11 +58,12 @@ export namespace CoreTypes {
export const send = 'send';
}
- export type TextAlignmentType = 'initial' | 'left' | 'center' | 'right';
+ export type TextAlignmentType = 'initial' | 'left' | 'center' | 'right' | 'justify';
export module TextAlignment {
export const left = 'left';
export const center = 'center';
export const right = 'right';
+ export const justify = 'justify';
}
export type TextDecorationType = 'none' | 'underline' | 'line-through' | 'underline line-through';
diff --git a/packages/core/css/parser.ts b/packages/core/css/parser.ts
index 83c1ee1aa..e13411158 100644
--- a/packages/core/css/parser.ts
+++ b/packages/core/css/parser.ts
@@ -23,7 +23,7 @@ export interface LinearGradient {
colors: ColorStop[];
}
export interface Background {
- readonly color?: number;
+ readonly color?: number | Color;
readonly image?: URL | LinearGradient;
readonly repeat?: BackgroundRepeat;
readonly position?: BackgroundPosition;
diff --git a/packages/core/global-types.d.ts b/packages/core/global-types.d.ts
index ec925d9f2..2987a1e6d 100644
--- a/packages/core/global-types.d.ts
+++ b/packages/core/global-types.d.ts
@@ -129,7 +129,7 @@ declare namespace NodeJS {
rootLayout: any;
}
}
-declare const __DEV__: string;
+declare const __DEV__: boolean;
declare const __CSS_PARSER__: string;
declare const __NS_WEBPACK__: boolean;
declare const __UI_USE_EXTERNAL_RENDERER__: boolean;
diff --git a/packages/core/package.json b/packages/core/package.json
index 6109c50c7..367a76bdc 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -3,7 +3,7 @@
"main": "index",
"types": "index.d.ts",
"description": "A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.",
- "version": "8.1.2",
+ "version": "8.1.3",
"homepage": "https://nativescript.org",
"repository": {
"type": "git",
diff --git a/packages/core/platforms/android/widgets-release.aar b/packages/core/platforms/android/widgets-release.aar
index 137060cee..fb0997fa7 100644
Binary files a/packages/core/platforms/android/widgets-release.aar and b/packages/core/platforms/android/widgets-release.aar differ
diff --git a/packages/core/ui/action-bar/index.ios.ts b/packages/core/ui/action-bar/index.ios.ts
index ce1747e27..c30ff8b2c 100644
--- a/packages/core/ui/action-bar/index.ios.ts
+++ b/packages/core/ui/action-bar/index.ios.ts
@@ -406,14 +406,37 @@ export class ActionBar extends ActionBarBase {
}
private updateFlatness(navBar: UINavigationBar) {
+
if (this.flat) {
- navBar.setBackgroundImageForBarMetrics(UIImage.new(), UIBarMetrics.Default);
- navBar.shadowImage = UIImage.new();
- navBar.translucent = false;
+
+ if (majorVersion >= 15) {
+ const appearance = navBar.standardAppearance ?? UINavigationBarAppearance.new();
+ appearance.shadowColor = UIColor.clearColor;
+
+ navBar.standardAppearance = appearance;
+ navBar.compactAppearance = appearance;
+ navBar.scrollEdgeAppearance = appearance;
+ } else {
+
+ navBar.setBackgroundImageForBarMetrics(UIImage.new(), UIBarMetrics.Default);
+ navBar.shadowImage = UIImage.new();
+ navBar.translucent = false;
+ }
} else {
- navBar.setBackgroundImageForBarMetrics(null, null);
- navBar.shadowImage = null;
- navBar.translucent = true;
+ if (majorVersion >= 15) {
+ if(navBar.standardAppearance){ // Not flat and never been set do nothing.
+ const appearance = navBar.standardAppearance;
+ appearance.shadowColor = UINavigationBarAppearance.new().shadowColor;
+
+ navBar.standardAppearance = appearance;
+ navBar.compactAppearance = appearance;
+ navBar.scrollEdgeAppearance = appearance;
+ }
+ } else {
+ navBar.setBackgroundImageForBarMetrics(null, null);
+ navBar.shadowImage = null;
+ navBar.translucent = true;
+ }
}
}
diff --git a/packages/core/ui/frame/index.android.ts b/packages/core/ui/frame/index.android.ts
index ea84c02b7..f739990c7 100644
--- a/packages/core/ui/frame/index.android.ts
+++ b/packages/core/ui/frame/index.android.ts
@@ -146,8 +146,8 @@ export class Frame extends FrameBase {
// _onAttachedToWindow called from OS again after it was detach
// still happens with androidx.fragment:1.3.2
- const activity = androidApplication.foregroundActivity || androidApplication.startActivity;
- if ((this._manager && this._manager.isDestroyed()) || !activity.getLifecycle?.().getCurrentState().isAtLeast(androidx.lifecycle.Lifecycle.State.STARTED)) {
+ const lifecycleState = (androidApplication.foregroundActivity?.getLifecycle?.() || androidApplication.startActivity?.getLifecycle?.())?.getCurrentState() || androidx.lifecycle.Lifecycle.State.CREATED;
+ if ((this._manager && this._manager.isDestroyed()) || !lifecycleState.isAtLeast(androidx.lifecycle.Lifecycle.State.CREATED)) {
return;
}
diff --git a/packages/core/ui/styling/style-properties.ts b/packages/core/ui/styling/style-properties.ts
index c0fb01e4e..e57310201 100644
--- a/packages/core/ui/styling/style-properties.ts
+++ b/packages/core/ui/styling/style-properties.ts
@@ -838,7 +838,10 @@ backgroundPositionProperty.register(Style);
function convertToBackgrounds(this: void, value: string): [CssProperty, any][] {
if (typeof value === 'string') {
const backgrounds = parser.parseBackground(value).value;
- const backgroundColor = backgrounds.color ? new Color(backgrounds.color) : unsetValue;
+ let backgroundColor = unsetValue;
+ if (backgrounds.color) {
+ backgroundColor = backgrounds.color instanceof Color ? backgrounds.color : new Color(backgrounds.color);
+ }
let backgroundImage: string | LinearGradient;
if (typeof backgrounds.image === 'object' && backgrounds.image) {
diff --git a/packages/core/ui/text-base/index.android.ts b/packages/core/ui/text-base/index.android.ts
index 75509a54f..24490dc5b 100644
--- a/packages/core/ui/text-base/index.android.ts
+++ b/packages/core/ui/text-base/index.android.ts
@@ -286,18 +286,22 @@ export class TextBase extends TextBaseCommon {
[textAlignmentProperty.setNative](value: CoreTypes.TextAlignmentType) {
const verticalGravity = this.nativeTextViewProtected.getGravity() & android.view.Gravity.VERTICAL_GRAVITY_MASK;
switch (value) {
- case 'initial':
- case 'left':
- this.nativeTextViewProtected.setGravity(android.view.Gravity.START | verticalGravity);
- break;
-
case 'center':
this.nativeTextViewProtected.setGravity(android.view.Gravity.CENTER_HORIZONTAL | verticalGravity);
break;
-
case 'right':
this.nativeTextViewProtected.setGravity(android.view.Gravity.END | verticalGravity);
break;
+ default: // initial | left | justify
+ this.nativeTextViewProtected.setGravity(android.view.Gravity.START | verticalGravity);
+ break;
+ }
+ if (android.os.Build.VERSION.SDK_INT >= 25) {
+ if (value === 'justify') {
+ this.nativeTextViewProtected.setJustificationMode(android.text.Layout.JUSTIFICATION_MODE_INTER_WORD);
+ } else {
+ this.nativeTextViewProtected.setJustificationMode(android.text.Layout.JUSTIFICATION_MODE_NONE);
+ }
}
}
diff --git a/packages/core/ui/text-base/index.ios.ts b/packages/core/ui/text-base/index.ios.ts
index 1f8b953c4..5a1514fb9 100644
--- a/packages/core/ui/text-base/index.ios.ts
+++ b/packages/core/ui/text-base/index.ios.ts
@@ -171,6 +171,9 @@ export class TextBase extends TextBaseCommon {
case 'right':
nativeView.textAlignment = NSTextAlignment.Right;
break;
+ case 'justify':
+ nativeView.textAlignment = NSTextAlignment.Justified;
+ break;
}
}
diff --git a/packages/core/ui/text-base/text-base-common.ts b/packages/core/ui/text-base/text-base-common.ts
index b3b0b941d..d1a2057ef 100644
--- a/packages/core/ui/text-base/text-base-common.ts
+++ b/packages/core/ui/text-base/text-base-common.ts
@@ -246,7 +246,7 @@ export function getClosestPropertyValue(property: CssProperty, span:
}
}
-const textAlignmentConverter = makeParser(makeValidator('initial', 'left', 'center', 'right'));
+const textAlignmentConverter = makeParser(makeValidator('initial', 'left', 'center', 'right', 'justify'));
export const textAlignmentProperty = new InheritedCssProperty