FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix originX/Y not applied when set before layout in android by PanayotCankov · Pull Request #1381 · NativeScript/NativeScript · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 5 additions & 0 deletions org.nativescript.widgets.d.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
horizontal,
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);
Expand Down
8 changes: 2 additions & 6 deletions ui/core/view.android.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

Back | FazBrowse Home | New Git URL