mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
@ -110,50 +110,30 @@ export module ad {
|
|||||||
|
|
||||||
function refreshBorderDrawable(view: view.View, borderDrawable: org.nativescript.widgets.BorderDrawable){
|
function refreshBorderDrawable(view: view.View, borderDrawable: org.nativescript.widgets.BorderDrawable){
|
||||||
let background = <background.Background>view.style._getValue(style.backgroundInternalProperty);
|
let background = <background.Background>view.style._getValue(style.backgroundInternalProperty);
|
||||||
let borderWidth: number = view.borderWidth;
|
|
||||||
let borderColor: number = 0;
|
|
||||||
if (view.borderColor && view.borderColor.android){
|
|
||||||
borderColor = view.borderColor.android;
|
|
||||||
}
|
|
||||||
let borderRadius: number = view.borderRadius;
|
|
||||||
let clipPath: string = view.style._getValue(style.clipPathProperty);
|
|
||||||
let backgroundColor: number = 0;
|
|
||||||
let backgroundImage: android.graphics.Bitmap = null;
|
|
||||||
let backgroundRepeat: string = null;
|
|
||||||
let backgroundPosition: string = null;
|
|
||||||
let backgroundPositionParsedCSSValues: native.Array<org.nativescript.widgets.CSSValue> = null;
|
|
||||||
let backgroundSize: string = null;
|
|
||||||
let backgroundSizeParsedCSSValues: native.Array<org.nativescript.widgets.CSSValue> = null;
|
|
||||||
if (background){
|
if (background){
|
||||||
if (background.color && background.color.android){
|
let backgroundPositionParsedCSSValues: native.Array<org.nativescript.widgets.CSSValue> = null;
|
||||||
backgroundColor = background.color.android;
|
let backgroundSizeParsedCSSValues: native.Array<org.nativescript.widgets.CSSValue> = null;
|
||||||
}
|
|
||||||
if (background.image && background.image.android){
|
|
||||||
backgroundImage = background.image.android;
|
|
||||||
}
|
|
||||||
if (background.position){
|
if (background.position){
|
||||||
backgroundPosition = background.position;
|
|
||||||
backgroundPositionParsedCSSValues = createNativeCSSValueArray(background.position);
|
backgroundPositionParsedCSSValues = createNativeCSSValueArray(background.position);
|
||||||
}
|
}
|
||||||
if (background.size){
|
if (background.size){
|
||||||
backgroundSize = background.size;
|
|
||||||
backgroundSizeParsedCSSValues = createNativeCSSValueArray(background.size);
|
backgroundSizeParsedCSSValues = createNativeCSSValueArray(background.size);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
borderDrawable.refresh(
|
borderDrawable.refresh(
|
||||||
borderWidth,
|
background.borderWidth,
|
||||||
borderColor,
|
(background.borderColor && background.borderColor.android) ? background.borderColor.android : 0,
|
||||||
borderRadius,
|
background.borderRadius,
|
||||||
clipPath,
|
background.clipPath,
|
||||||
backgroundColor,
|
(background.color && background.color.android) ? background.color.android : 0,
|
||||||
backgroundImage,
|
(background.image && background.image.android) ? background.image.android : null,
|
||||||
backgroundRepeat,
|
background.repeat,
|
||||||
backgroundPosition,
|
background.position,
|
||||||
backgroundPositionParsedCSSValues,
|
backgroundPositionParsedCSSValues,
|
||||||
backgroundSize,
|
background.size,
|
||||||
backgroundSizeParsedCSSValues
|
backgroundSizeParsedCSSValues
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createNativeCSSValueArray(css: string): native.Array<org.nativescript.widgets.CSSValue>{
|
function createNativeCSSValueArray(css: string): native.Array<org.nativescript.widgets.CSSValue>{
|
||||||
|
Reference in New Issue
Block a user