mirror of
https://github.com/ThisIsBenny/iOS-Widgets.git
synced 2025-05-02 12:47:40 +00:00
v1.1.0
- Change Cache TTL to 4 hours - show total numbers in karge widget (optional)
This commit is contained in:
parent
fddc24df0a
commit
59a480baef
1 changed files with 14 additions and 5 deletions
|
@ -3,9 +3,12 @@
|
||||||
// icon-color: red; icon-glyph: syringe;
|
// icon-color: red; icon-glyph: syringe;
|
||||||
|
|
||||||
/**************
|
/**************
|
||||||
Version 1.0.2
|
Version 1.1.0
|
||||||
|
|
||||||
Changelog:
|
Changelog:
|
||||||
|
v1.1.0
|
||||||
|
- Cache TTL changed to 4 hours
|
||||||
|
- Show total numbers in large widget
|
||||||
v1.0.2
|
v1.0.2
|
||||||
- prevent error if user deletes Widget-"Parameter"
|
- prevent error if user deletes Widget-"Parameter"
|
||||||
- optionally format numbers with more readable units and their correct abbreviation
|
- optionally format numbers with more readable units and their correct abbreviation
|
||||||
|
@ -21,7 +24,10 @@ Changelog:
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// How many minutes should the cache be valid
|
// How many minutes should the cache be valid
|
||||||
const cacheMinutes = 6 * 60
|
const cacheMinutes = 4 * 60
|
||||||
|
|
||||||
|
// Set to true to show total numbers in the large widget
|
||||||
|
const showTotalInLargeWidget = false
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
////////////////////////// Dev Settings ////////////////////////
|
////////////////////////// Dev Settings ////////////////////////
|
||||||
|
@ -250,9 +256,11 @@ if (config.widgetFamily === 'large') {
|
||||||
row.layoutHorizontally()
|
row.layoutHorizontally()
|
||||||
const stateText = row.addText(key)
|
const stateText = row.addText(key)
|
||||||
stateText.font = Font.mediumSystemFont(fontSize)
|
stateText.font = Font.mediumSystemFont(fontSize)
|
||||||
|
stateText.lineLimit = 1
|
||||||
|
|
||||||
row.addSpacer()
|
row.addSpacer()
|
||||||
const quoteText = row.addText(`${value.quote} %`.replace('.', ','))
|
const totalText = showTotalInLargeWidget ? `${parseInt(value.vaccinated).toLocaleString(Device.language())} / ` : ''
|
||||||
|
const quoteText = row.addText(`${totalText}${value.quote.toString().replace('.', ',')} %`)
|
||||||
quoteText.font = Font.systemFont(fontSize)
|
quoteText.font = Font.systemFont(fontSize)
|
||||||
|
|
||||||
row.addSpacer(4)
|
row.addSpacer(4)
|
||||||
|
@ -268,7 +276,8 @@ if (config.widgetFamily === 'large') {
|
||||||
stateText.font = Font.boldSystemFont(fontSize + 1)
|
stateText.font = Font.boldSystemFont(fontSize + 1)
|
||||||
|
|
||||||
row.addSpacer()
|
row.addSpacer()
|
||||||
const quoteText = row.addText(`${result.quote} %`.replace('.', ','))
|
const totalText = showTotalInLargeWidget ? `${parseInt(result.vaccinated).toLocaleString(Device.language())} / ` : ''
|
||||||
|
const quoteText = row.addText(`${totalText}${result.quote.toString().replace('.', ',')} %`)
|
||||||
quoteText.font = Font.boldSystemFont(fontSize + 1)
|
quoteText.font = Font.boldSystemFont(fontSize + 1)
|
||||||
|
|
||||||
row.addSpacer(4)
|
row.addSpacer(4)
|
||||||
|
|
Loading…
Add table
Reference in a new issue