mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
fix(button-android): use setMinWidth to set TextView widgets min-width (#7804)
* fix: setMinimumWidth does not really set the minWidth for TextView widgets * chore: fix versions * refactor(android): default minWidth/Height values for button * reafctor: reset minWidth when view is in flexbox for backcompat * refactor: ensure back-compatible layout for btns * chore: cut 6.5.0 release (#8443) * release: cut 6.5.0 release * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Vasil Trifonov <v.trifonov@gmail.com> Co-authored-by: vakrilov <alexander.vakrilov@telerik.com> Co-authored-by: Dimitar Topuzov <dtopuzov@gmail.com> Co-authored-by: Vasil Trifonov <v.trifonov@gmail.com>
This commit is contained in:

committed by
GitHub

parent
1f04469fb3
commit
66cc8a477e
@ -432,10 +432,17 @@ export abstract class ViewBase extends Observable {
|
||||
* @private
|
||||
*/
|
||||
public recycleNativeView: "always" | "never" | "auto";
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
public _isPaddingRelative: boolean;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
public _ignoreFlexMinWidthHeightReset: boolean;
|
||||
|
||||
public _styleScope: any;
|
||||
|
||||
/**
|
||||
|
@ -227,6 +227,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
|
||||
_oldTop: number;
|
||||
_oldRight: number;
|
||||
_oldBottom: number;
|
||||
_ignoreFlexMinWidthHeightReset: boolean;
|
||||
|
||||
public effectiveMinWidth: number;
|
||||
public effectiveMinHeight: number;
|
||||
|
@ -389,7 +389,7 @@ export class View extends ViewCommon {
|
||||
this.nativeViewProtected.setClickable(this._isClickable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this._manager = null;
|
||||
this._rootManager = null;
|
||||
super.onUnloaded();
|
||||
@ -982,17 +982,17 @@ export class View extends ViewCommon {
|
||||
|
||||
[minWidthProperty.setNative](value: Length) {
|
||||
if (this.parent instanceof CustomLayoutView && this.parent.nativeViewProtected) {
|
||||
this.parent._setChildMinWidthNative(this);
|
||||
this.parent._setChildMinWidthNative(this, value);
|
||||
} else {
|
||||
this._setMinWidthNative(this.minWidth);
|
||||
this._setMinWidthNative(value);
|
||||
}
|
||||
}
|
||||
|
||||
[minHeightProperty.setNative](value: Length) {
|
||||
if (this.parent instanceof CustomLayoutView && this.parent.nativeViewProtected) {
|
||||
this.parent._setChildMinHeightNative(this);
|
||||
this.parent._setChildMinHeightNative(this, value);
|
||||
} else {
|
||||
this._setMinHeightNative(this.minHeight);
|
||||
this._setMinHeightNative(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1050,16 +1050,15 @@ export class CustomLayoutView extends ContainerView implements CustomLayoutViewD
|
||||
}
|
||||
|
||||
public _updateNativeLayoutParams(child: View): void {
|
||||
this._setChildMinWidthNative(child);
|
||||
this._setChildMinHeightNative(child);
|
||||
// noop
|
||||
}
|
||||
|
||||
public _setChildMinWidthNative(child: View): void {
|
||||
child._setMinWidthNative(child.minWidth);
|
||||
public _setChildMinWidthNative(child: View, value: Length): void {
|
||||
child._setMinWidthNative(value);
|
||||
}
|
||||
|
||||
public _setChildMinHeightNative(child: View): void {
|
||||
child._setMinHeightNative(child.minHeight);
|
||||
public _setChildMinHeightNative(child: View, value: Length): void {
|
||||
child._setMinHeightNative(value);
|
||||
}
|
||||
|
||||
public _removeViewFromNativeVisualTree(child: ViewCommon): void {
|
||||
|
4
nativescript-core/ui/core/view/view.d.ts
vendored
4
nativescript-core/ui/core/view/view.d.ts
vendored
@ -796,11 +796,11 @@ export class CustomLayoutView extends ContainerView {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_setChildMinWidthNative(child: View): void;
|
||||
_setChildMinWidthNative(child: View, value: Length): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_setChildMinHeightNative(child: View): void;
|
||||
_setChildMinHeightNative(child: View, value: Length): void;
|
||||
//@endprivate
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user