mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +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
@ -1,7 +1,8 @@
|
||||
import {
|
||||
ButtonBase, PseudoClassHandler,
|
||||
paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty,
|
||||
Length, zIndexProperty, textAlignmentProperty, TextAlignment
|
||||
Length, zIndexProperty, textAlignmentProperty, TextAlignment, layout,
|
||||
minWidthProperty, minHeightProperty
|
||||
} from "./button-common";
|
||||
import { profile } from "../../profiling";
|
||||
import { TouchGestureEventData, GestureTypes, TouchAction } from "../gestures";
|
||||
@ -111,6 +112,18 @@ export class Button extends ButtonBase {
|
||||
}
|
||||
}
|
||||
|
||||
[minWidthProperty.getDefault](): Length {
|
||||
const dips = org.nativescript.widgets.ViewHelper.getMinWidth(this.nativeViewProtected);
|
||||
|
||||
return { value: dips, unit: "px" };
|
||||
}
|
||||
|
||||
[minHeightProperty.getDefault](): Length {
|
||||
const dips = org.nativescript.widgets.ViewHelper.getMinHeight(this.nativeViewProtected);
|
||||
|
||||
return { value: dips, unit: "px" };
|
||||
}
|
||||
|
||||
[paddingTopProperty.getDefault](): Length {
|
||||
return { value: this._defaultPaddingTop, unit: "px" };
|
||||
}
|
||||
@ -177,3 +190,5 @@ export class Button extends ButtonBase {
|
||||
return 4; // 4dp @dimen/button_pressed_z_material
|
||||
}
|
||||
}
|
||||
|
||||
Button.prototype._ignoreFlexMinWidthHeightReset = true;
|
||||
|
Reference in New Issue
Block a user