Skip to content

Commit 7a331e4

Browse files
authored
Merge pull request #393 from NativeScript/update-gauge-demo
chore: update 'gauge' demo for nativescript-ui-gauge v6.0.0
2 parents 0fbff6d + b8ca93e commit 7a331e4

File tree

8 files changed

+24
-22
lines changed

8 files changed

+24
-22
lines changed

gauge/app/App_Resources/Android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<activity
2929
android:name="com.tns.NativeScriptActivity"
3030
android:label="@string/title_activity_kimera"
31-
android:configChanges="keyboardHidden|orientation|screenSize"
31+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
3232
android:theme="@style/LaunchScreenTheme">
3333

3434
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

gauge/app/App_Resources/Android/src/main/res/values/styles.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
<!-- theme to use AFTER launch screen is loaded-->
2323
<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
24+
<item name="android:forceDarkAllowed">true</item>
2425
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
2526

2627
<item name="colorPrimary">@color/ns_primary</item>

gauge/app/examples/animations/animations-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { topmost } from "tns-core-modules/ui/frame";
1+
import { Frame } from "tns-core-modules/ui/frame";
22
import { RadRadialGauge, RadialScale, RadialNeedle } from "nativescript-ui-gauge";
33

44
let needle: RadialNeedle;
55
export function onNavigatedTo(args) {
66

7-
let gauge: RadRadialGauge = <RadRadialGauge>topmost().getViewById("gaugeView");
7+
let gauge: RadRadialGauge = <RadRadialGauge>Frame.topmost().getViewById("gaugeView");
88
let scale: RadialScale = <RadialScale>gauge.scales.getItem(0);
99
needle = <RadialNeedle>scale.indicators.getItem(scale.indicators.length - 1);
1010
}

gauge/app/examples/customization/customization-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { topmost } from "tns-core-modules/ui/frame";
1+
import { Frame } from "tns-core-modules/ui/frame";
22
import { RadRadialGauge, RadialScale, RadialBarIndicator } from "nativescript-ui-gauge";
33

44
// >> gauges-indicators-bars-animate
55
export function onNavigatedTo(args) {
6-
let gaugeView: RadRadialGauge = <RadRadialGauge>topmost().getViewById("gaugeView");
6+
let gaugeView: RadRadialGauge = <RadRadialGauge>Frame.topmost().getViewById("gaugeView");
77
let scale: RadialScale = <RadialScale>gaugeView.scales.getItem(0);
88
for (let i = 0; i < scale.indicators.length; i++) {
99
let barIndicator: RadialBarIndicator = <RadialBarIndicator>scale.indicators.getItem(i);

gauge/app/navigation/categories-view-model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Observable } from "tns-core-modules/data/observable";
2-
import { topmost } from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33
import { isAndroid } from "tns-core-modules/platform/platform";
44

55
export class NavigationItem {
@@ -126,12 +126,12 @@ export class NavigationViewModel extends Observable {
126126
}
127127

128128
if (tappedItem.subItems.length > 0) {
129-
topmost().navigate({
129+
Frame.topmost().navigate({
130130
moduleName: "navigation/category-list-page"
131131
});
132132
} else {
133133
if (tappedItem.module) {
134-
topmost().navigate({
134+
Frame.topmost().navigate({
135135
moduleName: tappedItem.module,
136136
context: tappedItem
137137
});

gauge/app/navigation/category-list-page.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as categoriesViewModel from "./categories-view-model";
2-
import * as frameModule from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33
import * as actionBarModule from "tns-core-modules/ui/action-bar";
44
import * as applicationModule from "tns-core-modules/application";
55
import * as utilsModule from "tns-core-modules/utils/utils";
66

77
let dataModel = categoriesViewModel.navigationModel;
88

99
export function pageLoaded(args) {
10-
if (frameModule.topmost().android) {
10+
if (Frame.topmost().android) {
1111
let page = args.object;
1212
let actionBar = page.actionBar === undefined ? new actionBarModule.ActionBar() : page.actionBar;
1313
actionBar.title = dataModel.currentParent.title;
@@ -17,7 +17,7 @@ export function pageLoaded(args) {
1717
if (page.content) {
1818
utilsModule.ad.dismissSoftInput(page.content.android);
1919
}
20-
frameModule.topmost().goBack();
20+
Frame.topmost().goBack();
2121
});
2222
if (dataModel.hasBackNavigation) {
2323
navigationButton.android.systemIcon = "ic_menu_back";
@@ -45,5 +45,5 @@ export function onPageNavigatingFrom(args) {
4545
}
4646

4747
export function onBackTap(args) {
48-
frameModule.topmost().goBack();
48+
Frame.topmost().goBack();
4949
}

gauge/app/navigation/example-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Page } from "tns-core-modules/ui/page";
22
import { ActionBar, NavigationButton } from "tns-core-modules/ui/action-bar";
33
import { android } from "tns-core-modules/application";
4-
import { topmost } from "tns-core-modules/ui/frame";
4+
import { Frame } from "tns-core-modules/ui/frame";
55
import { ad } from "tns-core-modules/utils/utils";
66

77
export class ExamplePage extends Page {
@@ -33,7 +33,7 @@ export class ExamplePage extends Page {
3333
if (this.content) {
3434
ad.dismissSoftInput(this.content.android);
3535
}
36-
topmost().goBack();
36+
Frame.topmost().goBack();
3737
});
3838
navigationButton.android.systemIcon = "ic_menu_back";
3939
actionBar.navigationButton = navigationButton;

gauge/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@
66
"nativescript": {
77
"id": "org.nativescript.demo",
88
"tns-ios": {
9-
"version": "6.1.0"
9+
"version": "6.2.0"
1010
},
1111
"tns-android": {
12-
"version": "6.1.0"
12+
"version": "6.2.0"
1313
}
1414
},
1515
"dependencies": {
1616
"nativescript-theme-core": "^1.0.4",
1717
"nativescript-ui-gauge": "*",
1818
"nativescript-unit-test-runner": "0.7.0",
19-
"tns-core-modules": "^6.0.0"
19+
"tns-core-modules": "^6.2.0"
2020
},
2121
"devDependencies": {
2222
"@types/chai": "~4.1.3",
2323
"@types/mocha": "~5.2.1",
2424
"@types/node": "^7.0.5",
25+
"chai": "~4.2.0",
2526
"filewalker": "0.1.2",
2627
"jasmine-core": "^2.5.2",
2728
"karma": "4.1.0",
@@ -31,13 +32,13 @@
3132
"markdown-snippet-injector": "^0.2.2",
3233
"mocha": "5.2.0",
3334
"mocha-junit-reporter": "^1.18.0",
34-
"mocha-multi": "1.1.0",
35+
"mocha-multi-reporters": "^1.1.0",
3536
"mochawesome": "^3.1.1",
3637
"nativescript-css-loader": "~0.26.0",
37-
"nativescript-dev-appium": "~6.0.0",
38-
"nativescript-dev-webpack": "^1.0.0",
39-
"tns-platform-declarations": "^6.1.0",
38+
"nativescript-dev-appium": "^6.0.0",
39+
"nativescript-dev-webpack": "^1.3.0",
40+
"tns-platform-declarations": "^6.2.0",
4041
"tslint": "~5.11.0",
41-
"typescript": "~3.4.5"
42+
"typescript": "~3.5.3"
4243
}
4344
}

0 commit comments

Comments
 (0)