Skip to content

Commit

Permalink
Disable outline props on old architecture (#46608)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
jorge-cab authored and facebook-github-bot committed Sep 23, 2024
1 parent 8ad4b7d commit 7ab0002
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ public object BackgroundStyleApplicator {

@JvmStatic
public fun setOutlineColor(view: View, @ColorInt outlineColor: Int?): Unit {
if (ViewUtil.getUIManagerType(view) != UIManagerType.FABRIC) {
return
}

val outline = ensureOutlineDrawable(view)
if (outlineColor != null) {
outline.outlineColor = outlineColor
Expand All @@ -158,6 +162,10 @@ public object BackgroundStyleApplicator {

@JvmStatic
public fun setOutlineOffset(view: View, outlineOffset: Float): Unit {
if (ViewUtil.getUIManagerType(view) != UIManagerType.FABRIC) {
return
}

val outline = ensureOutlineDrawable(view)
outline.outlineOffset = outlineOffset.dpToPx()
}
Expand All @@ -166,6 +174,10 @@ public object BackgroundStyleApplicator {

@JvmStatic
public fun setOutlineStyle(view: View, outlineStyle: OutlineStyle?): Unit {
if (ViewUtil.getUIManagerType(view) != UIManagerType.FABRIC) {
return
}

val outline = ensureOutlineDrawable(view)
if (outlineStyle != null) {
outline.outlineStyle = outlineStyle
Expand All @@ -176,6 +188,10 @@ public object BackgroundStyleApplicator {

@JvmStatic
public fun setOutlineWidth(view: View, width: Float): Unit {
if (ViewUtil.getUIManagerType(view) != UIManagerType.FABRIC) {
return
}

val outline = ensureOutlineDrawable(view)
outline.outlineWidth = width.dpToPx()
}
Expand Down

0 comments on commit 7ab0002

Please sign in to comment.