mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 05:18:39 +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
@ -65,6 +65,11 @@
|
|||||||
horizontal,
|
horizontal,
|
||||||
vertical
|
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 {
|
export class LayoutBase extends android.view.ViewGroup {
|
||||||
constructor(context: android.content.Context);
|
constructor(context: android.content.Context);
|
||||||
|
@ -50,16 +50,12 @@ function onScaleYPropertyChanged(data: dependencyObservable.PropertyChangeData)
|
|||||||
(<proxy.PropertyMetadata>viewCommon.View.scaleYProperty.metadata).onSetNativeValue = onScaleYPropertyChanged;
|
(<proxy.PropertyMetadata>viewCommon.View.scaleYProperty.metadata).onSetNativeValue = onScaleYPropertyChanged;
|
||||||
|
|
||||||
function onOriginXPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
function onOriginXPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||||
var view = <View>data.object;
|
org.nativescript.widgets.OriginPoint.setX((<View>data.object)._nativeView, data.newValue);
|
||||||
var width = view._nativeView.getWidth();
|
|
||||||
view._nativeView.setPivotX(data.newValue * width);
|
|
||||||
}
|
}
|
||||||
(<proxy.PropertyMetadata>viewCommon.View.originXProperty.metadata).onSetNativeValue = onOriginXPropertyChanged;
|
(<proxy.PropertyMetadata>viewCommon.View.originXProperty.metadata).onSetNativeValue = onOriginXPropertyChanged;
|
||||||
|
|
||||||
function onOriginYPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
function onOriginYPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||||
var view = <View>data.object;
|
org.nativescript.widgets.OriginPoint.setY((<View>data.object)._nativeView, data.newValue);
|
||||||
var height = view._nativeView.getHeight();
|
|
||||||
view._nativeView.setPivotY(data.newValue * height);
|
|
||||||
}
|
}
|
||||||
(<proxy.PropertyMetadata>viewCommon.View.originYProperty.metadata).onSetNativeValue = onOriginYPropertyChanged;
|
(<proxy.PropertyMetadata>viewCommon.View.originYProperty.metadata).onSetNativeValue = onOriginYPropertyChanged;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user