Skip to content

Commit

Permalink
Wires up MC to skip host alpha reset
Browse files Browse the repository at this point in the history
Summary: Wires up MC to skip host alpha reset

Reviewed By: zielinskimz

Differential Revision: D55235512

fbshipit-source-id: 9ea968188412cc2fd81afe6b5597d0eac545238d
  • Loading branch information
adityasharat authored and facebook-github-bot committed Mar 22, 2024
1 parent 20cda45 commit 34fc1c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.facebook.litho;

import android.content.Context;
import android.os.Build;
import android.util.SparseArray;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;
Expand Down Expand Up @@ -73,9 +72,9 @@ protected void onMount(
final @Nullable InterStagePropsContainer interStagePropsContainer) {
final ComponentHost host = (ComponentHost) convertContent;

if (Build.VERSION.SDK_INT >= 11) {
// We need to do this in case an external user of this ComponentHost has manually set alpha
// to 0, which will mean that it won't draw anything.
if (!ComponentsConfiguration.skipHostAlphaReset) {
// We need to do this in case an external user of this ComponentHost
// has manually set alpha to 0, which will mean that it won't draw anything.
host.setAlpha(1.0f);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ internal constructor(
@JvmField var bindOnSameComponentTree: Boolean = true
@JvmField var isEventHandlerRebindLoggingEnabled: Boolean = false
@JvmField var useSafeSpanEndInTextInputSpec: Boolean = false
@JvmField var skipHostAlphaReset: Boolean = false

/**
* This method is only used so that Java clients can have a builder like approach to override a
Expand Down

0 comments on commit 34fc1c2

Please sign in to comment.