fastlane structure, updated recipe time

This commit is contained in:
Vishnu Raghav B 2020-12-01 14:52:22 +05:30
parent 1b0070bb00
commit 06890b19d3
28 changed files with 654 additions and 580 deletions

View file

@ -76,6 +76,32 @@
/>
<Label top="0" class="fieldLabel" text="Category" />
</AbsoluteLayout>
<GridLayout columns="*, 8, *">
<AbsoluteLayout class="inputField" col="0">
<TextField
ref="prepTime"
:text="timeRequired('prepTime')"
editable="false"
@focus="
modalOpen === false && setTimeRequired(true, 'prepTime')
"
@tap="setTimeRequired(false, 'prepTime')"
/>
<Label top="0" class="fieldLabel" text="Preparation time" />
</AbsoluteLayout>
<AbsoluteLayout class="inputField" col="2">
<TextField
ref="cookTime"
:text="timeRequired('cookTime')"
editable="false"
@focus="
modalOpen === false && setTimeRequired(true, 'cookTime')
"
@tap="setTimeRequired(false, 'cookTime')"
/>
<Label top="0" class="fieldLabel" text="Cooking time" />
</AbsoluteLayout>
</GridLayout>
<GridLayout columns="*, 8, *">
<AbsoluteLayout class="inputField" col="0">
<TextField
@ -83,6 +109,7 @@
v-model="recipeContent.yield.quantity"
hint="1"
keyboardType="number"
returnKeyType="next"
/>
<Label top="0" class="fieldLabel" text="Yield quantity" />
</AbsoluteLayout>
@ -96,19 +123,6 @@
<Label top="0" class="fieldLabel" text="Yield measured in" />
</AbsoluteLayout>
</GridLayout>
<GridLayout columns="*, 8, *">
<AbsoluteLayout class="inputField" col="0">
<TextField
ref="timeRequired"
:text="timeRequired"
editable="false"
@focus="modalOpen === false && setTimeRequired(true)"
@tap="setTimeRequired(false)"
/>
<Label top="0" class="fieldLabel" text="Time required" />
</AbsoluteLayout>
</GridLayout>
<StackLayout class="hr" margin="24 16"></StackLayout>
</StackLayout>
@ -301,7 +315,8 @@ export default {
imageSrc: null,
title: undefined,
category: "Undefined",
timeRequired: "00:00",
prepTime: "00:00",
cookTime: "00:00",
yield: {
quantity: undefined,
unit: "Servings",
@ -346,12 +361,6 @@ export default {
JSON.stringify(this.tempRecipeContent)
)
},
timeRequired() {
let t = this.recipeContent.timeRequired.split(":")
let h = parseInt(t[0])
let m = parseInt(t[1])
return h ? (m ? `${h} hr ${m} min` : `${h} hr`) : `${m} min`
},
},
methods: {
...mapActions([
@ -365,6 +374,12 @@ export default {
onPageLoad() {
this.showFab = true
},
timeRequired(time) {
let t = this.recipeContent[time].split(":")
let h = parseInt(t[0])
let m = parseInt(t[1])
return h ? (m ? `${h} hr ${m} min` : `${h} hr`) : `${m} min`
},
// HELPERS
focusField(args, type) {
@ -411,23 +426,34 @@ export default {
}
return res
},
setTimeRequired(focus) {
setTimeRequired(focus, time) {
this.modalOpen = true
let time = this.recipeContent.timeRequired.split(":")
let hr = time[0]
let min = time[1]
let t = this.recipeContent[time].split(":")
let hr = t[0]
let min = t[1]
this.$showModal(ListPicker, {
props: {
title: "Time required",
title: `${time == "prepTime" ? "Preparation" : "Cooking"} time`,
action: "SET",
selectedHr: hr,
selectedMin: min,
},
}).then((result) => {
if (result) {
this.recipeContent.timeRequired = result
this.recipeContent[time] = result
this.modalOpen = false
if (focus) this.addIngredient()
if (focus) {
switch (time) {
case "prepTime":
this.autoFocusField("cookTime", false)
break
case "cookTime":
this.autoFocusField("yieldQuantity",true)
break
default:
break
}
}
}
})
},
@ -458,25 +484,27 @@ export default {
if (category.length) {
this.recipeContent.category = category
this.addCategoryAction(category)
if (focus) this.autoFocusField("yieldQuantity")
this.modalOpen = false
if (focus) this.autoFocusField("prepTime",false)
}
})
} else if (action) {
this.recipeContent.category = action
this.hijackBackEvent()
if (focus) this.autoFocusField("yieldQuantity")
this.modalOpen = false
if (focus) this.autoFocusField("prepTime",false)
} else {
this.hijackBackEvent()
}
})
},
autoFocusField(ref) {
autoFocusField(ref, showSoftInput) {
this.$refs[ref].nativeView.focus()
if (showSoftInput) {
setTimeout(() => {
Utils.ad.showSoftInput(this.$refs[ref].nativeView.android)
}, 1)
}
},
showYieldUnits(focus) {
this.modalOpen = true
@ -501,14 +529,14 @@ export default {
this.recipeContent.yield.unit = yieldUnit
this.addYieldUnitAction(yieldUnit)
this.modalOpen = false
if (focus) this.autoFocusField("timeRequired")
if (focus) this.addIngredient()
}
})
} else if (action) {
this.recipeContent.yield.unit = action
this.hijackBackEvent()
this.modalOpen = false
if (focus) this.autoFocusField("timeRequired")
if (focus) this.addIngredient()
} else {
this.hijackBackEvent()
}

