Skip to content

Commit

Permalink
Store backfaceVisibility as boolean (#48268)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
javache authored and facebook-github-bot committed Dec 16, 2024
1 parent eac4b32 commit 173b658
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void shutdown() {
private boolean mNeedsOffscreenAlphaCompositing;
private @Nullable ViewGroupDrawingOrderHelper mDrawingOrderHelper;
private float mBackfaceOpacity;
private String mBackfaceVisibility;
private boolean mBackfaceVisible;
private @Nullable Set<Integer> mChildrenRemovedWhileTransitioning;

/**
Expand Down Expand Up @@ -172,7 +172,7 @@ private void initView() {
mNeedsOffscreenAlphaCompositing = false;
mDrawingOrderHelper = null;
mBackfaceOpacity = 1.f;
mBackfaceVisibility = "visible";
mBackfaceVisible = true;
mChildrenRemovedWhileTransitioning = null;
}

Expand Down Expand Up @@ -989,14 +989,12 @@ public void setOpacityIfPossible(float opacity) {
}

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;
}
Expand Down

0 comments on commit 173b658

Please sign in to comment.