Skip to content

Commit 7ab0002

Browse files
jorge-cabfacebook-github-bot
authored andcommitted
Disable outline props on old architecture (facebook#46608)
Summary: Pull Request resolved: facebook#46608 tsia Changelog: [Android][Changed] - Disabling `outline` props on Android to stay consistent with iOS Reviewed By: NickGerleman Differential Revision: D63143626 fbshipit-source-id: 3eafe5beeb54b1619d94fe3d886ab19d445a0b09
1 parent 8ad4b7d commit 7ab0002

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ public object BackgroundStyleApplicator {
148148

149149
@JvmStatic
150150
public fun setOutlineColor(view: View, @ColorInt outlineColor: Int?): Unit {
151+
if (ViewUtil.getUIManagerType(view) != UIManagerType.FABRIC) {
152+
return
153+
}
154+
151155
val outline = ensureOutlineDrawable(view)
152156
if (outlineColor != null) {
153157
outline.outlineColor = outlineColor
@@ -158,6 +162,10 @@ public object BackgroundStyleApplicator {
158162

159163
@JvmStatic
160164
public fun setOutlineOffset(view: View, outlineOffset: Float): Unit {
165+
if (ViewUtil.getUIManagerType(view) != UIManagerType.FABRIC) {
166+
return
167+
}
168+
161169
val outline = ensureOutlineDrawable(view)
162170
outline.outlineOffset = outlineOffset.dpToPx()
163171
}
@@ -166,6 +174,10 @@ public object BackgroundStyleApplicator {
166174

167175
@JvmStatic
168176
public fun setOutlineStyle(view: View, outlineStyle: OutlineStyle?): Unit {
177+
if (ViewUtil.getUIManagerType(view) != UIManagerType.FABRIC) {
178+
return
179+
}
180+
169181
val outline = ensureOutlineDrawable(view)
170182
if (outlineStyle != null) {
171183
outline.outlineStyle = outlineStyle
@@ -176,6 +188,10 @@ public object BackgroundStyleApplicator {
176188

177189
@JvmStatic
178190
public fun setOutlineWidth(view: View, width: Float): Unit {
191+
if (ViewUtil.getUIManagerType(view) != UIManagerType.FABRIC) {
192+
return
193+
}
194+
179195
val outline = ensureOutlineDrawable(view)
180196
outline.outlineWidth = width.dpToPx()
181197
}

0 commit comments

Comments
 (0)