chore: merge release to master (#7809)

* feat(android): fix tab resource icon size based on spec (#7737)

* feat(ios): add icon rendering mode for bottom navigation (#7738)

* fix(ios-tabs): crash when add tabstrip in loaded event (#7743)

* fix(css): parse css selectors with escape sequences (#7689) (#7732)

* fix(ios-tabs): handle nesting proxy view container (#7755)

* fix-next(css): className to preserve root views classes (#7725)

* docs: cut the 6.1.0 release (#7773)

* fix(android-list-picker): NoSuchFieldException on api29 (#7790)

* chore: hardcode tslib version to 1.10.0 (#7776)

* fix(css-calc): reduce_css_calc_1.default is not a function (#7787) (#7801)
This commit is contained in:
Manol Donev
2019-09-12 14:33:03 +03:00
committed by GitHub
parent f3d8967e0c
commit e0c4933337
25 changed files with 416 additions and 184 deletions

View File

@@ -40,6 +40,8 @@ import {
LoadAppCSSEventData,
UnhandledErrorEventData
} from "./application";
import { CLASS_PREFIX, pushToRootViewCssClasses, removeFromRootViewCssClasses } from "../css/system-classes";
import { DeviceOrientation } from "../ui/enums/enums";
export { UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData };
@@ -54,11 +56,10 @@ export const uncaughtErrorEvent = "uncaughtError";
export const discardedErrorEvent = "discardedError";
export const orientationChangedEvent = "orientationChanged";
export const CSS_CLASS_PREFIX = "ns-";
const ORIENTATION_CSS_CLASSES = [
`${CSS_CLASS_PREFIX}${DeviceOrientation.portrait}`,
`${CSS_CLASS_PREFIX}${DeviceOrientation.landscape}`,
`${CSS_CLASS_PREFIX}${DeviceOrientation.unknown}`
`${CLASS_PREFIX}${DeviceOrientation.portrait}`,
`${CLASS_PREFIX}${DeviceOrientation.landscape}`,
`${CLASS_PREFIX}${DeviceOrientation.unknown}`
];
let cssFile: string = "./app.css";
@@ -126,9 +127,15 @@ export function loadAppCss(): void {
}
export function orientationChanged(rootView: View, newOrientation: "portrait" | "landscape" | "unknown"): void {
const newOrientationCssClass = `${CSS_CLASS_PREFIX}${newOrientation}`;
const newOrientationCssClass = `${CLASS_PREFIX}${newOrientation}`;
if (!rootView.cssClasses.has(newOrientationCssClass)) {
ORIENTATION_CSS_CLASSES.forEach(c => rootView.cssClasses.delete(c));
const removeCssClass = (c: string) => {
removeFromRootViewCssClasses(c);
rootView.cssClasses.delete(c);
};
ORIENTATION_CSS_CLASSES.forEach(c => removeCssClass(c));
pushToRootViewCssClasses(newOrientationCssClass);
rootView.cssClasses.add(newOrientationCssClass);
rootView._onCssStateChange();
}

View File

@@ -53,11 +53,6 @@ export const lowMemoryEvent: string;
*/
export const orientationChangedEvent: string;
/**
* String value "ns-" used for CSS class prefix.
*/
export const CSS_CLASS_PREFIX: string;
/**
* Event data containing information for the application events.
*/

View File

@@ -1,4 +1,3 @@
import {
ApplicationEventData,
CssChangedEventData,
@@ -9,9 +8,8 @@ import {
} from ".";
import {
CSS_CLASS_PREFIX, displayedEvent, exitEvent, getCssFileName, launchEvent, livesync,
lowMemoryEvent, notify, on, orientationChanged, orientationChangedEvent, resumeEvent,
setApplication, suspendEvent
displayedEvent, exitEvent, getCssFileName, launchEvent, livesync, lowMemoryEvent, notify, on,
orientationChanged, orientationChangedEvent, resumeEvent, setApplication, suspendEvent
} from "./application-common";
// First reexport so that app module is initialized.
@@ -19,18 +17,15 @@ export * from "./application-common";
// TODO: Remove this and get it from global to decouple builder for angular
import { createViewFromEntry } from "../ui/builder";
import { CLASS_PREFIX, getRootViewCssClasses, pushToRootViewCssClasses } from "../css/system-classes";
import { ios as iosView, View } from "../ui/core/view";
import { Frame, NavigationEntry } from "../ui/frame";
import { device } from "../platform/platform";
import { profile } from "../profiling";
import { ios } from "../utils/utils";
const ROOT = "root";
const IOS_PLATFORM = "ios";
const ROOT_VIEW_CSS_CLASSES = [
`${CSS_CLASS_PREFIX}${ROOT}`,
`${CSS_CLASS_PREFIX}${IOS_PLATFORM}`
];
const getVisibleViewController = ios.getVisibleViewController;
// NOTE: UIResponder with implementation of window - related to https://github.com/NativeScript/ios-runtime/issues/430
@@ -317,9 +312,12 @@ function createRootView(v?: View) {
}
const deviceType = device.deviceType.toLowerCase();
ROOT_VIEW_CSS_CLASSES.push(`${CSS_CLASS_PREFIX}${deviceType}`);
ROOT_VIEW_CSS_CLASSES.push(`${CSS_CLASS_PREFIX}${iosApp.orientation}`);
ROOT_VIEW_CSS_CLASSES.forEach(c => rootView.cssClasses.add(c));
pushToRootViewCssClasses(`${CLASS_PREFIX}${IOS_PLATFORM}`);
pushToRootViewCssClasses(`${CLASS_PREFIX}${deviceType}`);
pushToRootViewCssClasses(`${CLASS_PREFIX}${iosApp.orientation}`);
const rootViewCssClasses = getRootViewCssClasses();
rootViewCssClasses.forEach(c => rootView.cssClasses.add(c));
return rootView;
}