mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 03:01:51 +08:00
Fix WrapLayout
Fix ScrollView Fix Stylers.android Remove some method from View class Fix layout-helper test views Fix all android failing tests Remove onLayout on Button and TextBase
This commit is contained in:
@ -1,6 +1,4 @@
|
||||
import common = require("ui/button/button-common");
|
||||
import utils = require("utils/utils");
|
||||
import trace = require("trace");
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
@ -36,26 +34,4 @@ export class Button extends common.Button {
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public onLayout(left: number, top: number, right: number, bottom: number): void {
|
||||
if (this.android) {
|
||||
var measuredWidth = this.getMeasuredWidth();
|
||||
var measuredHeight = this.getMeasuredHeight();
|
||||
|
||||
var measureSpecs = this._getCurrentMeasureSpecs();
|
||||
var widthModeIsNotExact = utils.layout.getMeasureSpecMode(measureSpecs.widthMeasureSpec) !== utils.layout.EXACTLY;
|
||||
var heightModeIsNotExact = utils.layout.getMeasureSpecMode(measureSpecs.heightMeasureSpec) !== utils.layout.EXACTLY;
|
||||
|
||||
var width = right - left;
|
||||
var height = bottom - top;
|
||||
if ((Math.abs(measuredWidth - width) > 1 && widthModeIsNotExact) || (Math.abs(measuredHeight - height) > 1 && heightModeIsNotExact)) {
|
||||
var widthMeasureSpec = utils.layout.makeMeasureSpec(width, utils.layout.EXACTLY);
|
||||
var heightMeasureSpec = utils.layout.makeMeasureSpec(height, utils.layout.EXACTLY);
|
||||
trace.write(this + ", measuredSize: (" + measuredWidth + ", " + measuredHeight + ")" + ", remeasure with: (" + width + ", " + height + ")", trace.categories.Layout);
|
||||
this.android.measure(widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
}
|
||||
|
||||
super.onLayout(left, top, right, bottom);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user