mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Store backfaceVisibility as boolean (#48268)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48268 No need to store and compare strings here when a simple boolean will do. Changelog: [Internal] Reviewed By: NickGerleman, mdvacca Differential Revision: D67204387 fbshipit-source-id: c78cc758797980c2bce11875e0f6ea1961058f05
This commit is contained in:
committed by
Facebook GitHub Bot
parent
eac4b32573
commit
173b65803d
+4
-6
@@ -137,7 +137,7 @@ public class ReactViewGroup extends ViewGroup
|
||||
private boolean mNeedsOffscreenAlphaCompositing;
|
||||
private @Nullable ViewGroupDrawingOrderHelper mDrawingOrderHelper;
|
||||
private float mBackfaceOpacity;
|
||||
private String mBackfaceVisibility;
|
||||
private boolean mBackfaceVisible;
|
||||
private @Nullable Set<Integer> mChildrenRemovedWhileTransitioning;
|
||||
|
||||
/**
|
||||
@@ -172,7 +172,7 @@ public class ReactViewGroup extends ViewGroup
|
||||
mNeedsOffscreenAlphaCompositing = false;
|
||||
mDrawingOrderHelper = null;
|
||||
mBackfaceOpacity = 1.f;
|
||||
mBackfaceVisibility = "visible";
|
||||
mBackfaceVisible = true;
|
||||
mChildrenRemovedWhileTransitioning = null;
|
||||
}
|
||||
|
||||
@@ -989,14 +989,12 @@ public class ReactViewGroup extends ViewGroup
|
||||
}
|
||||
|
||||
public void setBackfaceVisibility(String backfaceVisibility) {
|
||||
mBackfaceVisibility = backfaceVisibility;
|
||||
mBackfaceVisible = "visible".equals(backfaceVisibility);
|
||||
setBackfaceVisibilityDependantOpacity();
|
||||
}
|
||||
|
||||
public void setBackfaceVisibilityDependantOpacity() {
|
||||
boolean isBackfaceVisible = mBackfaceVisibility.equals("visible");
|
||||
|
||||
if (isBackfaceVisible) {
|
||||
if (mBackfaceVisible) {
|
||||
setAlpha(mBackfaceOpacity);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user