Skip to content

Commit a8fde5f

Browse files
authored
Merge pull request #137 from NativeScript/update-listview-demo
chore: update 'listview' demo for nativescript-ui-listview v8.0.1
2 parents bb5445b + 9304247 commit a8fde5f

23 files changed

+55
-53
lines changed

listview/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" />

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<item name="colorPrimary">@color/ns_primary</item>
2727
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
2828
<item name="colorAccent">@color/ns_accent</item>
29+
<item name="android:forceDarkAllowed">true</item>
2930

3031
</style>
3132

listview/app/app.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,10 @@
7070

7171
.iosButton {
7272
margin: 10
73+
}
74+
75+
.red-transparent-selection-list {
76+
item-selected-background-color: red;
77+
background-color: transparent;
78+
color: white;
7379
}

listview/app/examples/FirstVisibleIndex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getItemList } from '../data';
2-
import * as frameModule from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33
import { RadListView } from 'nativescript-ui-listview';
44

55
const description = 'Get first visible index';
@@ -41,7 +41,7 @@ export default {
4141
console.log("First visible index:", this.firstVisibleIndex);
4242
},
4343
onNavigationButtonTap() {
44-
frameModule.topmost().goBack();
44+
Frame.topmost().goBack();
4545
}
4646
}
4747
};

listview/app/examples/GettingStarted.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getItemList } from '../data';
2-
import * as frameModule from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33

44
const description = 'Getting Started';
55
// >> listview-getting-started-vue
@@ -36,7 +36,7 @@ export default {
3636
console.log(`Tapped on ${item.name}`);
3737
},
3838
onNavigationButtonTap() {
39-
frameModule.topmost().goBack();
39+
Frame.topmost().goBack();
4040
}
4141
}
4242
};

listview/app/examples/GettingStartedHo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { simpleItemList } from '../data';
2-
import * as frameModule from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33

44
const description = 'Getting Started Horizontal';
55

@@ -36,7 +36,7 @@ export default {
3636
console.log(`Tapped on ${item.name}`);
3737
},
3838
onNavigationButtonTap() {
39-
frameModule.topmost().goBack();
39+
Frame.topmost().goBack();
4040
}
4141
}
4242
};

listview/app/examples/GridLayout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { simpleItemList } from '../data';
2-
import * as frameModule from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33

44
const description = 'Grid with item height';
55
// >> listvue-gridlayout-vue
@@ -37,7 +37,7 @@ export default {
3737
console.log(`Tapped on ${item.name}`);
3838
},
3939
onNavigationButtonTap() {
40-
frameModule.topmost().goBack();
40+
Frame.topmost().goBack();
4141
}
4242
}
4343
};

listview/app/examples/GridLayoutNoHeight.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { simpleItemList100 } from '../data';
2-
import * as frameModule from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33

44
const description = 'Grid without item height';
55
export default {
@@ -35,7 +35,7 @@ export default {
3535
console.log(`Tapped on ${item.name}`);
3636
},
3737
onNavigationButtonTap() {
38-
frameModule.topmost().goBack();
38+
Frame.topmost().goBack();
3939
}
4040
}
4141
};

listview/app/examples/Group.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as frameModule from "tns-core-modules/ui/frame";
1+
import { Frame } from "tns-core-modules/ui/frame";
22

33
const description = 'Group';
44

