Skip to content

Commit 3db3c7b

Browse files
committed
test: demo app
1 parent 855ec42 commit 3db3c7b

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

demo-vue/app/examples/BottomSheetInner.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<template>
22
<GridLayout id="test1" rows="auto auto" height="300" backgroundColor="yellow">
33
<!-- highlighted in red to demonstrate movement -->
4-
<GridLayout id="test2" row="0" backgroundColor="red" verticalAlignment="top">
4+
<Stacklayout id="test2" row="0" backgroundColor="red" verticalAlignment="top">
55
<Button @tap="toggleExtraContent" text="Toggle extra content"></Button>
6-
</GridLayout>
6+
<Button @tap="openAnotherInner" text="Open second"></Button>
7+
<Button id="innerButton" @tap="onButtonTap" text="close with result"></Button>
8+
</Stacklayout>
79
<GridLayout id="test4" row="1" v-if="showExtraContent">
810
<Label text="Extra content"></Label>
911
</GridLayout>
@@ -14,6 +16,8 @@
1416
<script lang="ts">
1517
import * as frameModule from '@nativescript/core/ui/frame';
1618
import Vue from 'vue';
19+
import NativeScriptVue from 'nativescript-vue';
20+
import BottomSheetInnerKeyboardVue from './BottomSheetInnerKeyboard.vue';
1721
1822
export default Vue.extend({
1923
data() {
@@ -30,6 +34,15 @@ export default Vue.extend({
3034
},
3135
toggleExtraContent() {
3236
this.showExtraContent = !this.showExtraContent;
37+
},
38+
openAnotherInner() {
39+
(this as NativeScriptVue).$showBottomSheet(BottomSheetInnerKeyboardVue, {
40+
// transparent:true,
41+
ignoreBottomSafeArea: true,
42+
closeCallback: (...args) => {
43+
console.log('bottom sheet closed', args);
44+
}
45+
});
3346
}
3447
}
3548
});

demo-vue/app/examples/BottomSheetInnerKeyboard.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
22
<StackLayout>
3+
<Stacklayout id="test2" row="0" backgroundColor="red" verticalAlignment="top">
4+
<Button id="innerButtonK" @tap="onButtonTap" text="close with result k"></Button>
5+
</Stacklayout>
36
<MDTextField margin="10" variant="filled" hint="Working TextView hint 🤪" />
47
<PreviousNextView />
58
</StackLayout>
@@ -16,6 +19,9 @@ export default Vue.extend({
1619
methods: {
1720
onShownInBottomSheet(args) {
1821
console.log('onShownInBottomSheet');
22+
},
23+
onButtonTap(event) {
24+
this.$closeBottomSheet(event.object.id);
1925
}
2026
}
2127
});

demo-vue/app/examples/Mixins.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
<NavigationButton text="Back" android.systemIcon="ic_menu_back" @tap="onNavigationButtonTap"></NavigationButton>
55
</ActionBar>
66
<StackLayout>
7-
<Button margin="10" rippleColor="red" backgroundColor="green" borderRadius="10" fontSize="20" text="elevated button" />
7+
<StackLayout backgroundColor="yellow" elevation="10" dynamicElevationOffset="3">
8+
<Button margin="10" elevation="5" rippleColor="red" backgroundColor="green" borderRadius="10" fontSize="20" text="elevated button" @tap="onButtonTap"/>
89
<Button margin="10" rippleColor="red" fontSize="20" text="elevated button" />
910
<Label margin="10" horizontalAlignment="center" backgroundColor="yellow" padding="10" elevation="1" borderRadius="20" rippleColor="red" text="elevated text" />
1011
<Label margin="10" horizontalAlignment="center" padding="10" backgroundColor="yellow" dynamicElevationOffset="3" elevation="1" rippleColor="red" text="elevated text" />
1112
<StackLayout class="cardView" height="100" orientation="horizontal" >
1213
<Label width="100%" textAlignment="center" verticalAlignment="center" text="elevated text" />
1314
</StackLayout>
1415
</StackLayout>
16+
</StackLayout>
1517
</Page>
1618
</template>
1719

@@ -34,6 +36,9 @@ export default Vue.extend({
3436
methods: {
3537
onNavigationButtonTap() {
3638
frameModule.Frame.topmost().goBack();
39+
},
40+
onButtonTap() {
41+
console.log('onButtonTap');
3742
}
3843
},
3944

0 commit comments

Comments
 (0)