Skip to content

Commit

Permalink
fix: listview
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Aug 3, 2016
1 parent 03b2da1 commit 109baea
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 5 deletions.
85 changes: 85 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch on iOS Device",
"type": "nativescript",
"platform": "ios",
"request": "launch",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"diagnosticLogging": false,
"emulator": false
},
{
"name": "Attach on iOS Device",
"type": "nativescript",
"platform": "ios",
"request": "attach",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"diagnosticLogging": false,
"emulator": false
},
{
"name": "Launch on iOS Emulator",
"type": "nativescript",
"platform": "ios",
"request": "launch",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"diagnosticLogging": false,
"emulator": true
},
{
"name": "Attach on iOS Emulator",
"type": "nativescript",
"platform": "ios",
"request": "attach",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"diagnosticLogging": false,
"emulator": true
},
{
"name": "Launch on Android Device",
"type": "nativescript",
"platform": "android",
"request": "launch",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"diagnosticLogging": false,
"emulator": false
},
{
"name": "Launch on Android Emulator",
"type": "nativescript",
"platform": "android",
"request": "launch",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"diagnosticLogging": false,
"emulator": true
},
{
"name": "Attach on Android Device",
"type": "nativescript",
"platform": "android",
"request": "attach",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"diagnosticLogging": false,
"emulator": false
},
{
"name": "Attach on Android Emulator",
"type": "nativescript",
"platform": "android",
"request": "attach",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"diagnosticLogging": false,
"emulator": true
}
]
}
4 changes: 2 additions & 2 deletions app/pages/listview-vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import {Observable} from 'data/observable';
import {topmost} from 'ui/frame';

export class ListViewModel extends Observable {
public items: Array<any>;
public sampleItems: Array<any>;

constructor() {
super();
this.set('items', [
this.set('sampleItems', [
{
label: 'TO DO :)'
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/pages/listview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</ActionBar>
</Page.actionBar>
<StackLayout>
<ListView items="{{ items }}">
<ListView items="{{ sampleItems }}">
<ListView.itemTemplate>
<StackLayout>
<Label text="{{ label }}" textWrap="true" />
Expand Down
7 changes: 5 additions & 2 deletions app/pages/themes-vm.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Observable} from 'data/observable';
import {topmost} from 'ui/frame';
import {knownFolders} from 'file-system';
var themes = require('nativescript-themes');

export class ThemesModel extends Observable {
Expand All @@ -14,12 +15,14 @@ export class ThemesModel extends Observable {
public switchTheme() {
this._toggled = !this._toggled;

let appPath = knownFolders.currentApp().path + '/';

if (this._toggled) {
this.set('btnText', 'Nina');
themes.applyTheme('app.css');
themes.applyTheme(`${appPath}app.css`);
} else {
this.set('btnText', 'Default');
themes.applyTheme('nina-theme.css');
themes.applyTheme(`${appPath}nina-theme.css`);
}

}
Expand Down

0 comments on commit 109baea

Please sign in to comment.