mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
ci: run apps/automated on CI (#9196)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user