Contents:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.x.test.KioskMode; | |
import android.app.ActivityManager; | |
import android.app.admin.DevicePolicyManager; | |
import android.app.admin.SystemUpdatePolicy; | |
import android.content.ComponentName; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.os.BatteryManager; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.x.test.StorageVolumes; | |
import android.Manifest; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.os.Build; | |
import android.os.StatFs; | |
import android.os.storage.StorageManager; | |
import android.os.storage.StorageVolume; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Scroll direction: natural | |
defaults write 'Apple Global Domain' com.apple.swipescrolldirection -bool FALSE | |
# Set the timezone | |
sudo systemsetup -settimezone "Europe/Paris" > /dev/null | |
# Require password immediately after sleep or screen saver begins | |
#defaults write com.apple.screensaver askForPasswordDelay -int 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FormControl, FormGroup } from '@angular/forms'; | |
export class PasswordValidator { | |
static areEqual(formGroup: FormGroup) { | |
let val; | |
let valid = true; | |
for (let key in formGroup.controls) { | |
if (formGroup.controls.hasOwnProperty(key)) { | |
let control: FormControl = <FormControl>formGroup.controls[key]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Complete example for Ionic Framework in: https://ionicthemes.com/tutorials/about/forms-and-validation-in-ionic | |
//Complete example for Angular 5 in: https://angular-templates.io/tutorials/about/angular-forms-and-validations | |
import { AbstractControl, ValidatorFn } from '@angular/forms'; | |
import * as libphonenumber from 'google-libphonenumber'; | |
export class PhoneValidator { | |
// Inspired on: https://github.com/yuyang041060120/ng2-validation/blob/master/src/equal-to/validator.ts | |
static validCountryPhone = (countryControl: AbstractControl): ValidatorFn => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ion-header.transparent, ion-footer.transparent { | |
ion-toolbar { | |
--background: transparent; | |
--ion-color-base: transparent !important; | |
} | |
/* Remove bottom border on md */ | |
&.header-md::after { | |
background-image: none; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable, throwError } from 'rxjs' | |
import { catchError } from 'rxjs/operators' | |
import { HttpErrorResponse } from '@angular/common/http' | |
export const throwForCodes = (codeErrors: Array<[number, () => Error]>) => { | |
const mappedCodeErrors = new Map(codeErrors) | |
return <T>(source: Observable<T>) => | |
source.pipe(catchError(error => { | |
if (error instanceof HttpErrorResponse) { | |
const mappedErrorFn = mappedCodeErrors.get(error.status) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {OneSignal, OSPermissionSubscriptionState} from "@ionic-native/onesignal"; | |
import {OpenNativeSettings} from '@ionic-native/open-native-settings'; | |
...... | |
private subscribed(): Promise<boolean> { | |
return new Promise((resolve, reject) => { | |
if (!this.platform.is('cordova')) { | |
resolve(true); | |
return; | |
} | |
// Запрашиваем состоние доступа к уведомлениям |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vk.com |
NewerOlder