1- import {
2- Application ,
3- Background ,
4- Button ,
5- Color ,
6- Length ,
7- PercentLength ,
8- Utils ,
9- View ,
10- androidDynamicElevationOffsetProperty ,
11- androidElevationProperty ,
12- backgroundInternalProperty
13- } from '@nativescript/core' ;
14- import { createRippleDrawable , createStateListAnimator , getAttrColor , getColorStateList , handleClearFocus , isPostLollipop , isPostLollipopMR1 , isPostMarshmallow } from './android/utils' ;
15- import { CornerFamily , applyMixins } from './index.common' ;
16- import { cssProperty , dynamicElevationOffsetProperty , elevationProperty , rippleColorProperty } from './cssproperties' ;
1+ import { Background , Button , Color , Length , PercentLength , Utils , View , androidDynamicElevationOffsetProperty , androidElevationProperty , backgroundInternalProperty } from '@nativescript/core' ;
172import { ad } from '@nativescript/core/utils' ;
183import { ShapeProperties } from '.' ;
4+ import { createRippleDrawable , createStateListAnimator , getAttrColor , getColorStateList , handleClearFocus , isPostLollipop , isPostMarshmallow } from './android/utils' ;
5+ import { cssProperty , dynamicElevationOffsetProperty , elevationProperty , rippleColorProperty } from './cssproperties' ;
6+ import { CornerFamily , applyMixins } from './index.common' ;
197export * from './cssproperties' ;
208export { applyMixins } ;
219
@@ -232,9 +220,9 @@ export function overrideViewBase() {
232220 return getRippleColor ( themer . getAccentColor ( ) ) ;
233221 }
234222
235- setRippleDrawable ( view : android . view . View , radius = 0 ) {
223+ setRippleDrawable ( view : android . view . View , topLeftRadius = 0 , topRightRadius = 0 , bottomRightRadius = 0 , bottomLeftRadius = 0 ) {
236224 if ( ! this . rippleDrawable ) {
237- this . rippleDrawable = createRippleDrawable ( this . getRippleColor ( ) , radius ) ;
225+ this . rippleDrawable = createRippleDrawable ( this . getRippleColor ( ) , topLeftRadius , topRightRadius , bottomRightRadius , bottomLeftRadius ) ;
238226 if ( isPostMarshmallow ) {
239227 view . setForeground ( this . rippleDrawable ) ;
240228 }
@@ -259,7 +247,13 @@ export function overrideViewBase() {
259247 nativeViewProtected . setClickable ( this . isUserInteractionEnabled ) ;
260248 const rippleDrawable = this . rippleDrawable ;
261249 if ( ! rippleDrawable ) {
262- this . setRippleDrawable ( nativeViewProtected , Length . toDevicePixels ( this . style . borderTopLeftRadius ) ) ;
250+ this . setRippleDrawable (
251+ nativeViewProtected ,
252+ Length . toDevicePixels ( this . style . borderTopLeftRadius ) ,
253+ Length . toDevicePixels ( this . style . borderTopRightRadius ) ,
254+ Length . toDevicePixels ( this . style . borderBottomRightRadius ) ,
255+ Length . toDevicePixels ( this . style . borderBottomLeftRadius )
256+ ) ;
263257 } else {
264258 if ( isPostLollipop ) {
265259 ( rippleDrawable as android . graphics . drawable . RippleDrawable ) . setColor ( getColorStateList ( rippleColor ) ) ;
@@ -277,7 +271,13 @@ export function overrideViewBase() {
277271 // native button have on the background. Setting color will remove the ripple!
278272 if ( this . rippleDrawable || ( value . color && this instanceof Button && this . rippleColor ) ) {
279273 this . rippleDrawable = null ;
280- this . setRippleDrawable ( this . nativeViewProtected , value . borderTopLeftRadius ) ;
274+ this . setRippleDrawable (
275+ this . nativeViewProtected ,
276+ Length . toDevicePixels ( this . style . borderTopLeftRadius ) ,
277+ Length . toDevicePixels ( this . style . borderTopRightRadius ) ,
278+ Length . toDevicePixels ( this . style . borderBottomRightRadius ) ,
279+ Length . toDevicePixels ( this . style . borderBottomLeftRadius )
280+ ) ;
281281 }
282282 }
283283 }
0 commit comments