Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public initSnack(options: SnackBarOptions, resolve?: Function) {
if (this._snackbar) {
return;
}
// options.actionText = options.actionText ? options.actionText : 'Close';
options.hideDelay = options.hideDelay ? options.hideDelay : 3000;
const attachToView = (options.view && options.view.android) || topmost().currentPage.android;
this._snackbar = com.google.android.material.snackbar.Snackbar.make(attachToView, options.message, options.hideDelay);
this._snackbar.setText(options.message);
this._snackbar.setDuration(options.hideDelay);
// set text color of the TextView in the Android SnackBar
if (options.textColor && Color.isValid(options.textColor)) {
const color = (options.textColor instanceof Color ? options.textColor : new Color(options.textColor)).android;
if ((this._snackbar as any).setTextColor) {
(this._snackbar as any).setTextColor(color);
} else {
const mainTextView = this._snackbar.getView().findViewById(SnackBar.SNACKBAR_TEXT_ID) as android.widget.TextView;
if (mainTextView) {
mainTextView.setTextColor(color);
}
public onServiceTap(args) {
const service = this.discoveredServices.getItem(args.index);
console.log('--- service selected: ' + service.UUID);
const navigationEntry = {
moduleName: 'characteristics-page',
context: {
peripheral: this.peripheral,
service
},
animated: true
};
topmost().navigate(navigationEntry);
}
public onPeripheralTestTap(peri) {
this.doStopScanning();
console.log('!!&&&&***** Long press item with index ' + peri);
console.log('--- peripheral selected: ' + peri.UUID);
const navigationEntry = {
moduleName: 'test-page',
context: {
peripheral: peri
},
animated: true
};
topmost().navigate(navigationEntry);
}
onNavigationButtonTap() {
frameModule.topmost().goBack();
}
},
onNavigationButtonTap() {
frameModule.topmost().goBack();
},
onTap() {
onNavigationButtonTap() {
frameModule.topmost().goBack();
},
onFocus() {
onNavigationButtonTap() {
frameModule.topmost().goBack();
}
},
onNavigationButtonTap() {
frameModule.topmost().goBack();
}
},
onNavigationButtonTap() {
frameModule.topmost().goBack();
},
onTap(args: EventData) {
onNavigationButtonTap() {
frameModule.topmost().goBack();
},
onTap(args: EventData) {