Skip to content

Commit 4e0a58d

Browse files
committed
chore: fixed all imports for N 7
1 parent 60706d8 commit 4e0a58d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+138
-149
lines changed

src/appbar/angular/appbar.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AfterViewInit, Directive } from '@angular/core';
22
import { ActivatedRoute } from '@angular/router';
3-
import { Page } from '@nativescript/core/ui/page/page';
3+
import { Page } from '@nativescript/core/ui/page';
44
import { addCss, ios as iosApp } from '@nativescript/core/application';
55
import { themer } from 'nativescript-material-core/core';
66

src/bottomnavigationbar/bottomnavigationbar-common.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import { AddChildFromBuilder, booleanConverter, Color, CssProperty, CSSType, Property, Style, View } from '@nativescript/core/ui/core/view';
1+
import { AddChildFromBuilder, CSSType, View } from '@nativescript/core/ui/core/view';
2+
import { booleanConverter } from '@nativescript/core/ui/core/view-base';
23

4+
import { Color } from '@nativescript/core/color';
5+
import { CssProperty, Property } from '@nativescript/core/ui/core/properties';
6+
import { Style } from '@nativescript/core/ui/styling/style';
37
import { ImageSource } from '@nativescript/core/image-source';
48

59
import { cssProperty } from 'nativescript-material-core/cssproperties';
@@ -48,7 +52,7 @@ export interface TabReselectedEventData extends EventData {
4852
export enum TitleVisibility {
4953
Selected = 0,
5054
Always = 1,
51-
Never = 2
55+
Never = 2,
5256
}
5357

5458
@CSSType('BottomNavigationBar')
@@ -71,7 +75,7 @@ export abstract class BottomNavigationBarBase extends View implements AddChildFr
7175

7276
onLoaded() {
7377
super.onLoaded();
74-
this._items.forEach(child => {
78+
this._items.forEach((child) => {
7579
this.loadView(child);
7680
return true;
7781
});
@@ -89,7 +93,7 @@ export abstract class BottomNavigationBarBase extends View implements AddChildFr
8993
let eventData: TabPressedEventData = {
9094
eventName: BottomNavigationBarBase.tabPressedEvent,
9195
object: this,
92-
index
96+
index,
9397
};
9498
this.notify(eventData);
9599
this.removeBadge(index);
@@ -100,7 +104,7 @@ export abstract class BottomNavigationBarBase extends View implements AddChildFr
100104
eventName: BottomNavigationBarBase.tabSelectedEvent,
101105
object: this,
102106
oldIndex: this.selectedTabIndex,
103-
newIndex: index
107+
newIndex: index,
104108
};
105109
this.selectedTabIndex = index;
106110
this.notify(eventData);
@@ -111,7 +115,7 @@ export abstract class BottomNavigationBarBase extends View implements AddChildFr
111115
let eventData: TabReselectedEventData = {
112116
eventName: BottomNavigationBarBase.tabReselectedEvent,
113117
object: this,
114-
index
118+
index,
115119
};
116120
this.notify(eventData);
117121
}
@@ -139,7 +143,7 @@ export abstract class BottomNavigationBarBase extends View implements AddChildFr
139143

140144
export const tabsProperty = new Property<BottomNavigationBarBase, BottomNavigationTabBase[]>({
141145
name: 'tabs',
142-
affectsLayout: true
146+
affectsLayout: true,
143147
});
144148

145149
tabsProperty.register(BottomNavigationBarBase);
@@ -149,7 +153,7 @@ export const titleVisibilityProperty = new Property<BottomNavigationBarBase, Tit
149153
equalityComparer: (x, y) => x === y,
150154
affectsLayout: true,
151155
defaultValue: TitleVisibility.Selected,
152-
valueConverter: v => TitleVisibility[v]
156+
valueConverter: (v) => TitleVisibility[v],
153157
});
154158

155159
titleVisibilityProperty.register(BottomNavigationBarBase);
@@ -159,7 +163,7 @@ export const activeColorCssProperty = new CssProperty<Style, Color>({
159163
cssName: 'active-color',
160164
equalityComparer: Color.equals,
161165
defaultValue: new Color('black'),
162-
valueConverter: v => new Color(v)
166+
valueConverter: (v) => new Color(v),
163167
});
164168
activeColorCssProperty.register(Style);
165169

@@ -168,7 +172,7 @@ export const inactiveColorCssProperty = new CssProperty<Style, Color>({
168172
cssName: 'inactive-color',
169173
equalityComparer: Color.equals,
170174
defaultValue: new Color('gray'),
171-
valueConverter: v => new Color(v)
175+
valueConverter: (v) => new Color(v),
172176
});
173177
inactiveColorCssProperty.register(Style);
174178

@@ -209,15 +213,15 @@ export abstract class BottomNavigationTabBase extends View implements BottomNavi
209213
export const isSelectableProperty = new Property<BottomNavigationTabBase, boolean>({
210214
name: 'isSelectable',
211215
defaultValue: true,
212-
valueConverter: booleanConverter
216+
valueConverter: booleanConverter,
213217
});
214218

215219
isSelectableProperty.register(BottomNavigationTabBase);
216220

