Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getRippleColor(color: string | Color): UIColor {
if (color) {
const temp = typeof color === 'string' ? new Color(color) : color;
return new Color(temp.a !== 255 ? temp.a : 36, temp.r, temp.g, temp.b).ios; // default alpha is 0.14
}
return null;
}
const styles = {
listContainer: {
flex: 1,
},
list: {
backgroundColor: '#eeeeee',
},
sectionHeader: {
backgroundColor: new Color('#eeeeee'),
padding: 5,
// fontWeight: '500',
fontSize: 11,
},
row: {
backgroundColor: new Color('white'),
justifyContent: 'center' as 'center',
paddingHorizontal: 15,
paddingVertical: 8,
},
separator: {
// height: StyleSheet.hairlineWidth,
backgroundColor: '#bbbbbb',
marginLeft: 15,
},
separatorHighlighted: {
// height: StyleSheet.hairlineWidth,
backgroundColor: 'rgb(217, 217, 217)',
},
sectionListContentContainer: {
backgroundColor: 'white',
},
export function getEnabledColorStateList(color: number, variant: string) {
const states = Array.create('[I', 2);
// const SELECTED_PRESSED_STATE_SET = Array.create("int",1);
// SELECTED_PRESSED_STATE_SET[0] = state.enabled;
states[0] = Array.create('int', 1);
states[0][0] = -state.enabled;
states[1] = android.util.StateSet.NOTHING;
// states[1][0] = new java.lang.Integer(-state.enabled);
// const states = [
// getSELECTED_PRESSED_STATE_SET(),
// []]
// ;
const colors = Array.create('int', 2);
colors[0] = variant === 'text' || variant === 'outline' ? 0 : new Color(30, 0, 0, 0).android;
colors[1] = color;
return new android.content.res.ColorStateList(states, colors);
}
export function getFocusedColorStateList(color: number, variant: string) {
createContent(index: number) {
const label = new Label();
label.text = `${index === 0 ? "Home" : (index === 1 ? "Account" : "Search")}`;
label.className = "h2 text-center";
label.color = new Color("red");
const stack = new StackLayout();
stack.verticalAlignment = "middle";
stack.addChild(label);
return stack;
}
// << (hide)
export function getFocusedColorStateList(color: number, variant: string) {
const states = Array.create('[I', 3);
states[0] = Array.create('int', 1);
states[0][0] = state.pressed;
states[1] = Array.create('int', 2);
states[1][0] = state.enabled;
states[1][1] = state.focused;
// states[2] = Array.create('int', 1);
// states[2][0] = state.selected;
states[2] = android.util.StateSet.NOTHING;
const colors = Array.create('int', 4);
colors[0] = color;
colors[1] = color;
colors[2] = color;
colors[2] = new Color(255, 160, 160, 160).android;
return new android.content.res.ColorStateList(states, colors);
}
createViewBadge(bottomBar: BottomNavigationViewType, context: any): Label {
const textView = new Label();
textView.text = this._badge ? this._badge : '';
textView.textAlignment = textView.horizontalAlignment = 'center';
textView.fontSize = 8;
textView.color = new Color('white');
textView.backgroundColor = this._badgeBackgroundColor
? this._badgeBackgroundColor
: 'red';
textView.borderRadius = '10';
textView.width = 13;
textView.height = 13;
textView.marginLeft = 10;
textView.marginTop = 5;
textView._setupUI(context);
textView.onLoaded();
const itemView = (bottomBar.getChildAt(0) as any)
.getChildAt(this.index);
itemView.addView(textView.android);
function onLoaded(args) {
const page = args.object;
photoViewer = new photoViewerModule.PhotoViewer();
mySpinner = page.getViewById("myspinner");
if (pageModule.isIOS) {
mySpinner.ios.activityIndicatorViewStyle = 0;
mySpinner.ios.color = new colorModule.Color("#415677").ios;
}
}
}).then(() => {
grid.animate({
backgroundColor: new Color('#fff'),
duration: 0
}).then(() => {
this.routerExt.navigate(['/app/dashboard', widget.label]);
});
});
}
public setTheme = value => () => {
const color = new Color(value);
ANDROID_WAVE_KEYPATHS.forEach(keyPath => {
this._lottieViewTwo.setColorValueDelegateForKeyPath(color, [...keyPath]);
});
};
valueConverter: value => new Color(value)
});