mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(typings): Adding Android typings for API levels from 17 to 27 (#5890)
Adding android typings for API levels from 17 to 27 BREAKING CHANGES: There is no longer added `I` prefix in the names of the interfaces. For example `android.view.IMenuItem` is now `android.view.MenuItem`. This matches the original name of the interface in the android framework.
This commit is contained in:
committed by
Alexander Vakrilov
parent
bcadcbe7b5
commit
398c9b3f33
@@ -8,7 +8,7 @@ export function getNativeText(button: buttonModule.Button): string {
|
||||
}
|
||||
|
||||
export function getNativeTextWrap(button: buttonModule.Button): boolean {
|
||||
return (<android.widget.Button>button.android).isSingleLine();
|
||||
return ((<android.widget.Button>button.android).getLineCount() === 1);
|
||||
}
|
||||
|
||||
export function getNativeFontSize(button: buttonModule.Button): number {
|
||||
|
||||
@@ -14,14 +14,14 @@ class NativeButton extends android.widget.Button {
|
||||
return global.__native(this);
|
||||
}
|
||||
|
||||
protected onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
|
||||
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
this.owner.widthMeasureSpec = widthMeasureSpec;
|
||||
this.owner.heightMeasureSpec = heightMeasureSpec;
|
||||
this.owner.measureCount++;
|
||||
}
|
||||
|
||||
protected onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void {
|
||||
public onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
this.owner.arrangeCount++;
|
||||
}
|
||||
@@ -33,14 +33,14 @@ class NativeStackLayout extends org.nativescript.widgets.StackLayout {
|
||||
return global.__native(this);
|
||||
}
|
||||
|
||||
protected onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
|
||||
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
this.owner.widthMeasureSpec = widthMeasureSpec;
|
||||
this.owner.heightMeasureSpec = heightMeasureSpec;
|
||||
this.owner.measureCount++;
|
||||
}
|
||||
|
||||
protected onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void {
|
||||
public onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
this.owner.arrangeCount++;
|
||||
}
|
||||
@@ -52,14 +52,14 @@ class NativeGridLayout extends org.nativescript.widgets.GridLayout {
|
||||
return global.__native(this);
|
||||
}
|
||||
|
||||
protected onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
|
||||
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
this.owner.widthMeasureSpec = widthMeasureSpec;
|
||||
this.owner.heightMeasureSpec = heightMeasureSpec;
|
||||
this.owner.measureCount++;
|
||||
}
|
||||
|
||||
protected onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void {
|
||||
public onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
this.owner.arrangeCount++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user