Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (id == 1) {
if (this.$store.state.counter.humanScore > this.$store.state.counter.botScore) {
msg = '👩 🏆';
} else if (this.$store.state.counter.humanScore < this.$store.state.counter.botScore) {
msg = '🤖 🏆';
} else {
msg = "It's a 👩 🤖 tie!";
}
let feedback = new Feedback();
feedback.show({
title: msg,
message: 'Try another set of images!',
position: FeedbackPosition.Bottom, // iOS only
messageColor: new Color('#6a5cff'),
duration: 3000,
backgroundColor: new Color('#4fffe8'),
onTap: () => {
feedback.hide();
},
});
this.$store.dispatch('clearCount');
this.$store.dispatch('clearScore');
} else {
this.queryMLKit(id);
}
},
private _setBackgroundColor(color) {
// set background color
if (color) {
const sbView = this._snackbar.getView();
sbView.setBackgroundColor(new Color(color).android);
}
}
for (let tab of tabs) {
const bubbleToggle = new BubbleToggleView(this._context);
const id = android.view.View.generateViewId();
(bubbleToggle as any).setId(id);
bubbleToggle.setBtDuration(300);
let icon = utils.ad.resources.getDrawableId(tab.icon);
bubbleToggle.setBtIcon(icon);
bubbleToggle.setBtTitle(tab.title);
if (tab.colorActive) {
bubbleToggle.setBtColorActive(new Color(tab.colorActive).android);
}
if (tab.colorInactive) {
bubbleToggle.setBtColorInactive(new Color(tab.colorInactive).android);
}
this.nativeView.addView(bubbleToggle);
}
}
// Tabs Property
if (this.barWidth) {
this.android.setBarWidth(this.barWidth);
} else {
if (this.rimWidth) {
// set rim width to bar width if no bar width provided
this.android.setBarWidth(this.rimWidth);
}
}
if (this.rimWidth) {
this.android.setRimWidth(this.rimWidth);
}
if (this.barColor) {
this.android.setBarColor([new Color(this.barColor).argb]);
}
if (this.fillColor) {
this.android.setFillCircleColor(new Color(this.fillColor).argb);
}
this.android.setDirection(this.clockwise ? at.grabner.circleprogress.Direction.CW : at.grabner.circleprogress.Direction.CCW);
}
}
export function createPage() {
var page = new pages.Page();
var stack = new stackModule.StackLayout();
stack.style.backgroundColor = new color.Color("#FFFFFF00");
var btn = new button.Button();
btn.text = "Page C";
btn.on(button.Button.tapEvent, function () {
var nextPage = "tests/pages/navigation/pageC";
frame.topmost().navigate(nextPage);
});
stack.addChild(btn);
var btnActivity = new button.Button();
btnActivity.text = "start activity";
btnActivity.on(button.Button.tapEvent, function () {
var newFrame = new frame.Frame();
var newPage = "tests/pages/navigation/pageA-new-activity";
newFrame.navigate(newPage);
});
private static applyOnIOS(tnsView: any, data: IOSData) {
const nativeView = tnsView.ios;
const elevation = parseFloat(((data.elevation as number) - 0).toFixed(2));
nativeView.layer.maskToBounds = false;
nativeView.layer.shadowColor = new Color(data.shadowColor).ios.CGColor;
nativeView.layer.shadowOffset =
data.shadowOffset ?
CGSizeMake(0, parseFloat(String(data.shadowOffset))) :
CGSizeMake(0, 0.54 * elevation - 0.14);
nativeView.layer.shadowOpacity =
data.shadowOpacity ?
parseFloat(String(data.shadowOpacity)) :
0.006 * elevation + 0.25;
nativeView.layer.shadowRadius =
data.shadowRadius ?
parseFloat(String(data.shadowRadius)) :
0.66 * elevation - 0.5;
}
private _setBackgroundColor(color) {
if (color) {
this._snackbarManager.snackbarMessageViewBackgroundColor = new Color(color).ios;
}
}
export function getColor(priority: PriorityEnum): Color {
switch (priority) {
case PriorityEnum.Critical:
return new Color('#820101');
case PriorityEnum.High:
return new Color('#b27100');
case PriorityEnum.Medium:
return new Color('#0c6d00');
case PriorityEnum.Low:
return new Color('#002b6d');
}
}
}
const targets: any[] = stops.map(stop => {
this.currentStop = 0;
return TapTarget.forView(stop.view.android, stop.title, stop.description|| this.defaults.description)
.outerCircleColorInt(new Color(stop.outerCircleColor|| this.defaults.outerCircleColor).android)
.outerCircleAlpha(float(stop.outerCircleOpacity|| this.defaults.outerCircleOpacity))
.targetCircleColorInt(new Color(stop.innerCircleColor|| this.defaults.innerCircleColor).android)
.titleTextSize(stop.titleTextSize|| this.defaults.titleTextSize)
.titleTextColorInt(new Color(stop.titleTextColor|| this.defaults.titleTextColor).android)
.descriptionTextSize(stop.descriptionTextSize|| this.defaults.descriptionTextSize)
.descriptionTextColorInt(new Color(stop.descriptionTextColor|| this.defaults.descriptionTextColor).android)
.cancelable(stop.dismissable)
.drawShadow(true)
.tintTarget(false)
.targetRadius(stop.innerCircleRadius|| this.defaults.innerCircleRadius);
});
set filledColor(color: string) {
this._filledColor = color;
if (this._stars) {
const leftDrawable = this._stars.getDrawable(
1
) as android.graphics.drawable.Drawable;
const rightDrawable = this._stars.getDrawable(
2
) as android.graphics.drawable.Drawable;
leftDrawable.setColorFilter(
new Color(color).android,
android.graphics.PorterDuff.Mode.CLEAR
);
rightDrawable.setColorFilter(
new Color(color).android,
android.graphics.PorterDuff.Mode.SRC_ATOP
);
}
}