mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Merge pull request #1381 from NativeScript/cankov/pivot-point-android
Fix originX/Y not applied when set before layout in android
This commit is contained in:
5
org.nativescript.widgets.d.ts
vendored
5
org.nativescript.widgets.d.ts
vendored
@ -66,6 +66,11 @@
|
||||
vertical
|
||||
}
|
||||
|
||||
export class OriginPoint {
|
||||
public static setX(view: android.view.View, value: number);
|
||||
public static setY(view: android.view.View, value: number);
|
||||
}
|
||||
|
||||
export class LayoutBase extends android.view.ViewGroup {
|
||||
constructor(context: android.content.Context);
|
||||
}
|
||||
|
@ -50,16 +50,12 @@ function onScaleYPropertyChanged(data: dependencyObservable.PropertyChangeData)
|
||||
(<proxy.PropertyMetadata>viewCommon.View.scaleYProperty.metadata).onSetNativeValue = onScaleYPropertyChanged;
|
||||
|
||||
function onOriginXPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
var view = <View>data.object;
|
||||
var width = view._nativeView.getWidth();
|
||||
view._nativeView.setPivotX(data.newValue * width);
|
||||
org.nativescript.widgets.OriginPoint.setX((<View>data.object)._nativeView, data.newValue);
|
||||
}
|
||||
(<proxy.PropertyMetadata>viewCommon.View.originXProperty.metadata).onSetNativeValue = onOriginXPropertyChanged;
|
||||
|
||||
function onOriginYPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
var view = <View>data.object;
|
||||
var height = view._nativeView.getHeight();
|
||||
view._nativeView.setPivotY(data.newValue * height);
|
||||
org.nativescript.widgets.OriginPoint.setY((<View>data.object)._nativeView, data.newValue);
|
||||
}
|
||||
(<proxy.PropertyMetadata>viewCommon.View.originYProperty.metadata).onSetNativeValue = onOriginYPropertyChanged;
|
||||
|
||||
|
Reference in New Issue
Block a user