217221
export const iconProperty = new Property<BottomNavigationTabBase, ImageSource>({
218222
name: 'icon',
219223
affectsLayout: true,
220-
valueConverter: ImageSource.fromFileOrResourceSync
224+
valueConverter: ImageSource.fromFileOrResourceSync,
221225
});
222226

223227
iconProperty.register(BottomNavigationTabBase);

src/bottomnavigationbar/bottomnavigationbar.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ export class BottomNavigationBar extends BottomNavigationBarBase {
201201
export class BottomNavigationTab extends BottomNavigationTabBase {
202202
nativeViewProtected: android.view.MenuItem;
203203
index: number = android.view.Menu.NONE;
204-
_isPaddingRelative = true; // trick because tns-core-modules expect us to be a view
204+
_isPaddingRelative = true; // trick because @nativescript/core expect us to be a view
205205
createNativeView() {
206206
const view = (this.parent as BottomNavigationBar).nativeViewProtected.getMenu().add(android.view.Menu.NONE, this.index, android.view.Menu.NONE, this.title);
207-
// trick because tns-core-modules expect us to be a view
207+
// trick because @nativescript/core expect us to be a view
208208
(view as any).defaultPaddings = { top: 0, left: 0, bottom: 0, right: 0 };
209209
return view;
210210
}

src/bottomnavigationbar/bottomnavigationbar.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Color, EventData } from '@nativescript/core/ui/core/view';
1+
import { Color } from '@nativescript/core/color';
2+
import { EventData } from '@nativescript/core/data/observable';
23

34
import { BottomNavigationBarBase, BottomNavigationTabBase, TabPressedEventData, TabReselectedEventData, TabSelectedEventData, TitleVisibility } from './bottomnavigationbar-common';
45
import { ImageSource } from '@nativescript/core/image-source';

src/bottomnavigationbar/bottomnavigationbar.ios.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { screen } from '@nativescript/core/platform';
22
import { ios } from '@nativescript/core/application';
3-
import { backgroundColorProperty, Color, layout } from '@nativescript/core/ui/core/view';
3+
import { layout } from '@nativescript/core/utils/utils';
4+
import { backgroundColorProperty } from '@nativescript/core/ui/styling/style-properties';
5+
import { Color } from '@nativescript/core/color';
46
import { ImageSource } from '@nativescript/core/image-source';
57
import { getRippleColor, themer } from 'nativescript-material-core/core';
68

src/bottomsheet/bottomsheet-common.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { View } from '@nativescript/core/ui/core/view';
2-
import { Frame } from '@nativescript/core/ui/frame';
3-
import { EventData } from '@nativescript/core/data/observable';
4-
import { eachDescendant, ViewBase } from '@nativescript/core/ui/core/view-base';
5-
import { getSystemCssClasses, MODAL_ROOT_VIEW_CSS_CLASS } from '@nativescript/core/css/system-classes';
61
import { Builder } from "@nativescript/core";
2+
import { getSystemCssClasses, MODAL_ROOT_VIEW_CSS_CLASS } from '@nativescript/core/css/system-classes';
3+
import { EventData } from '@nativescript/core/data/observable';
4+
import { View } from '@nativescript/core/ui/core/view';
5+
import { ViewBase } from '@nativescript/core/ui/core/view-base';
76

87
declare module '@nativescript/core/ui/core/view/view' {
98
interface View {

src/bottomsheet/bottomsheet.android.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { View, Color } from '@nativescript/core/ui/core/view';
1+
import { android as androidApp, AndroidActivityBackPressedEventData } from '@nativescript/core/application';
22
import { fromObject } from '@nativescript/core/data/observable';
3-
import { BottomSheetOptions, ViewWithBottomSheetBase } from './bottomsheet-common';
3+
import { View } from '@nativescript/core/ui/core/view';
44
import { applyMixins } from 'nativescript-material-core/core';
5-
import { android as androidApp, AndroidActivityBackPressedEventData } from '@nativescript/core/application';
5+
import { BottomSheetOptions, ViewWithBottomSheetBase } from './bottomsheet-common';
66

77
interface BottomSheetDataOptions {
88
owner: View;

src/bottomsheet/bottomsheet.ios.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { ViewWithBottomSheetBase } from './bottomsheet-common';
2-
import { ios, traceCategories, traceError, traceMessageType, traceWrite, View } from '@nativescript/core/ui/core/view';
3-
import { ViewBase } from '@nativescript/core/ui/core/view-base';
4-
import { layout } from '@nativescript/core/utils/utils';
5-
import { BottomSheetOptions } from './bottomsheet';
61
import { fromObject } from '@nativescript/core/data/observable';
7-
import { applyMixins } from 'nativescript-material-core/core';
8-
import { ios as iosUtils } from '@nativescript/core/utils/utils';
2+
import { ios, View } from '@nativescript/core/ui/core/view';
3+
import { categories, error, messageType, write } from '@nativescript/core/trace';
94
import { ios as iosView } from '@nativescript/core/ui/core/view/view-helper';
105
import { Page } from '@nativescript/core/ui/page';
6+
import { ios as iosUtils, layout } from '@nativescript/core/utils/utils';
7+
import { applyMixins } from 'nativescript-material-core/core';
8+
import { BottomSheetOptions } from './bottomsheet';
9+
import { ViewWithBottomSheetBase } from './bottomsheet-common';
1110

1211
const majorVersion = iosUtils.MajorVersion;
1312

@@ -85,7 +84,7 @@ function initLayoutGuide(controller: UIViewController) {
8584
function layoutView(controller: IUILayoutViewController, owner: View): void {
8685
let layoutGuide = controller.view.safeAreaLayoutGuide;
8786
if (!layoutGuide) {
88-
traceWrite(`safeAreaLayoutGuide during layout of ${owner}. Creating fallback constraints, but layout might be wrong.`, traceCategories.Layout, traceMessageType.error);
87+
write(`safeAreaLayoutGuide during layout of ${owner}. Creating fallback constraints, but layout might be wrong.`, categories.Layout, messageType.error);
8988

9089
layoutGuide = initLayoutGuide(controller);
9190
}
@@ -340,18 +339,18 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
340339
options.context = options.context || {};
341340
const parentWithController = ios.getParentWithViewController(parent);
342341
if (!parentWithController) {
343-
traceWrite(`Could not find parent with viewController for ${parent} while showing bottom sheet view.`, traceCategories.ViewHierarchy, traceMessageType.error);
342+
write(`Could not find parent with viewController for ${parent} while showing bottom sheet view.`, categories.ViewHierarchy, messageType.error);
344343
return;
345344
}
346345

347346
const parentController = parentWithController.viewController;
348347
if (parentController.presentedViewController) {
349-
traceWrite('Parent is already presenting view controller. Close the current bottom sheet page before showing another one!', traceCategories.ViewHierarchy, traceMessageType.error);
348+
write('Parent is already presenting view controller. Close the current bottom sheet page before showing another one!', categories.ViewHierarchy, messageType.error);
350349
return;
351350
}
352351

353352
if (!parentController.view || !parentController.view.window) {
354-
traceWrite('Parent page is not part of the window hierarchy.', traceCategories.ViewHierarchy, traceMessageType.error);
353+
write('Parent page is not part of the window hierarchy.', categories.ViewHierarchy, messageType.error);
355354
return;
356355
}
357356
this._setupAsRootView({});
@@ -434,7 +433,7 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
434433
protected _hideNativeBottomSheet(parent: View, whenClosedCallback: () => void) {
435434
const parentWithController = ios.getParentWithViewController(parent);
436435
if (!parent || !parentWithController) {
437-
traceError('Trying to hide bottom-sheet view but no parent with viewController specified.');
436+
error('Trying to hide bottom-sheet view but no parent with viewController specified.');
438437
return;
439438
}
440439

src/button/button.android.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { createStateListAnimator, getEnabledColorStateList, getLayout, isPostLollipop } from 'nativescript-material-core/android/utils';
2-
import { dynamicElevationOffsetProperty, elevationProperty, rippleColorProperty, verticalTextAlignmentProperty } from 'nativescript-material-core/cssproperties';
31
import { Color } from '@nativescript/core/color';
2+
import { profile } from '@nativescript/core/profiling';
43
import { Background } from '@nativescript/core/ui/styling/background';
5-
import { TextBase } from '@nativescript/core/ui/text-base';
64
import { androidDynamicElevationOffsetProperty, androidElevationProperty, backgroundInternalProperty, Length } from '@nativescript/core/ui/styling/style-properties';
7-
import { ButtonBase } from './button-common';
85
import { VerticalTextAlignment } from 'nativescript-material-core';
9-
import { profile } from '@nativescript/core/profiling/profiling';
6+
import { createStateListAnimator, getEnabledColorStateList, getLayout, isPostLollipop } from 'nativescript-material-core/android/utils';
7+
import { dynamicElevationOffsetProperty, elevationProperty, rippleColorProperty, verticalTextAlignmentProperty } from 'nativescript-material-core/cssproperties';
8+
import { ButtonBase } from './button-common';
109

1110
let LayoutInflater: typeof android.view.LayoutInflater;
1211

src/button/button.ios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { getRippleColor, themer } from 'nativescript-material-core/core';
2-
import { dynamicElevationOffsetProperty, elevationProperty, rippleColorProperty } from 'nativescript-material-core/cssproperties';
31
import { Color } from '@nativescript/core/color';
42
import { screen } from '@nativescript/core/platform';
53
import { Background } from '@nativescript/core/ui/styling/background';
@@ -13,6 +11,8 @@ import {
1311
fontInternalProperty
1412
} from '@nativescript/core/ui/styling/style-properties';
1513
import { layout } from '@nativescript/core/utils/utils';
14+
import { getRippleColor, themer } from 'nativescript-material-core/core';
15+
import { dynamicElevationOffsetProperty, elevationProperty, rippleColorProperty } from 'nativescript-material-core/cssproperties';
1616
import { ButtonBase } from './button-common';
1717

1818
let buttonScheme: MDCButtonScheme;

0 commit comments

Comments
 (0)