This repository has been archived by the owner on Jun 16, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(android): Fix Objects.equals that is only available after API 19 (#…
- Loading branch information
1 parent
047bbea
commit 8c6a26f
Showing
3 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
android/src/main/java/org/reactnative/camera/utils/ObjectUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.reactnative.camera.utils; | ||
|
||
|
||
public class ObjectUtils { | ||
|
||
/* | ||
* Replacement for Objects.equals that is only available after Android API 19 | ||
*/ | ||
public static boolean equals(Object o1, Object o2) { | ||
if (o1 == null && o2 == null) return true; | ||
if (o1 == null) return false; | ||
return o1.equals(o2); | ||
} | ||
|
||
} |