mirror of
https://github.com/status-im/react-native.git
synced 2025-01-13 19:15:05 +00:00
Make ResourceDrawableIdHelper work with resource id
Reviewed By: fkgozali Differential Revision: D5636657 fbshipit-source-id: 251b8b495655abf83618922b86f710fa38b08317
This commit is contained in:
parent
9c2a5cdbc3
commit
dc61f10e8b
@ -55,6 +55,13 @@ public class ResourceDrawableIdHelper {
|
|||||||
}
|
}
|
||||||
name = name.toLowerCase().replace("-", "_");
|
name = name.toLowerCase().replace("-", "_");
|
||||||
|
|
||||||
|
// name could be a resource id.
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(name);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (mResourceDrawableIdMap.containsKey(name)) {
|
if (mResourceDrawableIdMap.containsKey(name)) {
|
||||||
return mResourceDrawableIdMap.get(name);
|
return mResourceDrawableIdMap.get(name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user