@@ -36,7 +36,7 @@ export default {
3636
},
3737
methods: {
3838
onNavigationButtonTap() {
39-
frameModule.topmost().goBack();
39+
Frame.topmost().goBack();
4040
},
4141
getItemGroup(item) {
4242
return item.group;

listview/app/examples/GroupScrollTo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as frameModule from "tns-core-modules/ui/frame";
1+
import { Frame } from "tns-core-modules/ui/frame";
22
import { ObservableArray } from "tns-core-modules/data/observable-array";
33

44

@@ -57,7 +57,7 @@ export default {
5757
},
5858
methods: {
5959
onNavigationButtonTap() {
60-
frameModule.topmost().goBack();
60+
Frame.topmost().goBack();
6161
},
6262
getItemGroup(item) {
6363
return item.category;

listview/app/examples/GroupWithHeaderFooter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as frameModule from "tns-core-modules/ui/frame";
1+
import { Frame } from "tns-core-modules/ui/frame";
22

33
const description = 'Group with header/footer';
44

@@ -39,7 +39,7 @@ export default {
3939
},
4040
methods: {
4141
onNavigationButtonTap() {
42-
frameModule.topmost().goBack();
42+
Frame.topmost().goBack();
4343
},
4444
getItemList() {
4545
const GENERATED_ITEMS_COUNT = 100;

listview/app/examples/ItemAnimations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getItemList } from "../data";
2-
import * as frameModule from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33
import { ObservableArray } from "tns-core-modules/data/observable-array/observable-array";
44
import { ListViewEventData, ListViewItemAnimation } from "nativescript-ui-listview";
55
import * as dialogs from "tns-core-modules/ui/dialogs";
@@ -113,7 +113,7 @@ export default {
113113
});
114114
},
115115
onNavigationButtonTap() {
116-
frameModule.topmost().goBack();
116+
Frame.topmost().goBack();
117117
}
118118
}
119119
};

listview/app/examples/ItemLoading.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { simpleItemList } from '../data';
22
import { Color } from 'tns-core-modules/color';
3-
import * as frameModule from "tns-core-modules/ui/frame";
3+
import { Frame } from "tns-core-modules/ui/frame";
44

55
const description = 'Item Loading';
66

@@ -44,7 +44,7 @@ export default {
4444
}
4545
},
4646
onNavigationButtonTap() {
47-
frameModule.topmost().goBack();
47+
Frame.topmost().goBack();
4848
}
4949
}
5050
};

listview/app/examples/ItemReorder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { simpleItemList } from '../data';
2-
import * as frameModule from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33

44
const description = 'Item Reorder';
55
// >> listview-itemreorder-vue
@@ -37,7 +37,7 @@ export default {
3737
console.log(`Item reordered from index ${index} to ${data.targetIndex}`);
3838
},
3939
onNavigationButtonTap() {
40-
frameModule.topmost().goBack();
40+
Frame.topmost().goBack();
4141
}
4242
}
4343
};

listview/app/examples/ItemSelection.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getItemList } from '../data';
2-
import * as frameModule from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33

44
import { ObservableArray } from 'tns-core-modules/data/observable-array';
55

@@ -13,22 +13,17 @@ export default {
1313
<ActionBar :title="title">
1414
<NavigationButton text="Back" android.systemIcon="ic_menu_back" @tap="onNavigationButtonTap"></NavigationButton>
1515
</ActionBar>
16-
<StackLayout>
16+
<StackLayout backgroundColor="green">
1717
<RadListView ref="listView"
18+
class="red-transparent-selection-list"
1819
for="item in itemList"
1920
selectionBehavior="Press"
2021
@itemSelected="onItemSelected"
2122
@itemSelecting="onItemSelecting"
2223
@itemDeselecting="onItemDeselecting"
2324
@itemDeselected="onItemDeselected">
2425
<v-template>
25-
<StackLayout class="item p-10" orientation="vertical">
26-
<Label :text="item.name" class="nameLabel m-t-10"></Label>
27-
<Label :text="item.description" class="descriptionLabel"></Label>
28-
</StackLayout>
29-
</v-template>
30-
<v-template if="$selected">
31-
<StackLayout class="item p-10 selected" orientation="vertical">
26+
<StackLayout orientation="vertical">
3227
<Label :text="item.name" class="nameLabel m-t-10"></Label>
3328
<Label :text="item.description" class="descriptionLabel"></Label>
3429
</StackLayout>
@@ -66,7 +61,7 @@ export default {
6661
console.log(`Item deselected ${itemSelected.name}`);
6762
},
6863
onNavigationButtonTap() {
69-
frameModule.topmost().goBack();
64+
Frame.topmost().goBack();
7065
}
7166
}
7267
};

listview/app/examples/MultipleTemplates.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as frameModule from "tns-core-modules/ui/frame";
1+
import { Frame } from "tns-core-modules/ui/frame";
22

