Skip to content

Commit b3e9ce0

Browse files
committed
test: demo app
1 parent c959916 commit b3e9ce0

File tree

4 files changed

+27
-17
lines changed

4 files changed

+27
-17
lines changed

demo-vue/app/examples/BottomSheet.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import { EventData, View, Color } from '@nativescript/core';
2020
import { StackLayout } from '@nativescript/core';
2121
import { ActivityIndicator } from '@nativescript/core';
2222
import { Label } from '@nativescript/core';
23-
import BottomSheetInner from './BottomSheetInner.vue';
24-
import BottomSheetInnerKeyboard from './BottomSheetInnerKeyboard.vue';
23+
import BottomSheetInner from './BottomSheetInner.vue';
24+
import BottomSheetInnerKeyboard from './BottomSheetInnerKeyboard.vue';
2525
import { NativeScriptVue } from 'nativescript-vue';
2626
2727
export const title = 'BottomSheet sample';
@@ -44,7 +44,7 @@ export default Vue.extend({
4444
switch (objId) {
4545
case 'bottomsheet': {
4646
(this as NativeScriptVue).$showBottomSheet(BottomSheetInner, {
47-
transparent:true,
47+
// transparent: true,
4848
closeCallback: (...args) => {
4949
console.log('bottom sheet closed', args);
5050
}
@@ -53,7 +53,7 @@ export default Vue.extend({
5353
}
5454
case 'dont_ignore_top_safe_area': {
5555
(this as NativeScriptVue).$showBottomSheet(BottomSheetInner, {
56-
ignoreTopSafeArea:false,
56+
ignoreTopSafeArea: false,
5757
// transparent:true,
5858
closeCallback: (...args) => {
5959
console.log('bottom sheet closed', args);
@@ -64,7 +64,7 @@ export default Vue.extend({
6464
case 'ignore_bottom_safe_area': {
6565
(this as NativeScriptVue).$showBottomSheet(BottomSheetInner, {
6666
// transparent:true,
67-
ignoreBottomSafeArea:true,
67+
ignoreBottomSafeArea: true,
6868
closeCallback: (...args) => {
6969
console.log('bottom sheet closed', args);
7070
}
@@ -74,8 +74,8 @@ export default Vue.extend({
7474
case 'dont_ignore_top_ignore_bottom_safe_area': {
7575
(this as NativeScriptVue).$showBottomSheet(BottomSheetInner, {
7676
// transparent:true,
77-
ignoreTopSafeArea:false,
78-
ignoreBottomSafeArea:true,
77+
ignoreTopSafeArea: false,
78+
ignoreBottomSafeArea: true,
7979
closeCallback: (...args) => {
8080
console.log('bottom sheet closed', args);
8181
}
@@ -94,4 +94,4 @@ export default Vue.extend({
9494
}
9595
}
9696
});
97-
</script>
97+
</script>

demo-vue/app/examples/BottomSheetInner.vue

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<template>
2-
<MDCardView @shownInBottomSheet="onShownInBottomSheet" borderRadius="20" elevation="30" backgroundColor="green">
3-
<StackLayout>
4-
<MDButton id="test1" text="test1" borderRadius="20" margin="20" @tap="onButtonTap"/>
5-
<MDButton id="test2" text="test2" @tap="onButtonTap"/>
6-
</StackLayout>
7-
</MDCardView>
2+
<!-- <MDCardView @shownInBottomSheet="onShownInBottomSheet" borderRadius="20" elevation="30" backgroundColor="green"> -->
3+
<GridLayout id="test1" rows="auto auto" height="300" backgroundColor="yellow">
4+
<!-- highlighted in red to demonstrate movement -->
5+
<GridLayout id="test2" row="0" backgroundColor="red" verticalAlignment="top">
6+
<Button @tap="toggleExtraContent" text="Toggle extra content"></Button>
7+
</GridLayout>
8+
<GridLayout id="test4" row="1" v-if="showExtraContent">
9+
<Label text="Extra content"></Label>
10+
</GridLayout>
11+
</GridLayout>
12+
<!-- </MDCardView> -->
813
</template>
914

1015
<script lang="ts">
@@ -13,14 +18,19 @@ import Vue from 'vue';
1318
1419
export default Vue.extend({
1520
data() {
16-
return {};
21+
return {
22+
showExtraContent: false
23+
};
1724
},
1825
methods: {
1926
onButtonTap(event) {
2027
this.$closeBottomSheet(event.object.id);
2128
},
2229
onShownInBottomSheet(args) {
2330
console.log('onShownInBottomSheet');
31+
},
32+
toggleExtraContent() {
33+
this.showExtraContent = !this.showExtraContent;
2434
}
2535
}
2636
});

demo-vue/app/examples/BottomSheetInnerKeyboard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ export default Vue.extend({
1919
}
2020
}
2121
});
22-
</script>
22+
</script>

demo-vue/app/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
// import {Trace} from '@nativescript/core';
3-
// Trace.addCategories(Trace.categories.concat(Trace.categories.All));
3+
// Trace.addCategories(Trace.categories.concat(Trace.categories.Layout));
44
// Trace.enable();
55

66
import Vue from 'nativescript-vue';

0 commit comments

Comments
 (0)