mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Screen Orientation for mobile its lock
This commit is contained in:
@@ -8,6 +8,7 @@ import * as _rollupMoment from 'moment';
|
|||||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||||
const moment = _rollupMoment || _moment;
|
const moment = _rollupMoment || _moment;
|
||||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||||
|
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||||
|
|
||||||
|
|
||||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
@@ -35,7 +36,8 @@ export class AppComponent {
|
|||||||
constructor(
|
constructor(
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
/* private splashScreen: SplashScreen, */
|
/* private splashScreen: SplashScreen, */
|
||||||
private statusBar: StatusBar
|
private statusBar: StatusBar,
|
||||||
|
private screenOrientation: ScreenOrientation
|
||||||
) {
|
) {
|
||||||
this.initializeApp();
|
this.initializeApp();
|
||||||
}
|
}
|
||||||
@@ -44,6 +46,12 @@ export class AppComponent {
|
|||||||
this.platform.ready().then(() => {
|
this.platform.ready().then(() => {
|
||||||
this.statusBar.styleDefault();
|
this.statusBar.styleDefault();
|
||||||
/* this.splashScreen.hide(); */
|
/* this.splashScreen.hide(); */
|
||||||
|
|
||||||
|
if (this.platform.is("tablet")) {
|
||||||
|
this.screenOrientation.unlock();
|
||||||
|
} else if( this.platform.is("mobile")) {
|
||||||
|
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT_PRIMARY);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import { BackgroundService } from 'src/app/services/background.service';
|
|||||||
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
import { EventsService } from 'src/app/services/events.service';
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
|
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -84,7 +85,8 @@ export class HomePage implements OnInit {
|
|||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
private offlinemanager: OfflineManagerService,
|
private offlinemanager: OfflineManagerService,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private eventservice: EventsService) {
|
private eventservice: EventsService,
|
||||||
|
private screenOrientation: ScreenOrientation) {
|
||||||
|
|
||||||
this.webNotificationPopupService.askNotificationPermission()
|
this.webNotificationPopupService.askNotificationPermission()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user