ci: run apps/automated on CI (#9196)

This commit is contained in:
Igor Randjelovic
2021-02-05 20:21:16 +01:00
committed by GitHub
parent abc78800f2
commit 4945702620
13 changed files with 182 additions and 97 deletions

View File

@@ -3,7 +3,7 @@ import * as enums from '@nativescript/core/ui/enums';
import * as colorModule from '@nativescript/core/color';
export function getNativeTextAlignment(label: labelModule.Label): string {
var gravity = label.android.getGravity();
let gravity = label.android.getGravity();
if ((gravity & android.view.Gravity.HORIZONTAL_GRAVITY_MASK) === android.view.Gravity.LEFT) {
return enums.TextAlignment.left;
@@ -21,10 +21,12 @@ export function getNativeTextAlignment(label: labelModule.Label): string {
}
export function getNativeBackgroundColor(label: labelModule.Label): colorModule.Color {
var bkg = <any>label.android.getBackground();
if (bkg instanceof org.nativescript.widgets.BorderDrawable) {
return new colorModule.Color((<org.nativescript.widgets.BorderDrawable>bkg).getBackgroundColor());
let bg = <any>label.android.getBackground();
if (bg instanceof org.nativescript.widgets.BorderDrawable) {
return new colorModule.Color(bg.getBackgroundColor());
} else if (bg instanceof android.graphics.drawable.ColorDrawable) {
return new colorModule.Color(bg.getColor());
} else {
return new colorModule.Color(bkg.backgroundColor);
return new colorModule.Color(bg.backgroundColor);
}
}

View File

@@ -330,8 +330,8 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
normalColor = actualColors.getDefaultColor();
TKUnit.assert(normalColor, 'Expected: ' + expColor + ', Actual: ' + normalColor);
const bkg = <org.nativescript.widgets.BorderDrawable>testLabel.android.getBackground();
actualBackgroundColor = bkg.getBackgroundColor();
const bg = testLabel.android.getBackground();
actualBackgroundColor = bg['getBackgroundColor'] ? bg.getBackgroundColor() : bg.getColor();
expBackgroundColor = android.graphics.Color.parseColor(backgroundColor);
TKUnit.assertEqual(actualBackgroundColor, expBackgroundColor);
} else {