transparent modal dialogs

This commit is contained in:
vishnuraghavb 2021-03-10 21:29:50 +05:30
parent b92ede3fe2
commit 4840fb609d
6 changed files with 72 additions and 7 deletions

View file

@ -1,5 +1,5 @@
<template>
<Page>
<Page @loaded="onPageLoad" backgroundColor="transparent">
<GridLayout
columns="*"
:rows="`auto, auto, ${stretch ? '*' : 'auto'}, auto`"
@ -64,6 +64,7 @@ import * as Toast from "nativescript-toast";
import { localize } from "@nativescript/localize";
import { mapState, mapActions } from "vuex";
import ConfirmDialog from "./ConfirmDialog.vue";
export default {
props: ["title", "list", "stretch", "action", "helpIcon"],
data() {
@ -85,6 +86,16 @@ export default {
},
methods: {
...mapActions(["removeListItemAction"]),
onPageLoad(args) {
args.object._dialogFragment
.getDialog()
.getWindow()
.setBackgroundDrawable(
new android.graphics.drawable.ColorDrawable(
android.graphics.Color.TRANSPARENT
)
);
},
localized(item) {
if (this.title !== "lang") return localize(item);
else return item;

View file

@ -1,5 +1,5 @@
<template>
<Page>
<Page @loaded="onPageLoad" backgroundColor="transparent">
<GridLayout
columns="*"
rows="auto, auto, auto, *, auto"
@ -118,6 +118,16 @@ export default {
},
},
methods: {
onPageLoad(args) {
args.object._dialogFragment
.getDialog()
.getWindow()
.setBackgroundDrawable(
new android.graphics.drawable.ColorDrawable(
android.graphics.Color.TRANSPARENT
)
);
},
tapAction(recipe) {
this.$modal.close(recipe.id);
},

View file

@ -1,5 +1,5 @@
<template>
<Page>
<Page @loaded="onPageLoad" backgroundColor="transparent">
<StackLayout class="dialogContainer" :class="appTheme">
<Label
class="er dialogIcon"
@ -36,7 +36,7 @@
</template>
<script>
import { Application } from "@nativescript/core";
import { Application, Color } from "@nativescript/core";
import { mapState } from "vuex";
export default {
props: [
@ -59,5 +59,17 @@ export default {
return this.isLightMode ? "#f0f0f0" : "#1A1A1A";
},
},
methods: {
onPageLoad(args) {
args.object._dialogFragment
.getDialog()
.getWindow()
.setBackgroundDrawable(
new android.graphics.drawable.ColorDrawable(
android.graphics.Color.TRANSPARENT
)
);
},
},
};
</script>

View file

@ -1,5 +1,5 @@
<template>
<Page>
<Page @loaded="onPageLoad" backgroundColor="transparent">
<StackLayout class="dialogContainer" :class="appTheme">
<Label
class="er dialogIcon"
@ -97,6 +97,16 @@ export default {
},
},
methods: {
onPageLoad(args) {
args.object._dialogFragment
.getDialog()
.getWindow()
.setBackgroundDrawable(
new android.graphics.drawable.ColorDrawable(
android.graphics.Color.TRANSPARENT
)
);
},
setHrs(args) {
let hr = "0" + this.hrs[args.object.selectedIndex];
this.selectedHrs = hr.slice(-2);

View file

@ -1,5 +1,5 @@
<template>
<Page>
<Page @loaded="onPageLoad" backgroundColor="transparent">
<StackLayout class="dialogContainer" :class="appTheme">
<Label
class="er dialogIcon"
@ -61,6 +61,16 @@ export default {
},
},
methods: {
onPageLoad(args) {
args.object._dialogFragment
.getDialog()
.getWindow()
.setBackgroundDrawable(
new android.graphics.drawable.ColorDrawable(
android.graphics.Color.TRANSPARENT
)
);
},
focusField(args) {
args.object.focus();
setTimeout((e) => Utils.ad.showSoftInput(args.object.android), 1);

View file

@ -1,5 +1,5 @@
<template>
<Page>
<Page @loaded="onPageLoad" backgroundColor="transparent">
<StackLayout class="dialogContainer" :class="appTheme">
<Label
class="er dialogIcon"
@ -76,5 +76,17 @@ export default {
return this.isLightMode ? "#fff" : "#292929";
},
},
methods: {
onPageLoad(args) {
args.object._dialogFragment
.getDialog()
.getWindow()
.setBackgroundDrawable(
new android.graphics.drawable.ColorDrawable(
android.graphics.Color.TRANSPARENT
)
);
},
},
};
</script>