Skip to content

Commit b12117a

Browse files
dgladkovfacebook-github-bot-9
authored andcommitted
Fix View translations in Android
Summary: Fixes regression in bf59864 Closes #3773 Closes #3954 Reviewed By: svcscm Differential Revision: D2631180 Pulled By: kmagiera fb-gh-sync-id: 09a1a2e48fd6fff37d1491c120a28221cdc1b163
1 parent 714d452 commit b12117a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ public void setScaleY(T view, float scaleY) {
115115
@Deprecated
116116
@ReactProp(name = PROP_TRANSLATE_X, defaultFloat = 1f)
117117
public void setTranslateX(T view, float translateX) {
118-
view.setTranslationX(translateX);
118+
view.setTranslationX(PixelUtil.toPixelFromDIP(translateX));
119119
}
120120

121121
@Deprecated
122122
@ReactProp(name = PROP_TRANSLATE_Y, defaultFloat = 1f)
123123
public void setTranslateY(T view, float translateY) {
124-
view.setTranslationY(translateY);
124+
view.setTranslationY(PixelUtil.toPixelFromDIP(translateY));
125125
}
126126

127127
@ReactProp(name = PROP_ACCESSIBILITY_LIVE_REGION)

0 commit comments

Comments
 (0)