Skip to content

Commit 71bc4cb

Browse files
Fabio Carballofacebook-github-bot
authored andcommitted
Do not use ViewAttributesExtension if binder is enabled
Summary: This diff avoid the LithoViewAttributesExtension codepaths whenever we are using the binder approach. Reviewed By: adityasharat Differential Revision: D60372226 fbshipit-source-id: b9508c17576b9666d03a17bde8740af841bc56e2
1 parent bb46e89 commit 71bc4cb

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

litho-core/src/main/java/com/facebook/litho/BaseMountingView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,9 @@ protected void setupMountExtensions() {
930930
mLithoHostListenerCoordinator.enableEndToEndTestProcessing();
931931
}
932932

933-
mLithoHostListenerCoordinator.enableViewAttributes();
933+
if (!ComponentsConfiguration.defaultInstance.useViewAttributesBinder) {
934+
mLithoHostListenerCoordinator.enableViewAttributes();
935+
}
934936
mLithoHostListenerCoordinator.enableDynamicProps();
935937
}
936938

litho-core/src/main/java/com/facebook/litho/LithoReducer.kt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -920,14 +920,19 @@ internal object LithoReducer {
920920
}
921921

922922
val attrs: ViewAttributes? =
923-
LithoNodeUtils.createViewAttributes(
924-
unit,
925-
component,
926-
(result as? LithoLayoutResult)?.node,
927-
type,
928-
unit.importantForAccessibility,
929-
reductionState.componentContext.lithoConfiguration.componentsConfig
930-
.shouldAddRootHostViewOrDisableBgFgOutputs)
923+
if (reductionState.componentContext.lithoConfiguration.componentsConfig
924+
.useViewAttributesBinder) {
925+
null
926+
} else {
927+
LithoNodeUtils.createViewAttributes(
928+
unit,
929+
component,
930+
(result as? LithoLayoutResult)?.node,
931+
type,
932+
unit.importantForAccessibility,
933+
reductionState.componentContext.lithoConfiguration.componentsConfig
934+
.shouldAddRootHostViewOrDisableBgFgOutputs)
935+
}
931936

932937
if (attrs != null) {
933938
reductionState.renderUnitsWithViewAttributes[id] = attrs

0 commit comments

Comments
 (0)