33
const description = 'Multiple Templates';
44
// >> listview-multipletemplates-itemselector-vue
@@ -79,7 +79,7 @@ export default {
7979

8080
methods: {
8181
onNavigationButtonTap() {
82-
frameModule.topmost().goBack();
82+
Frame.topmost().goBack();
8383
},
8484
templateSelector(item, index, items) {
8585
return {

listview/app/examples/Observable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as frameModule from 'tns-core-modules/ui/frame';
1+
import { Frame } from 'tns-core-modules/ui/frame';
22
import { ObservableArray } from 'tns-core-modules/data/observable-array';
33

44
const description = 'Observable items';
@@ -101,7 +101,7 @@ export default {
101101
},
102102
methods: {
103103
onNavigationButtonTap() {
104-
frameModule.topmost().goBack();
104+
Frame.topmost().goBack();
105105
},
106106
addItem() {
107107
console.log(`Push ${this.nextItem}`);

listview/app/examples/PullToRefresh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as frameModule from "tns-core-modules/ui/frame";
1+
import { Frame } from "tns-core-modules/ui/frame";
22

33
const description = 'Pull To Refresh';
44
// >> listview-pulltorefresh-vue
@@ -70,7 +70,7 @@ export default {
7070
console.log(`Tapped on ${item.name}`);
7171
},
7272
onNavigationButtonTap() {
73-
frameModule.topmost().goBack();
73+
Frame.topmost().goBack();
7474
}
7575
}
7676
};

listview/app/examples/ScrollTo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getItemList } from '../data';
2-
import * as frameModule from "tns-core-modules/ui/frame";
2+
import { Frame } from "tns-core-modules/ui/frame";
33
import { ListViewItemSnapMode } from "nativescript-ui-listview";
44

55
const description = 'Scroll To Item';
@@ -59,7 +59,7 @@ export default {
5959
this.scrollOffset = scrollOffset;
6060
},
6161
onNavigationButtonTap() {
62-
frameModule.topmost().goBack();
62+
Frame.topmost().goBack();
6363
}
6464
}
6565
};

listview/app/examples/StaggeredLayout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as frameModule from "tns-core-modules/ui/frame";
1+
import { Frame } from "tns-core-modules/ui/frame";
22

33
const description = 'Staggered Layout';
44
// >> listview-staggeredlayout-vue
@@ -59,7 +59,7 @@ export default {
5959
console.log(`Tapped on ${item.name}`);
6060
},
6161
onNavigationButtonTap() {
62-
frameModule.topmost().goBack();
62+
Frame.topmost().goBack();
6363
}
6464
}
6565
};

listview/app/examples/SwipeActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getItemList } from '../data';
2-
import * as frameModule from 'tns-core-modules/ui/frame';
2+
import { Frame }from 'tns-core-modules/ui/frame';
33

44
const description = 'Swipe Actions';
55
// >> listview-swipeactions-vue
@@ -68,7 +68,7 @@ export default {
6868
this.$refs.listView.notifySwipeToExecuteFinished();
6969
},
7070
onNavigationButtonTap() {
71-
frameModule.topmost().goBack();
71+
Frame.topmost().goBack();
7272
},
7373
}
7474
};

listview/app/examples/TemplateGroup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as frameModule from "tns-core-modules/ui/frame";
1+
import { Frame } from "tns-core-modules/ui/frame";
22

33
const description = 'Template Group';
44

@@ -39,7 +39,7 @@ export default {
3939
},
4040
methods: {
4141
onNavigationButtonTap() {
42-
frameModule.topmost().goBack();
42+
Frame.topmost().goBack();
4343
},
4444
getItemGroup(item) {
4545
return item.group;

listview/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
"nativescript": {
77
"id": "org.nativescript.demovueradlistview",
88
"tns-android": {
9-
"version": "6.1.0"
9+
"version": "6.2.0"
1010
},
1111
"tns-ios": {
12-
"version": "6.1.0"
12+
"version": "6.2.0"
1313
}
1414
},
1515
"dependencies": {
1616
"nativescript-theme-core": "~1.0.4",
1717
"nativescript-ui-listview": "*",
1818
"nativescript-vue": "~2.4.0",
19-
"tns-core-modules": "^6.0.0",
19+
"tns-core-modules": "^6.2.0",
2020
"tslib": "^1.9.3",
2121
"vue": "^2.5.17"
2222
},
@@ -36,12 +36,12 @@
3636
"mocha-multi-reporters": "^1.1.0",
3737
"mochawesome": "^3.1.1",
3838
"nativescript-dev-appium": "^6.0.0",
39-
"nativescript-dev-webpack": "^1.0.0",
39+
"nativescript-dev-webpack": "^1.3.0",
4040
"nativescript-vue-template-compiler": "~2.4.0",
4141
"shelljs": "^0.8.2",
42-
"tns-platform-declarations": "^6.1.1",
42+
"tns-platform-declarations": "^6.2.0",
4343
"tslint": "~5.11.0",
44-
"typescript": "~3.4.5",
44+
"typescript": "~3.5.3",
4545
"vue-loader": "^15.4.2"
4646
}
4747
}

0 commit comments

Comments
 (0)