Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Latropos committed Aug 12, 2024
1 parent 84d50a8 commit 0f53fd4
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -454,27 +454,27 @@ public String obtainProp(int viewTag, String propName) {
return Float.toString(PixelUtil.toDIPFromPixel(view.getLeft()));
case "backgroundColor":
Drawable background = view.getBackground();
int actualColor = -1;
if (background instanceof ReactViewBackgroundDrawable) {
actualColor = ((ReactViewBackgroundDrawable) background).getColor();
}
;

if (background instanceof ReactViewBackgroundDrawable
|| background instanceof CSSBackgroundDrawable) {
int actualColor = -1;
if (background instanceof ReactViewBackgroundDrawable) {
actualColor = ((ReactViewBackgroundDrawable) background).getColor();
}
;

if (background instanceof CSSBackgroundDrawable) {
actualColor = ((CSSBackgroundDrawable) background).getColor();
}
;
if (background instanceof CSSBackgroundDrawable) {
actualColor = ((CSSBackgroundDrawable) background).getColor();
}
;

String invertedColor = String.format("%08x", (0xFFFFFFFF & actualColor));
// By default transparency is first, color second
return "#" + invertedColor.substring(2, 8) + invertedColor.substring(0, 2);
if (actualColor == -1) {
return "Unable to resolve background color";
}

String invertedColor = String.format("%08x", (0xFFFFFFFF & actualColor));
// By default transparency is first, color second
return "#" + invertedColor.substring(2, 8) + invertedColor.substring(0, 2);

;

return "Unable to resolve background color";
default:
throw new IllegalArgumentException(
"[Reanimated] Attempted to get unsupported property "
Expand Down

0 comments on commit 0f53fd4

Please sign in to comment.