@nativescript-community/ui-material-ripple
Version:
The Material Design Ripple component provides a radial action in the form of a visual ripple expanding outward from the user's touch. Ripple is a visual form of feedback for touch events providing users a clear signal that an element is being touched.
24 lines • 1.14 kB
JavaScript
import { getRippleColor, rippleColorAlphaProperty, rippleColorProperty, themer } from '@nativescript-community/ui-material-core';
import { RippleBase } from './ripple-common';
export class Ripple extends RippleBase {
createNativeView() {
const view = UIView.alloc().init();
this.inkTouchController = MDCRippleTouchController.alloc().initWithView(view);
const colorScheme = themer.getAppColorScheme();
if (colorScheme && colorScheme.primaryColor) {
this.inkTouchController.rippleView.rippleColor = colorScheme.primaryColor.colorWithAlphaComponent(0.24);
}
// this.inkTouchController
// MDCInkColorThemer.applyColorSchemeToInkView(colorScheme, this.inkTouchController.defaultInkView);
return view;
}
[rippleColorProperty.setNative](color) {
this.inkTouchController.rippleView.rippleColor = getRippleColor(color, this.rippleColorAlpha);
}
[rippleColorAlphaProperty.setNative](value) {
if (this.rippleColor) {
this[rippleColorProperty.setNative](this.rippleColor);
}
}
}
//# sourceMappingURL=ripple.ios.js.map