Skip to content

chore: update 'gauge' demo for nativescript-ui-gauge v6.0.0 #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<activity
android:name="com.tns.NativeScriptActivity"
android:label="@string/title_activity_kimera"
android:configChanges="keyboardHidden|orientation|screenSize"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
android:theme="@style/LaunchScreenTheme">

<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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

<item name="colorPrimary">@color/ns_primary</item>
Expand Down
4 changes: 2 additions & 2 deletions gauge/app/examples/animations/animations-page.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { topmost } from "tns-core-modules/ui/frame";
import { Frame } from "tns-core-modules/ui/frame";
import { RadRadialGauge, RadialScale, RadialNeedle } from "nativescript-ui-gauge";

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

let gauge: RadRadialGauge = <RadRadialGauge>topmost().getViewById("gaugeView");
let gauge: RadRadialGauge = <RadRadialGauge>Frame.topmost().getViewById("gaugeView");
let scale: RadialScale = <RadialScale>gauge.scales.getItem(0);
needle = <RadialNeedle>scale.indicators.getItem(scale.indicators.length - 1);
}
Expand Down
4 changes: 2 additions & 2 deletions gauge/app/examples/customization/customization-page.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { topmost } from "tns-core-modules/ui/frame";
import { Frame } from "tns-core-modules/ui/frame";
import { RadRadialGauge, RadialScale, RadialBarIndicator } from "nativescript-ui-gauge";

// >> gauges-indicators-bars-animate
export function onNavigatedTo(args) {
let gaugeView: RadRadialGauge = <RadRadialGauge>topmost().getViewById("gaugeView");
let gaugeView: RadRadialGauge = <RadRadialGauge>Frame.topmost().getViewById("gaugeView");
let scale: RadialScale = <RadialScale>gaugeView.scales.getItem(0);
for (let i = 0; i < scale.indicators.length; i++) {
let barIndicator: RadialBarIndicator = <RadialBarIndicator>scale.indicators.getItem(i);
Expand Down
6 changes: 3 additions & 3 deletions gauge/app/navigation/categories-view-model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Observable } from "tns-core-modules/data/observable";
import { topmost } from "tns-core-modules/ui/frame";
import { Frame } from "tns-core-modules/ui/frame";
import { isAndroid } from "tns-core-modules/platform/platform";

export class NavigationItem {
Expand Down Expand Up @@ -126,12 +126,12 @@ export class NavigationViewModel extends Observable {
}

if (tappedItem.subItems.length > 0) {
topmost().navigate({
Frame.topmost().navigate({
moduleName: "navigation/category-list-page"
});
} else {
if (tappedItem.module) {
topmost().navigate({
Frame.topmost().navigate({
moduleName: tappedItem.module,
context: tappedItem
});
Expand Down
8 changes: 4 additions & 4 deletions gauge/app/navigation/category-list-page.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as categoriesViewModel from "./categories-view-model";
import * as frameModule from "tns-core-modules/ui/frame";
import { Frame } from "tns-core-modules/ui/frame";
import * as actionBarModule from "tns-core-modules/ui/action-bar";
import * as applicationModule from "tns-core-modules/application";
import * as utilsModule from "tns-core-modules/utils/utils";

let dataModel = categoriesViewModel.navigationModel;

export function pageLoaded(args) {
if (frameModule.topmost().android) {
if (Frame.topmost().android) {
let page = args.object;
let actionBar = page.actionBar === undefined ? new actionBarModule.ActionBar() : page.actionBar;
actionBar.title = dataModel.currentParent.title;
Expand All @@ -17,7 +17,7 @@ export function pageLoaded(args) {
if (page.content) {
utilsModule.ad.dismissSoftInput(page.content.android);
}
frameModule.topmost().goBack();
Frame.topmost().goBack();
});
if (dataModel.hasBackNavigation) {
navigationButton.android.systemIcon = "ic_menu_back";
Expand Down Expand Up @@ -45,5 +45,5 @@ export function onPageNavigatingFrom(args) {
}

export function onBackTap(args) {
frameModule.topmost().goBack();
Frame.topmost().goBack();
}
4 changes: 2 additions & 2 deletions gauge/app/navigation/example-page.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Page } from "tns-core-modules/ui/page";
import { ActionBar, NavigationButton } from "tns-core-modules/ui/action-bar";
import { android } from "tns-core-modules/application";
import { topmost } from "tns-core-modules/ui/frame";
import { Frame } from "tns-core-modules/ui/frame";
import { ad } from "tns-core-modules/utils/utils";

export class ExamplePage extends Page {
Expand Down Expand Up @@ -33,7 +33,7 @@ export class ExamplePage extends Page {
if (this.content) {
ad.dismissSoftInput(this.content.android);
}
topmost().goBack();
Frame.topmost().goBack();
});
navigationButton.android.systemIcon = "ic_menu_back";
actionBar.navigationButton = navigationButton;
Expand Down
17 changes: 9 additions & 8 deletions gauge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@
"nativescript": {
"id": "org.nativescript.demo",
"tns-ios": {
"version": "6.1.0"
"version": "6.2.0"
},
"tns-android": {
"version": "6.1.0"
"version": "6.2.0"
}
},
"dependencies": {
"nativescript-theme-core": "^1.0.4",
"nativescript-ui-gauge": "*",
"nativescript-unit-test-runner": "0.7.0",
"tns-core-modules": "^6.0.0"
"tns-core-modules": "^6.2.0"
},
"devDependencies": {
"@types/chai": "~4.1.3",
"@types/mocha": "~5.2.1",
"@types/node": "^7.0.5",
"chai": "~4.2.0",
"filewalker": "0.1.2",
"jasmine-core": "^2.5.2",
"karma": "4.1.0",
Expand All @@ -31,13 +32,13 @@
"markdown-snippet-injector": "^0.2.2",
"mocha": "5.2.0",
"mocha-junit-reporter": "^1.18.0",
"mocha-multi": "1.1.0",
"mocha-multi-reporters": "^1.1.0",
"mochawesome": "^3.1.1",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-appium": "~6.0.0",
"nativescript-dev-webpack": "^1.0.0",
"tns-platform-declarations": "^6.1.0",
"nativescript-dev-appium": "^6.0.0",
"nativescript-dev-webpack": "^1.3.0",
"tns-platform-declarations": "^6.2.0",
"tslint": "~5.11.0",
"typescript": "~3.4.5"
"typescript": "~3.5.3"
}
}