mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: Enums > CoreTypes
Cleanup type symbol usage by consolidating to manage in one spot. This makes them easier to use as well by providing a single rollup of all the common type symbol's used throughout core.
This commit is contained in:
@@ -34,15 +34,15 @@ export function getNativeTextAlignment(button: Button): string {
|
||||
let gravity = button.android.getGravity();
|
||||
|
||||
if ((gravity & android.view.Gravity.HORIZONTAL_GRAVITY_MASK) === android.view.Gravity.LEFT) {
|
||||
return Enums.TextAlignment.left;
|
||||
return CoreTypes.TextAlignment.left;
|
||||
}
|
||||
|
||||
if ((gravity & android.view.Gravity.HORIZONTAL_GRAVITY_MASK) === android.view.Gravity.CENTER_HORIZONTAL) {
|
||||
return Enums.TextAlignment.center;
|
||||
return CoreTypes.TextAlignment.center;
|
||||
}
|
||||
|
||||
if ((gravity & android.view.Gravity.HORIZONTAL_GRAVITY_MASK) === android.view.Gravity.RIGHT) {
|
||||
return Enums.TextAlignment.right;
|
||||
return CoreTypes.TextAlignment.right;
|
||||
}
|
||||
|
||||
return 'unexpected value';
|
||||
|
||||
@@ -26,11 +26,11 @@ export function getNativeBackgroundColor(button: buttonModule.Button): colorModu
|
||||
export function getNativeTextAlignment(button: buttonModule.Button): string {
|
||||
switch (button.ios.titleLabel.textAlignment) {
|
||||
case NSTextAlignment.Left:
|
||||
return Enums.TextAlignment.left;
|
||||
return CoreTypes.TextAlignment.left;
|
||||
case NSTextAlignment.Center:
|
||||
return Enums.TextAlignment.center;
|
||||
return CoreTypes.TextAlignment.center;
|
||||
case NSTextAlignment.Right:
|
||||
return Enums.TextAlignment.right;
|
||||
return CoreTypes.TextAlignment.right;
|
||||
default:
|
||||
return 'unexpected value';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user