View file

@ -100,7 +100,11 @@
<Label class="bx small" :text="icon.time" />
<Label
class="time"
:text="`${formattedTime(recipe.timeRequired).time}`"
:text="
`${
formattedTotalTime(recipe.prepTime, recipe.cookTime).time
}`
"
/>
</StackLayout>
</StackLayout>
@ -319,10 +323,11 @@ export default {
this.updateFilter()
}
},
formattedTime(time) {
let t = time.split(":")
let h = parseInt(t[0])
let m = parseInt(t[1])
formattedTotalTime(prepTime, cookTime) {
let t1 = prepTime.split(":")
let t2 = cookTime.split(":")
let h = parseInt(t1[0]) + parseInt(t2[0])
let m = parseInt(t1[1]) + parseInt(t2[1])
return {
time: h ? (m ? `${h} hr ${m} min` : `${h} hr`) : `${m} min`,
duration: `${h}${m}`,
@ -401,8 +406,9 @@ export default {
.localeCompare(otherItem.title.toLowerCase(), "en", {
ignorePunctuation: true,
})
let d1 = this.formattedTime(item.timeRequired).duration
let d2 = this.formattedTime(otherItem.timeRequired).duration
let d1 = this.formattedTotalTime(item.prepTime, item.cookTime).duration
let d2 = this.formattedTotalTime(otherItem.prepTime, otherItem.cookTime)
.duration
let ld1 = new Date(item.lastModified)
let ld2 = new Date(otherItem.lastModified)
switch (this.sortType) {

View file

@ -115,8 +115,12 @@
textWrap="true"
/>
<StackLayout orientation="horizontal" class="time">
<Label text="Time required:" />
<Label :text="` ${formattedTime(recipe.timeRequired)}`" />
<Label text="Preparation time:" />
<Label :text="` ${formattedTime(recipe.prepTime)}`" />
</StackLayout>
<StackLayout orientation="horizontal" class="time">
<Label text="Cooking time:" />
<Label :text="` ${formattedTime(recipe.cookTime)}`" />
</StackLayout>
<GridLayout
rows="auto, auto"
@ -637,7 +641,9 @@ export default {
shareRecipe() {
let overview = `${
this.recipe.title
}\n\nTime required: ${this.formattedTime(this.recipe.timeRequired)}\n`
}\n\nPreparation time: ${this.formattedTime(
this.recipe.prepTime
)}\nCooking time: ${this.formattedTime(this.recipe.cookTime)}\n`
let shareContent = overview
if (this.recipe.ingredients.length) {
let ingredients = `\n\nIngredients for ${

View file

@ -208,13 +208,26 @@ export default new Vuex.Store({
} else {
createDocuments(recipes)
}
function getUpdatedData(data) {
return data.map((recipe) => {
let r = Object.assign({}, recipe)
if (r.timeRequired) {
r.prepTime = "00:00"
r.cookTime = r.timeRequired
delete r.timeRequired
}
return r
})
}
function createDocuments(data) {
data = getUpdatedData(data)
state.recipes = [...state.recipes, ...data]
data.forEach((recipe) => {
EnRecipesDB.createDocument(recipe, recipe.id)
})
}
function updateDocuments(data) {
data = getUpdatedData(data)
data.forEach((recipe) => {
let recipeIndex = state.recipes
.map((e, i) => {

View file

@ -0,0 +1,19 @@
EnRecipes is an easy to use, privacy-friendly digital cookbook that lets you create, manage and share your own recipes.
Features:
- Create recipes quickly
- Add photo, notes and references to your recipes
- Organise your recipes by category
- Quickly search for your recipes
- Mark recipes as favorites and add them to your Try Later list
- Scale your recipe ingredients to serve more or less people
- Get notified of the last time you tried a recipe
- Share your recipe to anyone by any means as a nicely formatted message. You can share the recipe photo too.
- Create meal plans
- Import/Export recipes
- Light & Dark theme
- No annoying ads or pop-ups
- No internet access is required and never asks for any unwanted permissions
- 100% free and open-source
Lots of interesting features on the way...

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View file

@ -0,0 +1 @@
A simple, offline recipe manager.

View file

@ -0,0 +1 @@
EnRecipes

View file

@ -1,8 +1,8 @@
{
"time": "Tue Dec 01 2020 12:44:57 GMT+0530 (India Standard Time)",
"time": "Tue Dec 01 2020 14:41:20 GMT+0530 (India Standard Time)",
"nativePlatformStatus": "3",
"changesRequireBuild": true,
"projectFileHash": "7e76fcc579c6b048fb6a6099b9da9192f2f9ca58fe7cc504fe760ca454b8d7ae",
"changesRequireBuildTime": "Tue Dec 01 2020 12:44:57 GMT+0530 (India Standard Time)",
"changesRequireBuildTime": "Tue Dec 01 2020 14:41:20 GMT+0530 (India Standard Time)",
"release": true
}

View file

@ -1,4 +1,4 @@
#Tue Dec 01 12:45:15 IST 2020
#Tue Dec 01 14:41:24 IST 2020
/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/res/drawable-anydpi-v26/ic_launcher.xml=/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/build/intermediates/res/merged/release/drawable-anydpi-v26_ic_launcher.xml.flat
/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/res/drawable-mdpi/logo.png=/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/build/intermediates/res/merged/release/drawable-mdpi_logo.png.flat
/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/res/drawable-xxhdpi/share.png=/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/build/intermediates/res/merged/release/drawable-xxhdpi_share.png.flat

View file

@ -1,4 +1,4 @@
#Tue Dec 01 12:46:05 IST 2020
#Tue Dec 01 14:41:56 IST 2020
base.0=/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/build/intermediates/dex/release/out/classes.dex
path.0=classes.dex
renamed.0=classes.dex

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
{
"prepareTime": "Tue Dec 01 2020 12:44:57 GMT+0530 (India Standard Time)",
"buildTime": "Tue Dec 01 2020 12:46:19 GMT+0530 (India Standard Time)"
"prepareTime": "Tue Dec 01 2020 14:41:20 GMT+0530 (India Standard Time)",
"buildTime": "Tue Dec 01 2020 14:51:26 GMT+0530 (India Standard Time)"
}

View file

@ -30,8 +30,8 @@
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/App_Resources/Android/src/main/res/drawable-mdpi/share.png": "5f4976a18eeacc8509e7bd71d9cc2dae051af149",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/App_Resources/Android/src/main/res/drawable-xhdpi/camera.png": "56e67577db1d4ddd5cf78371d523559a9054c477",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/App_Resources/Android/src/main/res/drawable-xhdpi/check.png": "4e786675947040b6a0f5f0f9d83a4f9f0822a094",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/App_Resources/Android/src/main/res/drawable-xhdpi/detail.png": "ec0da35c95f4773c8c26e70647b6a974103e9944",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/App_Resources/Android/src/main/res/drawable-xhdpi/ic_launcher.png": "681a23ee3bcbb5c744cb80f224a4baedad3f0075",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/App_Resources/Android/src/main/res/drawable-xhdpi/detail.png": "ec0da35c95f4773c8c26e70647b6a974103e9944",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/App_Resources/Android/src/main/res/drawable-xhdpi/ic_launcher_foreground.png": "58375b6039b0bf0fc65802a162d84cba8f6fb368",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png": "d55b18eecf5018f9a3adc6ebcc24d309dbed4493",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/App_Resources/Android/src/main/res/drawable-xhdpi/photo.png": "7a9b1b430fe189e3a918743044bcb77a932b6ccf",
@ -60,7 +60,7 @@
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/package.json": "b5c23d281c6a3d2b571a570721d60bbce6c9be29",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/runtime.js": "46d6b98a238721f34ab9bc68b90c0cdea00153cf",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/vendor.js.LICENSE.txt": "fe0ae576f8684fbe78596ad84eddafc528dba50c",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/bundle.js": "ee00d2a68a9bbc5f90add6216b8709de9f3c181c",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/bundle.js": "71670860a95aee20ecdf4e9a027b88acc06128a1",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/fonts/boxicons.ttf": "6c9944326ed3c901afcb78a9ed07906f04f9cbb2",
"/mnt/82e5ff15-70b8-44a5-bb66-55688fc2381f/Freelance/Projects/WIP/EnRecipes/Developement/EnRecipes/platforms/android/app/src/main/assets/app/vendor.js": "a7ef05c23f9043860c8ecc71b3aaabdfe0b2e7f4"
}

View file

@ -176,7 +176,7 @@ document.getElementById(id).style.display = 'none';
<span class="mdl-layout-title">Lint Report: No errors or warnings</span>
<div class="mdl-layout-spacer"></div>
<nav class="mdl-navigation mdl-layout--large-screen-only">
Check performed at Tue Dec 01 12:45:57 IST 2020 </nav>
Check performed at Tue Dec 01 14:51:25 IST 2020 </nav>
</div>
</header>
<div class="mdl-layout__drawer">

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff