Skip to content

Commit

Permalink
#841 - Make text size bigger for flow control
Browse files Browse the repository at this point in the history
#621 - Just atach to notification of pressensor when in brew-add/brew-edit to save energy.
#811 / #837 - Making more pipes, switching to native @if / @else, removing unneeded html tags with this, changing more functions to variables, adding more to pipes. Using ng-container and ng-template for reducing duplicated HTML. Just use swiper-element on brew-information when brew-profile is given, else jut use the normal card, makes it less performance-relevant because swiper is not listening. Removing unneded imports
#838 - Reverting ag-virtual-scroll to 100vh, but adding scroll-event trigger
#842 - Add norwegian language
#661 - When resetting the buttons are displayed again
#660 - Fixing cut of scroll bar ios
  • Loading branch information
graphefruit committed Nov 23, 2024
1 parent 5ee3ae7 commit c828a0a
Show file tree
Hide file tree
Showing 62 changed files with 1,700 additions and 1,785 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background>
<inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
<inset android:drawable="@mipmap/ic_launcher_background" android:inset="16%" />
</background>
<foreground>
<inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
<inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16%" />
</foreground>
</adaptive-icon>
</adaptive-icon>
29 changes: 23 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.7.0",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"prettier": "^3.3.3",
"protractor": "^7.0.0",
"skwas-cordova-plugin-datetimepicker": "^3.0.2",
"stylelint": "^13.12.0",
Expand Down
6 changes: 3 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
<ion-item [class.active]="pages.home.active" [routerLink]="[pages.home.url]" replaceUrl="true">
<ion-label>{{pages.home.title | translate}}</ion-label>
</ion-item>
<ion-item *ngIf="showRoastingSection()" [class.active]="pages.roasting_section.active" [routerLink]="[pages.roasting_section.url]" replaceUrl="true">
<ion-item *ngIf="uiRoastingSectionVisible" [class.active]="pages.roasting_section.active" [routerLink]="[pages.roasting_section.url]" replaceUrl="true">
<ion-label>{{pages.roasting_section.title | translate}}</ion-label>
</ion-item>
<ion-item *ngIf="showWaterSection()" [class.active]="pages.water_section.active" [routerLink]="[pages.water_section.url]" replaceUrl="true">
<ion-item *ngIf="uiWaterSectionVisible" [class.active]="pages.water_section.active" [routerLink]="[pages.water_section.url]" replaceUrl="true">
<ion-label>{{pages.water_section.title | translate}}</ion-label>
</ion-item>
<ion-item *ngIf="showGraphSection()" [class.active]="pages.graph_section.active" [routerLink]="[pages.graph_section.url]" replaceUrl="true">
<ion-item *ngIf="uiGraphSectionVisible" [class.active]="pages.graph_section.active" [routerLink]="[pages.graph_section.url]" replaceUrl="true">
<ion-label>{{pages.graph_section.title | translate}}</ion-label>
</ion-item>
<ion-item [class.active]="pages.brew_parameter.active" [routerLink]="[pages.brew_parameter.url]"
Expand Down
82 changes: 46 additions & 36 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ import { STARTUP_VIEW_ENUM } from '../enums/settings/startupView';
import { environment } from '../environments/environment';
import { AnalyticsPopoverComponent } from '../popover/analytics-popover/analytics-popover.component';
import { WelcomePopoverComponent } from '../popover/welcome-popover/welcome-popover.component';
import { AndroidPlatformService } from '../services/androidPlatform/android-platform.service';

import { CleanupService } from '../services/cleanupService/cleanup.service';
import { IntentHandlerService } from '../services/intentHandler/intent-handler.service';
import { IosPlatformService } from '../services/iosPlatform/ios-platform.service';
import { UIAlert } from '../services/uiAlert';
import { UIAnalytics } from '../services/uiAnalytics';
import { UIBeanHelper } from '../services/uiBeanHelper';
Expand All @@ -50,9 +47,6 @@ import { UISettingsStorage } from '../services/uiSettingsStorage';
import { UIUpdate } from '../services/uiUpdate';
import { UiVersionStorage } from '../services/uiVersionStorage';
import { UIWaterStorage } from '../services/uiWaterStorage';
import { Storage } from '@ionic/storage';

import { UIToast } from '../services/uiToast';
import { CoffeeBluetoothDevicesService } from '../services/coffeeBluetoothDevices/coffee-bluetooth-devices.service';
import {
Logger,
Expand Down Expand Up @@ -209,6 +203,10 @@ export class AppComponent implements AfterViewInit {
},
};

public uiGraphSectionVisible: boolean = false;
public uiWaterSectionVisible: boolean = false;
public uiRoastingSectionVisible: boolean = false;

constructor(
private readonly router: Router,
public platform: Platform,
Expand All @@ -218,7 +216,6 @@ export class AppComponent implements AfterViewInit {
private readonly uiPreparationStorage: UIPreparationStorage,
private readonly uiMillStorage: UIMillStorage,
private readonly uiBrewHelper: UIBrewHelper,
private readonly menuCtrl: MenuController,
private readonly uiSettingsStorage: UISettingsStorage,
private readonly modalCtrl: ModalController,
private readonly uiHelper: UIHelper,
Expand All @@ -231,19 +228,15 @@ export class AppComponent implements AfterViewInit {
private readonly uiGreenBeanStorage: UIGreenBeanStorage,
private readonly uiRoastingMachineStorage: UIRoastingMachineStorage,
private readonly intentHandlerService: IntentHandlerService,
private readonly iosPlatformService: IosPlatformService,
private readonly androidPlatformService: AndroidPlatformService,
private readonly uiWaterStorage: UIWaterStorage,
private readonly uiBeanHelper: UIBeanHelper,
private readonly uiMillHelper: UIMillHelper,
private readonly uiPreparationHelper: UIPreparationHelper,
private readonly bleManager: CoffeeBluetoothDevicesService,
private readonly cleanupService: CleanupService,
private readonly storage: Storage,
private readonly uiToast: UIToast,
private readonly uiExportImportHelper: UIExportImportHelper,
private readonly uiGraphStorage: UIGraphStorage,
private readonly uiStorage: UIStorage
private readonly uiStorage: UIStorage,
) {
// Dont remove androidPlatformService, we need to initialize it via constructor
try {
Expand Down Expand Up @@ -302,7 +295,7 @@ export class AppComponent implements AfterViewInit {
const versionCode = (await App.getInfo()).version;
this.uiLog.log(`App-Version: ${versionCode}`);
this.uiLog.log(
`Storage-Driver: ${this.uiStorage.getStorage().driver}`
`Storage-Driver: ${this.uiStorage.getStorage().driver}`,
);
}
} catch (ex) {}
Expand Down Expand Up @@ -351,7 +344,7 @@ export class AppComponent implements AfterViewInit {
this.uiAnalytics.trackEvent(
STARTUP_TRACKING.TITLE,
STARTUP_TRACKING.ACTIONS.FORCE_TOUCH.CATEGORY,
payloadType.toUpperCase()
payloadType.toUpperCase(),
);
this.uiLog.log(`iOS Device - Home icon was pressed`);
} catch (ex) {}
Expand Down Expand Up @@ -426,7 +419,6 @@ export class AppComponent implements AfterViewInit {
]).then(
async () => {
this.uiLog.log('App finished loading');
this.uiLog.info('Everything should be fine!!!');
await this.__checkUpdate();
await this.__checkCleanup();
await this.__initApp();
Expand All @@ -435,7 +427,7 @@ export class AppComponent implements AfterViewInit {
async () => {
await this.uiAlert.showAppShetItSelfMessage();
this.uiLog.error('App finished loading, but errors occured');
}
},
);
} catch (ex) {
await this.uiAlert.showAppShetItSelfMessage();
Expand Down Expand Up @@ -506,6 +498,8 @@ export class AppComponent implements AfterViewInit {
settingLanguage = 'id';
} else if (systemLanguage === 'nl') {
settingLanguage = 'nl';
} else if (systemLanguage === 'no') {
settingLanguage = 'no';
} else {
settingLanguage = 'en';
}
Expand All @@ -519,7 +513,7 @@ export class AppComponent implements AfterViewInit {
} catch (ex) {
const exMessage: string = JSON.stringify(ex);
this.uiLog.error(
`Exception occured when setting language ${exMessage}`
`Exception occured when setting language ${exMessage}`,
);
this._translate.setDefaultLang('en');
await this._translate.use('en').toPromise();
Expand All @@ -538,7 +532,7 @@ export class AppComponent implements AfterViewInit {
} catch (ex) {
const exMessage: string = JSON.stringify(ex);
this.uiLog.error(
`Exception occured when setting language ${exMessage}`
`Exception occured when setting language ${exMessage}`,
);
this._translate.setDefaultLang('en');
settings.language = 'en';
Expand All @@ -549,7 +543,7 @@ export class AppComponent implements AfterViewInit {
}
} else {
this.uiLog.info(
'Cant set language for device, because no cordova device'
'Cant set language for device, because no cordova device',
);
if (
settings.language !== null &&
Expand All @@ -563,7 +557,7 @@ export class AppComponent implements AfterViewInit {
resolve(undefined);
} else {
this.uiLog.info(
`Set default language from settings, because no settings set: en `
`Set default language from settings, because no settings set: en `,
);
this._translate.setDefaultLang('en');
settings.language = 'en';
Expand All @@ -582,7 +576,7 @@ export class AppComponent implements AfterViewInit {
this.uiAnalytics.trackEvent(
STARTUP_TRACKING.TITLE,
STARTUP_TRACKING.ACTIONS.STARTUP_VIEW.CATEGORY,
settings.startup_view
settings.startup_view,
);
}
switch (settings.startup_view) {
Expand All @@ -602,7 +596,20 @@ export class AppComponent implements AfterViewInit {
}
}

/**
* If settings are changed, we set the ui params, to not have callbacks all day long
* @private
*/
private setUIParams() {
const settings = this.uiSettingsStorage.getSettings();
this.uiGraphSectionVisible = settings.show_graph_section;
this.uiWaterSectionVisible = settings.show_water_section;
this.uiRoastingSectionVisible = settings.show_roasting_section;
}

private async __initApp() {
this.setUIParams();

this.__registerBack();
await this.__setDeviceLanguage();

Expand Down Expand Up @@ -650,7 +657,7 @@ export class AppComponent implements AfterViewInit {
}

await this.__checkStartupView();
this.__instanceAppRating();
//this.__instanceAppRating();
this.__attachOnDevicePause();
this.__attachOnDeviceResume();
/**If Anything changes, we reset**/
Expand All @@ -666,6 +673,9 @@ export class AppComponent implements AfterViewInit {
this.uiMillStorage.attachOnEvent().subscribe((_val) => {
BrewInstanceHelper.setEntryAmountBackToZero();
});
this.uiSettingsStorage.attachOnEvent().subscribe(() => {
this.setUIParams();
});
}

private async __checkBluetoothDevices() {
Expand Down Expand Up @@ -717,7 +727,7 @@ export class AppComponent implements AfterViewInit {
scale_id,
false,
() => {},
() => {}
() => {},
);
} else {
this.uiLog.log('Smartscale not connected, dont try to connect');
Expand All @@ -736,7 +746,7 @@ export class AppComponent implements AfterViewInit {
pressure_id,
false,
() => {},
() => {}
() => {},
);
} else {
this.uiLog.log('Pressure device not connected, dont try to connect');
Expand All @@ -755,7 +765,7 @@ export class AppComponent implements AfterViewInit {
temperature_id,
false,
() => {},
() => {}
() => {},
);
} else {
this.uiLog.log('Temperature device not connected, dont try to connect');
Expand All @@ -774,7 +784,7 @@ export class AppComponent implements AfterViewInit {
refractometer_id,
false,
() => {},
() => {}
() => {},
);
} else {
this.uiLog.log('Refractometer device not connected, dont try to connect');
Expand Down Expand Up @@ -806,7 +816,7 @@ export class AppComponent implements AfterViewInit {
// Don't show message on device pause.
this.bleManager.disconnectTemperatureDevice(
settings.temperature_id,
false
false,
);
}
}
Expand All @@ -817,7 +827,7 @@ export class AppComponent implements AfterViewInit {
// Don't show message on device pause.
this.bleManager.disconnectRefractometerDevice(
settings.refractometer_id,
false
false,
);
}
}
Expand Down Expand Up @@ -848,7 +858,7 @@ export class AppComponent implements AfterViewInit {
if (this.platform.is('ios')) {
this.uiStorage.get('MILL').then(
() => {},
() => {}
() => {},
);
}
});
Expand Down Expand Up @@ -964,38 +974,38 @@ export class AppComponent implements AfterViewInit {
public openGithub() {
this.uiAnalytics.trackEvent(
LINK_TRACKING.TITLE,
LINK_TRACKING.ACTIONS.GITHUB
LINK_TRACKING.ACTIONS.GITHUB,
);
this.uiHelper.openExternalWebpage(
'https://github.com/graphefruit/Beanconqueror'
'https://github.com/graphefruit/Beanconqueror',
);
}

public openDiscord() {
this.uiAnalytics.trackEvent(
LINK_TRACKING.TITLE,
LINK_TRACKING.ACTIONS.DISCORD
LINK_TRACKING.ACTIONS.DISCORD,
);
this.uiHelper.openExternalWebpage('https://discord.gg/vDzA5dZjG8');
}

public openInstagram() {
this.uiAnalytics.trackEvent(
LINK_TRACKING.TITLE,
LINK_TRACKING.ACTIONS.INSTAGRAM
LINK_TRACKING.ACTIONS.INSTAGRAM,
);
this.uiHelper.openExternalWebpage(
'https://www.instagram.com/beanconqueror/'
'https://www.instagram.com/beanconqueror/',
);
}

public openFacebook() {
this.uiAnalytics.trackEvent(
LINK_TRACKING.TITLE,
LINK_TRACKING.ACTIONS.FACEBOOK
LINK_TRACKING.ACTIONS.FACEBOOK,
);
this.uiHelper.openExternalWebpage(
'https://www.facebook.com/Beanconqueror/'
'https://www.facebook.com/Beanconqueror/',
);
}

Expand Down
Loading

0 comments on commit c828a0a

Please sign in to comment.