diff --git a/README.md b/README.md
index b29fcc19..9c297a2e 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,13 @@
+## :warning: Important Notice :warning:
+
+To continue receiving updates, please update your EnRecipes to v2.0.0
+
+There are some significant changes in this version. So, in order to continue, you must do the following:
+
+1. Export a full backup.
+2. Uninstall EnRecipes.
+3. Install v2.0.0 and Import your data.
+
A Simple, Offline Recipe Manager
@@ -15,7 +25,7 @@
Important Links
-User Guide - Privacy Policy - Contribution Guide - Roadmap - Telegram Group - Website
+User Guide · Privacy Policy · Contribution Guide · Roadmap · Telegram Group · Website
## Features
@@ -32,7 +42,7 @@
- Create meal plans
- Set cooking timers
- You can Import or Export your data
-- Has Light, Dark and Black themes
+- Light, Dark and Black themes
## Highlights
@@ -41,10 +51,6 @@
- No special permissions required
- No annoying ads or pop-ups
-**Languages being translated**:
-
-[![Translation status](https://hosted.weblate.org/widgets/enrecipes/-/app-translations/multi-auto.svg)](https://hosted.weblate.org/engage/enrecipes/)
-
Check the [Roadmap](https://github.com/vishnuraghavb/EnRecipes/projects/1) for upcoming features.
Please read the [User Guide](https://github.com/vishnuraghavb/EnRecipes/wiki/User-Guide) to get the most out of EnRecipes.
@@ -55,11 +61,11 @@ Please read the [User Guide](https://github.com/vishnuraghavb/EnRecipes/wiki/Use
| :---------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------: |
| **Home - Light theme** | **Home - Dark theme** |
| | |
-| **Home - Black theme** | **Recipe view** |
+| **Recipe view** | **Scale ingredients** |
| | |
-| **Share menu** | **Scale ingredients** |
+| **Share menu** | **Meal Planner** |
| | |
-| **Meal planner** | **About** |
+| **Cooking Timer** | **About** |
## Contribution
@@ -75,19 +81,52 @@ You can,
- [Join the Telegram group](http://t.me/enrecipes) (quicker replies)
- Contact me at apps@vishnuraghav.com
-### Looking to translate the app to your own language?
+### Looking to translate EnRecipes?
EnRecipes is being translated using [Weblate](https://hosted.weblate.org/engage/enrecipes/). See [translation instructions](https://github.com/vishnuraghavb/EnRecipes/wiki/Translation-Instructions) in the wiki for more information.
-
+
+
+
## Credits
This app was written in my free time using NativeScript-Vue. I would like to thank all those people who helped me understand the concepts during the process and my special thanks to the NativeScript team and the community. I also would like to thank the members of the [EnRecipes Telegram group](https://t.me/enrecipes) for contributing their ideas for this project.
-### Recipes used in the Screenshots
+### Translation credits
+
+| Language | Translator(s) |
+| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Arabic | [phwright](https://hosted.weblate.org/user/phwright/) |
+| Catalan | J. Lavoie |
+| Danish | [mondstern](https://hosted.weblate.org/user/mondstern/), Henrik Dankvardt, J. Lavoie, Allan Nordhøy, Jonas Hansen |
+| Dutch | Heimen Stoffels |
+| English (India) | Vishnu Raghav B |
+| English (United Kingdom) | Vishnu Raghav B |
+| English (United States) | Vishnu Raghav B |
+| Finnish | J. Lavoie |
+| French | J. Lavoie, Swann Fournial, fabeuss, [mondstern](https://hosted.weblate.org/user/mondstern/) |
+| French (Canada) | Swann Fournial, J. Lavoie |
+| French (Switzerland) | Swann Fournial, J. Lavoie |
+| French (Belgium) | Swann Fournial, J. Lavoie |
+| German | J. Lavoie, nautilusx, Swann Fournial |
+| Hindi | Vishnu Raghav B, V |
+| Indonesian | Reza Almanda, [mondstern](https://hosted.weblate.org/user/mondstern/) |
+| Italian | J. Lavoie, [mondstern](https://hosted.weblate.org/user/mondstern/), Andrea Ghensi |
+| Japanese | Y. Sakamoto, K. Herbert |
+| Malayalam | Vishnu Raghav B |
+| Norwegian Bokmål | Allan Nordhøy, [mondstern](https://hosted.weblate.org/user/mondstern/), Lars A Reinton |
+| Portuguese | Sérgio Morais, [mondstern](https://hosted.weblate.org/user/mondstern/), J. Lavoie |
+| Portuguese (Brazil) | [mondstern](https://hosted.weblate.org/user/mondstern/), Sérgio Morais, Wesley, Ricardo Zamarrenho Carvalho Correa, J. Lavoie, Nínive de Jesus Celestino, emmanuel einstein campos vasconcelos, Fabio Oliveira |
+| Russian | dm9pZCAq, [mondstern](https://hosted.weblate.org/user/mondstern/), Leca |
+| Spanish | taraletti, J. Lavoie, Sansom, [mondstern](https://hosted.weblate.org/user/mondstern/), Diego |
+| Spanish (Argentina) | another-sapiens |
+| Tamil | Vishnu Raghav B |
+
+### Screenshot recipe credits
- **Meen Pollichathu** by [Bency Veronica](https://www.instagram.com/bencys_lil_kitchen)
- **Curd Vada** by P. Shanmugalakshmi
diff --git a/app/app.scss b/app/app.scss
index ddb33624..7ce68960 100644
--- a/app/app.scss
+++ b/app/app.scss
@@ -17,7 +17,7 @@ $t1: 25;
$t2: 21;
$t3: 17;
$t4: 14;
-$t5: 12; // Base size
+$t5: 12; // Base
$t6: 10;
Page {
@@ -25,34 +25,35 @@ Page {
font-size: $t4;
}
.ico {
- font-family: 'enrecipes';
- font-size: 24;
- vertical-alignment: center;
- &.sm {
+ font-family: 'EnRecipes';
+ font-size: 23;
+ &.s {
font-size: $t3;
opacity: 0.5;
}
}
+.vc {
+ vertical-align: center;
+}
.tb {
font-family: 'Inter-Bold', sans-serif;
}
-.tac {
+.tc {
text-align: center;
}
.tw {
text-wrap: true;
}
-.pageTitle {
- @extend .tb;
- @extend .tw;
+
+.pTitle {
font-size: $t1;
padding: 16 16 24;
}
+
.Light {
color: $gray9;
background: $gray1;
Page,
- .filters,
.sticky {
background: $gray1;
}
@@ -67,8 +68,9 @@ Page {
.appbar,
.modal {
background: $gray0;
+ box-shadow: 0 2 rgba($gray10, 0.1);
}
- .fieldLabel,
+ .fLabel,
.sub {
color: $gray6;
}
@@ -76,7 +78,7 @@ Page {
color: $gray3;
background: $gray2;
}
- .snackBar {
+ .snackbar {
color: $gray1;
background: $gray9;
}
@@ -88,7 +90,6 @@ Page {
color: $gray1;
background: $gray9;
Page,
- .filters,
.sticky {
background: $gray9;
}
@@ -105,7 +106,7 @@ Page {
color: $gray0;
background: $gray8;
}
- .fieldLabel,
+ .fLabel,
.sub {
color: $gray5;
}
@@ -113,7 +114,7 @@ Page {
color: $gray9;
background: $gray10;
}
- .snackBar {
+ .snackbar {
color: $gray9;
background: $gray1;
}
@@ -125,7 +126,6 @@ Page {
color: $gray2;
background: $gray10;
Page,
- .filters,
.sticky {
background: $gray10;
}
@@ -142,7 +142,7 @@ Page {
color: $gray1;
background: $gray9;
}
- .fieldLabel,
+ .fLabel,
.sub {
color: $gray6;
}
@@ -150,7 +150,7 @@ Page {
color: $gray10;
background: $gray9;
}
- .snackBar {
+ .snackbar {
color: $gray10;
background: $gray2;
}
@@ -158,8 +158,9 @@ Page {
color: $gray10;
}
}
+
TextField.combField,
-#searchBar {
+#search {
border-color: transparent;
}
@@ -167,28 +168,24 @@ TextField.combField,
// Elements
TextField,
TextView {
- width: 100%;
+ // width: 100%;
padding: 14 8;
border-bottom-width: 1;
}
TextView {
line-height: 4;
}
-#searchBar {
- padding: 13 12;
+#search {
+ padding: 13 8;
}
-.inputField {
+.inputC {
margin-bottom: 24;
}
-.fieldLabel {
+.fLabel {
font-size: $t5;
}
-.progressContainer {
- width: 100%;
-}
progress {
color: $orange;
- width: 100%;
height: 2;
background-color: $gray5;
}
@@ -197,12 +194,17 @@ Switch {
off-background-color: $gray5;
}
button {
- background-color: transparent;
z-index: 0;
padding: 8;
border-radius: 12;
min-width: 0;
min-height: 0;
+ text-transform: none;
+ background-color: transparent;
+ &.sst {
+ width: 48;
+ height: 48;
+ }
&.ico {
width: 48;
height: 48;
@@ -212,36 +214,28 @@ button {
@extend .fade;
}
}
+ &.si {
+ width: 40;
+ height: 40;
+ }
&.text {
- @extend .tb;
color: $orange;
- &:active {
- @extend .fade;
- }
+ }
+ &.st {
+ font-size: $t5;
+ padding: 12;
}
&.big {
margin-top: 8;
padding: 16 0;
}
- &.sm {
- font-size: $t5;
- padding: 12;
- }
- &.min {
- width: 40;
- height: 40;
- vertical-alignment: center;
- }
- &.fb:active {
- @extend .fade;
- }
&.rate {
margin: 0 4 0 0;
width: 32;
height: 32;
- &:active {
- @extend .fade;
- }
+ }
+ &.fb:active {
+ @extend .fade;
}
}
ActivityIndicator {
@@ -255,52 +249,40 @@ ActivityIndicator {
// Home
.segment {
border-radius: 12;
- margin: 0 4 0 0;
- padding: 0 12;
- .value {
- padding: 0 0 0 8;
- vertical-alignment: center;
- &.r {
- padding: 0 8 0 0;
- transform: scaleX(-1);
- }
+ padding: 8;
+ .v {
+ padding: 0 4;
}
}
-.select {
- color: $orange;
- @extend .hl;
+.t3 {
+ font-size: $t3;
}
-.emptyState {
+.empty {
padding: 16 16 8;
- label {
- @extend .tw;
- }
- .title {
- @extend .tb;
- font-size: $t3;
- }
}
// -----------------------------
// Recipe Item
-.recipeItem {
+.recipe {
padding: 8 16;
- .recipeInfo {
- vertical-alignment: center;
+ .info {
padding: 0 8 4;
}
.title {
padding: 0 0 4;
}
}
-.attrs {
+.oh {
orientation: horizontal;
}
+.t6 {
+ font-size: $t6;
+}
.attr {
font-size: $t6;
- padding: 1 4;
+ padding: 0 4 2;
}
-.simple .recipeInfo {
+.simple .info {
padding: 8 0;
}
.minimal .title {
@@ -308,7 +290,7 @@ ActivityIndicator {
}
.grid {
padding: 8;
- .recipeInfo {
+ .info {
padding: 8 0 4;
}
&.odd {
@@ -318,18 +300,12 @@ ActivityIndicator {
padding: 8 16 8 8;
}
}
-.photogrid .recipeInfo {
+.photogrid .info {
padding: 8 0 0;
}
.lastItem {
margin-bottom: 128;
}
-.selected {
- @extend .hl;
-}
-.unselected {
- background-color: transparent;
-}
.imgHolder {
border-radius: 12;
}
@@ -351,9 +327,8 @@ ActivityIndicator {
// -----------------------------
// Settings
-.group-info {
+.groupInfo {
padding: 16 16 16 72;
- line-height: 4;
&.r {
padding: 16 72 16 16;
}
@@ -375,14 +350,11 @@ ActivityIndicator {
}
}
}
-.listSpace {
- height: 72;
-}
// -----------------------------
// About
-.app-info {
- .icon {
+.appInfo {
+ .logo {
horizontal-alignment: center;
}
.name {
@@ -401,108 +373,62 @@ ActivityIndicator {
margin: 24 16 0 0;
vertical-align: top;
}
-.photoviewer {
+.imgV {
width: 96;
height: 96;
opacity: 0;
background: #000;
}
-.attribute {
+.attrT {
margin: 8 16;
.sub {
font-size: $t5;
}
- .value {
+ .v {
@extend .tb;
@extend .tw;
}
}
-.ingredient {
+.check {
padding: 0 16;
- .value {
- @extend .tw;
- vertical-align: center;
- padding: 14 16;
- line-height: 4;
- }
-}
-.instruction {
- padding: 0 16;
- .count {
- @extend .tb;
- font-size: $t3;
- }
- .value {
- @extend .tw;
+ .v {
padding: 14 16;
line-height: 4;
}
}
.done {
opacity: 0.5;
- .value {
+ .v {
text-decoration: line-through;
}
}
-.combination {
- @extend .tw;
- text-align: left;
- padding: 16;
- line-height: 4;
-}
.note {
- @extend .tw;
- line-height: 4;
- padding: 16 0;
-}
-.dateInfo {
- padding: 32 16 16;
- font-size: $t5;
+ padding: 16 24;
line-height: 4;
}
// -----------------------------
// AppBar
+
.appbar {
- z-index: 4;
- min-height: 56;
- margin: 8;
- padding: 4;
+ margin: 0 8 8;
border-radius: 16;
- .title {
- @extend .tb;
- @extend .tw;
- vertical-align: center;
- margin: 0 12;
- line-height: 4;
+ padding: 2;
+ .ico {
+ margin: 2;
}
- .msg {
- padding: 14 16;
- margin: 0;
- }
- .fab {
- margin-left: 8;
- }
- &.home {
- margin: 8 8 0;
- }
-}
-.sidebar {
- margin-bottom: 0;
}
.toolbar {
- z-index: 4;
- padding: 4;
- margin: 0 0 52;
+ height: 1;
+ vertical-align: bottom;
+ transform: translateY(48);
+ padding: 4 2;
.tool {
+ orientation: horizontal;
padding: 0 8;
- label {
- vertical-alignment: center;
- }
- .value,
- .ico {
- padding: 0 4;
- }
+ }
+ .v {
+ padding: 0 4;
}
}
.fab {
@@ -512,64 +438,44 @@ ActivityIndicator {
// -----------------------------
// EditRecipe
-.sectionTitle {
- @extend .tb;
- @extend .tw;
- font-size: $t2;
- padding: 0;
+.section {
+ padding: 0 16;
margin: 32 0 16;
}
+.t2 {
+ font-size: $t2;
+}
.sticky {
width: 100%;
padding: 0 16 16;
- margin: 0;
-}
-.countdown {
- font-size: $t3;
- color: $orange;
}
// -----------------------------
// MealPlanner
-.monthSwitcher {
- padding: 0 16;
- .month {
- vertical-alignment: center;
- text-align: center;
- font-size: $t3;
- }
-}
.calendar {
- padding: 0 16;
- .dayName {
- vertical-alignment: center;
- text-align: center;
- font-size: $t5;
- }
+ padding: 0 16 16;
.accent.sub {
- color: rgba($orange, 0.5);
+ color: rgba($orange, 0.6);
}
}
.plans {
- padding: 8 16 80;
- width: 100%;
+ margin: 0 16;
.date {
- font-size: $t2;
- padding: 16 0;
+ padding: 16 0 8;
+ }
+ .type {
+ padding: 8 0;
}
.plan {
- padding: 8 0;
- }
- .meal {
- font-size: $t3;
- padding: 8 0;
- }
- .planContent {
min-height: 48;
- padding: 8;
+ padding: 4 0;
}
- .attr {
- padding: 0;
+ .info {
+ min-height: 40;
+ padding: 0 8;
+ }
+ .note {
+ padding: 4 0;
}
}
@@ -589,35 +495,16 @@ ActivityIndicator {
.input {
padding: 0 16 8;
}
- .description {
- line-height: 4;
- padding: 0 16 8;
- }
ListPicker {
width: 30%;
height: 144;
margin: 16 0;
}
.listItem {
- letter-spacing: 0;
- text-transform: none;
line-height: 4;
padding: 13 16;
- margin: 0;
background-color: transparent;
}
- .shareItem {
- border-radius: 12;
- margin: 0 8 8;
- text-align: center;
- .ico {
- padding: 16 0 0;
- }
- .item {
- @extend .tw;
- padding: 8 16 16;
- }
- }
.actions {
padding: 4;
}
@@ -626,27 +513,25 @@ ActivityIndicator {
margin: 0 0 8;
}
}
-.noResInfo {
- @extend .tac;
- @extend .tw;
- padding: 16;
- line-height: 4;
-}
// -----------------------------
// Transitions
-.hl {
- animation-name: hl;
+.select {
+ color: $orange;
+ animation-name: select;
animation-duration: 0.2s;
animation-fill-mode: forwards;
animation-timing-function: ease;
}
-@keyframes hl {
+.deselect {
+ background-color: transparent;
+}
+@keyframes select {
0% {
background-color: transparent;
}
100% {
- background-color: rgba($orange, 0.2);
+ background-color: rgba($orange, 0.1);
}
}
.fade {
@@ -660,7 +545,7 @@ ActivityIndicator {
opacity: 1;
}
100% {
- opacity: 0.5;
+ opacity: 0.75;
}
}
@@ -678,3 +563,18 @@ ActivityIndicator {
horizontal-alignment: right;
}
}
+.har {
+ horizontal-alignment: right;
+ &.r {
+ horizontal-alignment: left;
+ }
+}
+.edge {
+ width: 16;
+}
+.ls {
+ height: 72;
+}
+.lh4 {
+ line-height: 4;
+}
diff --git a/app/components/CookingTimer.vue b/app/components/CookingTimer.vue
index d0e4351f..24eaf053 100644
--- a/app/components/CookingTimer.vue
+++ b/app/components/CookingTimer.vue
@@ -1,5 +1,5 @@
-
+
-
+
-
+
-
-
-
-
+
+
+
+
-
-
+
+
+
+
@@ -58,7 +70,6 @@
import { localize } from "@nativescript/localize";
import {
Observable,
- CoreTypes,
Application,
Utils,
Device,
@@ -104,11 +115,11 @@ export default {
...mapState([
"icon",
"recipes",
- "timerSound",
- "timerVibrate",
- "timerPresets",
- "activeTimers",
- "FGService",
+ "timerS",
+ "timerV",
+ "timerPs",
+ "activeTs",
+ "FGS",
"RTL",
]),
hasBackStack() {
@@ -116,24 +127,12 @@ export default {
},
},
methods: {
- ...mapActions([
- "addActiveTimer",
- "removeActiveTimer",
- "clearTimerInterval",
- "addTimerPreset",
- "updateActiveTimer",
- "setFGService",
- ]),
+ ...mapActions(["addAT", "removeAT", "clearATIs", "updateAT", "setFgS"]),
pgLoad({ object }) {
object.bindingContext = new Observable();
- if (this.activeTimers.filter((e: any) => e.done).length)
- this.openReminder();
- this.keepScreenOnCountUp();
+ if (this.activeTs.filter((e: any) => e.done).length) this.openReminder();
setNumber("isTimer", 1);
},
- pgUnload() {
- utils.keepScreenOn(0);
- },
abLoad({ object }) {
this.appbar = object;
},
@@ -151,19 +150,8 @@ export default {
scrollUp = y < this.scrollPos;
this.scrollPos = Math.abs(y);
let ab = this.appbar.translateY;
- if (!scrollUp && ab == 0) {
- this.appbar.animate({
- translate: { x: 0, y: 64 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
- } else if (scrollUp && ab == 64) {
- this.appbar.animate({
- translate: { x: 0, y: 0 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
- }
+ if (!scrollUp && ab == 0) this.animateBar(this.appbar, 0);
+ else if (scrollUp && ab == 64) this.animateBar(this.appbar, 1);
}
},
@@ -192,8 +180,8 @@ export default {
// NOTIFICATION HANDLERS
timerInfo() {
- let activeCount = this.activeTimers.length;
- let pausedCount = this.activeTimers.filter((e) => e.isPaused).length;
+ let activeCount = this.activeTs.length;
+ let pausedCount = this.activeTs.filter((e) => e.isPaused).length;
let ongoingCount = activeCount - pausedCount;
this.foregroundService(activeCount);
function show() {
@@ -208,14 +196,12 @@ export default {
title: localize("timer"),
});
}
- if (this.FGService)
- setTimeout(() => this.activeTimers.length && show(), 250);
- this.keepScreenOnCountUp();
+ if (this.FGS) setTimeout(() => this.activeTs.length && show(), 250);
utils.wakeLock(ongoingCount);
},
timerAlert() {
let title, description, bID;
- let firedTimers = this.activeTimers.filter((e) => e.done);
+ let firedTimers = this.activeTs.filter((e) => e.done);
let timer = firedTimers[0];
if (firedTimers.length > 1) {
title = localize("texp", firedTimers.length);
@@ -240,9 +226,9 @@ export default {
multi: firedTimers.length > 1,
nID: 7,
priority: 1,
- sound: this.timerSound.uri,
+ sound: this.timerS.uri,
title,
- vibrate: this.timerVibrate,
+ vibrate: this.timerV,
});
if (firedTimers.length == 1) {
Application.android.registerBroadcastReceiver(bID, (ctx, intent) => {
@@ -260,7 +246,7 @@ export default {
}
},
openReminder() {
- this.clearTimerInterval();
+ this.clearATIs();
this.$showModal(TimerReminder, {
fullscreen: true,
props: {
@@ -271,7 +257,7 @@ export default {
showToast: this.showToast,
},
}).then(() => {
- this.clearTimerInterval();
+ this.clearATIs();
this.key = Math.floor(Math.random() * 900) + 100;
});
},
@@ -281,16 +267,16 @@ export default {
ctx,
com.tns.ForegroundService.class
);
- if (n && !this.FGService) {
+ if (n && !this.FGS) {
parseInt(Device.sdkVersion) < 26
? ctx.startService(intent)
: ctx.startForegroundService(intent);
- this.setFGService(1);
- setNumber("FGService", 1);
- } else if (!this.activeTimers.length) {
+ this.setFgS(1);
+ setNumber("FGS", 1);
+ } else if (!this.activeTs.length) {
ctx.stopService(intent);
- this.setFGService(0);
- setNumber("FGService", 0);
+ this.setFgS(0);
+ setNumber("FGS", 0);
}
},
@@ -299,14 +285,14 @@ export default {
this.$showModal(TimePickerHMS, {
props: {
title: "ntmr",
- label: `${localize("tmr", this.activeTimers.length + 1)}`,
+ label: `${localize("tmr", this.activeTs.length + 1)}`,
action: "strtBtn",
- showPreset: this.timerPresets.length,
+ showPreset: this.timerPs.length,
},
}).then((res) => {
if (res) {
if (res == "presets") {
- let list = this.timerPresets.map(
+ let list = this.timerPs.map(
(e) => `${e.label} - ${this.formattedTime(e.time)}`
);
this.$showModal(Action, {
@@ -317,22 +303,22 @@ export default {
}).then((preset) => {
if (preset) {
let timer = JSON.parse(
- JSON.stringify(this.timerPresets[list.indexOf(preset)])
+ JSON.stringify(this.timerPs[list.indexOf(preset)])
);
timer.id = utils.getRandomID(1);
timer.recipeID = this.recipeID;
timer.timerInt = timer.isPaused = 0;
timer.preset = timer.mode = 1;
- this.addActiveTimer({
+ this.addAT({
timer,
- i: this.activeTimers.length,
+ i: this.activeTs.length,
});
this.timerInfo();
}
});
} else {
let mode = res.time != "00:00:00" ? 1 : 0;
- this.addActiveTimer({
+ this.addAT({
timer: {
id: utils.getRandomID(1),
label: res.label,
@@ -344,7 +330,7 @@ export default {
done: 0,
mode,
},
- i: this.activeTimers.length,
+ i: this.activeTs.length,
});
this.timerInfo();
}
@@ -352,11 +338,11 @@ export default {
});
},
removeTimer(id, noUndo) {
- let i = this.activeTimers.findIndex((e) => e.id == id);
- let temp = this.activeTimers[i];
+ let i = this.activeTs.findIndex((e) => e.id == id);
+ let temp = this.activeTs[i];
clearInterval(temp.timerInt);
temp.timerInt = 0;
- this.removeActiveTimer(i);
+ this.removeAT(i);
let secs = [getNumber(`${temp.id}c`, 0), getNumber(`${temp.id}d`, 0)];
function removeSettings() {
remove(`${temp.id}c`);
@@ -368,7 +354,7 @@ export default {
.then(() => {
setNumber(`${temp.id}c`, secs[0]),
setNumber(`${temp.id}d`, secs[1]),
- this.addActiveTimer({
+ this.addAT({
timer: temp,
i,
});
@@ -382,7 +368,7 @@ export default {
togglePause(timer, n) {
timer.isPaused =
typeof n === "number" ? n : (!timer.isPaused as boolean | 0);
- this.updateActiveTimer(timer);
+ this.updateAT(timer);
n ? 0 : this.timerInfo();
},
showToast(data) {
@@ -390,7 +376,7 @@ export default {
this.animateBar(this.appbar, 0).then(() => {
this.showUndo = 0;
this.toast = localize(data);
- this.animateBar(this.toastbar, 1);
+ this.animateBar(this.toastbar, 1, 1);
let a = 5;
clearInterval(barTimer);
barTimer = setInterval(() => a-- < 1 && this.hideBar(), 1000);
@@ -404,7 +390,7 @@ export default {
this.showUndo = 1;
this.snackMsg = message;
this.countdown = 5;
- this.animateBar(this.snackbar, 1).then(() => {
+ this.animateBar(this.snackbar, 1, 1).then(() => {
let a = 5;
clearInterval(barTimer);
barTimer = setInterval(() => {
@@ -456,14 +442,9 @@ export default {
},
// HELPERS
- keepScreenOnCountUp() {
- utils.keepScreenOn(
- this.activeTimers.filter((e: any) => !e.isPaused).length
- );
- },
},
created() {
- this.clearTimerInterval();
+ this.clearATIs();
this.recipeID && this.addTimer();
},
destroyed() {
diff --git a/app/components/EditRecipe.vue b/app/components/EditRecipe.vue
index 0a54e8fd..97fc55cf 100644
--- a/app/components/EditRecipe.vue
+++ b/app/components/EditRecipe.vue
@@ -3,7 +3,11 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
+
+
@@ -315,10 +339,8 @@ import {
Screen,
Utils,
Observable,
- CoreTypes,
Frame,
Application,
- GridLayout,
} from "@nativescript/core";
import { getString, setString } from "@nativescript/core/application-settings";
import { localize } from "@nativescript/localize";
@@ -369,7 +391,7 @@ export default {
modalOpen: 0,
saving: 0,
cacheImagePath: null,
- unSyncCombinations: [],
+ unLinkCombs: [],
difficultyLevels: ["Easy", "Moderate", "Challenging"],
appbar: null,
snackbar: null,
@@ -405,11 +427,7 @@ export default {
},
},
methods: {
- ...mapActions([
- "addRecipeAction",
- "addListItemAction",
- "unSyncCombinationsAction",
- ]),
+ ...mapActions(["addR", "addLI", "unLinkCs"]),
pgLoad({ object }) {
object.bindingContext = new Observable();
this.hijackBackEvent();
@@ -430,19 +448,10 @@ export default {
scrollUp = y < this.scrollPos;
this.scrollPos = Math.abs(y);
let ab = this.appbar.translateY;
- if (!scrollUp && ab == 0) {
- this.appbar.animate({
- translate: { x: 0, y: 64 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
- } else if (scrollUp && ab == 64) {
+ if (!scrollUp && ab == 0) this.animateBar(this.appbar, 0);
+ else if (scrollUp && ab == 64) {
Utils.ad.dismissSoftInput();
- this.appbar.animate({
- translate: { x: 0, y: 0 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
+ this.animateBar(this.appbar, 1);
}
}
},
@@ -478,37 +487,39 @@ export default {
knownFolders.temp().path,
`${utils.getRandomID(0)}.jpg`
);
- utils.copyPhotoToCache(uri, this.cacheImagePath).then((imgPath) => {
- if (imgPath) {
- ImageSource.fromFile(imgPath).then((image) => {
- ImageCropper.prototype
- .show(
- image,
- {
- width: 1080,
- height: 1080,
- },
- {
- hideBottomControls: true,
- toolbarTitle: localize("cPic"),
- statusBarColor: "#ff5200",
- toolbarTextColor: aT == "Light" ? "#212529" : "#f1f3f5",
- toolbarColor:
- aT == "Light"
- ? "#f1f3f5"
- : aT == "Dark"
- ? "#212529"
- : "#000000",
- cropFrameColor: "#ff5200",
- }
- )
- .then((cropped) => {
- cropped.image.saveToFile(this.cacheImagePath, "jpg", 75);
- this.recipe.image = this.cacheImagePath;
- });
- });
- }
- });
+ utils
+ .copyPhotoToCache(uri.toString(), this.cacheImagePath)
+ .then((imgPath) => {
+ if (imgPath) {
+ ImageSource.fromFile(imgPath).then((image) => {
+ ImageCropper.prototype
+ .show(
+ image,
+ {
+ width: 1080,
+ height: 1080,
+ },
+ {
+ hideBottomControls: true,
+ toolbarTitle: localize("cPic"),
+ statusBarColor: "#ff5200",
+ toolbarTextColor: aT == "Light" ? "#212529" : "#f1f3f5",
+ toolbarColor:
+ aT == "Light"
+ ? "#f1f3f5"
+ : aT == "Dark"
+ ? "#212529"
+ : "#000000",
+ cropFrameColor: "#ff5200",
+ }
+ )
+ .then((cropped) => {
+ cropped.image.saveToFile(this.cacheImagePath, "jpg", 75);
+ this.recipe.image = this.cacheImagePath;
+ });
+ });
+ }
+ });
}
});
},
@@ -545,7 +556,7 @@ export default {
this.modalOpen = 0;
if (item.length) {
this.recipe.cuisine = item;
- this.addListItemAction({
+ this.addLI({
item,
listName: "cuisines",
});
@@ -559,7 +570,7 @@ export default {
if (focus) this.autoFocusField("category", 0);
} else
this.cuisines.includes(this.recipe.cuisine)
- ? mull
+ ? null
: (this.recipe.cuisine = "Undefined");
}
});
@@ -584,7 +595,7 @@ export default {
this.modalOpen = 0;
if (item.length) {
this.recipe.category = item;
- this.addListItemAction({
+ this.addLI({
item,
listName: "categories",
});
@@ -598,7 +609,7 @@ export default {
if (focus) this.autoFocusField("tags", 1);
} else
this.categories.includes(this.recipe.category)
- ? mull
+ ? null
: (this.recipe.category = "Undefined");
}
});
@@ -623,7 +634,7 @@ export default {
this.modalOpen = 0;
if (item.length) {
this.recipe.yieldUnit = item;
- this.addListItemAction({
+ this.addLI({
item,
listName: "yieldUnits",
});
@@ -637,7 +648,7 @@ export default {
if (focus) this.autoFocusField("difficultyLevel", 0);
} else
this.yieldUnits.includes(this.recipe.yieldUnit)
- ? mull
+ ? null
: (this.recipe.yieldUnit = "Serving");
}
});
@@ -657,7 +668,7 @@ export default {
if (focus) this.addIngredient();
} else
this.difficultyLevels.includes(this.recipe.difficulty)
- ? mull
+ ? null
: (this.recipe.difficulty = "Easy");
});
},
@@ -681,7 +692,7 @@ export default {
this.modalOpen = 0;
if (item.length) {
this.recipe.ingredients[index].unit = item;
- this.addListItemAction({
+ this.addLI({
item,
listName: "units",
});
@@ -772,7 +783,7 @@ export default {
removeCombination(id) {
let index = this.recipe.combinations.indexOf(id);
this.recipe.combinations.splice(index, 1);
- this.unSyncCombinations.push(id);
+ this.unLinkCombs.push(id);
this.showUndoBar("rmCmb").then((res) =>
this.recipe.combinations.splice(index, 0, id)
);
@@ -819,14 +830,14 @@ export default {
} else if (this.tempRecipe.image) {
getFileAccess().deleteFile(this.tempRecipe.image);
}
- this.unSyncCombinationsAction({
+ this.unLinkCs({
id: this.recipeID,
- combinations: this.unSyncCombinations,
+ combs: this.unLinkCombs,
});
this.saveRecipe();
},
saveRecipe() {
- this.addRecipeAction(this.recipe);
+ this.addR(this.recipe);
this.saving = 0;
this.dupRecipe
? this.$navigateTo(EnRecipes, {
@@ -844,7 +855,7 @@ export default {
this.showUndo = 1;
this.snackMsg = message;
this.countdown = 5;
- this.animateBar(this.snackbar, 1).then(() => {
+ this.animateBar(this.snackbar, 1, 1).then(() => {
let a = 5;
barTimer = setInterval(() => {
if (this.undo) {
diff --git a/app/components/EnRecipes.vue b/app/components/EnRecipes.vue
index 3f34288f..c869af32 100644
--- a/app/components/EnRecipes.vue
+++ b/app/components/EnRecipes.vue
@@ -1,6 +1,6 @@
-
-
+
+
-
+
-
+
-
+
@@ -65,7 +65,7 @@
-
+
-
+
-
+
-
-
+
+
-
-
-
-
+
+
+
+
-
+
@@ -129,7 +125,7 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -189,7 +181,7 @@
-
+
@@ -227,7 +219,7 @@
-
+
-
-
+
+
-
+
-
-
+
+
@@ -259,7 +247,7 @@
-
+
@@ -278,75 +266,61 @@
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
null"
>
@@ -403,14 +377,14 @@
{};
if (!rl && !ff && !ftl) {
r.title = "strAdd";
r.sub = "plsAdd";
@@ -591,20 +583,7 @@ export default {
},
},
methods: {
- ...mapActions([
- "initListItems",
- "initRecipes",
- "initMealPlans",
- "initTimerPresets",
- "setShake",
- "setFirstDay",
- "setLayout",
- "setSortType",
- "deleteRecipes",
- "clearFilter",
- "setTheme",
- "setTimerSound",
- ]),
+ ...mapActions(["setS", "setST", "deleteRs", "clearF"]),
setComp(comp) {
this.currentComp = comp;
},
@@ -620,15 +599,14 @@ export default {
if (this.shake) {
if (utils.hasAccelerometer())
startAccelerometerUpdates((data) => this.onSensorData(data));
- else this.setShake(0);
+ else this.setS(0);
}
this.hijackBackEvent();
setTimeout(() => {
if (this.listview) this.listview.refresh();
}, 1000);
- this.showTools && this.toggleTools();
},
- onPageUnload() {
+ pgUnload() {
if (this.shake) stopAccelerometerUpdates();
},
abLoad({ object }) {
@@ -644,9 +622,9 @@ export default {
object.android.setOverScrollMode(View.OVER_SCROLL_NEVER);
this.listview = object;
},
- cvScroll(args) {
+ cvScroll({ object }) {
let scrollUp;
- let y = args.object.scrollOffset;
+ let y = object.scrollOffset;
if (y) {
scrollUp = y < this.scrollPos;
this.scrollPos = Math.abs(y);
@@ -656,19 +634,11 @@ export default {
}
},
showBars() {
- this.appbar.animate({
- translate: { x: 0, y: 0 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
+ this.animateBar(this.appbar, 1);
},
hideBars() {
this.showTools && this.toggleTools();
- this.appbar.animate({
- translate: { x: 0, y: 64 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
+ this.animateBar(this.appbar, 0);
},
getSpanSize(index) {
return (this.layout == "grid" || this.layout == "photogrid") &&
@@ -709,12 +679,12 @@ export default {
"Newest first",
"Oldest first",
],
- selected: this.sortType,
+ selected: this.sortT,
},
}).then((action) => {
- if (action && this.sortType !== action) {
- this.setSortType(action);
- ApplicationSettings.setString("sortType", action);
+ if (action && this.sortT !== action) {
+ this.setST(action);
+ ApplicationSettings.setString("sortT", action);
this.updateSort();
}
this.hijackBackEvent();
@@ -736,29 +706,31 @@ export default {
// Tools
toggleTools() {
if (this.showTools) {
- this.toolbar.translateY = 0;
this.toolbar
.animate({
- translate: { x: 0, y: 112 },
+ height: 0,
+ translate: { x: 0, y: 48 },
duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
+ curve: CoreTypes.AnimationCurve.easeIn,
})
.then(() => (this.showTools = 0));
} else {
+ this.toolbar.height = 1;
this.showTools = 1;
- this.toolbar.translateY = 112;
- this.toolbar.animate({
- translate: { x: 0, y: 0 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
+ setTimeout(() => {
+ this.toolbar.animate({
+ height: 52 * this.tbItems.length + 8,
+ duration: 200,
+ translate: { x: 0, y: 0 },
+ curve: CoreTypes.AnimationCurve.easeOut,
+ });
+ }, 1);
}
},
// ListHandlers
addToSelection(id) {
this.showTools && this.toggleTools();
-
this.selectMode = 1;
this.appbar.translateY = 0;
this.selection.includes(id)
@@ -793,7 +765,7 @@ export default {
},
}).then((action) => {
if (action) {
- this.deleteRecipes(this.selection);
+ this.deleteRs(this.selection);
if (!this.filteredRecipes.length) this.goToHome();
this.clearSelection();
}
@@ -894,11 +866,9 @@ export default {
}).length;
break;
}
- return count && this.getLocaleN(count);
- },
- centerLabel({ object }) {
- object.android.setGravity(17);
+ return count && this.localeN(count);
},
+
focusField({ object }) {
if (this.RTL) object.android.setGravity(5);
setTimeout((e) => {
@@ -915,7 +885,6 @@ export default {
},
randomRecipeID() {
- // TODO: show only from selected filter
let min = 0;
let max = this.filteredRecipes.length - 1;
let randomIndex = Math.round(Math.random() * (max - min));
@@ -963,7 +932,7 @@ export default {
}
let dl1 = difficultyLevel(a.difficulty);
let dl2 = difficultyLevel(b.difficulty);
- switch (this.sortType) {
+ switch (this.sortT) {
case "random":
return 0.5 - Math.random();
case "title":
@@ -1000,7 +969,7 @@ export default {
id == this.filteredRecipes[length - 2].id)
? "lastItem"
: "";
- let selection = this.selection.includes(id) ? "selected" : "unselected";
+ let selection = this.selection.includes(id) ? "select" : "deselect";
let classes = itemPos + " " + selection;
return l2 ? classes + oddOrEven : classes;
},
@@ -1045,7 +1014,7 @@ export default {
goToHome() {
this.setComp("EnRecipes");
this.filterFavourites = this.filterTrylater = null;
- this.clearFilter();
+ this.clearF();
},
navigateTo(to, title, page) {
this.showTools && this.toggleTools();
@@ -1067,7 +1036,7 @@ export default {
this.setComp(title);
this.filterFavourites = to == "favourites";
this.filterTrylater = to == "trylater";
- this.clearFilter();
+ this.clearF();
}
},
stSwipe({ direction }) {
@@ -1081,7 +1050,7 @@ export default {
this.setComp(comps[index - 1]);
this.filterFavourites = comps[index - 1] == "favourites";
this.filterTrylater = comps[index - 1] == "trylater";
- this.clearFilter();
+ this.clearF();
}
break;
case 2:
@@ -1095,7 +1064,7 @@ export default {
break;
}
},
- addRecipe() {
+ addR() {
this.showTools && this.toggleTools();
this.$navigateTo(EditRecipe, {
props: {
@@ -1126,24 +1095,16 @@ export default {
});
},
touchSelector({ object, action }, comp, title) {
- let selected = this.currentComp == comp;
- object.className = action.match(/down|move/)
- ? `segment r ${selected ? "select" : "fade"}`
- : `segment r ${selected && "select"}`;
- if (action == "up") this.navigateTo(comp, title);
- },
- touchRecipe({ object, action }) {
- let classes = object.className;
- if (!this.selectMode) {
- object.className = action.match(/down|move/)
- ? !classes.includes("fade")
- ? classes + " fade"
- : classes
- : classes.replace(/ fade/g, "");
+ if (this.currentComp != title) {
+ this.touchFade(object, action);
+ if (action == "up") this.navigateTo(comp, title);
}
},
+ touchRecipe({ object, action }) {
+ if (!this.selectMode) this.touchFade(object, action);
+ },
touchTool({ object, action }, comp, value) {
- object.className = action.match(/down|move/) ? `tool fade` : `tool`;
+ this.touchFade(object, action);
if (action == "up") this.navigateTo(comp, value, 1);
},
},
diff --git a/app/components/MealPlanner.vue b/app/components/MealPlanner.vue
index e37bca00..37b8a87f 100644
--- a/app/components/MealPlanner.vue
+++ b/app/components/MealPlanner.vue
@@ -1,39 +1,41 @@
-
+
-
+
-
+
-
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-->
-
+
+
+
diff --git a/app/components/ViewRecipe.vue b/app/components/ViewRecipe.vue
index c89ae113..dc510e65 100644
--- a/app/components/ViewRecipe.vue
+++ b/app/components/ViewRecipe.vue
@@ -10,7 +10,11 @@
paddingBottom="24"
>
-
+
@@ -50,66 +51,56 @@
>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -118,18 +109,17 @@
orientation="horizontal"
v-for="(item, index) in recipe.ingredients"
:key="index + 'ing'"
- class="ingredient"
+ class="check"
@touch="touchIngredient($event, index)"
>
-
-
+
+
-
-
+
+
-
-
+
+
@@ -180,9 +172,10 @@
null"
>
-
+
+
+
@@ -322,13 +329,13 @@ export default {
toast: null,
photoOpen: 0,
showTitleArr: [0, 0, 0, 0],
- sticky: null,
view: null,
wv: null,
+ showTools: 0,
};
},
computed: {
- ...mapState(["icon", "recipes", "RTL"]),
+ ...mapState(["icon", "recipes", "RTL", "awakeV"]),
tempYieldQuantity() {
return Math.abs(this.yieldMultiplier) > 0
? Math.abs(parseFloat(this.yieldMultiplier))
@@ -357,13 +364,13 @@ export default {
},
},
methods: {
- ...mapActions(["toggleStateAction", "setRatingAction", "toggleCartAction"]),
+ ...mapActions(["toggleState", "setR"]),
pgLoad({ object }) {
this.busyDup = this.busyEdit = this.photoOpen = 0;
object.bindingContext = new Observable();
if (this.yieldMultiplier == this.recipe.yieldQuantity)
this.yieldMultiplier = this.recipe.yieldQuantity;
- utils.keepScreenOn(1);
+ if (this.awakeV) utils.keepScreenOn(1);
this.syncCombinations();
this.view = object.page.getViewById("printview");
},
@@ -409,9 +416,6 @@ export default {
this.imgView.top = 24;
this.imgView.left = this.RTL ? 16 : Screen.mainScreen.widthDIPs - 112;
},
- onStickyLoad({ object }) {
- this.sticky = object;
- },
fixTitle(object, swipeUp: boolean): void {
let ingL = this.recipe.ingredients.length;
let insL = this.recipe.instructions.length;
@@ -465,28 +469,11 @@ export default {
}
},
showBars() {
- this.appbar.animate({
- translate: { x: 0, y: 0 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
- this.sidebar.animate({
- translate: { x: 0, y: 0 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
+ this.animateBar(this.appbar, 1);
},
hideBars() {
- this.appbar.animate({
- translate: { x: 0, y: 64 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
- this.sidebar.animate({
- translate: { x: this.RTL ? -64 : 64, y: 0 },
- duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
- });
+ this.showTools && this.toggleTools();
+ this.animateBar(this.appbar, 0);
},
// Helpers
@@ -501,8 +488,8 @@ export default {
s = this.stepsDid;
break;
}
- c = this.getLocaleN(c);
- s = s && this.getLocaleN(s);
+ c = this.localeN(c);
+ s = s && this.localeN(s);
let text = s ? ` (${s}/${c})` : ` (${c})`;
return localize(title) + text;
},
@@ -554,7 +541,7 @@ export default {
"triedInfo",
this.niceDate(this.recipe.lastTried)
);
- this.animateBar(this.toastbar, 1);
+ this.animateBar(this.toastbar, 1, 1);
let a = 10;
clearInterval(barTimer);
barTimer = setInterval(() => a-- < 1 && this.hideBar(), 1000);
@@ -569,48 +556,6 @@ export default {
: this.animateBar(this.appbar, 1);
});
},
- // getMeasure(value: number, unit: string) {
- // let vm = this;
- // function roundedQ(val: number) {
- // return Math.abs(
- // Math.round(
- // (val / vm.recipe.yieldQuantity) * vm.tempYieldQuantity * 100
- // ) / 100
- // );
- // }
- // if (value) {
- // let rounded = Math.abs(
- // Math.round(
- // (value / this.recipe.yieldQuantity) * this.tempYieldQuantity * 100
- // ) / 100
- // );
- // let lUnit = localize(unit);
-
- // switch (unit) {
- // //IMPERIAL
- // case "g":
- // return rounded < 1000
- // ? `${rounded} ${lUnit} `
- // : `${roundedQ(rounded / 1000)} ${localize("kg")} `;
- // case "ml":
- // return rounded < 1000
- // ? `${rounded} ${lUnit} `
- // : `${roundedQ(rounded / 1000)} ${localize("l")} `;
-
- // //METRIC
- // case "tsp":
- // return rounded < 3
- // ? `${rounded} ${lUnit} `
- // : `${roundedQ(rounded / 3)} ${localize("tbsp")} `;
- // case "in":
- // return rounded < 12
- // ? `${rounded} ${lUnit} `
- // : `${roundedQ(rounded / 12)} ${localize("ft")} `;
- // default:
- // return `${rounded} ${lUnit} `;
- // }
- // } else return "";
- // },
roundedQuantity(quantity: number) {
return Math.abs(
Math.round(
@@ -657,9 +602,7 @@ export default {
// });
},
touchIngredient({ object, action }, index) {
- object.className = action.match(/down|move/)
- ? "ingredient fade"
- : "ingredient";
+ this.touchFade(object, action);
if (action == "up") this.checkChange(object, index);
},
checkChange(obj, index) {
@@ -681,25 +624,23 @@ export default {
},
touchInstruction({ object, action }) {
let hasDone = object.className.includes("done");
- object.className = action.match(/down|move/)
- ? `instruction ${hasDone ? "done" : "fade"}`
- : `instruction ${hasDone ? "done" : ""}`;
+ if (!hasDone) this.touchFade(object, action);
if (action == "up") this.stepDone(object);
},
stepDone(object) {
let a = object;
if (a.className.includes("done")) {
- a.className = "instruction";
+ a.className = "check";
this.stepsDid--;
} else {
- a.className = "instruction done";
+ a.className = "check done";
this.stepsDid++;
}
},
clearSteps() {
this.stepsDid = 0;
for (let i = 1; i < this.inscon.getChildrenCount(); i++) {
- this.inscon.getChildAt(i).className = "instruction";
+ this.inscon.getChildAt(i).className = "check";
}
},
getDates() {
@@ -741,6 +682,31 @@ export default {
this.recipe.tried && this.recipe.lastTried && this.showLastTried();
},
+ // Tools
+ toggleTools() {
+ if (this.showTools) {
+ this.sidebar
+ .animate({
+ height: 0,
+ translate: { x: 0, y: 48 },
+ duration: 200,
+ curve: CoreTypes.AnimationCurve.easeIn,
+ })
+ .then(() => (this.showTools = 0));
+ } else {
+ this.sidebar.height = 1;
+ this.showTools = 1;
+ setTimeout(() => {
+ this.sidebar.animate({
+ height: 216,
+ duration: 200,
+ translate: { x: 0, y: 0 },
+ curve: CoreTypes.AnimationCurve.easeOut,
+ });
+ }, 1);
+ }
+ },
+
// ShareAction
shareHandler() {
if (this.recipe.image) {
@@ -831,37 +797,34 @@ export default {
// DataHandlers
toggle(key: string, setDate: boolean) {
- this.toggleStateAction({
+ this.toggleState({
id: this.currentRecipeID,
key,
setDate,
});
if (setDate) this.$navigateBack();
},
- setRating(rating) {
- if (rating !== this.recipe.rating || rating === 1) {
- this.setRatingAction({
+ touchRate({ object, action }, r) {
+ this.touchFade(object, action);
+ if (action == "up") this.setRating(r);
+ },
+ setRating(r) {
+ if (r !== this.recipe.rating || r === 1) {
+ if (this.recipe.rating == 1 && r == 1) r = 0;
+ this.setR({
id: this.currentRecipeID,
- rating,
+ r,
});
}
},
// ShoppingList
- toggleCart() {
- if (!this.recipe.inBag) {
- } else {
- }
- this.toggleCartAction({
- id: this.currentRecipeID,
- });
- },
// Notes
createNote(note) {
let regex = /(https?:\/\/[^\s]+)/g;
const lbl = new RLabel();
- lbl.className = "note";
+ lbl.className = "note tw";
lbl.textWrap = true;
let fString = new FormattedString();
let arr = note.split(regex);
@@ -928,7 +891,7 @@ export default {
height: sw,
translate: { x: this.RTL ? -16 : 112 - sw, y: (sh - sw) / 3 },
duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
+ curve: CoreTypes.AnimationCurve.easeOut,
})
)
.then(() =>
@@ -936,7 +899,7 @@ export default {
height: sh,
translate: { x: this.RTL ? -16 : 112 - sw, y: -((sh - sw) / 6) },
duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
+ curve: CoreTypes.AnimationCurve.easeOut,
})
);
},
@@ -949,7 +912,7 @@ export default {
height: sw,
translate: { x: this.RTL ? -16 : 112 - sw, y: (sh - sw) / 3 },
duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
+ curve: CoreTypes.AnimationCurve.easeIn,
})
.then(() =>
pv.animate({
@@ -957,7 +920,7 @@ export default {
height: 96,
translate: { x: 0, y: 0 },
duration: 200,
- curve: CoreTypes.AnimationCurve.ease,
+ curve: CoreTypes.AnimationCurve.easeIn,
})
)
.then(() =>
@@ -1112,9 +1075,8 @@ export default {
// Helpers
touchYield({ object, action }) {
- object.className = action.match(/down|move/)
- ? "value accent fade"
- : "value accent";
+ this.touchFade(object, action);
+
if (action == "up") this.changeYield();
},
},
diff --git a/app/components/modals/Action.vue b/app/components/modals/Action.vue
index b935cd09..d467ea3a 100644
--- a/app/components/modals/Action.vue
+++ b/app/components/modals/Action.vue
@@ -1,9 +1,5 @@
-
+
@@ -84,10 +80,10 @@ export default {
};
},
computed: {
- ...mapState(["sortType", "icon", "theme", "RTL"]),
+ ...mapState(["icon", "theme", "RTL"]),
},
methods: {
- ...mapActions(["removeListItemAction", "deleteTimerPreset"]),
+ ...mapActions(["removeLI", "deleteTP"]),
localized(item: string): string {
return this.title !== "lang" ? localize(item) : item;
},
@@ -118,22 +114,22 @@ export default {
let vm = this;
let index = this.newList.findIndex((e) => e === item);
let localizedItem = `"${localize(item)}"`;
- function removeListItem(listName: string, desc: string): void {
+ function removeLI(listName: string, desc: string): void {
vm.removeConfirmation(`${localize(desc, localizedItem)}`).then(
(action: boolean) => {
if (action)
- vm.removeListItemAction({
+ vm.removeLI({
item,
listName,
});
}
);
}
- function deleteTimerPreset(): void {
+ function deleteTP(): void {
vm.deletionConfirmation(`${localize("delPrst", `"${item}"`)}`).then(
(action: boolean) => {
if (action) {
- vm.deleteTimerPreset(index);
+ vm.deleteTP(index);
vm.newList.splice(index, 1);
}
}
@@ -141,29 +137,24 @@ export default {
}
switch (this.title) {
case "cui":
- removeListItem("cuisines", "rmCuiInfo");
+ removeLI("cuisines", "rmCuiInfo");
break;
case "cat":
- removeListItem("categories", "rmCatInfo");
+ removeLI("categories", "rmCatInfo");
break;
case "yieldU":
- removeListItem("yieldUnits", "rmYUInfo");
+ removeLI("yieldUnits", "rmYUInfo");
break;
case "Unit":
- removeListItem("units", "rmUInfo");
+ removeLI("units", "rmUInfo");
break;
case "prsts":
- deleteTimerPreset();
+ deleteTP();
break;
}
},
touch({ object, action }): void {
- let classes = object.className;
- object.className = action.match(/down|move/)
- ? !classes.includes("fade")
- ? classes + " fade"
- : classes
- : classes.replace(/ fade/g, "");
+ this.touchFade(object, action);
},
},
created() {
diff --git a/app/components/modals/ActionWithSearch.vue b/app/components/modals/ActionWithSearch.vue
index b837d020..b62d9101 100644
--- a/app/components/modals/ActionWithSearch.vue
+++ b/app/components/modals/ActionWithSearch.vue
@@ -1,9 +1,5 @@
-
+
-
@@ -82,14 +74,17 @@ export default {
})
.filter((e) => this.recipeFilter(e));
},
+ noResult() {
+ if (!this.recipes.length) return "recListEmp";
+ else if (!this.filteredRecipes.length && this.searchQuery)
+ return "noRecs";
+ else 0;
+ },
},
methods: {
tapAction(recipe) {
this.$modal.close(recipe.id);
},
- centerLabel({ object }) {
- object.android.setGravity(16);
- },
recipeFilter(e) {
let searchQuery = this.searchQuery.toLowerCase();
return (
@@ -101,9 +96,7 @@ export default {
);
},
touch({ object, action }, recipe) {
- object.className = action.match(/down|move/)
- ? "listItem fade"
- : "listItem ";
+ this.touchFade(object, action);
if (action == "up") this.tapAction(recipe);
},
},
diff --git a/app/components/modals/Confirm.vue b/app/components/modals/Confirm.vue
index 802ad536..b952b62c 100644
--- a/app/components/modals/Confirm.vue
+++ b/app/components/modals/Confirm.vue
@@ -1,28 +1,24 @@
-
+
diff --git a/app/components/modals/DMYPicker.vue b/app/components/modals/DMYPicker.vue
index e1982df0..b057703c 100644
--- a/app/components/modals/DMYPicker.vue
+++ b/app/components/modals/DMYPicker.vue
@@ -1,6 +1,6 @@
@@ -33,13 +33,13 @@
diff --git a/app/components/modals/Filter.vue b/app/components/modals/Filter.vue
index 795cdb80..a96ff09d 100644
--- a/app/components/modals/Filter.vue
+++ b/app/components/modals/Filter.vue
@@ -5,19 +5,19 @@
-
+
@@ -41,16 +41,16 @@
columns="auto, *, auto, auto"
class="actions"
>
-
+
@@ -66,7 +66,7 @@ let filterTimer;
export default {
data() {
return {
- filterType: "cuisine",
+ filter: "cuisine",
localCuisine: null,
localCategory: null,
localTag: null,
@@ -100,7 +100,7 @@ export default {
title: localize(this.localTag),
},
];
- switch (this.filterType) {
+ switch (this.filter) {
case "cuisine":
return arr.slice(0, -2);
case "category":
@@ -109,7 +109,7 @@ export default {
return arr;
},
filterList() {
- switch (this.filterType) {
+ switch (this.filter) {
case "cuisine":
return this.cuisineList;
case "category":
@@ -173,21 +173,21 @@ export default {
},
},
methods: {
- ...mapActions(["setCuisine", "setCategory", "setTag", "clearFilter"]),
+ ...mapActions(["setCuisine", "setCategory", "setTag"]),
pgLoad(args) {
- this.transparentPage(args);
+ this.mLoad(args);
this.localCuisine = this.selCuisine;
this.localCategory = this.selCategory;
this.localTag = this.selTag;
- if (this.localCuisine) this.filterType = "category";
- if (this.localCategory && this.localTag) this.filterType = "tag";
+ if (this.localCuisine) this.filter = "category";
+ if (this.localCategory && this.localTag) this.filter = "tag";
this.scrollToRight();
},
onScrollLoad(args) {
this.scrollview = args.object;
},
setFilterType(type) {
- this.filterType = type;
+ this.filter = type;
switch (type) {
case "cuisine":
this.localCategory = null;
@@ -210,14 +210,14 @@ export default {
},
setRecipeFilter(item) {
this.reset = 0;
- switch (this.filterType) {
+ switch (this.filter) {
case "cuisine":
this.localCuisine = item;
- this.filterType = "category";
+ this.filter = "category";
break;
case "category":
this.localCategory = item;
- if (this.tagList.length) this.filterType = "tag";
+ if (this.tagList.length) this.filter = "tag";
break;
default:
this.localTag = item;
@@ -233,23 +233,19 @@ export default {
this.$modal.close(this.reset);
},
resetFilter() {
- this.filterType = "cuisine";
+ this.filter = "cuisine";
this.localCuisine = this.localCategory = this.localTag = null;
this.reset = 1;
},
touch({ object, action }, item) {
- object.className = action.match(/down|move/)
- ? "listItem fade"
- : "listItem ";
+ this.touchFade(object, action);
if (action == "up") this.setRecipeFilter(item);
},
touchSelector({ object, action }, type) {
- let selected = this.filterType == type;
- let classes = `segment ${this.RTL ? "rtl" : ""} `;
- object.className = action.match(/down|move/)
- ? `${classes}${selected ? "select" : "fade"}`
- : `${classes}${selected && "select"}`;
- if (action == "up") this.setFilterType(type);
+ if (this.filter != type) {
+ this.touchFade(object, action);
+ if (action == "up") this.setFilterType(type);
+ }
},
},
};
diff --git a/app/components/modals/Prompt.vue b/app/components/modals/Prompt.vue
index 8a3c9fb9..1f6df716 100644
--- a/app/components/modals/Prompt.vue
+++ b/app/components/modals/Prompt.vue
@@ -1,6 +1,6 @@
@@ -28,13 +28,13 @@
diff --git a/app/components/modals/TimePickerHM.vue b/app/components/modals/TimePickerHM.vue
index a5fa110c..814d93b2 100644
--- a/app/components/modals/TimePickerHM.vue
+++ b/app/components/modals/TimePickerHM.vue
@@ -1,6 +1,6 @@
@@ -28,13 +28,13 @@
diff --git a/app/components/modals/TimePickerHMS.vue b/app/components/modals/TimePickerHMS.vue
index 27b7f5a0..99421cf8 100644
--- a/app/components/modals/TimePickerHMS.vue
+++ b/app/components/modals/TimePickerHMS.vue
@@ -1,9 +1,5 @@
-
+
@@ -47,17 +43,22 @@
>
-
+
@@ -121,7 +122,7 @@ export default {
object.focus();
setTimeout(() => Utils.ad.showSoftInput(object.android), 100);
},
- sendRespose() {
+ respond() {
this.$modal.close({
label: this.setLabel ? this.setLabel : this.label,
time: this.selectedTime,
diff --git a/app/components/modals/TimerReminder.vue b/app/components/modals/TimerReminder.vue
index bd6d116f..4384ca35 100644
--- a/app/components/modals/TimerReminder.vue
+++ b/app/components/modals/TimerReminder.vue
@@ -21,7 +21,7 @@
:timerAlert="timerAlert"
:showToast="showToast"
/>
-
+
@@ -42,10 +42,9 @@
import { Application, Screen, Device, Color, Utils } from "@nativescript/core";
import Timer from "../sub/Timer.vue";
import * as utils from "~/shared/utils";
-import { mapState, mapActions } from "vuex";
+import { mapState } from "vuex";
const windowMgr = android.view.WindowManager;
-const View = android.view.View as any;
-const ViewGroup = android.view.ViewGroup;
+
export default {
components: { Timer },
props: [
@@ -56,12 +55,12 @@ export default {
"showToast",
],
computed: {
- ...mapState(["icon", "theme", "activeTimers"]),
+ ...mapState(["icon", "theme", "activeTs"]),
screenWidth() {
return Screen.mainScreen.widthDIPs;
},
timers() {
- let timers = this.activeTimers.filter((e) => e.done);
+ let timers = this.activeTs.filter((e) => e.done);
if (!timers.length) {
this.$modal.close(1);
this.isScreenLocked && this.turnOffScreen();
@@ -81,7 +80,6 @@ export default {
},
},
methods: {
- ...mapActions(["clearTimerInterval"]),
pgLoad({ object }) {
let dialog = object._dialogFragment.getDialog();
let dialogWindow = dialog.getWindow();
diff --git a/app/components/settings/About.vue b/app/components/settings/About.vue
index 0cc63e92..00aa3572 100644
--- a/app/components/settings/About.vue
+++ b/app/components/settings/About.vue
@@ -3,19 +3,19 @@
-
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
+
+
@@ -98,13 +105,9 @@ export default {
pgLoad({ object }) {
object.bindingContext = new Observable();
},
- // HELPERS
- openURL(url) {
- Utils.openUrl(url);
- },
touch({ object, action }, url) {
- object.className = action.match(/down|move/) ? "option fade" : "option";
- if (action == "up") this.openURL(url);
+ this.touchFade(object, action);
+ if (action == "up") Utils.openUrl(url);
},
},
};
diff --git a/app/components/settings/AppSettings.vue b/app/components/settings/AppSettings.vue
index 7980c93b..61d8b095 100644
--- a/app/components/settings/AppSettings.vue
+++ b/app/components/settings/AppSettings.vue
@@ -3,8 +3,15 @@
-
+
+
+
@@ -70,7 +77,6 @@ export default {
pgLoad({ object }) {
object.bindingContext = new Observable();
},
- // HELPERS
navigateTo(view) {
this.$navigateTo(view, {
animated: false,
diff --git a/app/components/settings/CTSettings.vue b/app/components/settings/CTSettings.vue
index e642efd7..625fab1f 100644
--- a/app/components/settings/CTSettings.vue
+++ b/app/components/settings/CTSettings.vue
@@ -3,8 +3,15 @@
-
+
+
+
@@ -26,7 +33,7 @@ import * as utils from "~/shared/utils";
export default {
components: { OptionsList },
computed: {
- ...mapState(["icon", "timerDelay", "timerSound", "timerVibrate", "RTL"]),
+ ...mapState(["icon", "timerD", "timerS", "timerV", "RTL"]),
items() {
let options = [
{
@@ -34,7 +41,7 @@ export default {
icon: "sound",
rtl: 0,
title: "tmrSnd",
- subTitle: this.timerSound.title,
+ subTitle: this.timerS.title,
action: this.showSoundsList,
},
{
@@ -42,7 +49,7 @@ export default {
icon: "vibrate",
rtl: 0,
title: "tmrvbrt",
- checked: !!this.timerVibrate,
+ checked: !!this.timerV,
action: this.toggleTimerVibrate,
},
];
@@ -65,9 +72,8 @@ export default {
rtl: 0,
title: "dlyDur",
subTitle:
- this.delayList[
- this.delayList.findIndex((e) => e.n == this.timerDelay)
- ].l,
+ this.delayList[this.delayList.findIndex((e) => e.n == this.timerD)]
+ .l,
action: this.showDelayList,
},
...list,
@@ -80,14 +86,14 @@ export default {
...Array.from(Array(6), (_, x) => (x + 1) * 5),
].map((e) => {
return {
- l: `${this.getLocaleN(e)} ${localize(e > 1 ? "minutes" : "minute")}`,
+ l: `${this.localeN(e)} ${localize(e > 1 ? "minutes" : "minute")}`,
n: e,
};
});
},
},
methods: {
- ...mapActions(["setTimerDelay", "setTimerSound", "setTimerVibrate"]),
+ ...mapActions(["setTD", "setTS", "setTV"]),
pgLoad({ object }) {
object.bindingContext = new Observable();
ApplicationSettings.setNumber("isTimer", 2);
@@ -97,12 +103,12 @@ export default {
props: {
title: "dlyDur",
list: this.delayList.map((e) => e.l),
- selected: this.delayList.findIndex((e) => e.n == this.timerDelay),
+ selected: this.delayList.findIndex((e) => e.n == this.timerD),
},
}).then(
(res) =>
res &&
- this.setTimerDelay(
+ this.setTD(
this.delayList[this.delayList.findIndex((e) => e.l == res)].n
)
);
@@ -113,16 +119,19 @@ export default {
props: {
title: "tmrSnd",
list: getTones.tones.map((e) => e.title),
+ selected: getTones.tones.findIndex(
+ (e) => e.title == this.timerS.title
+ ),
},
}).then(
(tone) =>
tone &&
- tone !== this.timerSound.title &&
- this.setTimerSound(getTones.tones.filter((e) => e.title === tone)[0])
+ tone !== this.timerS.title &&
+ this.setTS(getTones.tones.filter((e) => e.title === tone)[0])
);
},
toggleTimerVibrate() {
- this.setTimerVibrate(!this.timerVibrate | 0);
+ this.setTV(!this.timerV | 0);
},
openNotificationChannelSettings() {
const ctx = Application.android.context;
@@ -137,8 +146,6 @@ export default {
intent.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
ctx.startActivity(intent);
},
-
- // HELPERS
channelExists() {
if (Device.sdkVersion * 1 >= 26) {
const ctx = Utils.ad.getApplicationContext();
diff --git a/app/components/settings/Database.vue b/app/components/settings/Database.vue
index 70db2573..ea0e3c23 100644
--- a/app/components/settings/Database.vue
+++ b/app/components/settings/Database.vue
@@ -10,7 +10,7 @@
rows="*"
columns="auto, *"
>
-
+
-
+
+
+
@@ -68,7 +75,7 @@ export default {
"yieldUnits",
"units",
"mealPlans",
- "importSummary",
+ "impSum",
"RTL",
]),
items() {
@@ -101,14 +108,14 @@ export default {
},
methods: {
...mapActions([
- "importListItems",
- "importRecipesFromJSON",
- "importRecipesFromDB",
- "importMealPlansFromJSON",
- "importMealPlansFromDB",
- "importTimerPresets",
- "unlinkBrokenImages",
- "clearImportSummary",
+ "importLIs",
+ "importRsJSON",
+ "importRsDB",
+ "importMPsJSON",
+ "importMPsDB",
+ "importTPs",
+ "unLinkBIs",
+ "clearIS",
]),
pgLoad({ object }) {
object.bindingContext = new Observable();
@@ -137,10 +144,8 @@ export default {
android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION |
android.content.Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
utils.getBackupFolder().then((uri) => {
- console.log(uri.toString());
if (uri != null) {
// ReleaseExistingPermissions
-
if (this.backupFolder && this.backupFolder != uri.toString())
ContentResolver.releasePersistableUriPermission(
new android.net.Uri.parse(this.backupFolder),
@@ -249,7 +254,7 @@ export default {
function importImages() {
const timer = setInterval(() => {
if (!vm.progress) clearInterval(timer);
- if (vm.progress && vm.importSummary.found) {
+ if (vm.progress && vm.impSum.found) {
Folder.exists(images)
? vm.importImages(uri)
: vm.showImportSummary();
@@ -263,8 +268,6 @@ export default {
importImages();
} else if (File.exists(recipes)) {
// IMPORT FROM JSON FILES
- console.log("import from json");
-
this.isFileDataValid([
{
path: recipes,
@@ -302,7 +305,6 @@ export default {
} else this.failedImport(localize("buInc"));
},
isFileDataValid(file) {
- console.log("isFileDataValid");
const files = file.filter((e) => File.exists(e.path));
if (files.length) {
let isValid = files.map(() => 0);
@@ -355,7 +357,7 @@ export default {
// Import recipes
db.select("SELECT * FROM recipes").then((res) => {
- this.importRecipesFromDB(res);
+ this.importRsDB(res);
});
// Import listitems
@@ -363,7 +365,7 @@ export default {
`SELECT cuisines, categories, yieldUnits, units FROM lists`
).then((res) =>
Object.keys(res[0]).forEach((listName) =>
- this.importListItems({
+ this.importLIs({
data: JSON.parse(res[0][listName]),
listName,
})
@@ -371,47 +373,44 @@ export default {
);
// Import mealPlans
- db.select(`SELECT * FROM mealPlans`).then((res) =>
- this.importMealPlansFromDB(res)
- );
+ db.select(`SELECT * FROM mealPlans`).then((res) => this.importMPsDB(res));
- // Import timerPresets
+ // Import timerPs
db.select(`SELECT * FROM timerPresets`).then((res) =>
- this.importTimerPresets(res)
+ this.importTPs(res)
);
},
importData(data, db) {
- console.log("importing");
switch (db) {
case "recipes":
- this.importRecipesFromJSON(data);
+ this.importRsJSON(data);
break;
case "userCuisines":
- this.importListItems({
+ this.importLIs({
data,
listName: "cuisines",
});
break;
case "userCategories":
- this.importListItems({
+ this.importLIs({
data,
listName: "categories",
});
break;
case "userYieldUnits":
- this.importListItems({
+ this.importLIs({
data,
listName: "yieldUnits",
});
break;
case "userUnits":
- this.importListItems({
+ this.importLIs({
data,
listName: "units",
});
break;
case "mealPlans":
- this.importMealPlansFromJSON(data);
+ this.importMPsJSON(data);
break;
}
},
@@ -430,14 +429,14 @@ export default {
});
});
this.showImportSummary();
- this.unlinkBrokenImages();
+ this.unLinkBIs();
}
});
},
showImportSummary() {
this.progress = null;
this.releaseBackEvent();
- let { found, imported, updated } = this.importSummary;
+ let { found, imported, updated } = this.impSum;
let exists = Math.abs(found - imported - updated) + updated;
let importedNote = `\n${localize("recI")} ${imported}`;
let existsNote = `\n${localize("recE")} ${exists}`;
@@ -450,7 +449,7 @@ export default {
)}\n${importedNote}${existsNote}${updatedNote}`,
okButtonText: "OK",
},
- }).then(() => this.clearImportSummary());
+ }).then(() => this.clearIS());
},
// NAVIGATION HANDLERS
@@ -474,7 +473,7 @@ export default {
showToast(data) {
this.animateBar(this.appbar, 0).then(() => {
this.toast = data;
- this.animateBar(this.toastbar, 1);
+ this.animateBar(this.toastbar, 1, 1);
utils.timer(5, (val) => !val && this.hideBar());
});
},
diff --git a/app/components/settings/Interface.vue b/app/components/settings/Interface.vue
index f870f929..3f8be08c 100644
--- a/app/components/settings/Interface.vue
+++ b/app/components/settings/Interface.vue
@@ -3,8 +3,15 @@
-
+
+
+
@@ -25,7 +32,7 @@ export default {
};
},
computed: {
- ...mapState(["icon", "language", "theme", "layout", "RTL"]),
+ ...mapState(["icon", "langs", "theme", "layout", "RTL"]),
items() {
return [
{},
@@ -42,9 +49,7 @@ export default {
icon: "theme",
rtl: 0,
title: "Theme",
- subTitle: localize(
- ApplicationSettings.getString("theme", "sysDef")
- ),
+ subTitle: localize(ApplicationSettings.getString("theme", "sysDef")),
action: this.selectThemes,
},
{
@@ -60,17 +65,18 @@ export default {
},
},
methods: {
- ...mapActions(["setTheme", "setLayout", "setRTL"]),
+ ...mapActions(["setT", "setL", "setRTL"]),
pgLoad({ object }) {
object.bindingContext = new Observable();
},
- // LANGUAGE SELECTION
+ // LanguageSelection
setAppLang() {
- let languages = this.language.map((e) => e.title);
+ let languages = this.langs.map((e) => e.title);
this.$showModal(Action, {
props: {
title: "lang",
list: [...languages],
+ selected: this.applang,
},
}).then((action) => {
if (action && this.applang !== action) {
@@ -78,8 +84,7 @@ export default {
"appLocale",
"none"
).split("-");
- let locale = this.language.filter((e) => e.title === action)[0]
- .locale;
+ let locale = this.langs.filter((e) => e.title === action)[0].locale;
if (currentLocale !== locale) {
this.applang = action;
ApplicationSettings.setString("applang", action);
@@ -91,12 +96,13 @@ export default {
}
});
},
- // THEME SELECTION
+ // ThemeSelection
selectThemes() {
this.$showModal(Action, {
props: {
title: "Theme",
list: ["Light", "Dark", "Black", "sysDef", "sysDefB"],
+ selected: ApplicationSettings.getString("theme", "sysDef"),
},
}).then((action) => {
if (
@@ -105,24 +111,21 @@ export default {
? 1
: this.theme != action)
) {
- this.setTheme(action);
+ this.setT(action);
Frame.reloadPage();
}
});
},
- // LAYOUT MODE
+ // LayoutMode
setLayoutMode() {
this.$showModal(Action, {
props: {
title: "listVM",
list: ["detailed", "grid", "photogrid", "simple", "minimal"],
+ selected: this.layout,
},
- }).then((action) => {
- if (action && this.layoutMode !== action) {
- let act = action.toLowerCase();
- ApplicationSettings.setString("layout", act);
- this.setLayout(act);
- }
+ }).then((mode) => {
+ if (mode && this.layout !== mode) this.setL(mode.toLowerCase());
});
},
},
diff --git a/app/components/settings/MPSettings.vue b/app/components/settings/MPSettings.vue
index fc0624df..42185a86 100644
--- a/app/components/settings/MPSettings.vue
+++ b/app/components/settings/MPSettings.vue
@@ -3,8 +3,15 @@
-
+
+
+
@@ -19,7 +26,7 @@ import { localize } from "@nativescript/localize";
export default {
components: { OptionsList },
computed: {
- ...mapState(["icon", "mondayFirst", "RTL", "plannerView", "planDeletion"]),
+ ...mapState(["icon", "startMon", "RTL", "plannerV", "planDel"]),
items() {
return [
{},
@@ -27,21 +34,21 @@ export default {
type: "list",
icon: "calv",
title: "calVM",
- subTitle: localize(this.plannerView),
+ subTitle: localize(this.plannerV),
action: this.selectPlannerView,
},
{
type: "switch",
icon: "week",
title: "swm",
- checked: !!this.mondayFirst,
+ checked: !!this.startMon,
action: this.toggleFirstDay,
},
{
type: "list",
icon: "mpd",
title: "admp",
- subTitle: localize(this.planDeletion),
+ subTitle: localize(this.planDel),
action: this.selectDeletionTime,
},
{},
@@ -49,31 +56,33 @@ export default {
},
},
methods: {
- ...mapActions(["setFirstDay", "setPlannerView", "setPlanDeletion"]),
+ ...mapActions(["setFD", "setPlannerV", "setPlanDel"]),
pgLoad({ object }) {
object.bindingContext = new Observable();
},
toggleFirstDay() {
- this.setFirstDay(!this.mondayFirst | 0);
+ this.setFD(!this.startMon | 0);
},
selectPlannerView() {
this.$showModal(Action, {
props: {
title: "calVM",
- list: ["mnth", "wk", "d"],
+ list: ["d", "wk", "mnth"],
+ selected: this.plannerV,
},
}).then((res) => {
- if (res && this.plannerView != res) this.setPlannerView(res);
+ if (res && this.plannerV != res) this.setPlannerV(res);
});
},
selectDeletionTime() {
this.$showModal(Action, {
props: {
title: "admp",
- list: ["otay", "otam", "otaw", "nvr"],
+ list: ["otaw", "otam", "otay", "nvr"],
+ selected: this.planDel,
},
}).then((res) => {
- if (res && this.planDeletion != res) this.setPlanDeletion(res);
+ if (res && this.planDel != res) this.setPlanDel(res);
});
},
},
diff --git a/app/components/settings/Options.vue b/app/components/settings/Options.vue
index 5a1d31a8..2cbf9f8c 100644
--- a/app/components/settings/Options.vue
+++ b/app/components/settings/Options.vue
@@ -10,9 +10,16 @@
rows="*"
columns="auto, *"
>
-
+
+
+
@@ -35,7 +42,7 @@ export default {
};
},
computed: {
- ...mapState(["icon", "shake", "RTL"]),
+ ...mapState(["icon", "shake", "RTL", "edgeS", "awakeV"]),
items() {
return [
{},
@@ -47,12 +54,28 @@ export default {
checked: !!this.shake,
action: this.toggleShake,
},
+ {
+ type: "switch",
+ icon: "awake",
+ title: "ksavr",
+ subTitle: localize("ksavrInfo"),
+ checked: !!this.awakeV,
+ action: this.toggleAwake,
+ },
+ {
+ type: "switch",
+ icon: "edge",
+ title: "esgb",
+ subTitle: localize("esgbInfo"),
+ checked: !!this.edgeS,
+ action: this.toggleSwipe,
+ },
{},
];
},
},
methods: {
- ...mapActions(["setShake"]),
+ ...mapActions(["setS", "toggleEdgeS", "toggleAwakeV"]),
pgLoad({ object }) {
object.bindingContext = new Observable();
},
@@ -63,17 +86,23 @@ export default {
this.toastbar = object;
},
- // SHAKE VIEW RANDOM RECIPE
toggleShake() {
let checked = this.shake;
if (checked && !utils.hasAccelerometer())
this.showToast(localize("noAccSensor"));
- else this.setShake(!checked | 0);
+ else this.setS(+!checked);
},
+ toggleSwipe() {
+ this.toggleEdgeS(+!this.edgeS);
+ },
+ toggleAwake() {
+ this.toggleAwakeV(+!this.awakeV);
+ },
+
showToast(data) {
this.animateBar(this.appbar, 0).then(() => {
this.toast = data;
- this.animateBar(this.toastbar, 1);
+ this.animateBar(this.toastbar, 1, 1);
utils.timer(5, (val) => !val && this.hideBar());
});
},
diff --git a/app/components/settings/Reset.vue b/app/components/settings/Reset.vue
index 4598ae97..c693b91c 100644
--- a/app/components/settings/Reset.vue
+++ b/app/components/settings/Reset.vue
@@ -1,7 +1,7 @@
-
+
-
+
+
+
@@ -76,7 +83,7 @@ export default {
},
},
methods: {
- ...mapActions(["resetListItemsAction"]),
+ ...mapActions(["resetLIs"]),
pgLoad({ object }) {
object.bindingContext = new Observable();
},
@@ -86,15 +93,14 @@ export default {
tbLoad({ object }) {
this.toastbar = object;
},
- // RESET
- resetListItems(listName) {
- this.resetListItemsAction(listName);
+ reset(list) {
+ this.resetLIs(list);
this.showToast();
},
showToast() {
this.animateBar(this.appbar, 0).then(() => {
this.toast = localize("restDone");
- this.animateBar(this.toastbar, 1);
+ this.animateBar(this.toastbar, 1, 1);
});
utils.timer(5, (val) => !val && this.hideToast());
},
diff --git a/app/components/sub/OptionsList.vue b/app/components/sub/OptionsList.vue
index 5193bd04..0247af58 100644
--- a/app/components/sub/OptionsList.vue
+++ b/app/components/sub/OptionsList.vue
@@ -1,7 +1,7 @@
-
+
-
+
-
+
-
+
@@ -75,7 +79,7 @@ export default {
);
},
touch({ object, action }, data, localAction) {
- object.className = action.match(/down|move/) ? "option fade" : "option";
+ this.touchFade(object, action);
if (action == "up") localAction ? localAction(data) : this.action(data);
},
},
diff --git a/app/components/sub/SnackBar.vue b/app/components/sub/SnackBar.vue
index d2e55621..29cf3831 100644
--- a/app/components/sub/SnackBar.vue
+++ b/app/components/sub/SnackBar.vue
@@ -2,13 +2,19 @@
-
-
+
+
diff --git a/app/components/sub/Timer.vue b/app/components/sub/Timer.vue
index 7caa801e..c8584683 100644
--- a/app/components/sub/Timer.vue
+++ b/app/components/sub/Timer.vue
@@ -6,7 +6,7 @@
class="timer"
>
@@ -20,8 +20,7 @@
:hidden="!timer.recipeID && done"
@touch="!done && touch($event)"
:text="getRecipeTitle"
- class="a"
- :class="timer.recipeID ? 'sub' : 'accent'"
+ class="a accent"
/>
@@ -57,11 +56,11 @@