mirror of
https://github.com/tomfong/simple-qr.git
synced 2025-06-28 12:09:58 +00:00
chore: change to use @capacitor/preferences as storage
This commit is contained in:
parent
438768d7b7
commit
63ea056c2a
35 changed files with 1073 additions and 434 deletions
|
@ -19,6 +19,7 @@ dependencies {
|
||||||
implementation project(':capacitor-filesystem')
|
implementation project(':capacitor-filesystem')
|
||||||
implementation project(':capacitor-haptics')
|
implementation project(':capacitor-haptics')
|
||||||
implementation project(':capacitor-keyboard')
|
implementation project(':capacitor-keyboard')
|
||||||
|
implementation project(':capacitor-preferences')
|
||||||
implementation project(':capacitor-splash-screen')
|
implementation project(':capacitor-splash-screen')
|
||||||
implementation project(':capacitor-status-bar')
|
implementation project(':capacitor-status-bar')
|
||||||
implementation project(':capacitor-toast')
|
implementation project(':capacitor-toast')
|
||||||
|
|
|
@ -39,6 +39,10 @@
|
||||||
"pkg": "@capacitor/keyboard",
|
"pkg": "@capacitor/keyboard",
|
||||||
"classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin"
|
"classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pkg": "@capacitor/preferences",
|
||||||
|
"classpath": "com.capacitorjs.plugins.preferences.PreferencesPlugin"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/splash-screen",
|
"pkg": "@capacitor/splash-screen",
|
||||||
"classpath": "com.capacitorjs.plugins.splashscreen.SplashScreenPlugin"
|
"classpath": "com.capacitorjs.plugins.splashscreen.SplashScreenPlugin"
|
||||||
|
|
|
@ -32,6 +32,9 @@ project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/
|
||||||
include ':capacitor-keyboard'
|
include ':capacitor-keyboard'
|
||||||
project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')
|
project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')
|
||||||
|
|
||||||
|
include ':capacitor-preferences'
|
||||||
|
project(':capacitor-preferences').projectDir = new File('../node_modules/@capacitor/preferences/android')
|
||||||
|
|
||||||
include ':capacitor-splash-screen'
|
include ':capacitor-splash-screen'
|
||||||
project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capacitor/splash-screen/android')
|
project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capacitor/splash-screen/android')
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ def capacitor_pods
|
||||||
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
|
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
|
||||||
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
|
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
|
||||||
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
|
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
|
||||||
|
pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences'
|
||||||
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
|
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
|
||||||
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
|
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
|
||||||
pod 'CapacitorToast', :path => '../../node_modules/@capacitor/toast'
|
pod 'CapacitorToast', :path => '../../node_modules/@capacitor/toast'
|
||||||
|
|
15
package-lock.json
generated
15
package-lock.json
generated
|
@ -39,6 +39,7 @@
|
||||||
"@capacitor/haptics": "^4.0.1",
|
"@capacitor/haptics": "^4.0.1",
|
||||||
"@capacitor/ios": "^4.3.0",
|
"@capacitor/ios": "^4.3.0",
|
||||||
"@capacitor/keyboard": "^4.0.1",
|
"@capacitor/keyboard": "^4.0.1",
|
||||||
|
"@capacitor/preferences": "^4.0.1",
|
||||||
"@capacitor/splash-screen": "^4.1.0",
|
"@capacitor/splash-screen": "^4.1.0",
|
||||||
"@capacitor/status-bar": "^4.0.1",
|
"@capacitor/status-bar": "^4.0.1",
|
||||||
"@capacitor/toast": "^4.0.1",
|
"@capacitor/toast": "^4.0.1",
|
||||||
|
@ -2490,6 +2491,14 @@
|
||||||
"@capacitor/core": "^4.0.0"
|
"@capacitor/core": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@capacitor/preferences": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@capacitor/preferences/-/preferences-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-FffJjKS4XcodUj/rtFtWizQ9q/oYDSn5opZ+JYwj/EkjiMWMhY/Pk9lN3vwQfp+VJrTt3hjr+bwKXjhTbYBqKw==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@capacitor/core": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@capacitor/splash-screen": {
|
"node_modules/@capacitor/splash-screen": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/splash-screen/-/splash-screen-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/splash-screen/-/splash-screen-4.1.0.tgz",
|
||||||
|
@ -16346,6 +16355,12 @@
|
||||||
"integrity": "sha512-JZVci2v9jAKH0sIoNNZzmw/cWGXWf+KneLt0yDr/6YSs/2/tfuH10yOrUOhgrKFkR+fFj/rddTClQXUQ8Rqcrg==",
|
"integrity": "sha512-JZVci2v9jAKH0sIoNNZzmw/cWGXWf+KneLt0yDr/6YSs/2/tfuH10yOrUOhgrKFkR+fFj/rddTClQXUQ8Rqcrg==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
|
"@capacitor/preferences": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@capacitor/preferences/-/preferences-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-FffJjKS4XcodUj/rtFtWizQ9q/oYDSn5opZ+JYwj/EkjiMWMhY/Pk9lN3vwQfp+VJrTt3hjr+bwKXjhTbYBqKw==",
|
||||||
|
"requires": {}
|
||||||
|
},
|
||||||
"@capacitor/splash-screen": {
|
"@capacitor/splash-screen": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/splash-screen/-/splash-screen-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/splash-screen/-/splash-screen-4.1.0.tgz",
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
"@capacitor/haptics": "^4.0.1",
|
"@capacitor/haptics": "^4.0.1",
|
||||||
"@capacitor/ios": "^4.3.0",
|
"@capacitor/ios": "^4.3.0",
|
||||||
"@capacitor/keyboard": "^4.0.1",
|
"@capacitor/keyboard": "^4.0.1",
|
||||||
|
"@capacitor/preferences": "^4.0.1",
|
||||||
"@capacitor/splash-screen": "^4.1.0",
|
"@capacitor/splash-screen": "^4.1.0",
|
||||||
"@capacitor/status-bar": "^4.0.1",
|
"@capacitor/status-bar": "^4.0.1",
|
||||||
"@capacitor/toast": "^4.0.1",
|
"@capacitor/toast": "^4.0.1",
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { NgxQrcodeElementTypes, NgxQrcodeErrorCorrectionLevels, QrcodeComponent
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
import { ScreenBrightness } from '@capacitor-community/screen-brightness';
|
import { ScreenBrightness } from '@capacitor-community/screen-brightness';
|
||||||
import { rgbToHex } from 'src/app/utils/helpers';
|
import { rgbToHex } from 'src/app/utils/helpers';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-qr-code',
|
selector: 'app-qr-code',
|
||||||
|
@ -149,7 +150,7 @@ export class QrCodePage {
|
||||||
|
|
||||||
async onErrorCorrectionLevelChange() {
|
async onErrorCorrectionLevelChange() {
|
||||||
this.setErrorCorrectionLevel();
|
this.setErrorCorrectionLevel();
|
||||||
await this.env.storageSet("error-correction-level", this.env.errorCorrectionLevel);
|
await Preferences.set({ key: this.env.KEY_ERROR_CORRECTION_LEVEL, value: this.env.errorCorrectionLevel });
|
||||||
if (this.qrcodeElement != null) {
|
if (this.qrcodeElement != null) {
|
||||||
this.qrcodeElement.errorCorrectionLevel = this.errorCorrectionLevel;
|
this.qrcodeElement.errorCorrectionLevel = this.errorCorrectionLevel;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { Toast } from '@capacitor/toast';
|
import { Toast } from '@capacitor/toast';
|
||||||
import { AlertController, Platform } from '@ionic/angular';
|
import { AlertController, Platform } from '@ionic/angular';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
@ -89,7 +90,7 @@ export class AboutPage {
|
||||||
if (this.env.debugMode != 'on') {
|
if (this.env.debugMode != 'on') {
|
||||||
if (this.tapAppVersionTimes >= 5) {
|
if (this.tapAppVersionTimes >= 5) {
|
||||||
this.env.debugMode = 'on';
|
this.env.debugMode = 'on';
|
||||||
await this.env.storageSet("debug-mode-on", 'on');
|
await Preferences.set({ key: this.env.KEY_DEBUG_MODE, value: 'on' });
|
||||||
await Toast.show({
|
await Toast.show({
|
||||||
text: this.translate.instant("MSG.DEBUG_MODE_ON"),
|
text: this.translate.instant("MSG.DEBUG_MODE_ON"),
|
||||||
duration: "short",
|
duration: "short",
|
||||||
|
|
|
@ -295,8 +295,8 @@ export class GeneratePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
async processQrCode(loading: HTMLIonLoadingElement): Promise<void> {
|
async processQrCode(loading: HTMLIonLoadingElement): Promise<void> {
|
||||||
this.env.result = this.qrCodeContent;
|
this.env.resultContent = this.qrCodeContent;
|
||||||
this.env.resultFormat = "";
|
this.env.resultContentFormat = "";
|
||||||
this.qrCodeContent = '';
|
this.qrCodeContent = '';
|
||||||
this.env.recordSource = "create";
|
this.env.recordSource = "create";
|
||||||
this.env.detailedRecordSource = "create";
|
this.env.detailedRecordSource = "create";
|
||||||
|
|
|
@ -198,7 +198,7 @@ export class HistoryPage {
|
||||||
case "RSS_EXPANDED":
|
case "RSS_EXPANDED":
|
||||||
return this.translate.instant("BARCODE_TYPE.RSS").trim();
|
return this.translate.instant("BARCODE_TYPE.RSS").trim();
|
||||||
default:
|
default:
|
||||||
return this.env.resultFormat;
|
return this.env.resultContentFormat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,8 +210,8 @@ export class HistoryPage {
|
||||||
this.changeDetectorRef.detectChanges();
|
this.changeDetectorRef.detectChanges();
|
||||||
this.changeDetectorRef.reattach();
|
this.changeDetectorRef.reattach();
|
||||||
const loading = await this.presentLoading(this.translate.instant('PLEASE_WAIT'));
|
const loading = await this.presentLoading(this.translate.instant('PLEASE_WAIT'));
|
||||||
this.env.result = data;
|
this.env.resultContent = data;
|
||||||
this.env.resultFormat = "";
|
this.env.resultContentFormat = "";
|
||||||
this.env.recordSource = "view";
|
this.env.recordSource = "view";
|
||||||
this.env.detailedRecordSource = source;
|
this.env.detailedRecordSource = source;
|
||||||
this.env.viewResultFrom = "/tabs/history";
|
this.env.viewResultFrom = "/tabs/history";
|
||||||
|
|
|
@ -101,8 +101,8 @@ export class ImportImagePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
async processQrCode(scannedData: string, loading: HTMLIonLoadingElement): Promise<void> {
|
async processQrCode(scannedData: string, loading: HTMLIonLoadingElement): Promise<void> {
|
||||||
this.env.result = scannedData;
|
this.env.resultContent = scannedData;
|
||||||
this.env.resultFormat = "QR_CODE";
|
this.env.resultContentFormat = "QR_CODE";
|
||||||
this.env.recordSource = "scan";
|
this.env.recordSource = "scan";
|
||||||
this.env.detailedRecordSource = "scan-image";
|
this.env.detailedRecordSource = "scan-image";
|
||||||
this.env.viewResultFrom = "/tabs/import-image";
|
this.env.viewResultFrom = "/tabs/import-image";
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
</ion-row>
|
</ion-row>
|
||||||
|
|
||||||
<ng-container *ngIf="qrCodeContent && qrCodeContent.trim().length > 0" [ngTemplateOutlet]="contentBlock"
|
<ng-container *ngIf="qrCodeContent && qrCodeContent.trim().length > 0" [ngTemplateOutlet]="contentBlock"
|
||||||
[ngTemplateOutletContext]="{ label: barcodeFormat + ('CONTENT' | translate), content: qrCodeContent, hint: env.resultFormat }">
|
[ngTemplateOutletContext]="{ label: barcodeFormat + ('CONTENT' | translate), content: qrCodeContent, hint: env.resultContentFormat }">
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="base64Encoded && qrCodeContent && qrCodeContent.trim().length > 0"
|
<ng-container *ngIf="base64Encoded && qrCodeContent && qrCodeContent.trim().length > 0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, OnInit, QueryList, ViewChildren } from '@angular/core';
|
import { Component, QueryList, ViewChildren } from '@angular/core';
|
||||||
import { Clipboard } from '@capacitor/clipboard';
|
import { Clipboard } from '@capacitor/clipboard';
|
||||||
import { Contacts, ContactType, EmailAddress, NewContact, PhoneNumber } from '@capacitor-community/contacts'
|
import { Contacts, ContactType, EmailAddress, NewContact, PhoneNumber } from '@capacitor-community/contacts'
|
||||||
import { SMS } from '@awesome-cordova-plugins/sms/ngx';
|
import { SMS } from '@awesome-cordova-plugins/sms/ngx';
|
||||||
|
@ -81,7 +81,7 @@ export class ResultPage {
|
||||||
this.showQrFirst = true;
|
this.showQrFirst = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.qrCodeContent = this.env.result;
|
this.qrCodeContent = this.env.resultContent;
|
||||||
this.setContentType();
|
this.setContentType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,7 +616,6 @@ export class ResultPage {
|
||||||
lines.forEach(
|
lines.forEach(
|
||||||
line => {
|
line => {
|
||||||
const tLine = line.trim();
|
const tLine = line.trim();
|
||||||
console.log(tLine);
|
|
||||||
if (tLine.toUpperCase().substr(0, fullNameId1.length) === fullNameId1) {
|
if (tLine.toUpperCase().substr(0, fullNameId1.length) === fullNameId1) {
|
||||||
this.vCardContact.fullName = tLine.substr(fullNameId1.length);
|
this.vCardContact.fullName = tLine.substr(fullNameId1.length);
|
||||||
} else if (tLine.toUpperCase().substr(0, fullNameId2.length) === fullNameId2) {
|
} else if (tLine.toUpperCase().substr(0, fullNameId2.length) === fullNameId2) {
|
||||||
|
@ -860,7 +859,7 @@ export class ResultPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
get barcodeFormat(): string {
|
get barcodeFormat(): string {
|
||||||
switch (this.env.resultFormat) {
|
switch (this.env.resultContentFormat) {
|
||||||
case "UPC_A":
|
case "UPC_A":
|
||||||
return this.translate.instant("BARCODE_TYPE.UPC");
|
return this.translate.instant("BARCODE_TYPE.UPC");
|
||||||
case "UPC_E":
|
case "UPC_E":
|
||||||
|
@ -900,7 +899,7 @@ export class ResultPage {
|
||||||
case "RSS_EXPANDED":
|
case "RSS_EXPANDED":
|
||||||
return this.translate.instant("BARCODE_TYPE.RSS");
|
return this.translate.instant("BARCODE_TYPE.RSS");
|
||||||
default:
|
default:
|
||||||
return this.env.resultFormat;
|
return this.env.resultContentFormat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,8 +137,8 @@ export class ScanPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
async processQrCode(scannedData: string, format: string, loading: HTMLIonLoadingElement): Promise<void> {
|
async processQrCode(scannedData: string, format: string, loading: HTMLIonLoadingElement): Promise<void> {
|
||||||
this.env.result = scannedData;
|
this.env.resultContent = scannedData;
|
||||||
this.env.resultFormat = format;
|
this.env.resultContentFormat = format;
|
||||||
this.env.recordSource = "scan";
|
this.env.recordSource = "scan";
|
||||||
this.env.detailedRecordSource = "scan-camera";
|
this.env.detailedRecordSource = "scan-camera";
|
||||||
this.env.viewResultFrom = "/tabs/scan";
|
this.env.viewResultFrom = "/tabs/scan";
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { Toast } from '@capacitor/toast';
|
import { Toast } from '@capacitor/toast';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
|
|
||||||
|
@ -15,12 +16,12 @@ export class SettingAutoBrightnessPage {
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async saveAutoMaxBrightness() {
|
async saveAutoMaxBrightness() {
|
||||||
await this.env.storageSet("auto-max-brightness", this.env.autoMaxBrightness);
|
await Preferences.set({ key: this.env.KEY_AUTO_MAX_BRIGHTNESS, value: this.env.autoMaxBrightness });
|
||||||
}
|
}
|
||||||
|
|
||||||
async onAutoMaxBrightnessChange(ev: any) {
|
async onAutoMaxBrightnessChange(ev: any) {
|
||||||
this.env.autoMaxBrightness = ev ? 'on' : 'off';
|
this.env.autoMaxBrightness = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("auto-max-brightness", this.env.autoMaxBrightness);
|
await Preferences.set({ key: this.env.KEY_AUTO_MAX_BRIGHTNESS, value: this.env.autoMaxBrightness });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -13,6 +14,6 @@ export class SettingAutoExitPage{
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async saveAutoExitAppMin() {
|
async saveAutoExitAppMin() {
|
||||||
await this.env.storageSet("autoExitAppMin", this.env.autoExitAppMin);
|
await Preferences.set({ key: this.env.KEY_AUTO_EXIT_MIN, value: JSON.stringify(this.env.autoExitAppMin) });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { Toast } from '@capacitor/toast';
|
import { Toast } from '@capacitor/toast';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
|
|
||||||
|
@ -16,31 +17,31 @@ export class SettingAutoQrPage {
|
||||||
|
|
||||||
async onShowQrAfterCameraScanChange(ev: any) {
|
async onShowQrAfterCameraScanChange(ev: any) {
|
||||||
this.env.showQrAfterCameraScan = ev ? 'on' : 'off';
|
this.env.showQrAfterCameraScan = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("show-qr-after-camera-scan", this.env.showQrAfterCameraScan);
|
await Preferences.set({ key: this.env.KEY_SHOW_QR_AFTER_CAMERA_SCAN, value: this.env.showQrAfterCameraScan });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onShowQrAfterImageScanChange(ev: any) {
|
async onShowQrAfterImageScanChange(ev: any) {
|
||||||
this.env.showQrAfterImageScan = ev ? 'on' : 'off';
|
this.env.showQrAfterImageScan = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("show-qr-after-image-scan", this.env.showQrAfterImageScan);
|
await Preferences.set({ key: this.env.KEY_SHOW_QR_AFTER_IMAGE_SCAN, value: this.env.showQrAfterImageScan });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onShowQrAfterCreateChange(ev: any) {
|
async onShowQrAfterCreateChange(ev: any) {
|
||||||
this.env.showQrAfterCreate = ev ? 'on' : 'off';
|
this.env.showQrAfterCreate = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("show-qr-after-create", this.env.showQrAfterCreate);
|
await Preferences.set({ key: this.env.KEY_SHOW_QR_AFTER_CREATE, value: this.env.showQrAfterCreate });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onShowQrAfterLogViewChange(ev: any) {
|
async onShowQrAfterLogViewChange(ev: any) {
|
||||||
this.env.showQrAfterLogView = ev ? 'on' : 'off';
|
this.env.showQrAfterLogView = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("show-qr-after-log-view", this.env.showQrAfterLogView);
|
await Preferences.set({ key: this.env.KEY_SHOW_QR_AFTER_LOG_VIEW, value: this.env.showQrAfterLogView });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onShowQrAfterBookmarkViewChange(ev: any) {
|
async onShowQrAfterBookmarkViewChange(ev: any) {
|
||||||
this.env.showQrAfterBookmarkView = ev ? 'on' : 'off';
|
this.env.showQrAfterBookmarkView = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("show-qr-after-bookmark-view", this.env.showQrAfterBookmarkView);
|
await Preferences.set({ key: this.env.KEY_SHOW_QR_AFTER_BOOKMARK_VIEW, value: this.env.showQrAfterBookmarkView });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { OverlayContainer } from '@angular/cdk/overlay';
|
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
|
|
||||||
|
@ -18,7 +19,7 @@ export class SettingColorPage {
|
||||||
|
|
||||||
async saveColorTheme() {
|
async saveColorTheme() {
|
||||||
await this.env.toggleColorTheme();
|
await this.env.toggleColorTheme();
|
||||||
await this.env.storageSet("color", this.env.selectedColorTheme);
|
await Preferences.set({ key: this.env.KEY_COLOR, value: this.env.selectedColorTheme });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
|
|
||||||
|
@ -15,7 +16,7 @@ export class SettingDebugPage {
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async saveDebugMode() {
|
async saveDebugMode() {
|
||||||
await this.env.storageSet("debug-mode-on", this.env.debugMode);
|
await Preferences.set({ key: this.env.KEY_DEBUG_MODE, value: this.env.debugMode });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
|
|
||||||
|
@ -16,6 +17,6 @@ export class SettingLanguagePage {
|
||||||
|
|
||||||
async saveLanguage() {
|
async saveLanguage() {
|
||||||
this.env.toggleLanguageChange();
|
this.env.toggleLanguageChange();
|
||||||
await this.env.storageSet("language", this.env.selectedLanguage);
|
await Preferences.set({ key: this.env.KEY_LANGUAGE, value: this.env.selectedLanguage });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -14,6 +15,6 @@ export class SettingOrientationPage {
|
||||||
|
|
||||||
async saveOrientation() {
|
async saveOrientation() {
|
||||||
await this.env.toggleOrientationChange();
|
await this.env.toggleOrientationChange();
|
||||||
await this.env.storageSet("orientation", this.env.orientation);
|
await Preferences.set({ key: this.env.KEY_ORIENTATION, value: this.env.orientation });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { Toast } from '@capacitor/toast';
|
import { Toast } from '@capacitor/toast';
|
||||||
import { AlertController, Platform } from '@ionic/angular';
|
import { AlertController, Platform } from '@ionic/angular';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
@ -68,35 +69,35 @@ export class SettingQrPage {
|
||||||
|
|
||||||
async saveErrorCorrectionLevel() {
|
async saveErrorCorrectionLevel() {
|
||||||
this.setErrorCorrectionLevel();
|
this.setErrorCorrectionLevel();
|
||||||
await this.env.storageSet("error-correction-level", this.env.errorCorrectionLevel);
|
await Preferences.set({ key: this.env.KEY_ERROR_CORRECTION_LEVEL, value: this.env.errorCorrectionLevel });
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveQrCodeDarkR() {
|
async saveQrCodeDarkR() {
|
||||||
await this.env.storageSet("qrCodeDarkR", this.env.qrCodeDarkR);
|
await Preferences.set({ key: this.env.KEY_QR_CODE_DARK_R, value: JSON.stringify(this.env.qrCodeDarkR) });
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveQrCodeDarkG() {
|
async saveQrCodeDarkG() {
|
||||||
await this.env.storageSet("qrCodeDarkG", this.env.qrCodeDarkG);
|
await Preferences.set({ key: this.env.KEY_QR_CODE_DARK_G, value: JSON.stringify(this.env.qrCodeDarkG) });
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveQrCodeDarkB() {
|
async saveQrCodeDarkB() {
|
||||||
await this.env.storageSet("qrCodeDarkB", this.env.qrCodeDarkB);
|
await Preferences.set({ key: this.env.KEY_QR_CODE_DARK_B, value: JSON.stringify(this.env.qrCodeDarkB) });
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveQrCodeLightR() {
|
async saveQrCodeLightR() {
|
||||||
await this.env.storageSet("qrCodeLightR", this.env.qrCodeLightR);
|
await Preferences.set({ key: this.env.KEY_QR_CODE_LIGHT_R, value: JSON.stringify(this.env.qrCodeLightR) });
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveQrCodeLightG() {
|
async saveQrCodeLightG() {
|
||||||
await this.env.storageSet("qrCodeLightG", this.env.qrCodeLightG);
|
await Preferences.set({ key: this.env.KEY_QR_CODE_LIGHT_G, value: JSON.stringify(this.env.qrCodeLightG) });
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveQrCodeLightB() {
|
async saveQrCodeLightB() {
|
||||||
await this.env.storageSet("qrCodeLightB", this.env.qrCodeLightB);
|
await Preferences.set({ key: this.env.KEY_QR_CODE_LIGHT_B, value: JSON.stringify(this.env.qrCodeLightB) });
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveQrCodeMargin() {
|
async saveQrCodeMargin() {
|
||||||
await this.env.storageSet("qrCodeMargin", this.env.qrCodeMargin);
|
await Preferences.set({ key: this.env.KEY_QR_CODE_MARGIN, value: JSON.stringify(this.env.qrCodeMargin) });
|
||||||
}
|
}
|
||||||
|
|
||||||
async resetDefault() {
|
async resetDefault() {
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { ScanRecord } from 'src/app/models/scan-record';
|
||||||
import { Bookmark } from 'src/app/models/bookmark';
|
import { Bookmark } from 'src/app/models/bookmark';
|
||||||
import { SocialSharing } from '@awesome-cordova-plugins/social-sharing/ngx';
|
import { SocialSharing } from '@awesome-cordova-plugins/social-sharing/ngx';
|
||||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-setting-record',
|
selector: 'app-setting-record',
|
||||||
|
@ -43,17 +44,17 @@ export class SettingRecordPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveHistoryPageStartSegment() {
|
async saveHistoryPageStartSegment() {
|
||||||
await this.env.storageSet("history-page-start-segment", this.env.historyPageStartSegment);
|
await Preferences.set({ key: this.env.KEY_HISTORY_PAGE_START_SEGMENT, value: this.env.historyPageStartSegment });
|
||||||
}
|
}
|
||||||
|
|
||||||
async onScanRecordLoggingChange(ev: any) {
|
async onScanRecordLoggingChange(ev: any) {
|
||||||
this.env.scanRecordLogging = ev ? 'on' : 'off';
|
this.env.scanRecordLogging = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("scan-record-logging", this.env.scanRecordLogging);
|
await Preferences.set({ key: this.env.KEY_SCAN_RECORD_LOGGING, value: this.env.scanRecordLogging });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveRecordsLimit() {
|
async saveRecordsLimit() {
|
||||||
await this.env.storageSet("recordsLimit", this.env.recordsLimit);
|
await Preferences.set({ key: this.env.KEY_RECORDS_LIMIT, value: JSON.stringify(this.env.recordsLimit) });
|
||||||
if (this.env.recordsLimit != -1 && !this.preventRecordsLimitToast) {
|
if (this.env.recordsLimit != -1 && !this.preventRecordsLimitToast) {
|
||||||
this.presentToast(this.translate.instant("MSG.DELETE_OVERFLOWED_RECORDS"), "short", "bottom");
|
this.presentToast(this.translate.instant("MSG.DELETE_OVERFLOWED_RECORDS"), "short", "bottom");
|
||||||
}
|
}
|
||||||
|
@ -61,7 +62,7 @@ export class SettingRecordPage {
|
||||||
|
|
||||||
async onShowNumberOfRecordsChange(ev: any) {
|
async onShowNumberOfRecordsChange(ev: any) {
|
||||||
this.env.showNumberOfRecords = ev ? 'on' : 'off';
|
this.env.showNumberOfRecords = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showNumberOfRecords", this.env.showNumberOfRecords);
|
await Preferences.set({ key: this.env.KEY_SHOW_NUMBER_OF_RECORDS, value: this.env.showNumberOfRecords });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { Toast } from '@capacitor/toast';
|
import { Toast } from '@capacitor/toast';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
|
|
||||||
|
@ -15,72 +16,72 @@ export class SettingResultButtonsPage {
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async saveResultPageButtons() {
|
async saveResultPageButtons() {
|
||||||
await this.env.storageSet("result-page-buttons", this.env.resultPageButtons);
|
await Preferences.set({ key: this.env.KEY_RESULT_PAGE_BUTTONS, value: this.env.resultPageButtons });
|
||||||
}
|
}
|
||||||
|
|
||||||
async onSearchButtonChange(ev: any) {
|
async onSearchButtonChange(ev: any) {
|
||||||
this.env.showSearchButton = ev ? 'on' : 'off';
|
this.env.showSearchButton = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showSearchButton", this.env.showSearchButton);
|
await Preferences.set({ key: this.env.KEY_SHOW_SEARCH_BUTTON, value: this.env.showSearchButton });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onCopyButtonChange(ev: any) {
|
async onCopyButtonChange(ev: any) {
|
||||||
this.env.showCopyButton = ev ? 'on' : 'off';
|
this.env.showCopyButton = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showCopyButton", this.env.showCopyButton);
|
await Preferences.set({ key: this.env.KEY_SHOW_COPY_BUTTON, value: this.env.showCopyButton });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onBase64ButtonChange(ev: any) {
|
async onBase64ButtonChange(ev: any) {
|
||||||
this.env.showBase64Button = ev ? 'on' : 'off';
|
this.env.showBase64Button = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showBase64Button", this.env.showBase64Button);
|
await Preferences.set({ key: this.env.KEY_SHOW_BASE64_BUTTON, value: this.env.showBase64Button });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onEnlargeButtonChange(ev: any) {
|
async onEnlargeButtonChange(ev: any) {
|
||||||
this.env.showEnlargeButton = ev ? 'on' : 'off';
|
this.env.showEnlargeButton = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showEnlargeButton", this.env.showEnlargeButton);
|
await Preferences.set({ key: this.env.KEY_SHOW_ENLARGE_BUTTON, value: this.env.showEnlargeButton });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onBookmarkButtonChange(ev: any) {
|
async onBookmarkButtonChange(ev: any) {
|
||||||
this.env.showBookmarkButton = ev ? 'on' : 'off';
|
this.env.showBookmarkButton = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showBookmarkButton", this.env.showBookmarkButton);
|
await Preferences.set({ key: this.env.KEY_SHOW_BOOKMARK_BUTTON, value: this.env.showBookmarkButton });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onOpenUrlButtonChange(ev: any) {
|
async onOpenUrlButtonChange(ev: any) {
|
||||||
this.env.showOpenUrlButton = ev ? 'on' : 'off';
|
this.env.showOpenUrlButton = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showOpenUrlButton", this.env.showOpenUrlButton);
|
await Preferences.set({ key: this.env.KEY_SHOW_OPEN_URL_BUTTON, value: this.env.showOpenUrlButton });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onBrowseButtonChange(ev: any) {
|
async onBrowseButtonChange(ev: any) {
|
||||||
this.env.showBrowseButton = ev ? 'on' : 'off';
|
this.env.showBrowseButton = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showBrowseButton", this.env.showBrowseButton);
|
await Preferences.set({ key: this.env.KEY_SHOW_BROWSE_BUTTON, value: this.env.showBrowseButton });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onAddContactButtonChange(ev: any) {
|
async onAddContactButtonChange(ev: any) {
|
||||||
this.env.showAddContactButton = ev ? 'on' : 'off';
|
this.env.showAddContactButton = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showAddContactButton", this.env.showAddContactButton);
|
await Preferences.set({ key: this.env.KEY_SHOW_ADD_CONTACT_BUTTON, value: this.env.showAddContactButton });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onCallButtonChange(ev: any) {
|
async onCallButtonChange(ev: any) {
|
||||||
this.env.showCallButton = ev ? 'on' : 'off';
|
this.env.showCallButton = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showCallButton", this.env.showCallButton);
|
await Preferences.set({ key: this.env.KEY_SHOW_CALL_BUTTON, value: this.env.showCallButton });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onSendMessageButtonChange(ev: any) {
|
async onSendMessageButtonChange(ev: any) {
|
||||||
this.env.showSendMessageButton = ev ? 'on' : 'off';
|
this.env.showSendMessageButton = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showSendMessageButton", this.env.showSendMessageButton);
|
await Preferences.set({ key: this.env.KEY_SHOW_SEND_MESSAGE_BUTTON, value: this.env.showSendMessageButton });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onSendEmailButtonChange(ev: any) {
|
async onSendEmailButtonChange(ev: any) {
|
||||||
this.env.showSendEmailButton = ev ? 'on' : 'off';
|
this.env.showSendEmailButton = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("showSendEmailButton", this.env.showSendEmailButton);
|
await Preferences.set({ key: this.env.KEY_SHOW_SEND_EMAIL_BUTTON, value: this.env.showSendEmailButton });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
|
|
||||||
|
@ -15,7 +16,7 @@ export class SettingSearchEnginePage {
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async saveSearchEngine() {
|
async saveSearchEngine() {
|
||||||
await this.env.storageSet("search-engine", this.env.searchEngine);
|
await Preferences.set({ key: this.env.KEY_SEARCH_ENGINE, value: this.env.searchEngine });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { Toast } from '@capacitor/toast';
|
import { Toast } from '@capacitor/toast';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
import { fadeIn } from 'src/app/utils/animations';
|
import { fadeIn } from 'src/app/utils/animations';
|
||||||
|
@ -17,12 +18,12 @@ export class SettingStartPagePage {
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async saveStartPage() {
|
async saveStartPage() {
|
||||||
await this.env.storageSet("start-page", this.env.startPage);
|
await Preferences.set({ key: this.env.KEY_START_PAGE, value: this.env.startPage });
|
||||||
}
|
}
|
||||||
|
|
||||||
async onStartPageHeaderChange(ev: any) {
|
async onStartPageHeaderChange(ev: any) {
|
||||||
this.env.startPageHeader = ev ? 'on' : 'off';
|
this.env.startPageHeader = ev ? 'on' : 'off';
|
||||||
await this.env.storageSet("start-page-header", this.env.startPageHeader);
|
await Preferences.set({ key: this.env.KEY_START_PAGE_HEADER, value: this.env.startPageHeader });
|
||||||
await this.tapHaptic();
|
await this.tapHaptic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { EnvService } from 'src/app/services/env.service';
|
import { EnvService } from 'src/app/services/env.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -13,6 +14,6 @@ export class SettingVibrationPage {
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async saveVibration() {
|
async saveVibration() {
|
||||||
await this.env.storageSet("vibration", this.env.vibration);
|
await Preferences.set({ key: this.env.KEY_VIBRATION, value: this.env.vibration });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||||
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { SplashScreen } from '@capacitor/splash-screen';
|
import { SplashScreen } from '@capacitor/splash-screen';
|
||||||
import { Toast } from '@capacitor/toast';
|
import { Toast } from '@capacitor/toast';
|
||||||
import { AlertController, Platform } from '@ionic/angular';
|
import { AlertController, Platform } from '@ionic/angular';
|
||||||
|
@ -62,29 +63,35 @@ export class TabsPage {
|
||||||
async ionViewDidEnter() {
|
async ionViewDidEnter() {
|
||||||
if (this.env.firstAppLoad) {
|
if (this.env.firstAppLoad) {
|
||||||
this.env.firstAppLoad = false;
|
this.env.firstAppLoad = false;
|
||||||
await this.router.navigate([this.env.startPage], { replaceUrl: true });
|
this.env.initObservable.subscribe(async value => {
|
||||||
await this.loadPatchNote();
|
console.log(`tabs.page.ts - ionViewDidEnter() - initObservable value: ${value}`)
|
||||||
|
if (value) {
|
||||||
|
console.log(`tabs.page.ts - ionViewDidEnter() - env.startPage: ${this.env.startPage}`)
|
||||||
|
await this.router.navigate([this.env.startPage], { replaceUrl: true });
|
||||||
|
await this.loadPatchNote();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadPatchNote() {
|
async loadPatchNote() {
|
||||||
const storageKey = this.platform.is('ios') ? this.env.IOS_PATCH_NOTE_STORAGE_KEY : this.env.AN_PATCH_NOTE_STORAGE_KEY;
|
const storageKey = this.platform.is('ios') ? this.env.KEY_IOS_NOT_SHOW_UPDATE_NOTES : this.env.KEY_ANDROID_NOT_SHOW_UPDATE_NOTES;
|
||||||
await this.env.storageGet(storageKey).then(
|
await Preferences.get({ key: storageKey }).then(
|
||||||
async value => {
|
async result => {
|
||||||
if (value != null) {
|
if (result.value != null) {
|
||||||
this.env.notShowUpdateNotes = (value === 'yes' ? true : false);
|
this.env.notShowUpdateNotes = result.value == 'yes';
|
||||||
} else {
|
} else {
|
||||||
this.env.notShowUpdateNotes = false;
|
this.env.notShowUpdateNotes = false;
|
||||||
}
|
}
|
||||||
await this.env.storageSet(storageKey, 'yes');
|
await Preferences.set({ key: storageKey, value: 'yes' });
|
||||||
if (this.env.notShowUpdateNotes === false) {
|
if (!this.env.notShowUpdateNotes) {
|
||||||
this.env.notShowUpdateNotes = true;
|
this.env.notShowUpdateNotes = true;
|
||||||
await this.showUpdateNotes();
|
await this.showUpdateNotes();
|
||||||
const versionWording = this.translate.instant("VERSION_VERSION") as string;
|
const versionWording = this.translate.instant("VERSION_VERSION") as string;
|
||||||
await this.presentToast(versionWording.replace("{version}", this.env.appVersionNumber), "short", 'bottom');
|
await this.presentToast(versionWording.replace("{version}", this.env.appVersionNumber), "short", 'bottom');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async showUpdateNotes() {
|
async showUpdateNotes() {
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -130,6 +130,7 @@
|
||||||
"OPEN": "Öffnen",
|
"OPEN": "Öffnen",
|
||||||
"OPEN_URL": "Öffne URL",
|
"OPEN_URL": "Öffne URL",
|
||||||
"OPEN_WITH_...": "Öffnen mit...",
|
"OPEN_WITH_...": "Öffnen mit...",
|
||||||
|
"OPTIMIZING_DATA": "Optimierung der Daten",
|
||||||
"ORGANIZATION": "Organization",
|
"ORGANIZATION": "Organization",
|
||||||
"ORIGINAL": "Original",
|
"ORIGINAL": "Original",
|
||||||
"OTHERS": "Andere",
|
"OTHERS": "Andere",
|
||||||
|
|
|
@ -130,6 +130,7 @@
|
||||||
"OPEN": "Open",
|
"OPEN": "Open",
|
||||||
"OPEN_URL": "Open URL",
|
"OPEN_URL": "Open URL",
|
||||||
"OPEN_WITH_...": "Open with...",
|
"OPEN_WITH_...": "Open with...",
|
||||||
|
"OPTIMIZING_DATA": "Optimizing data",
|
||||||
"ORGANIZATION": "Organization",
|
"ORGANIZATION": "Organization",
|
||||||
"ORIGINAL": "Original",
|
"ORIGINAL": "Original",
|
||||||
"OTHERS": "Others",
|
"OTHERS": "Others",
|
||||||
|
|
|
@ -130,6 +130,7 @@
|
||||||
"OPEN": "Ouvrir",
|
"OPEN": "Ouvrir",
|
||||||
"OPEN_URL": "Ouvrir l'URL",
|
"OPEN_URL": "Ouvrir l'URL",
|
||||||
"OPEN_WITH_...": "Ouvrir avec...",
|
"OPEN_WITH_...": "Ouvrir avec...",
|
||||||
|
"OPTIMIZING_DATA": "Optimiser les données",
|
||||||
"ORGANIZATION": "Organisme",
|
"ORGANIZATION": "Organisme",
|
||||||
"ORIGINAL": "Original",
|
"ORIGINAL": "Original",
|
||||||
"OTHERS": "Autres",
|
"OTHERS": "Autres",
|
||||||
|
|
|
@ -130,6 +130,7 @@
|
||||||
"OPEN": "Aprire",
|
"OPEN": "Aprire",
|
||||||
"OPEN_URL": "Aprire l'URL",
|
"OPEN_URL": "Aprire l'URL",
|
||||||
"OPEN_WITH_...": "Apri con...",
|
"OPEN_WITH_...": "Apri con...",
|
||||||
|
"OPTIMIZING_DATA": "Ottimizzazione dei dati",
|
||||||
"ORGANIZATION": "Organizzazione",
|
"ORGANIZATION": "Organizzazione",
|
||||||
"ORIGINAL": "Orginale",
|
"ORIGINAL": "Orginale",
|
||||||
"OTHERS": "Altri",
|
"OTHERS": "Altri",
|
||||||
|
|
|
@ -130,6 +130,7 @@
|
||||||
"OPEN": "打开",
|
"OPEN": "打开",
|
||||||
"OPEN_URL": "打开网址",
|
"OPEN_URL": "打开网址",
|
||||||
"OPEN_WITH_...": "以下方式打开",
|
"OPEN_WITH_...": "以下方式打开",
|
||||||
|
"OPTIMIZING_DATA": "优化数据",
|
||||||
"ORGANIZATION": "组织",
|
"ORGANIZATION": "组织",
|
||||||
"ORIGINAL": "原始",
|
"ORIGINAL": "原始",
|
||||||
"OTHERS": "其他",
|
"OTHERS": "其他",
|
||||||
|
|
|
@ -130,6 +130,7 @@
|
||||||
"OPEN": "打開",
|
"OPEN": "打開",
|
||||||
"OPEN_URL": "打開網址",
|
"OPEN_URL": "打開網址",
|
||||||
"OPEN_WITH_...": "用以下方式打開",
|
"OPEN_WITH_...": "用以下方式打開",
|
||||||
|
"OPTIMIZING_DATA": "最佳化數據",
|
||||||
"ORGANIZATION": "組織",
|
"ORGANIZATION": "組織",
|
||||||
"ORIGINAL": "原始",
|
"ORIGINAL": "原始",
|
||||||
"OTHERS": "其他",
|
"OTHERS": "其他",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue